Lines Matching refs:buf

302 	CK_BYTE   *buf = NULL;
330 buf = (CK_BYTE *)malloc(len);
331 if (! buf) {
335 buf[0] = 0x02;
336 buf[1] = data_len;
337 (void) memcpy(&buf[2], data, data_len);
340 *ber_int = buf;
345 buf[0] = 0x02;
346 buf[1] = 0x81;
347 buf[2] = data_len;
348 (void) memcpy(&buf[3], data, data_len);
351 *ber_int = buf;
356 buf[0] = 0x02;
357 buf[1] = 0x82;
358 buf[2] = (data_len >> 8) & 0xFF;
359 buf[3] = (data_len) & 0xFF;
360 (void) memcpy(&buf[4], data, data_len);
363 *ber_int = buf;
368 buf[0] = 0x02;
369 buf[1] = 0x83;
370 buf[2] = (data_len >> 16) & 0xFF;
371 buf[3] = (data_len >> 8) & 0xFF;
372 buf[4] = (data_len) & 0xFF;
373 (void) memcpy(&buf[5], data, data_len);
376 *ber_int = buf;
380 free(buf);
452 CK_BYTE *buf = NULL;
477 buf = (CK_BYTE *)malloc(len);
478 if (! buf) {
483 buf[0] = 0x04; /* primitive, OCTET STRING */
484 buf[1] = data_len;
485 (void) memcpy(&buf[2], data, data_len);
488 *str = buf;
493 buf[0] = 0x04; /* primitive, OCTET STRING */
494 buf[1] = 0x81; /* length header -- 1 length octets */
495 buf[2] = data_len;
497 (void) memcpy(&buf[3], data, data_len);
500 *str = buf;
505 buf[0] = 0x04; /* primitive, OCTET STRING */
506 buf[1] = 0x82; /* length header -- 2 length octets */
507 buf[2] = (data_len >> 8) & 0xFF;
508 buf[3] = (data_len) & 0xFF;
510 (void) memcpy(&buf[4], data, data_len);
513 *str = buf;
518 buf[0] = 0x04; /* primitive, OCTET STRING */
519 buf[1] = 0x83; /* length header -- 3 length octets */
520 buf[2] = (data_len >> 16) & 0xFF;
521 buf[3] = (data_len >> 8) & 0xFF;
522 buf[4] = (data_len) & 0xFF;
524 (void) memcpy(&buf[5], data, data_len);
527 *str = buf;
531 free(buf);
604 CK_BYTE *buf = NULL;
623 buf = (CK_BYTE *)malloc(len);
624 if (! buf) {
629 buf[0] = 0x30; /* constructed, SEQUENCE */
630 buf[1] = data_len;
631 (void) memcpy(&buf[2], data, data_len);
634 *seq = buf;
639 buf[0] = 0x30; /* constructed, SEQUENCE */
640 buf[1] = 0x81; /* length header -- 1 length octets */
641 buf[2] = data_len;
643 (void) memcpy(&buf[3], data, data_len);
646 *seq = buf;
651 buf[0] = 0x30; /* constructed, SEQUENCE */
652 buf[1] = 0x82; /* length header -- 2 length octets */
653 buf[2] = (data_len >> 8) & 0xFF;
654 buf[3] = (data_len) & 0xFF;
656 (void) memcpy(&buf[4], data, data_len);
659 *seq = buf;
664 buf[0] = 0x30; /* constructed, SEQUENCE */
665 buf[1] = 0x83; /* length header -- 3 length octets */
666 buf[2] = (data_len >> 16) & 0xFF;
667 buf[3] = (data_len >> 8) & 0xFF;
668 buf[4] = (data_len) & 0xFF;
670 (void) memcpy(&buf[5], data, data_len);
673 *seq = buf;
759 CK_BYTE * buf = NULL;
796 buf = (CK_BYTE *)malloc(len);
797 if (! buf) {
805 (void) memcpy(buf + len, tmp, total);
809 (void) memcpy(buf + len, algorithm_id, algorithm_id_len);
817 (void) memcpy(buf + len, tmp, total);
821 (void) memcpy(buf + len, attrib, sizeof (attrib));
824 rc = ber_encode_SEQUENCE(FALSE, data, data_len, buf, len);
827 free(buf);
838 CK_BYTE *buf = NULL;
847 rc = ber_decode_SEQUENCE(data, &buf, &buf_len, &field_len);
852 rc = ber_decode_INTEGER(buf + offset, &ver, &len, &field_len);
858 rc = ber_decode_SEQUENCE(buf + offset, &alg, &len, &field_len);
895 CK_BYTE *buf = NULL;
948 buf = (CK_BYTE *)malloc(offset);
949 if (! buf) {
959 (void) memcpy(buf + offset, buf2, len);
968 (void) memcpy(buf + offset, buf2, len);
977 (void) memcpy(buf + offset, buf2, len);
987 (void) memcpy(buf + offset, buf2, len);
996 (void) memcpy(buf + offset, buf2, len);
1005 (void) memcpy(buf + offset, buf2, len);
1015 (void) memcpy(buf + offset, buf2, len);
1025 (void) memcpy(buf + offset, buf2, len);
1034 (void) memcpy(buf + offset, buf2, len);
1038 rc = ber_encode_SEQUENCE(FALSE, &buf2, &len, buf, offset);
1048 if (buf) free(buf);
1075 CK_BYTE *buf = NULL;
1088 rc = ber_decode_SEQUENCE(rsa_priv_key, &buf, &buf_len, &field_len);
1093 rc = ber_decode_INTEGER(buf + offset, &tmp, &len, &field_len);
1099 rc = ber_decode_INTEGER(buf + offset, &tmp, &len, &field_len);
1105 rc = ber_decode_INTEGER(buf + offset, &tmp, &len, &field_len);
1111 rc = ber_decode_INTEGER(buf + offset, &tmp, &len, &field_len);
1117 rc = ber_decode_INTEGER(buf + offset, &tmp, &len, &field_len);
1123 rc = ber_decode_INTEGER(buf + offset, &tmp, &len, &field_len);
1129 rc = ber_decode_INTEGER(buf + offset, &tmp, &len, &field_len);
1135 rc = ber_decode_INTEGER(buf + offset, &tmp, &len, &field_len);
1141 rc = ber_decode_INTEGER(buf + offset, &tmp, &len, &field_len);
1153 rc = ber_decode_INTEGER(buf + offset, &tmp, &len, &field_len);
1159 rc = ber_decode_INTEGER(buf + offset, &tmp, &len, &field_len);
1170 rc = ber_decode_INTEGER(buf + offset, &tmp, &len, &field_len);
1181 rc = ber_decode_INTEGER(buf + offset, &tmp, &len, &field_len);
1192 rc = ber_decode_INTEGER(buf + offset, &tmp, &len, &field_len);
1203 rc = ber_decode_INTEGER(buf + offset, &tmp, &len, &field_len);
1214 rc = ber_decode_INTEGER(buf + offset, &tmp, &len, &field_len);
1225 rc = ber_decode_INTEGER(buf + offset, &tmp, &len, &field_len);
1236 rc = ber_decode_INTEGER(buf + offset, &tmp, &len, &field_len);