From 458cb85d1985aa3efe0a33eb59123d23b5fa975a Mon Sep 17 00:00:00 2001 From: Shane Lontis Date: Fri, 21 Aug 2020 11:15:59 +1000 Subject: [PATCH] Fix ECX serializer import calls to use correct selection flags. Reviewed-by: Richard Levitte (Merged from https://github.com/openssl/openssl/pull/12698) --- providers/implementations/encode_decode/encoder_ecx_pub.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/providers/implementations/encode_decode/encoder_ecx_pub.c b/providers/implementations/encode_decode/encoder_ecx_pub.c index 6f082c2b4c0..a4350d84cfd 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); -- 2.47.3