summaryrefslogtreecommitdiffstats
path: root/src/include/ipxe/asn1.h
diff options
context:
space:
mode:
authorMichael Brown2012-05-14 10:54:19 +0200
committerMichael Brown2012-05-14 12:02:38 +0200
commit4aad46ac70933458f118f59506044de35eb9f7cf (patch)
treeebdac8ad53dbfd64df37a9a4d498e2c52c9d733b /src/include/ipxe/asn1.h
parent[crypto] Generalise asn1_{digest,pubkey,signature}_algorithm() (diff)
downloadipxe-4aad46ac70933458f118f59506044de35eb9f7cf.tar.gz
ipxe-4aad46ac70933458f118f59506044de35eb9f7cf.tar.xz
ipxe-4aad46ac70933458f118f59506044de35eb9f7cf.zip
[crypto] Generalise x509_parse_bit_string() to asn1_bit_string()
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/include/ipxe/asn1.h')
-rw-r--r--src/include/ipxe/asn1.h18
1 files changed, 9 insertions, 9 deletions
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,