aboutsummaryrefslogtreecommitdiffstats
path: root/src/crypto/mishmash
diff options
context:
space:
mode:
authorMichael Brown <mcb30@ipxe.org>2024-08-26 23:36:06 +0100
committerMichael Brown <mcb30@ipxe.org>2024-08-28 13:03:55 +0100
commit4b4a362f0713ffa08c9236d66a1881d6234d7717 (patch)
tree70fca07b5f66b4b66a47fe405a04b577c150add4 /src/crypto/mishmash
parentbdb5b4aef46ed34b47094652f3eefc7d0463d166 (diff)
downloadipxe-4b4a362f0713ffa08c9236d66a1881d6234d7717.tar.gz
[crypto] Allow for extraction of ASN.1 algorithm parameters
Some ASN.1 OID-identified algorithms require additional parameters, such as an initialisation vector for a block cipher. The structure of the parameters is defined by the individual algorithm. Extend asn1_algorithm() to allow these additional parameters to be returned via a separate ASN.1 cursor. Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/crypto/mishmash')
-rw-r--r--src/crypto/mishmash/oid_aes_cbc.c3
-rw-r--r--src/crypto/mishmash/oid_aes_gcm.c3
2 files changed, 6 insertions, 0 deletions
diff --git a/src/crypto/mishmash/oid_aes_cbc.c b/src/crypto/mishmash/oid_aes_cbc.c
index 0a7951c63..b5f716574 100644
--- a/src/crypto/mishmash/oid_aes_cbc.c
+++ b/src/crypto/mishmash/oid_aes_cbc.c
@@ -40,6 +40,7 @@ struct asn1_algorithm aes_128_cbc_algorithm __asn1_algorithm = {
.name = "aes128-cbc",
.cipher = &aes_cbc_algorithm,
.oid = ASN1_CURSOR ( oid_aes_128_cbc ),
+ .parse = asn1_parse_cbc,
};
/** "aes192-cbc" OID-identified algorithm */
@@ -47,6 +48,7 @@ struct asn1_algorithm aes_192_cbc_algorithm __asn1_algorithm = {
.name = "aes192-cbc",
.cipher = &aes_cbc_algorithm,
.oid = ASN1_CURSOR ( oid_aes_192_cbc ),
+ .parse = asn1_parse_cbc,
};
/** "aes256-cbc" OID-identified algorithm */
@@ -54,4 +56,5 @@ struct asn1_algorithm aes_256_cbc_algorithm __asn1_algorithm = {
.name = "aes256-cbc",
.cipher = &aes_cbc_algorithm,
.oid = ASN1_CURSOR ( oid_aes_256_cbc ),
+ .parse = asn1_parse_cbc,
};
diff --git a/src/crypto/mishmash/oid_aes_gcm.c b/src/crypto/mishmash/oid_aes_gcm.c
index 0f94d5323..af1432d8e 100644
--- a/src/crypto/mishmash/oid_aes_gcm.c
+++ b/src/crypto/mishmash/oid_aes_gcm.c
@@ -40,6 +40,7 @@ struct asn1_algorithm aes_128_gcm_algorithm __asn1_algorithm = {
.name = "aes128-gcm",
.cipher = &aes_gcm_algorithm,
.oid = ASN1_CURSOR ( oid_aes_128_gcm ),
+ .parse = asn1_parse_gcm,
};
/** "aes192-gcm" OID-identified algorithm */
@@ -47,6 +48,7 @@ struct asn1_algorithm aes_192_gcm_algorithm __asn1_algorithm = {
.name = "aes192-gcm",
.cipher = &aes_gcm_algorithm,
.oid = ASN1_CURSOR ( oid_aes_192_gcm ),
+ .parse = asn1_parse_gcm,
};
/** "aes256-gcm" OID-identified algorithm */
@@ -54,4 +56,5 @@ struct asn1_algorithm aes_256_gcm_algorithm __asn1_algorithm = {
.name = "aes256-gcm",
.cipher = &aes_gcm_algorithm,
.oid = ASN1_CURSOR ( oid_aes_256_gcm ),
+ .parse = asn1_parse_gcm,
};