[openssl] openssl-3.0 update

tomas at openssl.org tomas at openssl.org
Mon Nov 29 12:50:49 UTC 2021


The branch openssl-3.0 has been updated
       via  91b749a2726351aa5fb37db7064a9104df074c9b (commit)
      from  94b45c31533421d33d4180b65ebeabfec50a1485 (commit)


- Log -----------------------------------------------------------------
commit 91b749a2726351aa5fb37db7064a9104df074c9b
Author: PW Hu <jlu.hpw at foxmail.com>
Date:   Wed Nov 10 00:25:47 2021 +0800

    Return -1 properly from do_X509_REQ_verify and do_X509_verify
    
    Reviewed-by: Kurt Roeckx <kurt at roeckx.be>
    Reviewed-by: Tomas Mraz <tomas at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/17001)
    
    (cherry picked from commit bc42cf51c8b2a22282bb3cdf6303e230dc7b7873)

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

Summary of changes:
 apps/lib/apps.c | 18 +++++++++++++++---
 1 file changed, 15 insertions(+), 3 deletions(-)

diff --git a/apps/lib/apps.c b/apps/lib/apps.c
index 43c01401e8..e01633c5b5 100644
--- a/apps/lib/apps.c
+++ b/apps/lib/apps.c
@@ -2302,23 +2302,35 @@ int do_X509_CRL_sign(X509_CRL *x, EVP_PKEY *pkey, const char *md,
     return rv;
 }
 
+/*
+ * do_X509_verify returns 1 if the signature is valid,
+ * 0 if the signature check fails, or -1 if error occurs.
+ */
 int do_X509_verify(X509 *x, EVP_PKEY *pkey, STACK_OF(OPENSSL_STRING) *vfyopts)
 {
     int rv = 0;
 
     if (do_x509_init(x, vfyopts) > 0)
-        rv = (X509_verify(x, pkey) > 0);
+        rv = X509_verify(x, pkey);
+    else
+        rv = -1;
     return rv;
 }
 
+/*
+ * do_X509_REQ_verify returns 1 if the signature is valid,
+ * 0 if the signature check fails, or -1 if error occurs.
+ */
 int do_X509_REQ_verify(X509_REQ *x, EVP_PKEY *pkey,
                        STACK_OF(OPENSSL_STRING) *vfyopts)
 {
     int rv = 0;
 
     if (do_x509_req_init(x, vfyopts) > 0)
-        rv = (X509_REQ_verify_ex(x, pkey,
-                                 app_get0_libctx(), app_get0_propq()) > 0);
+        rv = X509_REQ_verify_ex(x, pkey,
+                                 app_get0_libctx(), app_get0_propq());
+    else
+        rv = -1;
     return rv;
 }
 


More information about the openssl-commits mailing list