Move RSA Asym cipher code to the default provider
[oweals/openssl.git] / providers / defltprov.c
index 7dd0cf5012095cf3006fcb2d9e927b67b7a810d0..ceb3fd0896f61924c54816382306dfd7267cdc1b 100644 (file)
@@ -156,6 +156,11 @@ static const OSSL_ALGORITHM deflt_ciphers[] = {
     { "AES-192-OCB", "default=yes", aes192ocb_functions },
     { "AES-128-OCB", "default=yes", aes128ocb_functions },
 #endif /* OPENSSL_NO_OCB */
+#ifndef OPENSSL_NO_SIV
+    { "AES-128-SIV", "default=yes", aes128siv_functions },
+    { "AES-192-SIV", "default=yes", aes192siv_functions },
+    { "AES-256-SIV", "default=yes", aes256siv_functions },
+#endif /* OPENSSL_NO_SIV */
     { "AES-256-GCM:id-aes256-GCM", "default=yes", aes256gcm_functions },
     { "AES-192-GCM:id-aes192-GCM", "default=yes", aes192gcm_functions },
     { "AES-128-GCM:id-aes128-GCM", "default=yes", aes128gcm_functions },
@@ -280,6 +285,9 @@ static const OSSL_ALGORITHM deflt_ciphers[] = {
 #ifndef OPENSSL_NO_RC4
     { "RC4", "default=yes", rc4128_functions },
     { "RC4-40", "default=yes", rc440_functions },
+# ifndef OPENSSL_NO_MD5
+    { "RC4-HMAC-MD5", "default=yes", rc4_hmac_md5_functions },
+# endif /* OPENSSL_NO_MD5 */
 #endif /* OPENSSL_NO_RC4 */
 #ifndef OPENSSL_NO_RC5
     { "RC5-ECB", "default=yes", rc5128ecb_functions },
@@ -295,6 +303,12 @@ static const OSSL_ALGORITHM deflt_ciphers[] = {
     { "RC2-CFB", "default=yes", rc2128cfb128_functions },
     { "RC2-OFB", "default=yes", rc2128ofb128_functions },
 #endif /* OPENSSL_NO_RC2 */
+#ifndef OPENSSL_NO_CHACHA
+    { "ChaCha20", "default=yes", chacha20_functions },
+# ifndef OPENSSL_NO_POLY1305
+    { "ChaCha20-Poly1305", "default=yes", chacha20_poly1305_functions },
+# endif /* OPENSSL_NO_POLY1305 */
+#endif /* OPENSSL_NO_CHACHA */
     { NULL, NULL, NULL }
 };
 
@@ -320,20 +334,21 @@ static const OSSL_ALGORITHM deflt_macs[] = {
 };
 
 static const OSSL_ALGORITHM deflt_kdfs[] = {
-    { OSSL_KDF_NAME_HKDF, "default=yes", kdf_hkdf_functions },
-    { OSSL_KDF_NAME_SSKDF, "default=yes", kdf_sskdf_functions },
-    { OSSL_KDF_NAME_PBKDF2, "default=yes", kdf_pbkdf2_functions },
-    { OSSL_KDF_NAME_SSHKDF, "default=yes", kdf_sshkdf_functions },
-    { OSSL_KDF_NAME_X963KDF, "default=yes", kdf_x963_kdf_functions },
-    { OSSL_KDF_NAME_TLS1_PRF, "default=yes", kdf_tls1_prf_functions },
-    { OSSL_KDF_NAME_KBKDF, "default=yes", kdf_kbkdf_functions },
+    { "HKDF", "default=yes", kdf_hkdf_functions },
+    { "SSKDF", "default=yes", kdf_sskdf_functions },
+    { "PBKDF2", "default=yes", kdf_pbkdf2_functions },
+    { "SSHKDF", "default=yes", kdf_sshkdf_functions },
+    { "X963KDF", "default=yes", kdf_x963_kdf_functions },
+    { "TLS1-PRF", "default=yes", kdf_tls1_prf_functions },
+    { "KBKDF", "default=yes", kdf_kbkdf_functions },
 #ifndef OPENSSL_NO_CMS
-    { OSSL_KDF_NAME_X942KDF, "default=yes", kdf_x942_kdf_functions },
+    { "X942KDF", "default=yes", kdf_x942_kdf_functions },
 #endif
 #ifndef OPENSSL_NO_SCRYPT
     { "SCRYPT:id-scrypt", "default=yes", kdf_scrypt_functions },
 #endif
-   { NULL, NULL, NULL }
+    { "KRB5KDF", "default=yes", kdf_krb5kdf_functions },
+    { NULL, NULL, NULL }
 };
 
 static const OSSL_ALGORITHM deflt_keyexch[] = {
@@ -350,6 +365,10 @@ static const OSSL_ALGORITHM deflt_signature[] = {
     { NULL, NULL, NULL }
 };
 
+static const OSSL_ALGORITHM deflt_asym_cipher[] = {
+    { "RSA:rsaEncryption", "default=yes", rsa_asym_cipher_functions },
+    { NULL, NULL, NULL }
+};
 
 static const OSSL_ALGORITHM deflt_keymgmt[] = {
 #ifndef OPENSSL_NO_DH
@@ -358,6 +377,7 @@ static const OSSL_ALGORITHM deflt_keymgmt[] = {
 #ifndef OPENSSL_NO_DSA
     { "DSA", "default=yes", dsa_keymgmt_functions },
 #endif
+    { "RSA", "default=yes", rsa_keymgmt_functions },
     { NULL, NULL, NULL }
 };
 
@@ -381,6 +401,8 @@ static const OSSL_ALGORITHM *deflt_query(OSSL_PROVIDER *prov,
         return deflt_keyexch;
     case OSSL_OP_SIGNATURE:
         return deflt_signature;
+    case OSSL_OP_ASYM_CIPHER:
+        return deflt_asym_cipher;
     }
     return NULL;
 }