Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
*integer = value;
return 0;
}
+
+
+int asn1_get_sequence(const u8 *buf, size_t len, struct asn1_hdr *hdr,
+ const u8 **next)
+{
+ if (asn1_get_next(buf, len, hdr) < 0 ||
+ hdr->class != ASN1_CLASS_UNIVERSAL ||
+ hdr->tag != ASN1_TAG_SEQUENCE) {
+ wpa_printf(MSG_DEBUG,
+ "ASN.1: Expected SEQUENCE - found class %d tag 0x%x",
+ hdr->class, hdr->tag);
+ return -1;
+ }
+
+ if (next)
+ *next = hdr->payload + hdr->length;
+ return 0;
+}
unsigned long asn1_bit_string_to_long(const u8 *buf, size_t len);
int asn1_oid_equal(const struct asn1_oid *a, const struct asn1_oid *b);
int asn1_get_integer(const u8 *buf, size_t len, int *integer, const u8 **next);
+int asn1_get_sequence(const u8 *buf, size_t len, struct asn1_hdr *hdr,
+ const u8 **next);
extern struct asn1_oid asn1_sha1_oid;
extern struct asn1_oid asn1_sha256_oid;