[openssl] master update

Richard Levitte levitte at openssl.org
Wed Feb 12 12:09:37 UTC 2020


The branch master has been updated
       via  4b1aa164990a29db4a25b9478cc0066fe1ac9810 (commit)
      from  100cc8b0a644aab8e50b6ec29d966cc015cd5cf0 (commit)


- Log -----------------------------------------------------------------
commit 4b1aa164990a29db4a25b9478cc0066fe1ac9810
Author: Richard Levitte <levitte at openssl.org>
Date:   Tue Feb 11 06:23:58 2020 +0100

    Add OSSL_SERIALIZER_PUBKEY_TO_DER_PQ and friends
    
    It's already used internally, there's no reason the DER serializer
    propqueries shouldn't be present alongside the PEM and TEXT ones.
    
    Reviewed-by: Matt Caswell <matt at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/11055)

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

Summary of changes:
 crypto/x509/x_pubkey.c       | 2 +-
 include/openssl/serializer.h | 4 ++++
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/crypto/x509/x_pubkey.c b/crypto/x509/x_pubkey.c
index c4d2806ea1..f74c156652 100644
--- a/crypto/x509/x_pubkey.c
+++ b/crypto/x509/x_pubkey.c
@@ -93,7 +93,7 @@ int X509_PUBKEY_set(X509_PUBKEY **x, EVP_PKEY *pkey)
         }
     } else if (pkey->pkeys[0].keymgmt != NULL) {
         BIO *bmem = BIO_new(BIO_s_mem());
-        const char *serprop = "format=der,type=public";
+        const char *serprop = OSSL_SERIALIZER_PUBKEY_TO_DER_PQ;
         OSSL_SERIALIZER_CTX *sctx =
             OSSL_SERIALIZER_CTX_new_by_EVP_PKEY(pkey, serprop);
 
diff --git a/include/openssl/serializer.h b/include/openssl/serializer.h
index c37939f813..ceeeffb2b1 100644
--- a/include/openssl/serializer.h
+++ b/include/openssl/serializer.h
@@ -89,6 +89,10 @@ OSSL_SERIALIZER_CTX *OSSL_SERIALIZER_CTX_new_by_EVP_PKEY(const EVP_PKEY *pkey,
 # define OSSL_SERIALIZER_PrivateKey_TO_PEM_PQ "format=pem,type=private"
 # define OSSL_SERIALIZER_Parameters_TO_PEM_PQ "format=pem,type=parameters"
 
+# define OSSL_SERIALIZER_PUBKEY_TO_DER_PQ "format=der,type=public"
+# define OSSL_SERIALIZER_PrivateKey_TO_DER_PQ "format=der,type=private"
+# define OSSL_SERIALIZER_Parameters_TO_DER_PQ "format=der,type=parameters"
+
 /* Corresponding macros for text output */
 # define OSSL_SERIALIZER_PUBKEY_TO_TEXT_PQ "format=text,type=public"
 # define OSSL_SERIALIZER_PrivateKey_TO_TEXT_PQ "format=text,type=private"


More information about the openssl-commits mailing list