Lines Matching refs:hdr

21 	struct asn1_hdr hdr;  in pkcs8_key_import()  local
30 if (asn1_get_next(buf, len, &hdr) < 0 || !asn1_is_sequence(&hdr)) { in pkcs8_key_import()
31 asn1_unexpected(&hdr, in pkcs8_key_import()
35 pos = hdr.payload; in pkcs8_key_import()
36 end = pos + hdr.length; in pkcs8_key_import()
39 if (asn1_get_next(pos, end - pos, &hdr) < 0 || !asn1_is_integer(&hdr)) { in pkcs8_key_import()
40 asn1_unexpected(&hdr, "PKCS #8: Expected INTEGER"); in pkcs8_key_import()
48 if (bignum_set_unsigned_bin(zero, hdr.payload, hdr.length) < 0) { in pkcs8_key_import()
53 pos = hdr.payload + hdr.length; in pkcs8_key_import()
66 if (asn1_get_next(pos, len, &hdr) < 0 || !asn1_is_sequence(&hdr)) { in pkcs8_key_import()
67 asn1_unexpected(&hdr, in pkcs8_key_import()
72 if (asn1_get_oid(hdr.payload, hdr.length, &oid, &pos)) { in pkcs8_key_import()
94 pos = hdr.payload + hdr.length; in pkcs8_key_import()
97 if (asn1_get_next(pos, end - pos, &hdr) < 0 || in pkcs8_key_import()
98 !asn1_is_octetstring(&hdr)) { in pkcs8_key_import()
99 asn1_unexpected(&hdr, in pkcs8_key_import()
106 crypto_rsa_import_private_key(hdr.payload, hdr.length); in pkcs8_key_import()
113 struct asn1_hdr hdr; in pkcs8_enc_key_import() local
131 if (asn1_get_next(buf, len, &hdr) < 0 || !asn1_is_sequence(&hdr)) { in pkcs8_enc_key_import()
132 asn1_unexpected(&hdr, in pkcs8_enc_key_import()
136 pos = hdr.payload; in pkcs8_enc_key_import()
137 end = pos + hdr.length; in pkcs8_enc_key_import()
140 if (asn1_get_next(pos, end - pos, &hdr) < 0 || in pkcs8_enc_key_import()
141 !asn1_is_sequence(&hdr)) { in pkcs8_enc_key_import()
142 asn1_unexpected(&hdr, in pkcs8_enc_key_import()
146 enc_alg = hdr.payload; in pkcs8_enc_key_import()
147 enc_alg_len = hdr.length; in pkcs8_enc_key_import()
148 pos = hdr.payload + hdr.length; in pkcs8_enc_key_import()
151 if (asn1_get_next(pos, end - pos, &hdr) < 0 || in pkcs8_enc_key_import()
152 !asn1_is_octetstring(&hdr)) { in pkcs8_enc_key_import()
153 asn1_unexpected(&hdr, in pkcs8_enc_key_import()
158 data = pkcs5_decrypt(enc_alg, enc_alg_len, hdr.payload, hdr.length, in pkcs8_enc_key_import()