[openssl] master update

shane.lontis at oracle.com shane.lontis at oracle.com
Sun Aug 30 06:20:32 UTC 2020


The branch master has been updated
       via  458cb85d1985aa3efe0a33eb59123d23b5fa975a (commit)
       via  d9cdfda24fd140f3e4c7b4afd9b46a7929841c69 (commit)
       via  81fca0e7c1f4e874f860ac66415546fe8fc5ad18 (commit)
       via  3fab56631f597b969bb5849bd890e354d4062178 (commit)
      from  835b2900168bfd1cc471bf1d798d3b5b7219cd4d (commit)


- Log -----------------------------------------------------------------
commit 458cb85d1985aa3efe0a33eb59123d23b5fa975a
Author: Shane Lontis <shane.lontis at oracle.com>
Date:   Fri Aug 21 11:15:59 2020 +1000

    Fix ECX serializer import calls to use correct selection flags.
    
    Reviewed-by: Richard Levitte <levitte at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/12698)

commit d9cdfda24fd140f3e4c7b4afd9b46a7929841c69
Author: Shane Lontis <shane.lontis at oracle.com>
Date:   Fri Aug 21 11:15:10 2020 +1000

    Fix RSA serializer import calls to use correct selection flags.
    
    Reviewed-by: Richard Levitte <levitte at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/12698)

commit 81fca0e7c1f4e874f860ac66415546fe8fc5ad18
Author: Shane Lontis <shane.lontis at oracle.com>
Date:   Fri Aug 21 11:14:34 2020 +1000

    Fix DSA serializer import calls to use correct selection flags.
    
    Reviewed-by: Richard Levitte <levitte at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/12698)

commit 3fab56631f597b969bb5849bd890e354d4062178
Author: Shane Lontis <shane.lontis at oracle.com>
Date:   Fri Aug 21 11:13:09 2020 +1000

    Fix DH serializer import calls to use correct selection flags.
    
    Reviewed-by: Richard Levitte <levitte at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/12698)

-----------------------------------------------------------------------

Summary of changes:
 providers/implementations/encode_decode/encoder_dh_param.c  |  6 +++---
 providers/implementations/encode_decode/encoder_dh_priv.c   |  9 ++++++---
 providers/implementations/encode_decode/encoder_dh_pub.c    |  9 ++++++---
 providers/implementations/encode_decode/encoder_dsa_param.c |  6 +++---
 providers/implementations/encode_decode/encoder_dsa_priv.c  |  9 ++++++---
 providers/implementations/encode_decode/encoder_dsa_pub.c   | 10 ++++++----
 providers/implementations/encode_decode/encoder_ecx_pub.c   |  6 +++---
 providers/implementations/encode_decode/encoder_rsa_priv.c  |  9 ++++++---
 providers/implementations/encode_decode/encoder_rsa_pub.c   |  9 ++++++---
 9 files changed, 45 insertions(+), 28 deletions(-)

