diff options
| author | Michael Brown | 2012-03-20 05:20:06 +0100 |
|---|---|---|
| committer | Michael Brown | 2012-03-20 18:10:39 +0100 |
| commit | 05c13716f9a6323d8c8b4006f11dc2fc86493371 (patch) | |
| tree | 4e6c9c82a6627d89396098746f18ae505e90b2e2 /src/include | |
| parent | [tls] Treat handshake digest algorithm as a session parameter (diff) | |
| download | ipxe-05c13716f9a6323d8c8b4006f11dc2fc86493371.tar.gz ipxe-05c13716f9a6323d8c8b4006f11dc2fc86493371.tar.xz ipxe-05c13716f9a6323d8c8b4006f11dc2fc86493371.zip | |
[crypto] Use linker tables for RSA digestInfo prefixes
Allow external code to specify RSA digestInfo prefixes for additional
digest algorithms.
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/include')
| -rw-r--r-- | src/include/ipxe/rsa.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/include/ipxe/rsa.h b/src/include/ipxe/rsa.h index 87e75a82f..d43d336ab 100644 --- a/src/include/ipxe/rsa.h +++ b/src/include/ipxe/rsa.h @@ -11,6 +11,7 @@ FILE_LICENCE ( GPL2_OR_LATER ); #include <ipxe/crypto.h> #include <ipxe/bigint.h> #include <ipxe/asn1.h> +#include <ipxe/tables.h> /** ASN.1 OID for iso(1) member-body(2) us(840) */ #define ASN1_OID_ISO_US ASN1_OID_ISO_MEMBERBODY, ASN1_OID_DOUBLE ( 840 ) @@ -111,6 +112,23 @@ FILE_LICENCE ( GPL2_OR_LATER ); RSA_DIGESTALGORITHM ( __VA_ARGS__ ), \ RSA_DIGEST_PREFIX ( digest_size ) +/** An RSA digestInfo prefix */ +struct rsa_digestinfo_prefix { + /** Digest algorithm */ + struct digest_algorithm *digest; + /** Prefix */ + const void *data; + /** Length of prefix */ + size_t len; +}; + +/** RSA digestInfo prefix table */ +#define RSA_DIGESTINFO_PREFIXES \ + __table ( struct rsa_digestinfo_prefix, "rsa_digestinfo_prefixes" ) + +/** Declare an RSA digestInfo prefix */ +#define __rsa_digestinfo_prefix __table_entry ( RSA_DIGESTINFO_PREFIXES, 01 ) + /** An RSA context */ struct rsa_context { /** Allocated memory */ |
