[openssl] openssl-3.0 update

Richard Levitte levitte at openssl.org
Tue Nov 9 04:42:05 UTC 2021


The branch openssl-3.0 has been updated
       via  2cb802e16fff3fb2c57ae664baa7bd9ce3e33805 (commit)
      from  eaa76f4788ff1dfa82b0ab9172c81d70bcd1fb59 (commit)


- Log -----------------------------------------------------------------
commit 2cb802e16fff3fb2c57ae664baa7bd9ce3e33805
Author: Richard Levitte <levitte at openssl.org>
Date:   Sun Nov 7 06:18:16 2021 +0100

    Fix DER encoder implementations for output structures "EC" and "SM2"
    
    These DER encoder implementations are supposed to be aliases for the
    "type-specific" output structure, but were made different in so far
    that they would output a "type specific" public key, which turns out
    to be garbage (it called i2o_ECPublicKey()).  The "type-specific"
    output structure doesn't support that, and shouldn't.
    
    Fixes #16977
    
    Reviewed-by: Paul Dale <pauli at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/16983)

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

Summary of changes:
 providers/implementations/encode_decode/encode_key2any.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/providers/implementations/encode_decode/encode_key2any.c b/providers/implementations/encode_decode/encode_key2any.c
index 9ee12a9fd4..91269be3a1 100644
--- a/providers/implementations/encode_decode/encode_key2any.c
+++ b/providers/implementations/encode_decode/encode_key2any.c
@@ -731,7 +731,7 @@ static int ec_pki_priv_to_der(const void *veckey, unsigned char **pder)
 # define ec_epki_priv_to_der ec_pki_priv_to_der
 
 # define ec_type_specific_params_to_der (i2d_of_void *)i2d_ECParameters
-# define ec_type_specific_pub_to_der    (i2d_of_void *)i2o_ECPublicKey
+/* No ec_type_specific_pub_to_der, there simply is no such thing */
 # define ec_type_specific_priv_to_der   (i2d_of_void *)i2d_ECPrivateKey
 
 # define ec_check_key_type      NULL
@@ -1190,11 +1190,11 @@ static int key2any_encode(struct key2any_ctx_st *ctx, OSSL_CORE_BIO *cout,
 #define DO_DSA_selection_mask DO_type_specific_selection_mask
 #define DO_DSA(impl, type, output) DO_type_specific(impl, type, output)
 
-#define DO_EC_selection_mask DO_type_specific_selection_mask
-#define DO_EC(impl, type, output) DO_type_specific(impl, type, output)
+#define DO_EC_selection_mask DO_type_specific_no_pub_selection_mask
+#define DO_EC(impl, type, output) DO_type_specific_no_pub(impl, type, output)
 
-#define DO_SM2_selection_mask DO_type_specific_selection_mask
-#define DO_SM2(impl, type, output) DO_type_specific(impl, type, output)
+#define DO_SM2_selection_mask DO_type_specific_no_pub_selection_mask
+#define DO_SM2(impl, type, output) DO_type_specific_no_pub(impl, type, output)
 
 /* PKCS#1 defines a structure for RSA private and public keys */
 #define DO_PKCS1_selection_mask DO_RSA_selection_mask


More information about the openssl-commits mailing list