diff --git a/providers/implementations/encode_decode/encoder_dh_param.c b/providers/implementations/encode_decode/encoder_dh_param.c
index 23cda024c4..32c8769b5e 100644
--- a/providers/implementations/encode_decode/encoder_dh_param.c
+++ b/providers/implementations/encode_decode/encoder_dh_param.c
@@ -63,7 +63,7 @@ static int dh_param_der_data(void *ctx, const OSSL_PARAM params[],
 
         /* ctx == provctx */
         if ((dh = dh_new(ctx)) != NULL
-            && dh_import(dh, OSSL_KEYMGMT_SELECT_ALL_PARAMETERS, params)
+            && dh_import(dh, OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS, params)
             && dh_param_der(ctx, dh, out, cb, cbarg))
             ok = 1;
         dh_free(dh);
@@ -100,7 +100,7 @@ static int dh_param_pem_data(void *ctx, const OSSL_PARAM params[],
 
         /* ctx == provctx */
         if ((dh = dh_new(ctx)) != NULL
-            && dh_import(dh, OSSL_KEYMGMT_SELECT_ALL_PARAMETERS, params)
+            && dh_import(dh, OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS, params)
             && dh_param_pem(ctx, dh, out, cb, cbarg))
             ok = 1;
         dh_free(dh);
@@ -137,7 +137,7 @@ static int dh_param_print_data(void *ctx, const OSSL_PARAM params[],
 
         /* ctx == provctx */
         if ((dh = dh_new(ctx)) != NULL
-            && dh_import(dh, OSSL_KEYMGMT_SELECT_ALL_PARAMETERS, params)
+            && dh_import(dh, OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS, params)
             && dh_param_print(ctx, dh, out, cb, cbarg))
             ok = 1;
         dh_free(dh);
diff --git a/providers/implementations/encode_decode/encoder_dh_priv.c b/providers/implementations/encode_decode/encoder_dh_priv.c
index a9373df96a..dd94223084 100644
--- a/providers/implementations/encode_decode/encoder_dh_priv.c
+++ b/providers/implementations/encode_decode/encoder_dh_priv.c
@@ -25,6 +25,9 @@
 #include "prov/provider_ctx.h"
 #include "encoder_local.h"
 
+#define DH_SELECT_PRIVATE_IMPORTABLE                                           \
+    (OSSL_KEYMGMT_SELECT_KEYPAIR | OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS)
+
 static OSSL_FUNC_encoder_newctx_fn dh_priv_newctx;
 static OSSL_FUNC_encoder_freectx_fn dh_priv_freectx;
 static OSSL_FUNC_encoder_set_ctx_params_fn dh_priv_set_ctx_params;
@@ -132,7 +135,7 @@ static int dh_priv_der_data(void *vctx, const OSSL_PARAM params[],
         DH *dh;
 
         if ((dh = dh_new(ctx->provctx)) != NULL
-            && dh_import(dh, OSSL_KEYMGMT_SELECT_KEYPAIR, params)
+            && dh_import(dh, DH_SELECT_PRIVATE_IMPORTABLE, params)
             && dh_priv_der(ctx, dh, out, cb, cbarg))
             ok = 1;
         dh_free(dh);
@@ -178,7 +181,7 @@ static int dh_pem_priv_data(void *vctx, const OSSL_PARAM params[],
         DH *dh;
 
         if ((dh = dh_new(ctx->provctx)) != NULL
-            && dh_import(dh, OSSL_KEYMGMT_SELECT_KEYPAIR, params)
+            && dh_import(dh, DH_SELECT_PRIVATE_IMPORTABLE, params)
             && dh_pem_priv(ctx->provctx, dh, out, cb, cbarg))
             ok = 1;
         dh_free(dh);
@@ -235,7 +238,7 @@ static int dh_priv_print_data(void *vctx, const OSSL_PARAM params[],
         DH *dh;
 
         if ((dh = dh_new(ctx->provctx)) != NULL
-            && dh_import(dh, OSSL_KEYMGMT_SELECT_KEYPAIR, params)
+            && dh_import(dh, DH_SELECT_PRIVATE_IMPORTABLE, params)
             && dh_priv_print(ctx, dh, out, cb, cbarg))
             ok = 1;
         dh_free(dh);
diff --git a/providers/implementations/encode_decode/encoder_dh_pub.c b/providers/implementations/encode_decode/encoder_dh_pub.c
index 99f9532c34..583dcd9c5a 100644
--- a/providers/implementations/encode_decode/encoder_dh_pub.c
+++ b/providers/implementations/encode_decode/encoder_dh_pub.c
@@ -34,6 +34,9 @@ static OSSL_FUNC_encoder_encode_object_fn dh_pub_pem;
 static OSSL_FUNC_encoder_encode_data_fn dh_pub_print_data;
 static OSSL_FUNC_encoder_encode_object_fn dh_pub_print;
 
+#define DH_SELECT_PUBLIC_IMPORTABLE                                            \
+    (OSSL_KEYMGMT_SELECT_PUBLIC_KEY | OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS)
+
 /* Public key : context */
 
 /*
@@ -63,7 +66,7 @@ static int dh_pub_der_data(void *ctx, const OSSL_PARAM params[],
 
         /* ctx == provctx */
         if ((dh = dh_new(ctx)) != NULL
-            && dh_import(dh, OSSL_KEYMGMT_SELECT_KEYPAIR, params)
+            && dh_import(dh, DH_SELECT_PUBLIC_IMPORTABLE, params)
             && dh_pub_der(ctx, dh, out, cb, cbarg))
             ok = 1;
         dh_free(dh);
@@ -104,7 +107,7 @@ static int dh_pub_pem_data(void *ctx, const OSSL_PARAM params[],
 
         /* ctx == provctx */
         if ((dh = dh_new(ctx)) != NULL
-            && dh_import(dh, OSSL_KEYMGMT_SELECT_KEYPAIR, params)
+            && dh_import(dh, DH_SELECT_PUBLIC_IMPORTABLE, params)
             && dh_pub_pem(ctx, dh, out, cb, cbarg))
             ok = 1;
         dh_free(dh);
@@ -144,7 +147,7 @@ static int dh_pub_print_data(void *ctx, const OSSL_PARAM params[],
 
         /* ctx == provctx */
         if ((dh = dh_new(ctx)) != NULL
-            && dh_import(dh, OSSL_KEYMGMT_SELECT_KEYPAIR, params)
+            && dh_import(dh, DH_SELECT_PUBLIC_IMPORTABLE, params)
             && dh_pub_print(ctx, dh, out, cb, cbarg))
             ok = 1;
         dh_free(dh);
diff --git a/providers/implementations/encode_decode/encoder_dsa_param.c b/providers/implementations/encode_decode/encoder_dsa_param.c
index 87abde7212..0438b14cc8 100644
--- a/providers/implementations/encode_decode/encoder_dsa_param.c
+++ b/providers/implementations/encode_decode/encoder_dsa_param.c
@@ -63,7 +63,7 @@ static int dsa_param_der_data(void *ctx, const OSSL_PARAM params[],
 
         /* ctx == provctx */
         if ((dsa = dsa_new(ctx)) != NULL
-            && dsa_import(dsa, OSSL_KEYMGMT_SELECT_ALL_PARAMETERS, params)
+            && dsa_import(dsa, OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS, params)
             && dsa_param_der(ctx, dsa, out, cb, cbarg))
             ok = 1;
         dsa_free(dsa);
@@ -101,7 +101,7 @@ static int dsa_param_pem_data(void *ctx, const OSSL_PARAM params[],
 
         /* ctx == provctx */
         if ((dsa = dsa_new(ctx)) != NULL
-            && dsa_import(dsa, OSSL_KEYMGMT_SELECT_ALL_PARAMETERS, params)
+            && dsa_import(dsa, OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS, params)
             && dsa_param_pem(ctx, dsa, out, cb, cbarg))
             ok = 1;
         dsa_free(dsa);
@@ -138,7 +138,7 @@ static int dsa_param_print_data(void *ctx, const OSSL_PARAM params[],
 
         /* ctx == provctx */
         if ((dsa = dsa_new(ctx)) != NULL
-            && dsa_import(dsa, OSSL_KEYMGMT_SELECT_ALL_PARAMETERS, params)
+            && dsa_import(dsa, OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS, params)
             && dsa_param_print(ctx, dsa, out, cb, cbarg))
             ok = 1;
         dsa_free(dsa);
diff --git a/providers/implementations/encode_decode/encoder_dsa_priv.c b/providers/implementations/encode_decode/encoder_dsa_priv.c
index c37c9f9f3c..be5b7ee326 100644
--- a/providers/implementations/encode_decode/encoder_dsa_priv.c
+++ b/providers/implementations/encode_decode/encoder_dsa_priv.c
@@ -25,6 +25,9 @@
 #include "prov/provider_ctx.h"
 #include "encoder_local.h"
 
+#define DSA_SELECT_PRIVATE_IMPORTABLE                                          \
+    (OSSL_KEYMGMT_SELECT_KEYPAIR | OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS)
+
 static OSSL_FUNC_encoder_newctx_fn dsa_priv_newctx;
 static OSSL_FUNC_encoder_freectx_fn dsa_priv_freectx;
 static OSSL_FUNC_encoder_set_ctx_params_fn dsa_priv_set_ctx_params;
@@ -132,7 +135,7 @@ static int dsa_priv_der_data(void *vctx, const OSSL_PARAM params[],
         DSA *dsa;
 
         if ((dsa = dsa_new(ctx->provctx)) != NULL
-            && dsa_import(dsa, OSSL_KEYMGMT_SELECT_KEYPAIR, params)
+            && dsa_import(dsa, DSA_SELECT_PRIVATE_IMPORTABLE, params)
             && dsa_priv_der(ctx, dsa, out, cb, cbarg))
             ok = 1;
         dsa_free(dsa);
@@ -177,7 +180,7 @@ static int dsa_pem_priv_data(void *vctx, const OSSL_PARAM params[],
         DSA *dsa;
 
         if ((dsa = dsa_new(ctx->provctx)) != NULL
-            && dsa_import(dsa, OSSL_KEYMGMT_SELECT_KEYPAIR, params)
+            && dsa_import(dsa, DSA_SELECT_PRIVATE_IMPORTABLE, params)
             && dsa_pem_priv(ctx, dsa, out, cb, cbarg))
             ok = 1;
         dsa_free(dsa);
@@ -233,7 +236,7 @@ static int dsa_priv_print_data(void *vctx, const OSSL_PARAM params[],
         DSA *dsa;
 
         if ((dsa = dsa_new(ctx->provctx)) != NULL
-            && dsa_import(dsa, OSSL_KEYMGMT_SELECT_KEYPAIR, params)
+            && dsa_import(dsa, DSA_SELECT_PRIVATE_IMPORTABLE, params)
             && dsa_priv_print(ctx, dsa, out, cb, cbarg))
             ok = 1;
         dsa_free(dsa);
diff --git a/providers/implementations/encode_decode/encoder_dsa_pub.c b/providers/implementations/encode_decode/encoder_dsa_pub.c
index ca7dd4bf1e..f99388e150 100644
--- a/providers/implementations/encode_decode/encoder_dsa_pub.c
+++ b/providers/implementations/encode_decode/encoder_dsa_pub.c
@@ -24,13 +24,15 @@
 #include "prov/provider_ctx.h"
 #include "encoder_local.h"
 
+#define DSA_SELECT_PUBLIC_IMPORTABLE                                           \
+    (OSSL_KEYMGMT_SELECT_PUBLIC_KEY | OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS)
+
 static OSSL_FUNC_encoder_newctx_fn dsa_pub_newctx;
 static OSSL_FUNC_encoder_freectx_fn dsa_pub_freectx;
 static OSSL_FUNC_encoder_encode_data_fn dsa_pub_der_data;
 static OSSL_FUNC_encoder_encode_object_fn dsa_pub_der;
 static OSSL_FUNC_encoder_encode_data_fn dsa_pub_pem_data;
 static OSSL_FUNC_encoder_encode_object_fn dsa_pub_pem;
-
 static OSSL_FUNC_encoder_encode_data_fn dsa_pub_print_data;
 static OSSL_FUNC_encoder_encode_object_fn dsa_pub_print;
 
@@ -63,7 +65,7 @@ static int dsa_pub_der_data(void *ctx, const OSSL_PARAM params[],
 
         /* ctx == provctx */
         if ((dsa = dsa_new(ctx)) != NULL
-            && dsa_import(dsa, OSSL_KEYMGMT_SELECT_KEYPAIR, params)
+            && dsa_import(dsa, DSA_SELECT_PUBLIC_IMPORTABLE, params)
             && dsa_pub_der(ctx, dsa, out, cb, cbarg))
             ok = 1;
         dsa_free(dsa);
@@ -114,7 +116,7 @@ static int dsa_pub_pem_data(void *ctx, const OSSL_PARAM params[],
 
         /* ctx == provctx */
         if ((dsa = dsa_new(ctx)) != NULL
-            && dsa_import(dsa, OSSL_KEYMGMT_SELECT_KEYPAIR, params)
+            && dsa_import(dsa, DSA_SELECT_PUBLIC_IMPORTABLE, params)
             && dsa_pub_pem(ctx, dsa, out, cb, cbarg))
             ok = 1;
         dsa_free(dsa);
@@ -154,7 +156,7 @@ static int dsa_pub_print_data(void *ctx, const OSSL_PARAM params[],
 
         /* ctx == provctx */
         if ((dsa = dsa_new(ctx)) != NULL
-            && dsa_import(dsa, OSSL_KEYMGMT_SELECT_KEYPAIR, params)
+            && dsa_import(dsa, DSA_SELECT_PUBLIC_IMPORTABLE, params)
             && dsa_pub_print(ctx, dsa, out, cb, cbarg))
             ok = 1;
         dsa_free(dsa);
diff --git a/providers/implementations/encode_decode/encoder_ecx_pub.c b/providers/implementations/encode_decode/encoder_ecx_pub.c
index 6f082c2b4c..a4350d84cf 100644
--- a/providers/implementations/encode_decode/encoder_ecx_pub.c
+++ b/providers/implementations/encode_decode/encoder_ecx_pub.c
@@ -93,7 +93,7 @@ static int ecx_pub_der_data(void *vctx, const OSSL_PARAM params[],
         ECX_KEY *ecxkey;
 
         if ((ecxkey = ecx_new(ctx->provctx)) != NULL
-            && ecx_import(ecxkey, OSSL_KEYMGMT_SELECT_KEYPAIR, params)
+            && ecx_import(ecxkey, OSSL_KEYMGMT_SELECT_PUBLIC_KEY, params)
             && ecx_pub_der(ctx, ecxkey, out, cb, cbarg))
             ok = 1;
         ecx_free(ecxkey);
@@ -137,7 +137,7 @@ static int ecx_pub_pem_data(void *vctx, const OSSL_PARAM params[],
         ECX_KEY *ecxkey;
 
         if ((ecxkey = ecx_new(ctx->provctx)) != NULL
-            && ecx_import(ecxkey, OSSL_KEYMGMT_SELECT_KEYPAIR, params)
+            && ecx_import(ecxkey, OSSL_KEYMGMT_SELECT_PUBLIC_KEY, params)
             && ecx_pub_pem(ctx, ecxkey, out, cb, cbarg))
             ok = 1;
         ecx_free(ecxkey);
@@ -180,7 +180,7 @@ static int ecx_pub_print_data(void *vctx, const OSSL_PARAM params[],
         ECX_KEY *ecxkey;
 
         if ((ecxkey = ecx_new(ctx)) != NULL
-            && ecx_import(ecxkey, OSSL_KEYMGMT_SELECT_KEYPAIR, params)
+            && ecx_import(ecxkey, OSSL_KEYMGMT_SELECT_PUBLIC_KEY, params)
             && ecx_pub_print(ctx, ecxkey, out, cb, cbarg))
             ok = 1;
         ecx_free(ecxkey);
diff --git a/providers/implementations/encode_decode/encoder_rsa_priv.c b/providers/implementations/encode_decode/encoder_rsa_priv.c
index 3ba648f360..7be37dd49a 100644
--- a/providers/implementations/encode_decode/encoder_rsa_priv.c
+++ b/providers/implementations/encode_decode/encoder_rsa_priv.c
@@ -28,6 +28,9 @@
 #include "prov/provider_ctx.h"
 #include "encoder_local.h"
 
+#define RSA_SELECT_PRIVATE_IMPORTABLE                                          \
+    (OSSL_KEYMGMT_SELECT_KEYPAIR | OSSL_KEYMGMT_SELECT_OTHER_PARAMETERS)
+
 static OSSL_FUNC_encoder_newctx_fn rsa_priv_newctx;
 static OSSL_FUNC_encoder_freectx_fn rsa_priv_freectx;
 static OSSL_FUNC_encoder_set_ctx_params_fn rsa_priv_set_ctx_params;
@@ -134,7 +137,7 @@ static int rsa_priv_der_data(void *vctx, const OSSL_PARAM params[],
         RSA *rsa;
 
         if ((rsa = rsa_new(ctx->provctx)) != NULL
-            && rsa_import(rsa, OSSL_KEYMGMT_SELECT_KEYPAIR, params)
+            && rsa_import(rsa, RSA_SELECT_PRIVATE_IMPORTABLE, params)
             && rsa_priv_der(ctx, rsa, out, cb, cbarg))
             ok = 1;
         rsa_free(rsa);
@@ -180,7 +183,7 @@ static int rsa_pem_priv_data(void *vctx, const OSSL_PARAM params[],
         RSA *rsa;
 
         if ((rsa = rsa_new(ctx->provctx)) != NULL
-            && rsa_import(rsa, OSSL_KEYMGMT_SELECT_KEYPAIR, params)
+            && rsa_import(rsa, RSA_SELECT_PRIVATE_IMPORTABLE, params)
             && rsa_pem_priv(ctx, rsa, out, cb, cbarg))
             ok = 1;
         rsa_free(rsa);
@@ -237,7 +240,7 @@ static int rsa_priv_print_data(void *vctx, const OSSL_PARAM params[],
         RSA *rsa;
 
         if ((rsa = rsa_new(ctx->provctx)) != NULL
-            && rsa_import(rsa, OSSL_KEYMGMT_SELECT_KEYPAIR, params)
+            && rsa_import(rsa, RSA_SELECT_PRIVATE_IMPORTABLE, params)
             && rsa_priv_print(ctx, rsa, out, cb, cbarg))
             ok = 1;
         rsa_free(rsa);
diff --git a/providers/implementations/encode_decode/encoder_rsa_pub.c b/providers/implementations/encode_decode/encoder_rsa_pub.c
index 29e71cc093..73bb466767 100644
--- a/providers/implementations/encode_decode/encoder_rsa_pub.c
+++ b/providers/implementations/encode_decode/encoder_rsa_pub.c
@@ -24,6 +24,9 @@
 #include "prov/provider_ctx.h"
 #include "encoder_local.h"
 
+#define RSA_SELECT_PUBLIC_IMPORTABLE                                           \
+    (OSSL_KEYMGMT_SELECT_PUBLIC_KEY | OSSL_KEYMGMT_SELECT_OTHER_PARAMETERS)
+
 static OSSL_FUNC_encoder_newctx_fn rsa_pub_newctx;
 static OSSL_FUNC_encoder_freectx_fn rsa_pub_freectx;
 static OSSL_FUNC_encoder_encode_data_fn rsa_pub_der_data;
@@ -63,7 +66,7 @@ static int rsa_pub_der_data(void *ctx, const OSSL_PARAM params[],
 
         /* ctx == provctx */
         if ((rsa = rsa_new(ctx)) != NULL
-            && rsa_import(rsa, OSSL_KEYMGMT_SELECT_KEYPAIR, params)
+            && rsa_import(rsa, RSA_SELECT_PUBLIC_IMPORTABLE, params)
             && rsa_pub_der(ctx, rsa, out, cb, cbarg))
             ok = 1;
         rsa_free(rsa);
@@ -104,7 +107,7 @@ static int rsa_pub_pem_data(void *ctx, const OSSL_PARAM params[],
 
         /* ctx == provctx */
         if ((rsa = rsa_new(ctx)) != NULL
-            && rsa_import(rsa, OSSL_KEYMGMT_SELECT_KEYPAIR, params)
+            && rsa_import(rsa, RSA_SELECT_PUBLIC_IMPORTABLE, params)
             && rsa_pub_pem(ctx, rsa, out, cb, cbarg))
             ok = 1;
         rsa_free(rsa);
@@ -144,7 +147,7 @@ static int rsa_pub_print_data(void *ctx, const OSSL_PARAM params[],
 
         /* ctx == provctx */
         if ((rsa = rsa_new(ctx)) != NULL
-            && rsa_import(rsa, OSSL_KEYMGMT_SELECT_KEYPAIR, params)
+            && rsa_import(rsa, RSA_SELECT_PUBLIC_IMPORTABLE, params)
             && rsa_pub_print(ctx, rsa, out, cb, cbarg))
             ok = 1;
         rsa_free(rsa);


More information about the openssl-commits mailing list