|
@@ -1,78 +0,0 @@
|
|
-Subject: Add support for RSA-OAEP-224, RSA-OAEP-384 and RSA-OAEP-512
|
|
|
|
-Origin: v10-4-g9ec5bf7 <https://github.com/latchset/jose/commit/v10-4-g9ec5bf7>
|
|
|
|
-Upstream-Author: Nathaniel McCallum <npmccallum@redhat.com>
|
|
|
|
-Date: Tue May 1 11:03:10 2018 -0400
|
|
|
|
-
|
|
|
|
---- a/lib/openssl/rsaes.c
|
|
|
|
-+++ b/lib/openssl/rsaes.c
|
|
|
|
-@@ -26,7 +26,7 @@
|
|
|
|
- #include <string.h>
|
|
|
|
-
|
|
|
|
- #ifdef EVP_PKEY_CTX_set_rsa_oaep_md
|
|
|
|
--#define NAMES "RSA1_5", "RSA-OAEP", "RSA-OAEP-256"
|
|
|
|
-+#define NAMES "RSA1_5", "RSA-OAEP", "RSA-OAEP-224", "RSA-OAEP-256", "RSA-OAEP-384", "RSA-OAEP-512"
|
|
|
|
- #define HAVE_OAEP
|
|
|
|
- #else
|
|
|
|
- #define NAMES "RSA1_5"
|
|
|
|
-@@ -116,7 +116,10 @@
|
|
|
|
- switch (str2enum(alg->name, NAMES, NULL)) {
|
|
|
|
- case 0: pad = RSA_PKCS1_PADDING; tmp = 11; md = EVP_sha1(); break;
|
|
|
|
- case 1: pad = RSA_PKCS1_OAEP_PADDING; tmp = 41; md = EVP_sha1(); break;
|
|
|
|
-- case 2: pad = RSA_PKCS1_OAEP_PADDING; tmp = 41; md = EVP_sha256(); break;
|
|
|
|
-+ case 2: pad = RSA_PKCS1_OAEP_PADDING; tmp = 41; md = EVP_sha224(); break;
|
|
|
|
-+ case 3: pad = RSA_PKCS1_OAEP_PADDING; tmp = 41; md = EVP_sha256(); break;
|
|
|
|
-+ case 4: pad = RSA_PKCS1_OAEP_PADDING; tmp = 41; md = EVP_sha384(); break;
|
|
|
|
-+ case 5: pad = RSA_PKCS1_OAEP_PADDING; tmp = 41; md = EVP_sha512(); break;
|
|
|
|
- default: return false;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
-@@ -206,7 +209,10 @@
|
|
|
|
- switch (str2enum(alg->name, NAMES, NULL)) {
|
|
|
|
- case 0: pad = RSA_PKCS1_PADDING; md = EVP_sha1(); break;
|
|
|
|
- case 1: pad = RSA_PKCS1_OAEP_PADDING; md = EVP_sha1(); break;
|
|
|
|
-- case 2: pad = RSA_PKCS1_OAEP_PADDING; md = EVP_sha256(); break;
|
|
|
|
-+ case 2: pad = RSA_PKCS1_OAEP_PADDING; md = EVP_sha224(); break;
|
|
|
|
-+ case 3: pad = RSA_PKCS1_OAEP_PADDING; md = EVP_sha256(); break;
|
|
|
|
-+ case 4: pad = RSA_PKCS1_OAEP_PADDING; md = EVP_sha384(); break;
|
|
|
|
-+ case 5: pad = RSA_PKCS1_OAEP_PADDING; md = EVP_sha512(); break;
|
|
|
|
- default: return false;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
-@@ -309,6 +315,14 @@
|
|
|
|
- .wrap.enc = alg_wrap_enc,
|
|
|
|
- .wrap.wrp = alg_wrap_wrp,
|
|
|
|
- .wrap.unw = alg_wrap_unw },
|
|
|
|
-+ { .kind = JOSE_HOOK_ALG_KIND_WRAP,
|
|
|
|
-+ .name = "RSA-OAEP-224",
|
|
|
|
-+ .wrap.eprm = "wrapKey",
|
|
|
|
-+ .wrap.dprm = "unwrapKey",
|
|
|
|
-+ .wrap.alg = alg_wrap_alg,
|
|
|
|
-+ .wrap.enc = alg_wrap_enc,
|
|
|
|
-+ .wrap.wrp = alg_wrap_wrp,
|
|
|
|
-+ .wrap.unw = alg_wrap_unw },
|
|
|
|
- { .kind = JOSE_HOOK_ALG_KIND_WRAP,
|
|
|
|
- .name = "RSA-OAEP-256",
|
|
|
|
- .wrap.eprm = "wrapKey",
|
|
|
|
-@@ -317,6 +331,22 @@
|
|
|
|
- .wrap.enc = alg_wrap_enc,
|
|
|
|
- .wrap.wrp = alg_wrap_wrp,
|
|
|
|
- .wrap.unw = alg_wrap_unw },
|
|
|
|
-+ { .kind = JOSE_HOOK_ALG_KIND_WRAP,
|
|
|
|
-+ .name = "RSA-OAEP-384",
|
|
|
|
-+ .wrap.eprm = "wrapKey",
|
|
|
|
-+ .wrap.dprm = "unwrapKey",
|
|
|
|
-+ .wrap.alg = alg_wrap_alg,
|
|
|
|
-+ .wrap.enc = alg_wrap_enc,
|
|
|
|
-+ .wrap.wrp = alg_wrap_wrp,
|
|
|
|
-+ .wrap.unw = alg_wrap_unw },
|
|
|
|
-+ { .kind = JOSE_HOOK_ALG_KIND_WRAP,
|
|
|
|
-+ .name = "RSA-OAEP-512",
|
|
|
|
-+ .wrap.eprm = "wrapKey",
|
|
|
|
-+ .wrap.dprm = "unwrapKey",
|
|
|
|
-+ .wrap.alg = alg_wrap_alg,
|
|
|
|
-+ .wrap.enc = alg_wrap_enc,
|
|
|
|
-+ .wrap.wrp = alg_wrap_wrp,
|
|
|
|
-+ .wrap.unw = alg_wrap_unw },
|
|
|
|
- #endif
|
|
|
|
- {}
|
|
|
|
- };
|
|
|