]> git.ipfire.org Git - thirdparty/ipxe.git/commitdiff
[asn1] Rename ASN1_OID_CURSOR to ASN1_CURSOR
authorMichael Brown <mcb30@ipxe.org>
Tue, 8 Dec 2020 12:30:57 +0000 (12:30 +0000)
committerMichael Brown <mcb30@ipxe.org>
Tue, 8 Dec 2020 12:38:45 +0000 (12:38 +0000)
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>
20 files changed:
src/crypto/cms.c
src/crypto/mishmash/oid_md4.c
src/crypto/mishmash/oid_md5.c
src/crypto/mishmash/oid_rsa.c
src/crypto/mishmash/oid_sha1.c
src/crypto/mishmash/oid_sha224.c
src/crypto/mishmash/oid_sha256.c
src/crypto/mishmash/oid_sha384.c
src/crypto/mishmash/oid_sha512.c
src/crypto/mishmash/oid_sha512_224.c
src/crypto/mishmash/oid_sha512_256.c
src/crypto/mishmash/rsa_md5.c
src/crypto/mishmash/rsa_sha1.c
src/crypto/mishmash/rsa_sha224.c
src/crypto/mishmash/rsa_sha256.c
src/crypto/mishmash/rsa_sha384.c
src/crypto/mishmash/rsa_sha512.c
src/crypto/ocsp.c
src/crypto/x509.c
src/include/ipxe/asn1.h

index bc2148e8a7477fe0e9da14948b06b59a384f7fb9..9511cec8abe87840a67ca10fa9001a7e8847cbeb 100644 (file)
@@ -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
index 1054a79bef82ce1f6d64b1f72cb7c07c36a326b2..d42f2df19cdeaabf47d87d1f30cce99ae7613319 100644 (file)
@@ -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 ),
 };
index 96149d0967743b6486fe0fa059b656f55ff51d32..f56dd8b8d8f23258427f447cd7854d9d353e1def 100644 (file)
@@ -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 ),
 };
index 1360c31179e32f7ff53bff7d456cfbdb40e037d5..5820226283f034cfdfabd9eb097693cc258bee63 100644 (file)
@@ -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 ),
 };
index 0ab3bac6148f6305963f53463a3fbc76e24e2f96..5dae6d27c44deeaa0e84f5a6fc37919d3fb95cb0 100644 (file)
@@ -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 ),
 };
index 1ff6884a48517a685c6773d8e97ed9065159994b..ee7ed22e405a9162df2778059ffee7131cd4be23 100644 (file)
@@ -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 ),
 };
index 51ea585c5e7b8aae8f7fba2c6121bb6aadffc3cb..963fddb6309332b5944e14a358863e6403f32a7b 100644 (file)
@@ -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 ),
 };
index 5ba4d60a468256e334c10fbda283043e1c04d1db..81ff48bbf3ea948ee2570ffbc0dbc2ccd864dc08 100644 (file)
@@ -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 ),
 };
index 38e3c1a3dfa4f9448068f06d0bb8c5e1cbad97ed..78bae48b42ffa40104204f77590c9ae8ca730c28 100644 (file)
@@ -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 ),
 };
index 2300dad66dab861ed537d77f736c0b2a85707bf3..6f61f9cace46cd037cada99bd8505e637af4c085 100644 (file)
@@ -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 ),
 };
index 6af61fea9d177c17ab4f93f561c4b2958b06317e..bce4762e4bf15000e8be7970f84cae21f7263043 100644 (file)
@@ -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 ),
 };
index ac828ac111fedaba5dd9251bdd2478a7d546a9f1..051afe26489e5a72898ba1cb2c8bd3ce8941c00a 100644 (file)
@@ -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 */
index 39424bf2d4fbeb4527f0b02ee526ba395fe8482a..264f871f187e01df09389358b16a6889ddd11c5a 100644 (file)
@@ -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 */
index 5e8755aab27d01a071daa11fd2d94d6ec99c6105..1465a033d3d56c60d21d8a9bd97ff68acd9ab2f4 100644 (file)
@@ -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 */
index b44af5f1954027034530b5caacb382b485214201..7283c3e29bc5a5fb0000044a087e5d38690b7ba1 100644 (file)
@@ -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 */
index af22a2bf01f5ea8dc1ca095cfa5a1ff780c03942..6f8c29b29ae59505873e28bba2e3f828f323f1f1 100644 (file)
@@ -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 */
index 29ee154935cbf1f67113369c5fe5f3e2fb448128..bb4463a5a1fdd0a08dc08673bc39b80fca03bd88 100644 (file)
@@ -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 */
index 9ced59ea3a080351c9d6ebb753cd3de8f162e3cb..51dc939e87be356d989e47503bcbbbdfe85eca2e 100644 (file)
@@ -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
index feb7e4a0aee9985e7ada94c78038ddddf853162c..da0a85825e4f2c0e18525e151964136e06ea7dcf 100644 (file)
@@ -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,
        },
 };
index 7b0aacb5d3dbd0d81b204fcaeaccaa57e1aa6464..5b1af02d47ce4bc9b11f176c554cebee0e3231ba 100644 (file)
@@ -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 */