Lines Matching refs:hdr
21 struct asn1_hdr hdr; in pkcs8_key_import() local
30 if (asn1_get_next(buf, len, &hdr) < 0 || in pkcs8_key_import()
31 hdr.class != ASN1_CLASS_UNIVERSAL || in pkcs8_key_import()
32 hdr.tag != ASN1_TAG_SEQUENCE) { in pkcs8_key_import()
37 pos = hdr.payload; in pkcs8_key_import()
38 end = pos + hdr.length; in pkcs8_key_import()
41 if (asn1_get_next(pos, end - pos, &hdr) < 0 || in pkcs8_key_import()
42 hdr.class != ASN1_CLASS_UNIVERSAL || hdr.tag != ASN1_TAG_INTEGER) { in pkcs8_key_import()
45 hdr.class, hdr.tag); in pkcs8_key_import()
53 if (bignum_set_unsigned_bin(zero, hdr.payload, hdr.length) < 0) { in pkcs8_key_import()
58 pos = hdr.payload + hdr.length; in pkcs8_key_import()
71 if (asn1_get_next(pos, len, &hdr) < 0 || in pkcs8_key_import()
72 hdr.class != ASN1_CLASS_UNIVERSAL || in pkcs8_key_import()
73 hdr.tag != ASN1_TAG_SEQUENCE) { in pkcs8_key_import()
77 hdr.class, hdr.tag); in pkcs8_key_import()
81 if (asn1_get_oid(hdr.payload, hdr.length, &oid, &pos)) { in pkcs8_key_import()
103 pos = hdr.payload + hdr.length; in pkcs8_key_import()
106 if (asn1_get_next(pos, end - pos, &hdr) < 0 || in pkcs8_key_import()
107 hdr.class != ASN1_CLASS_UNIVERSAL || in pkcs8_key_import()
108 hdr.tag != ASN1_TAG_OCTETSTRING) { in pkcs8_key_import()
111 hdr.class, hdr.tag); in pkcs8_key_import()
117 crypto_rsa_import_private_key(hdr.payload, hdr.length); in pkcs8_key_import()
124 struct asn1_hdr hdr; in pkcs8_enc_key_import() local
142 if (asn1_get_next(buf, len, &hdr) < 0 || in pkcs8_enc_key_import()
143 hdr.class != ASN1_CLASS_UNIVERSAL || in pkcs8_enc_key_import()
144 hdr.tag != ASN1_TAG_SEQUENCE) { in pkcs8_enc_key_import()
150 pos = hdr.payload; in pkcs8_enc_key_import()
151 end = pos + hdr.length; in pkcs8_enc_key_import()
154 if (asn1_get_next(pos, end - pos, &hdr) < 0 || in pkcs8_enc_key_import()
155 hdr.class != ASN1_CLASS_UNIVERSAL || in pkcs8_enc_key_import()
156 hdr.tag != ASN1_TAG_SEQUENCE) { in pkcs8_enc_key_import()
160 hdr.class, hdr.tag); in pkcs8_enc_key_import()
163 enc_alg = hdr.payload; in pkcs8_enc_key_import()
164 enc_alg_len = hdr.length; in pkcs8_enc_key_import()
165 pos = hdr.payload + hdr.length; in pkcs8_enc_key_import()
168 if (asn1_get_next(pos, end - pos, &hdr) < 0 || in pkcs8_enc_key_import()
169 hdr.class != ASN1_CLASS_UNIVERSAL || in pkcs8_enc_key_import()
170 hdr.tag != ASN1_TAG_OCTETSTRING) { in pkcs8_enc_key_import()
173 hdr.class, hdr.tag); in pkcs8_enc_key_import()
177 data = pkcs5_decrypt(enc_alg, enc_alg_len, hdr.payload, hdr.length, in pkcs8_enc_key_import()