From 4aad46ac70933458f118f59506044de35eb9f7cf Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Mon, 14 May 2012 09:54:19 +0100 Subject: [crypto] Generalise x509_parse_bit_string() to asn1_bit_string() Signed-off-by: Michael Brown --- src/include/ipxe/asn1.h | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/include/ipxe/asn1.h') diff --git a/src/include/ipxe/asn1.h b/src/include/ipxe/asn1.h index cd0d53423..222e32ece 100644 --- a/src/include/ipxe/asn1.h +++ b/src/include/ipxe/asn1.h @@ -200,18 +200,14 @@ struct asn1_algorithm { /** Declare an ASN.1 OID-identified algorithm */ #define __asn1_algorithm __table_entry ( ASN1_ALGORITHMS, 01 ) -/** An ASN.1 boolean */ -struct asn1_boolean { - /** Value */ - uint8_t value; -} __attribute__ (( packed )); - /** An ASN.1 bit string */ struct asn1_bit_string { - /** Number of unused bits */ - uint8_t unused; /** Data */ - uint8_t data[0]; + const void *data; + /** Length */ + size_t len; + /** Unused bits at end of data */ + unsigned int unused; } __attribute__ (( packed )); /** @@ -236,6 +232,10 @@ extern int asn1_skip_any ( struct asn1_cursor *cursor ); extern int asn1_shrink_any ( struct asn1_cursor *cursor ); extern int asn1_boolean ( const struct asn1_cursor *cursor ); extern int asn1_integer ( const struct asn1_cursor *cursor, int *value ); +extern int asn1_bit_string ( const struct asn1_cursor *cursor, + struct asn1_bit_string *bits ); +extern int asn1_integral_bit_string ( const struct asn1_cursor *cursor, + struct asn1_bit_string *bits ); extern int asn1_compare ( const struct asn1_cursor *cursor1, const struct asn1_cursor *cursor2 ); extern int asn1_algorithm ( const struct asn1_cursor *cursor, -- cgit v1.2.3-55-g7522