aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Brown <mcb30@ipxe.org>2020-12-08 12:30:57 +0000
committerMichael Brown <mcb30@ipxe.org>2020-12-08 12:38:45 +0000
commite4b6328c84cf3dcbb4af9ba42b2e3cbbb2cfbfee (patch)
tree62272ccce436c733685c2e76612190a54a89c88c
parente33f5210813d704477eb16b45fbbaec143d8da95 (diff)
downloadipxe-e4b6328c84cf3dcbb4af9ba42b2e3cbbb2cfbfee.zip
ipxe-e4b6328c84cf3dcbb4af9ba42b2e3cbbb2cfbfee.tar.gz
ipxe-e4b6328c84cf3dcbb4af9ba42b2e3cbbb2cfbfee.tar.bz2
[asn1] Rename ASN1_OID_CURSOR to ASN1_CURSOR
There is nothing OID-specific about the ASN1_OID_CURSOR macro. Rename to allow it to be used for constructing ASN.1 cursors with arbitrary contents. Signed-off-by: Michael Brown <mcb30@ipxe.org>
-rw-r--r--src/crypto/cms.c2
-rw-r--r--src/crypto/mishmash/oid_md4.c2
-rw-r--r--src/crypto/mishmash/oid_md5.c2
-rw-r--r--src/crypto/mishmash/oid_rsa.c2
-rw-r--r--src/crypto/mishmash/oid_sha1.c2
-rw-r--r--src/crypto/mishmash/oid_sha224.c2
-rw-r--r--src/crypto/mishmash/oid_sha256.c2
-rw-r--r--src/crypto/mishmash/oid_sha384.c2
-rw-r--r--src/crypto/mishmash/oid_sha512.c2
-rw-r--r--src/crypto/mishmash/oid_sha512_224.c2
-rw-r--r--src/crypto/mishmash/oid_sha512_256.c2
-rw-r--r--src/crypto/mishmash/rsa_md5.c2
-rw-r--r--src/crypto/mishmash/rsa_sha1.c2
-rw-r--r--src/crypto/mishmash/rsa_sha224.c2
-rw-r--r--src/crypto/mishmash/rsa_sha256.c2
-rw-r--r--src/crypto/mishmash/rsa_sha384.c2
-rw-r--r--src/crypto/mishmash/rsa_sha512.c2
-rw-r--r--src/crypto/ocsp.c2
-rw-r--r--src/crypto/x509.c18
-rw-r--r--src/include/ipxe/asn1.h8
20 files changed, 31 insertions, 31 deletions
diff --git a/src/crypto/cms.c b/src/crypto/cms.c
index bc2148e..9511cec 100644
--- a/src/crypto/cms.c
+++ b/src/crypto/cms.c
@@ -76,7 +76,7 @@ static uint8_t oid_signeddata[] = { ASN1_OID_SIGNEDDATA };
/** "pkcs7-signedData" object identifier cursor */
static struct asn1_cursor oid_signeddata_cursor =
- ASN1_OID_CURSOR ( oid_signeddata );
+ ASN1_CURSOR ( oid_signeddata );
/**
* Parse CMS signature content type
diff --git a/src/crypto/mishmash/oid_md4.c b/src/crypto/mishmash/oid_md4.c
index 1054a79..d42f2df 100644
--- a/src/crypto/mishmash/oid_md4.c
+++ b/src/crypto/mishmash/oid_md4.c
@@ -33,5 +33,5 @@ static uint8_t oid_md4[] = { ASN1_OID_MD4 };
struct asn1_algorithm oid_md4_algorithm __asn1_algorithm = {
.name = "md4",
.digest = &md4_algorithm,
- .oid = ASN1_OID_CURSOR ( oid_md4 ),
+ .oid = ASN1_CURSOR ( oid_md4 ),
};
diff --git a/src/crypto/mishmash/oid_md5.c b/src/crypto/mishmash/oid_md5.c
index 96149d0..f56dd8b 100644
--- a/src/crypto/mishmash/oid_md5.c
+++ b/src/crypto/mishmash/oid_md5.c
@@ -33,5 +33,5 @@ static uint8_t oid_md5[] = { ASN1_OID_MD5 };
struct asn1_algorithm oid_md5_algorithm __asn1_algorithm = {
.name = "md5",
.digest = &md5_algorithm,
- .oid = ASN1_OID_CURSOR ( oid_md5 ),
+ .oid = ASN1_CURSOR ( oid_md5 ),
};
diff --git a/src/crypto/mishmash/oid_rsa.c b/src/crypto/mishmash/oid_rsa.c
index 1360c31..5820226 100644
--- a/src/crypto/mishmash/oid_rsa.c
+++ b/src/crypto/mishmash/oid_rsa.c
@@ -34,5 +34,5 @@ struct asn1_algorithm rsa_encryption_algorithm __asn1_algorithm = {
.name = "rsaEncryption",
.pubkey = &rsa_algorithm,
.digest = NULL,
- .oid = ASN1_OID_CURSOR ( oid_rsa_encryption ),
+ .oid = ASN1_CURSOR ( oid_rsa_encryption ),
};
diff --git a/src/crypto/mishmash/oid_sha1.c b/src/crypto/mishmash/oid_sha1.c
index 0ab3bac..5dae6d2 100644
--- a/src/crypto/mishmash/oid_sha1.c
+++ b/src/crypto/mishmash/oid_sha1.c
@@ -33,5 +33,5 @@ static uint8_t oid_sha1[] = { ASN1_OID_SHA1 };
struct asn1_algorithm oid_sha1_algorithm __asn1_algorithm = {
.name = "sha1",
.digest = &sha1_algorithm,
- .oid = ASN1_OID_CURSOR ( oid_sha1 ),
+ .oid = ASN1_CURSOR ( oid_sha1 ),
};
diff --git a/src/crypto/mishmash/oid_sha224.c b/src/crypto/mishmash/oid_sha224.c
index 1ff6884..ee7ed22 100644
--- a/src/crypto/mishmash/oid_sha224.c
+++ b/src/crypto/mishmash/oid_sha224.c
@@ -33,5 +33,5 @@ static uint8_t oid_sha224[] = { ASN1_OID_SHA224 };
struct asn1_algorithm oid_sha224_algorithm __asn1_algorithm = {
.name = "sha224",
.digest = &sha224_algorithm,
- .oid = ASN1_OID_CURSOR ( oid_sha224 ),
+ .oid = ASN1_CURSOR ( oid_sha224 ),
};
diff --git a/src/crypto/mishmash/oid_sha256.c b/src/crypto/mishmash/oid_sha256.c
index 51ea585..963fddb 100644
--- a/src/crypto/mishmash/oid_sha256.c
+++ b/src/crypto/mishmash/oid_sha256.c
@@ -33,5 +33,5 @@ static uint8_t oid_sha256[] = { ASN1_OID_SHA256 };
struct asn1_algorithm oid_sha256_algorithm __asn1_algorithm = {
.name = "sha256",
.digest = &sha256_algorithm,
- .oid = ASN1_OID_CURSOR ( oid_sha256 ),
+ .oid = ASN1_CURSOR ( oid_sha256 ),
};
diff --git a/src/crypto/mishmash/oid_sha384.c b/src/crypto/mishmash/oid_sha384.c
index 5ba4d60..81ff48b 100644
--- a/src/crypto/mishmash/oid_sha384.c
+++ b/src/crypto/mishmash/oid_sha384.c
@@ -33,5 +33,5 @@ static uint8_t oid_sha384[] = { ASN1_OID_SHA384 };
struct asn1_algorithm oid_sha384_algorithm __asn1_algorithm = {
.name = "sha384",
.digest = &sha384_algorithm,
- .oid = ASN1_OID_CURSOR ( oid_sha384 ),
+ .oid = ASN1_CURSOR ( oid_sha384 ),
};
diff --git a/src/crypto/mishmash/oid_sha512.c b/src/crypto/mishmash/oid_sha512.c
index 38e3c1a..78bae48 100644
--- a/src/crypto/mishmash/oid_sha512.c
+++ b/src/crypto/mishmash/oid_sha512.c
@@ -33,5 +33,5 @@ static uint8_t oid_sha512[] = { ASN1_OID_SHA512 };
struct asn1_algorithm oid_sha512_algorithm __asn1_algorithm = {
.name = "sha512",
.digest = &sha512_algorithm,
- .oid = ASN1_OID_CURSOR ( oid_sha512 ),
+ .oid = ASN1_CURSOR ( oid_sha512 ),
};
diff --git a/src/crypto/mishmash/oid_sha512_224.c b/src/crypto/mishmash/oid_sha512_224.c
index 2300dad..6f61f9c 100644
--- a/src/crypto/mishmash/oid_sha512_224.c
+++ b/src/crypto/mishmash/oid_sha512_224.c
@@ -33,5 +33,5 @@ static uint8_t oid_sha512_224[] = { ASN1_OID_SHA512_224 };
struct asn1_algorithm oid_sha512_224_algorithm __asn1_algorithm = {
.name = "sha512/224",
.digest = &sha512_224_algorithm,
- .oid = ASN1_OID_CURSOR ( oid_sha512_224 ),
+ .oid = ASN1_CURSOR ( oid_sha512_224 ),
};
diff --git a/src/crypto/mishmash/oid_sha512_256.c b/src/crypto/mishmash/oid_sha512_256.c
index 6af61fe..bce4762 100644
--- a/src/crypto/mishmash/oid_sha512_256.c
+++ b/src/crypto/mishmash/oid_sha512_256.c
@@ -33,5 +33,5 @@ static uint8_t oid_sha512_256[] = { ASN1_OID_SHA512_256 };
struct asn1_algorithm oid_sha512_256_algorithm __asn1_algorithm = {
.name = "sha512/256",
.digest = &sha512_256_algorithm,
- .oid = ASN1_OID_CURSOR ( oid_sha512_256 ),
+ .oid = ASN1_CURSOR ( oid_sha512_256 ),
};
diff --git a/src/crypto/mishmash/rsa_md5.c b/src/crypto/mishmash/rsa_md5.c
index ac828ac..051afe2 100644
--- a/src/crypto/mishmash/rsa_md5.c
+++ b/src/crypto/mishmash/rsa_md5.c
@@ -36,7 +36,7 @@ struct asn1_algorithm md5_with_rsa_encryption_algorithm __asn1_algorithm = {
.name = "md5WithRSAEncryption",
.pubkey = &rsa_algorithm,
.digest = &md5_algorithm,
- .oid = ASN1_OID_CURSOR ( oid_md5_with_rsa_encryption ),
+ .oid = ASN1_CURSOR ( oid_md5_with_rsa_encryption ),
};
/** MD5 digestInfo prefix */
diff --git a/src/crypto/mishmash/rsa_sha1.c b/src/crypto/mishmash/rsa_sha1.c
index 39424bf..264f871 100644
--- a/src/crypto/mishmash/rsa_sha1.c
+++ b/src/crypto/mishmash/rsa_sha1.c
@@ -37,7 +37,7 @@ struct asn1_algorithm sha1_with_rsa_encryption_algorithm __asn1_algorithm = {
.name = "sha1WithRSAEncryption",
.pubkey = &rsa_algorithm,
.digest = &sha1_algorithm,
- .oid = ASN1_OID_CURSOR ( oid_sha1_with_rsa_encryption ),
+ .oid = ASN1_CURSOR ( oid_sha1_with_rsa_encryption ),
};
/** SHA-1 digestInfo prefix */
diff --git a/src/crypto/mishmash/rsa_sha224.c b/src/crypto/mishmash/rsa_sha224.c
index 5e8755a..1465a03 100644
--- a/src/crypto/mishmash/rsa_sha224.c
+++ b/src/crypto/mishmash/rsa_sha224.c
@@ -37,7 +37,7 @@ struct asn1_algorithm sha224_with_rsa_encryption_algorithm __asn1_algorithm = {
.name = "sha224WithRSAEncryption",
.pubkey = &rsa_algorithm,
.digest = &sha224_algorithm,
- .oid = ASN1_OID_CURSOR ( oid_sha224_with_rsa_encryption ),
+ .oid = ASN1_CURSOR ( oid_sha224_with_rsa_encryption ),
};
/** SHA-224 digestInfo prefix */
diff --git a/src/crypto/mishmash/rsa_sha256.c b/src/crypto/mishmash/rsa_sha256.c
index b44af5f..7283c3e 100644
--- a/src/crypto/mishmash/rsa_sha256.c
+++ b/src/crypto/mishmash/rsa_sha256.c
@@ -37,7 +37,7 @@ struct asn1_algorithm sha256_with_rsa_encryption_algorithm __asn1_algorithm = {
.name = "sha256WithRSAEncryption",
.pubkey = &rsa_algorithm,
.digest = &sha256_algorithm,
- .oid = ASN1_OID_CURSOR ( oid_sha256_with_rsa_encryption ),
+ .oid = ASN1_CURSOR ( oid_sha256_with_rsa_encryption ),
};
/** SHA-256 digestInfo prefix */
diff --git a/src/crypto/mishmash/rsa_sha384.c b/src/crypto/mishmash/rsa_sha384.c
index af22a2b..6f8c29b 100644
--- a/src/crypto/mishmash/rsa_sha384.c
+++ b/src/crypto/mishmash/rsa_sha384.c
@@ -37,7 +37,7 @@ struct asn1_algorithm sha384_with_rsa_encryption_algorithm __asn1_algorithm = {
.name = "sha384WithRSAEncryption",
.pubkey = &rsa_algorithm,
.digest = &sha384_algorithm,
- .oid = ASN1_OID_CURSOR ( oid_sha384_with_rsa_encryption ),
+ .oid = ASN1_CURSOR ( oid_sha384_with_rsa_encryption ),
};
/** SHA-384 digestInfo prefix */
diff --git a/src/crypto/mishmash/rsa_sha512.c b/src/crypto/mishmash/rsa_sha512.c
index 29ee154..bb4463a 100644
--- a/src/crypto/mishmash/rsa_sha512.c
+++ b/src/crypto/mishmash/rsa_sha512.c
@@ -37,7 +37,7 @@ struct asn1_algorithm sha512_with_rsa_encryption_algorithm __asn1_algorithm = {
.name = "sha512WithRSAEncryption",
.pubkey = &rsa_algorithm,
.digest = &sha512_algorithm,
- .oid = ASN1_OID_CURSOR ( oid_sha512_with_rsa_encryption ),
+ .oid = ASN1_CURSOR ( oid_sha512_with_rsa_encryption ),
};
/** SHA-512 digestInfo prefix */
diff --git a/src/crypto/ocsp.c b/src/crypto/ocsp.c
index 9ced59e..51dc939 100644
--- a/src/crypto/ocsp.c
+++ b/src/crypto/ocsp.c
@@ -116,7 +116,7 @@ static const uint8_t oid_basic_response_type[] = { ASN1_OID_OCSP_BASIC };
/** OCSP basic response type cursor */
static struct asn1_cursor oid_basic_response_type_cursor =
- ASN1_OID_CURSOR ( oid_basic_response_type );
+ ASN1_CURSOR ( oid_basic_response_type );
/**
* Free OCSP check
diff --git a/src/crypto/x509.c b/src/crypto/x509.c
index feb7e4a..da0a858 100644
--- a/src/crypto/x509.c
+++ b/src/crypto/x509.c
@@ -156,7 +156,7 @@ static uint8_t oid_common_name[] = { ASN1_OID_COMMON_NAME };
/** "commonName" object identifier cursor */
static struct asn1_cursor oid_common_name_cursor =
- ASN1_OID_CURSOR ( oid_common_name );
+ ASN1_CURSOR ( oid_common_name );
/**
* Parse X.509 certificate version
@@ -523,12 +523,12 @@ static struct x509_key_purpose x509_key_purposes[] = {
{
.name = "codeSigning",
.bits = X509_CODE_SIGNING,
- .oid = ASN1_OID_CURSOR ( oid_code_signing ),
+ .oid = ASN1_CURSOR ( oid_code_signing ),
},
{
.name = "ocspSigning",
.bits = X509_OCSP_SIGNING,
- .oid = ASN1_OID_CURSOR ( oid_ocsp_signing ),
+ .oid = ASN1_CURSOR ( oid_ocsp_signing ),
},
};
@@ -631,7 +631,7 @@ static uint8_t oid_ad_ocsp[] = { ASN1_OID_OCSP };
static struct x509_access_method x509_access_methods[] = {
{
.name = "OCSP",
- .oid = ASN1_OID_CURSOR ( oid_ad_ocsp ),
+ .oid = ASN1_CURSOR ( oid_ad_ocsp ),
.parse = x509_parse_ocsp,
},
};
@@ -768,27 +768,27 @@ static uint8_t oid_ce_subject_alt_name[] =
static struct x509_extension x509_extensions[] = {
{
.name = "basicConstraints",
- .oid = ASN1_OID_CURSOR ( oid_ce_basic_constraints ),
+ .oid = ASN1_CURSOR ( oid_ce_basic_constraints ),
.parse = x509_parse_basic_constraints,
},
{
.name = "keyUsage",
- .oid = ASN1_OID_CURSOR ( oid_ce_key_usage ),
+ .oid = ASN1_CURSOR ( oid_ce_key_usage ),
.parse = x509_parse_key_usage,
},
{
.name = "extKeyUsage",
- .oid = ASN1_OID_CURSOR ( oid_ce_ext_key_usage ),
+ .oid = ASN1_CURSOR ( oid_ce_ext_key_usage ),
.parse = x509_parse_extended_key_usage,
},
{
.name = "authorityInfoAccess",
- .oid = ASN1_OID_CURSOR ( oid_pe_authority_info_access ),
+ .oid = ASN1_CURSOR ( oid_pe_authority_info_access ),
.parse = x509_parse_authority_info_access,
},
{
.name = "subjectAltName",
- .oid = ASN1_OID_CURSOR ( oid_ce_subject_alt_name ),
+ .oid = ASN1_CURSOR ( oid_ce_subject_alt_name ),
.parse = x509_parse_subject_alt_name,
},
};
diff --git a/src/include/ipxe/asn1.h b/src/include/ipxe/asn1.h
index 7b0aacb..5b1af02 100644
--- a/src/include/ipxe/asn1.h
+++ b/src/include/ipxe/asn1.h
@@ -291,10 +291,10 @@ struct asn1_builder_header {
ASN1_OID_INITIAL ( 2, 5 ), ASN1_OID_SINGLE ( 29 ), \
ASN1_OID_SINGLE ( 17 )
-/** Define an ASN.1 cursor containing an OID */
-#define ASN1_OID_CURSOR( oid_value ) { \
- .data = oid_value, \
- .len = sizeof ( oid_value ), \
+/** Define an ASN.1 cursor for a static value */
+#define ASN1_CURSOR( value ) { \
+ .data = value, \
+ .len = sizeof ( value ), \
}
/** An ASN.1 OID-identified algorithm */