]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Tweak some algorithm naming inconsistencies
authorMatt Caswell <matt@openssl.org>
Fri, 4 Oct 2019 10:50:49 +0000 (11:50 +0100)
committerMatt Caswell <matt@openssl.org>
Thu, 21 Nov 2019 15:45:37 +0000 (15:45 +0000)
Make some algorithms names better match our "canonical" style.

Reviewed-by: Paul Dale <paul.dale@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/10092)

include/openssl/core_names.h
providers/defltprov.c
providers/fips/fipsprov.c
providers/legacyprov.c

index cdc493bae1fb3d2cadbccade24de1f531d14e602..1e8b764fb42bc7bcf4c7d350c251966d93949a1a 100644 (file)
@@ -85,8 +85,8 @@ extern "C" {
 
 /* Known DIGEST names (not a complete list) */
 #define OSSL_DIGEST_NAME_MD5 "MD5"
-#define OSSL_DIGEST_NAME_KECCAK_KMAC128 "KECCAK_KMAC128"
-#define OSSL_DIGEST_NAME_KECCAK_KMAC256 "KECCAK_KMAC256"
+#define OSSL_DIGEST_NAME_KECCAK_KMAC128 "KECCAK-KMAC-128"
+#define OSSL_DIGEST_NAME_KECCAK_KMAC256 "KECCAK-KMAC-256"
 
 /* MAC parameters */
 #define OSSL_MAC_PARAM_KEY          "key"        /* octet string */
@@ -141,7 +141,7 @@ extern "C" {
 /* Known KDF names */
 #define OSSL_KDF_NAME_HKDF          "HKDF"
 #define OSSL_KDF_NAME_PBKDF2        "PBKDF2"
-#define OSSL_KDF_NAME_SCRYPT        "id-scrypt"
+#define OSSL_KDF_NAME_SCRYPT        "SCRYPT"
 #define OSSL_KDF_NAME_SSHKDF        "SSHKDF"
 #define OSSL_KDF_NAME_SSKDF         "SSKDF"
 #define OSSL_KDF_NAME_TLS1_PRF      "TLS1-PRF"
index ceb3fd0896f61924c54816382306dfd7267cdc1b..354c7a4a6d44f414d4acd2f20d8686dd099c9573 100644 (file)
@@ -73,6 +73,9 @@ static int deflt_get_params(const OSSL_PROVIDER *prov, OSSL_PARAM params[])
  * We add diverse other names where applicable, such as the names that
  * NIST uses, or that are used for ASN.1 OBJECT IDENTIFIERs, or names
  * we have used historically.
+ *
+ * Algorithm names are case insensitive, but we use all caps in our "canonical"
+ * names for consistency.
  */
 static const OSSL_ALGORITHM deflt_digests[] = {
     /* Our primary name:NIST name[:our older names] */
@@ -93,11 +96,11 @@ static const OSSL_ALGORITHM deflt_digests[] = {
     { "SHA3-512", "default=yes", sha3_512_functions },
 
     /*
-     * KECCAK_KMAC128 and KECCAK_KMAC256 as hashes are mostly useful for
-     * the KMAC128 and KMAC256.
+     * KECCAK-KMAC-128 and KECCAK-KMAC-256 as hashes are mostly useful for
+     * the KMAC-128 and KMAC-256.
      */
-    { "KECCAK_KMAC128", "default=yes", keccak_kmac_128_functions },
-    { "KECCAK_KMAC256", "default=yes", keccak_kmac_256_functions },
+    { "KECCAK-KMAC-128:KECCAK-KMAC128", "default=yes", keccak_kmac_128_functions },
+    { "KECCAK-KMAC-256:KECCAK-KMAC256", "default=yes", keccak_kmac_256_functions },
 
     /* Our primary name:NIST name */
     { "SHAKE-128:SHAKE128", "default=yes", shake_128_functions },
@@ -111,8 +114,8 @@ static const OSSL_ALGORITHM deflt_digests[] = {
      * If we assume that "2b" and "2s" are versions, that pattern
      * fits with ours.  We also add our historical names.
      */
-    { "BLAKE2s-256:BLAKE2s256", "default=yes", blake2s256_functions },
-    { "BLAKE2b-512:BLAKE2b512", "default=yes", blake2b512_functions },
+    { "BLAKE2S-256:BLAKE2s256", "default=yes", blake2s256_functions },
+    { "BLAKE2B-512:BLAKE2b512", "default=yes", blake2b512_functions },
 #endif /* OPENSSL_NO_BLAKE2 */
 
 #ifndef OPENSSL_NO_SM3
@@ -314,21 +317,21 @@ static const OSSL_ALGORITHM deflt_ciphers[] = {
 
 static const OSSL_ALGORITHM deflt_macs[] = {
 #ifndef OPENSSL_NO_BLAKE2
-    { "BLAKE2bMAC", "default=yes", blake2bmac_functions },
-    { "BLAKE2sMAC", "default=yes", blake2smac_functions },
+    { "BLAKE2BMAC", "default=yes", blake2bmac_functions },
+    { "BLAKE2SMAC", "default=yes", blake2smac_functions },
 #endif
 #ifndef OPENSSL_NO_CMAC
     { "CMAC", "default=yes", cmac_functions },
 #endif
     { "GMAC", "default=yes", gmac_functions },
     { "HMAC", "default=yes", hmac_functions },
-    { "KMAC128", "default=yes", kmac128_functions },
-    { "KMAC256", "default=yes", kmac256_functions },
+    { "KMAC-128:KMAC128", "default=yes", kmac128_functions },
+    { "KMAC-256:KMAC256", "default=yes", kmac256_functions },
 #ifndef OPENSSL_NO_SIPHASH
-    { "SipHash", "default=yes", siphash_functions },
+    { "SIPHASH", "default=yes", siphash_functions },
 #endif
 #ifndef OPENSSL_NO_POLY1305
-    { "Poly1305", "default=yes", poly1305_functions },
+    { "POLY1305", "default=yes", poly1305_functions },
 #endif
     { NULL, NULL, NULL }
 };
index 05e5dd4a4990986e5e99f4c7ca598aed620b10c1..a12163fa97a439fdf7d8b9f4a18997636df984da 100644 (file)
@@ -349,11 +349,11 @@ static const OSSL_ALGORITHM fips_digests[] = {
     { "SHA3-384", "fips=yes", sha3_384_functions },
     { "SHA3-512", "fips=yes", sha3_512_functions },
     /*
-     * KECCAK_KMAC128 and KECCAK_KMAC256 as hashes are mostly useful for
+     * KECCAK-KMAC-128 and KECCAK-KMAC-256 as hashes are mostly useful for
      * KMAC128 and KMAC256.
      */
-    { "KECCAK_KMAC128", "fips=yes", keccak_kmac_128_functions },
-    { "KECCAK_KMAC256", "fips=yes", keccak_kmac_256_functions },
+    { "KECCAK-KMAC-128:KECCAK-KMAC128", "fips=yes", keccak_kmac_128_functions },
+    { "KECCAK-KMAC-256:KECCAK-KMAC256", "fips=yes", keccak_kmac_256_functions },
 
     { NULL, NULL, NULL }
 };
@@ -402,8 +402,8 @@ static const OSSL_ALGORITHM fips_macs[] = {
 #endif
     { "GMAC", "fips=yes", gmac_functions },
     { "HMAC", "fips=yes", hmac_functions },
-    { "KMAC128", "fips=yes", kmac128_functions },
-    { "KMAC256", "fips=yes", kmac256_functions },
+    { "KMAC-128:KMAC128", "fips=yes", kmac128_functions },
+    { "KMAC-256:KMAC256", "fips=yes", kmac256_functions },
     { NULL, NULL, NULL }
 };
 
index 11a050e203c6c63ef315b26450118e4f5b2238fe..59373286384928c24c23c7c1b91c464d3657c30d 100644 (file)
@@ -68,11 +68,11 @@ static const OSSL_ALGORITHM legacy_digests[] = {
 #endif /* OPENSSL_NO_MDC2 */
 
 #ifndef OPENSSL_NO_WHIRLPOOL
-    { "whirlpool", "legacy=yes", wp_functions },
+    { "WHIRLPOOL", "legacy=yes", wp_functions },
 #endif /* OPENSSL_NO_WHIRLPOOL */
 
 #ifndef OPENSSL_NO_RMD160
-    { "RIPEMD160:RIPEMD:RMD160", "legacy=yes", ripemd160_functions },
+    { "RIPEMD-160:RIPEMD160:RIPEMD:RMD160", "legacy=yes", ripemd160_functions },
 #endif /* OPENSSL_NO_RMD160 */
 
     { NULL, NULL, NULL }