diff options
author | Pauli <paul.dale@oracle.com> | 2020-09-30 13:59:20 +1000 |
---|---|---|
committer | Pauli <paul.dale@oracle.com> | 2020-10-01 11:25:12 +1000 |
commit | 012903063900340b972a6a8d20c0a18c37a89428 (patch) | |
tree | 663ae5a236d1f0a6514a6d8700ea0327f6e978d8 /providers | |
parent | a55b00bdbc00b1632e551cf71bce72137e683c12 (diff) | |
download | openssl-new-012903063900340b972a6a8d20c0a18c37a89428.tar.gz |
der: _ossl prefix der_oid_ and der_aid_ functions
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/13038)
Diffstat (limited to 'providers')
-rw-r--r-- | providers/common/der/der_dsa_key.c | 4 | ||||
-rw-r--r-- | providers/common/der/der_dsa_sig.c | 4 | ||||
-rw-r--r-- | providers/common/der/der_ec_key.c | 4 | ||||
-rw-r--r-- | providers/common/der/der_ec_sig.c | 14 | ||||
-rw-r--r-- | providers/common/der/der_ecx_key.c | 16 | ||||
-rw-r--r-- | providers/common/der/der_rsa_key.c | 46 | ||||
-rw-r--r-- | providers/common/der/der_rsa_sig.c | 20 | ||||
-rw-r--r-- | providers/common/der/der_sm2_key.c | 4 | ||||
-rw-r--r-- | providers/common/der/der_sm2_sig.c | 6 | ||||
-rw-r--r-- | providers/common/der/oids_to_c.pm | 4 | ||||
-rw-r--r-- | providers/implementations/kdfs/x942kdf.c | 13 |
11 files changed, 69 insertions, 66 deletions
diff --git a/providers/common/der/der_dsa_key.c b/providers/common/der/der_dsa_key.c index b0a6db1054..1a369faa81 100644 --- a/providers/common/der/der_dsa_key.c +++ b/providers/common/der/der_dsa_key.c @@ -15,7 +15,7 @@ int ossl_DER_w_algorithmIdentifier_DSA(WPACKET *pkt, int tag, DSA *dsa) { return ossl_DER_w_begin_sequence(pkt, tag) /* No parameters (yet?) */ - && ossl_DER_w_precompiled(pkt, -1, der_oid_id_dsa, - sizeof(der_oid_id_dsa)) + && ossl_DER_w_precompiled(pkt, -1, ossl_der_oid_id_dsa, + sizeof(ossl_der_oid_id_dsa)) && ossl_DER_w_end_sequence(pkt, tag); } diff --git a/providers/common/der/der_dsa_sig.c b/providers/common/der/der_dsa_sig.c index ad747340ad..37ee5f459d 100644 --- a/providers/common/der/der_dsa_sig.c +++ b/providers/common/der/der_dsa_sig.c @@ -13,8 +13,8 @@ #define MD_CASE(name) \ case NID_##name: \ - precompiled = der_oid_id_dsa_with_##name; \ - precompiled_sz = sizeof(der_oid_id_dsa_with_##name); \ + precompiled = ossl_der_oid_id_dsa_with_##name; \ + precompiled_sz = sizeof(ossl_der_oid_id_dsa_with_##name); \ break; int ossl_DER_w_algorithmIdentifier_DSA_with_MD(WPACKET *pkt, int tag, diff --git a/providers/common/der/der_ec_key.c b/providers/common/der/der_ec_key.c index 4c0b9a2dd5..ae0775af53 100644 --- a/providers/common/der/der_ec_key.c +++ b/providers/common/der/der_ec_key.c @@ -15,7 +15,7 @@ int ossl_DER_w_algorithmIdentifier_EC(WPACKET *pkt, int cont, EC_KEY *ec) { return ossl_DER_w_begin_sequence(pkt, cont) /* No parameters (yet?) */ - && ossl_DER_w_precompiled(pkt, -1, der_oid_id_ecPublicKey, - sizeof(der_oid_id_ecPublicKey)) + && ossl_DER_w_precompiled(pkt, -1, ossl_der_oid_id_ecPublicKey, + sizeof(ossl_der_oid_id_ecPublicKey)) && ossl_DER_w_end_sequence(pkt, cont); } diff --git a/providers/common/der/der_ec_sig.c b/providers/common/der/der_ec_sig.c index 095e225077..25b672dab2 100644 --- a/providers/common/der/der_ec_sig.c +++ b/providers/common/der/der_ec_sig.c @@ -12,16 +12,16 @@ #include "prov/der_ec.h" /* Aliases so we can have a uniform MD_CASE */ -#define der_oid_id_ecdsa_with_sha1 der_oid_ecdsa_with_SHA1 -#define der_oid_id_ecdsa_with_sha224 der_oid_ecdsa_with_SHA224 -#define der_oid_id_ecdsa_with_sha256 der_oid_ecdsa_with_SHA256 -#define der_oid_id_ecdsa_with_sha384 der_oid_ecdsa_with_SHA384 -#define der_oid_id_ecdsa_with_sha512 der_oid_ecdsa_with_SHA512 +#define ossl_der_oid_id_ecdsa_with_sha1 ossl_der_oid_ecdsa_with_SHA1 +#define ossl_der_oid_id_ecdsa_with_sha224 ossl_der_oid_ecdsa_with_SHA224 +#define ossl_der_oid_id_ecdsa_with_sha256 ossl_der_oid_ecdsa_with_SHA256 +#define ossl_der_oid_id_ecdsa_with_sha384 ossl_der_oid_ecdsa_with_SHA384 +#define ossl_der_oid_id_ecdsa_with_sha512 ossl_der_oid_ecdsa_with_SHA512 #define MD_CASE(name) \ case NID_##name: \ - precompiled = der_oid_id_ecdsa_with_##name; \ - precompiled_sz = sizeof(der_oid_id_ecdsa_with_##name); \ + precompiled = ossl_der_oid_id_ecdsa_with_##name; \ + precompiled_sz = sizeof(ossl_der_oid_id_ecdsa_with_##name); \ break; int ossl_DER_w_algorithmIdentifier_ECDSA_with_MD(WPACKET *pkt, int cont, diff --git a/providers/common/der/der_ecx_key.c b/providers/common/der/der_ecx_key.c index d445836866..c00a11cac8 100644 --- a/providers/common/der/der_ecx_key.c +++ b/providers/common/der/der_ecx_key.c @@ -15,8 +15,8 @@ int ossl_DER_w_algorithmIdentifier_X25519(WPACKET *pkt, int cont, ECX_KEY *ec) { return ossl_DER_w_begin_sequence(pkt, cont) /* No parameters (yet?) */ - && ossl_DER_w_precompiled(pkt, -1, der_oid_id_X25519, - sizeof(der_oid_id_X25519)) + && ossl_DER_w_precompiled(pkt, -1, ossl_der_oid_id_X25519, + sizeof(ossl_der_oid_id_X25519)) && ossl_DER_w_end_sequence(pkt, cont); } @@ -24,8 +24,8 @@ int ossl_DER_w_algorithmIdentifier_X448(WPACKET *pkt, int cont, ECX_KEY *ec) { return ossl_DER_w_begin_sequence(pkt, cont) /* No parameters (yet?) */ - && ossl_DER_w_precompiled(pkt, -1, der_oid_id_X448, - sizeof(der_oid_id_X448)) + && ossl_DER_w_precompiled(pkt, -1, ossl_der_oid_id_X448, + sizeof(ossl_der_oid_id_X448)) && ossl_DER_w_end_sequence(pkt, cont); } @@ -33,8 +33,8 @@ int ossl_DER_w_algorithmIdentifier_ED25519(WPACKET *pkt, int cont, ECX_KEY *ec) { return ossl_DER_w_begin_sequence(pkt, cont) /* No parameters (yet?) */ - && ossl_DER_w_precompiled(pkt, -1, der_oid_id_Ed25519, - sizeof(der_oid_id_Ed25519)) + && ossl_DER_w_precompiled(pkt, -1, ossl_der_oid_id_Ed25519, + sizeof(ossl_der_oid_id_Ed25519)) && ossl_DER_w_end_sequence(pkt, cont); } @@ -42,7 +42,7 @@ int ossl_DER_w_algorithmIdentifier_ED448(WPACKET *pkt, int cont, ECX_KEY *ec) { return ossl_DER_w_begin_sequence(pkt, cont) /* No parameters (yet?) */ - && ossl_DER_w_precompiled(pkt, -1, der_oid_id_Ed448, - sizeof(der_oid_id_Ed448)) + && ossl_DER_w_precompiled(pkt, -1, ossl_der_oid_id_Ed448, + sizeof(ossl_der_oid_id_Ed448)) && ossl_DER_w_end_sequence(pkt, cont); } diff --git a/providers/common/der/der_rsa_key.c b/providers/common/der/der_rsa_key.c index 5340b6756b..6e8a37699d 100644 --- a/providers/common/der/der_rsa_key.c +++ b/providers/common/der/der_rsa_key.c @@ -64,66 +64,66 @@ const unsigned char der_aid_sha1Identifier[] = { DER_OID_SZ_id_sha224 + DER_SZ_NULL, \ DER_OID_V_id_sha224, \ DER_V_NULL -extern const unsigned char der_aid_sha224Identifier[]; -const unsigned char der_aid_sha224Identifier[] = { +extern const unsigned char ossl_der_aid_sha224Identifier[]; +const unsigned char ossl_der_aid_sha224Identifier[] = { DER_AID_V_sha224Identifier }; -#define DER_AID_SZ_sha224Identifier sizeof(der_aid_sha224Identifier) +#define DER_AID_SZ_sha224Identifier sizeof(ossl_der_aid_sha224Identifier) #define DER_AID_V_sha256Identifier \ DER_P_SEQUENCE|DER_F_CONSTRUCTED, \ DER_OID_SZ_id_sha256 + DER_SZ_NULL, \ DER_OID_V_id_sha256, \ DER_V_NULL -extern const unsigned char der_aid_sha256Identifier[]; -const unsigned char der_aid_sha256Identifier[] = { +extern const unsigned char ossl_der_aid_sha256Identifier[]; +const unsigned char ossl_der_aid_sha256Identifier[] = { DER_AID_V_sha256Identifier }; -#define DER_AID_SZ_sha256Identifier sizeof(der_aid_sha256Identifier) +#define DER_AID_SZ_sha256Identifier sizeof(ossl_der_aid_sha256Identifier) #define DER_AID_V_sha384Identifier \ DER_P_SEQUENCE|DER_F_CONSTRUCTED, \ DER_OID_SZ_id_sha384 + DER_SZ_NULL, \ DER_OID_V_id_sha384, \ DER_V_NULL -extern const unsigned char der_aid_sha384Identifier[]; -const unsigned char der_aid_sha384Identifier[] = { +extern const unsigned char ossl_der_aid_sha384Identifier[]; +const unsigned char ossl_der_aid_sha384Identifier[] = { DER_AID_V_sha384Identifier }; -#define DER_AID_SZ_sha384Identifier sizeof(der_aid_sha384Identifier) +#define DER_AID_SZ_sha384Identifier sizeof(ossl_der_aid_sha384Identifier) #define DER_AID_V_sha512Identifier \ DER_P_SEQUENCE|DER_F_CONSTRUCTED, \ DER_OID_SZ_id_sha512 + DER_SZ_NULL, \ DER_OID_V_id_sha512, \ DER_V_NULL -extern const unsigned char der_aid_sha512Identifier[]; -const unsigned char der_aid_sha512Identifier[] = { +extern const unsigned char ossl_der_aid_sha512Identifier[]; +const unsigned char ossl_der_aid_sha512Identifier[] = { DER_AID_V_sha512Identifier }; -#define DER_AID_SZ_sha512Identifier sizeof(der_aid_sha512Identifier) +#define DER_AID_SZ_sha512Identifier sizeof(ossl_der_aid_sha512Identifier) #define DER_AID_V_sha512_224Identifier \ DER_P_SEQUENCE|DER_F_CONSTRUCTED, \ DER_OID_SZ_id_sha512_224 + DER_SZ_NULL, \ DER_OID_V_id_sha512_224, \ DER_V_NULL -extern const unsigned char der_aid_sha512_224Identifier[]; -const unsigned char der_aid_sha512_224Identifier[] = { +extern const unsigned char ossl_der_aid_sha512_224Identifier[]; +const unsigned char ossl_der_aid_sha512_224Identifier[] = { DER_AID_V_sha512_224Identifier }; -#define DER_AID_SZ_sha512_224Identifier sizeof(der_aid_sha512_224Identifier) +#define DER_AID_SZ_sha512_224Identifier sizeof(ossl_der_aid_sha512_224Identifier) #define DER_AID_V_sha512_256Identifier \ DER_P_SEQUENCE|DER_F_CONSTRUCTED, \ DER_OID_SZ_id_sha512_256 + DER_SZ_NULL, \ DER_OID_V_id_sha512_256, \ DER_V_NULL -extern const unsigned char der_aid_sha512_256Identifier[]; -const unsigned char der_aid_sha512_256Identifier[] = { +extern const unsigned char ossl_der_aid_sha512_256Identifier[]; +const unsigned char ossl_der_aid_sha512_256Identifier[] = { DER_AID_V_sha512_256Identifier }; -#define DER_AID_SZ_sha512_256Identifier sizeof(der_aid_sha512_256Identifier) +#define DER_AID_SZ_sha512_256Identifier sizeof(ossl_der_aid_sha512_256Identifier) /*- * From https://tools.ietf.org/html/rfc8017#appendix-A.2.1 @@ -271,8 +271,8 @@ static int DER_w_MaskGenAlgorithm(WPACKET *pkt, int tag, #define OAEP_PSS_MD_CASE(name, var) \ case NID_##name: \ - var = der_oid_id_##name; \ - var##_sz = sizeof(der_oid_id_##name); \ + var = ossl_der_oid_id_##name; \ + var##_sz = sizeof(ossl_der_oid_id_##name); \ break; int ossl_DER_w_RSASSA_PSS_params(WPACKET *pkt, int tag, @@ -341,12 +341,12 @@ int ossl_DER_w_RSASSA_PSS_params(WPACKET *pkt, int tag, } /* Aliases so we can have a uniform RSA_CASE */ -#define der_oid_rsassaPss der_oid_id_RSASSA_PSS +#define ossl_der_oid_rsassaPss ossl_der_oid_id_RSASSA_PSS #define RSA_CASE(name, var) \ var##_nid = NID_##name; \ - var##_oid = der_oid_##name; \ - var##_oid_sz = sizeof(der_oid_##name); \ + var##_oid = ossl_der_oid_##name; \ + var##_oid_sz = sizeof(ossl_der_oid_##name); \ break; int ossl_DER_w_algorithmIdentifier_RSA(WPACKET *pkt, int tag, RSA *rsa) diff --git a/providers/common/der/der_rsa_sig.c b/providers/common/der/der_rsa_sig.c index 5bdfa66255..1ff9bf789b 100644 --- a/providers/common/der/der_rsa_sig.c +++ b/providers/common/der/der_rsa_sig.c @@ -13,19 +13,19 @@ #include "prov/der_digests.h" /* Aliases so we can have a uniform MD_with_RSA_CASE */ -#define der_oid_sha3_224WithRSAEncryption \ - der_oid_id_rsassa_pkcs1_v1_5_with_sha3_224 -#define der_oid_sha3_256WithRSAEncryption \ - der_oid_id_rsassa_pkcs1_v1_5_with_sha3_256 -#define der_oid_sha3_384WithRSAEncryption \ - der_oid_id_rsassa_pkcs1_v1_5_with_sha3_384 -#define der_oid_sha3_512WithRSAEncryption \ - der_oid_id_rsassa_pkcs1_v1_5_with_sha3_512 +#define ossl_der_oid_sha3_224WithRSAEncryption \ + ossl_der_oid_id_rsassa_pkcs1_v1_5_with_sha3_224 +#define ossl_der_oid_sha3_256WithRSAEncryption \ + ossl_der_oid_id_rsassa_pkcs1_v1_5_with_sha3_256 +#define ossl_der_oid_sha3_384WithRSAEncryption \ + ossl_der_oid_id_rsassa_pkcs1_v1_5_with_sha3_384 +#define ossl_der_oid_sha3_512WithRSAEncryption \ + ossl_der_oid_id_rsassa_pkcs1_v1_5_with_sha3_512 #define MD_with_RSA_CASE(name, var) \ case NID_##name: \ - var = der_oid_##name##WithRSAEncryption; \ - var##_sz = sizeof(der_oid_##name##WithRSAEncryption); \ + var = ossl_der_oid_##name##WithRSAEncryption; \ + var##_sz = sizeof(ossl_der_oid_##name##WithRSAEncryption); \ break; int ossl_DER_w_algorithmIdentifier_MDWithRSAEncryption(WPACKET *pkt, int tag, diff --git a/providers/common/der/der_sm2_key.c b/providers/common/der/der_sm2_key.c index 6a458514b5..a766bb4f3d 100644 --- a/providers/common/der/der_sm2_key.c +++ b/providers/common/der/der_sm2_key.c @@ -17,7 +17,7 @@ int DER_w_algorithmIdentifier_SM2(WPACKET *pkt, int cont, EC_KEY *ec) return ossl_DER_w_begin_sequence(pkt, cont) /* No parameters (yet?) */ /* It seems SM2 identifier is the same as id_ecPublidKey */ - && ossl_DER_w_precompiled(pkt, -1, der_oid_id_ecPublicKey, - sizeof(der_oid_id_ecPublicKey)) + && ossl_DER_w_precompiled(pkt, -1, ossl_der_oid_id_ecPublicKey, + sizeof(ossl_der_oid_id_ecPublicKey)) && ossl_DER_w_end_sequence(pkt, cont); } diff --git a/providers/common/der/der_sm2_sig.c b/providers/common/der/der_sm2_sig.c index 8c37c4d84d..7b710cfa53 100644 --- a/providers/common/der/der_sm2_sig.c +++ b/providers/common/der/der_sm2_sig.c @@ -12,12 +12,12 @@ #include "prov/der_sm2.h" /* Aliases so we can have a uniform MD_CASE */ -#define der_oid_id_sm2_with_sm3 der_oid_sm2_with_SM3 +#define ossl_der_oid_id_sm2_with_sm3 ossl_der_oid_sm2_with_SM3 #define MD_CASE(name) \ case NID_##name: \ - precompiled = der_oid_id_sm2_with_##name; \ - precompiled_sz = sizeof(der_oid_id_sm2_with_##name); \ + precompiled = ossl_der_oid_id_sm2_with_##name; \ + precompiled_sz = sizeof(ossl_der_oid_id_sm2_with_##name); \ break; int DER_w_algorithmIdentifier_SM2_with_MD(WPACKET *pkt, int cont, diff --git a/providers/common/der/oids_to_c.pm b/providers/common/der/oids_to_c.pm index dee326316b..aa5b80cc12 100644 --- a/providers/common/der/oids_to_c.pm +++ b/providers/common/der/oids_to_c.pm @@ -40,7 +40,7 @@ sub filter_to_H { $C_comment #define DER_OID_V_${C_name} DER_P_OBJECT, $oid_size, ${C_bytes} #define DER_OID_SZ_${C_name} ${C_bytes_size} -extern const unsigned char der_oid_${C_name}[DER_OID_SZ_${C_name}]; +extern const unsigned char ossl_der_oid_${C_name}[DER_OID_SZ_${C_name}]; _____ } @@ -58,7 +58,7 @@ sub filter_to_C { return <<"_____"; $C_comment -const unsigned char der_oid_${C_name}[DER_OID_SZ_${C_name}] = { +const unsigned char ossl_der_oid_${C_name}[DER_OID_SZ_${C_name}] = { DER_OID_V_${C_name} }; _____ diff --git a/providers/implementations/kdfs/x942kdf.c b/providers/implementations/kdfs/x942kdf.c index 20aa2c42cd..3377350bf3 100644 --- a/providers/implementations/kdfs/x942kdf.c +++ b/providers/implementations/kdfs/x942kdf.c @@ -58,12 +58,15 @@ static const struct { size_t oid_len; size_t keklen; /* size in bytes */ } kek_algs[] = { - { "AES-128-WRAP", der_oid_id_aes128_wrap, DER_OID_SZ_id_aes128_wrap, 16 }, - { "AES-192-WRAP", der_oid_id_aes192_wrap, DER_OID_SZ_id_aes192_wrap, 24 }, - { "AES-256-WRAP", der_oid_id_aes256_wrap, DER_OID_SZ_id_aes256_wrap, 32 }, -#ifndef FIPS_MODULE - { "DES3-WRAP", der_oid_id_alg_CMS3DESwrap, DER_OID_SZ_id_alg_CMS3DESwrap, + { "AES-128-WRAP", ossl_der_oid_id_aes128_wrap, DER_OID_SZ_id_aes128_wrap, + 16 }, + { "AES-192-WRAP", ossl_der_oid_id_aes192_wrap, DER_OID_SZ_id_aes192_wrap, 24 }, + { "AES-256-WRAP", ossl_der_oid_id_aes256_wrap, DER_OID_SZ_id_aes256_wrap, + 32 }, +#ifndef FIPS_MODULE + { "DES3-WRAP", ossl_der_oid_id_alg_CMS3DESwrap, + DER_OID_SZ_id_alg_CMS3DESwrap, 24 }, #endif }; |