[openssl] master update

tomas at openssl.org tomas at openssl.org
Mon Nov 22 13:48:12 UTC 2021


The branch master has been updated
       via  40649e36c4c0c9438f62e1bf2ccb983f6854c662 (commit)
       via  a9ed63f1d1d8993a8b30fc978ce09674f97f061d (commit)
       via  ac6568ecc6050bc526adc6a7245835fd95d8dfed (commit)
       via  a8f4cdd70c9d9ebe4553d7a72c67f73eaf0c169d (commit)
       via  7f608e4b1d9473258445144ba66216fb0e63aebe (commit)
       via  aba9943fef8dcc8416ac9a219c97c616c1fd6344 (commit)
       via  0650ac437b529274aca094c516a5a0127bbaf48c (commit)
       via  546b9f6b5cf6d0fde60aa37084eec1bb7d0fbc72 (commit)
       via  7264068a15e7c4955efa25753430595a45caa16f (commit)
      from  e7313323cc420e8dca2526578ae8a4a4d4d390be (commit)


- Log -----------------------------------------------------------------
commit 40649e36c4c0c9438f62e1bf2ccb983f6854c662
Author: Peiwei Hu <jlu.hpw at foxmail.com>
Date:   Mon Nov 15 00:27:31 2021 +0800

    SSL_export_keying_material: fix return check
    
    Reviewed-by: Paul Dale <pauli at openssl.org>
    Reviewed-by: Tomas Mraz <tomas at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/17028)

commit a9ed63f1d1d8993a8b30fc978ce09674f97f061d
Author: Peiwei Hu <jlu.hpw at foxmail.com>
Date:   Sun Nov 14 23:46:47 2021 +0800

    BIO_set_indent: fix return check
    
    Reviewed-by: Paul Dale <pauli at openssl.org>
    Reviewed-by: Tomas Mraz <tomas at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/17028)

commit ac6568ecc6050bc526adc6a7245835fd95d8dfed
Author: Peiwei Hu <jlu.hpw at foxmail.com>
Date:   Sun Nov 14 23:45:39 2021 +0800

    BIO_set_prefix: fix return check
    
    Reviewed-by: Paul Dale <pauli at openssl.org>
    Reviewed-by: Tomas Mraz <tomas at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/17028)

commit a8f4cdd70c9d9ebe4553d7a72c67f73eaf0c169d
Author: Peiwei Hu <jlu.hpw at foxmail.com>
Date:   Sun Nov 14 23:16:57 2021 +0800

    EVP_RAND_generate: fix return check
    
    Reviewed-by: Paul Dale <pauli at openssl.org>
    Reviewed-by: Tomas Mraz <tomas at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/17028)

commit 7f608e4b1d9473258445144ba66216fb0e63aebe
Author: Peiwei Hu <jlu.hpw at foxmail.com>
Date:   Sun Nov 14 23:00:00 2021 +0800

    asn1_item_embed_d2i: fix th return check
    
    Reviewed-by: Paul Dale <pauli at openssl.org>
    Reviewed-by: Tomas Mraz <tomas at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/17028)

commit aba9943fef8dcc8416ac9a219c97c616c1fd6344
Author: Peiwei Hu <jlu.hpw at foxmail.com>
Date:   Sun Nov 14 22:56:24 2021 +0800

    TXT_DB_write: fix the return check
    
    Reviewed-by: Paul Dale <pauli at openssl.org>
    Reviewed-by: Tomas Mraz <tomas at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/17028)

commit 0650ac437b529274aca094c516a5a0127bbaf48c
Author: Peiwei Hu <jlu.hpw at foxmail.com>
Date:   Sun Nov 14 17:57:57 2021 +0800

    Fix EVP_PKEY_decrypt return check
    
    Reviewed-by: Paul Dale <pauli at openssl.org>
    Reviewed-by: Tomas Mraz <tomas at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/17028)

commit 546b9f6b5cf6d0fde60aa37084eec1bb7d0fbc72
Author: Peiwei Hu <jlu.hpw at foxmail.com>
Date:   Sun Nov 14 17:15:11 2021 +0800

    ossl_do_blob_header: fix return check
    
    Reviewed-by: Paul Dale <pauli at openssl.org>
    Reviewed-by: Tomas Mraz <tomas at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/17028)

commit 7264068a15e7c4955efa25753430595a45caa16f
Author: Peiwei Hu <jlu.hpw at foxmail.com>
Date:   Sun Nov 14 16:55:45 2021 +0800

    BIO_gets: fix the incomplete return check
    
    Reviewed-by: Paul Dale <pauli at openssl.org>
    Reviewed-by: Tomas Mraz <tomas at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/17028)

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

Summary of changes:
 apps/s_client.c          | 4 ++--
 apps/s_server.c          | 4 ++--
 crypto/asn1/tasn_dec.c   | 4 ++--
 crypto/bn/bn_rand.c      | 2 +-
 engines/e_loader_attic.c | 4 ++--
 test/acvp_test.c         | 2 +-
 test/bio_prefix_text.c   | 4 ++--
 test/danetest.c          | 2 +-
 test/evp_extra_test.c    | 4 ++--
 test/sslapitest.c        | 2 +-
 test/threadstest.c       | 5 +++--
 11 files changed, 19 insertions(+), 18 deletions(-)

diff --git a/apps/s_client.c b/apps/s_client.c
index d40f7c948f..e0748496de 100644
--- a/apps/s_client.c
+++ b/apps/s_client.c
@@ -3295,11 +3295,11 @@ static void print_stuff(BIO *bio, SSL *s, int full)
         BIO_printf(bio, "    Label: '%s'\n", keymatexportlabel);
         BIO_printf(bio, "    Length: %i bytes\n", keymatexportlen);
         exportedkeymat = app_malloc(keymatexportlen, "export key");
-        if (!SSL_export_keying_material(s, exportedkeymat,
+        if (SSL_export_keying_material(s, exportedkeymat,
                                         keymatexportlen,
                                         keymatexportlabel,
                                         strlen(keymatexportlabel),
-                                        NULL, 0, 0)) {
+                                        NULL, 0, 0) <= 0) {
             BIO_printf(bio, "    Error\n");
         } else {
             BIO_printf(bio, "    Keying material: ");
diff --git a/apps/s_server.c b/apps/s_server.c
index 13d59faf14..d60a1f3c85 100644
--- a/apps/s_server.c
+++ b/apps/s_server.c
@@ -2959,11 +2959,11 @@ static void print_connection_info(SSL *con)
         BIO_printf(bio_s_out, "    Label: '%s'\n", keymatexportlabel);
         BIO_printf(bio_s_out, "    Length: %i bytes\n", keymatexportlen);
         exportedkeymat = app_malloc(keymatexportlen, "export key");
-        if (!SSL_export_keying_material(con, exportedkeymat,
+        if (SSL_export_keying_material(con, exportedkeymat,
                                         keymatexportlen,
                                         keymatexportlabel,
                                         strlen(keymatexportlabel),
-                                        NULL, 0, 0)) {
+                                        NULL, 0, 0) <= 0) {
             BIO_printf(bio_s_out, "    Error\n");
         } else {
             BIO_printf(bio_s_out, "    Keying material: ");
diff --git a/crypto/asn1/tasn_dec.c b/crypto/asn1/tasn_dec.c
index eff67d87fc..11198087a5 100644
--- a/crypto/asn1/tasn_dec.c
+++ b/crypto/asn1/tasn_dec.c
@@ -648,9 +648,9 @@ static int asn1_template_noexp_d2i(ASN1_VALUE **val,
                 break;
             }
             skfield = NULL;
-            if (!asn1_item_embed_d2i(&skfield, &p, len,
+            if (asn1_item_embed_d2i(&skfield, &p, len,
                                      ASN1_ITEM_ptr(tt->item), -1, 0, 0, ctx,
-                                     depth, libctx, propq)) {
+                                     depth, libctx, propq) <= 0) {
                 ERR_raise(ERR_LIB_ASN1, ERR_R_NESTED_ASN1_ERROR);
                 /* |skfield| may be partially allocated despite failure. */
                 ASN1_item_free(skfield, ASN1_ITEM_ptr(tt->item));
diff --git a/crypto/bn/bn_rand.c b/crypto/bn/bn_rand.c
index baac4ea7ed..1b49596990 100644
--- a/crypto/bn/bn_rand.c
+++ b/crypto/bn/bn_rand.c
@@ -287,7 +287,7 @@ int BN_generate_dsa_nonce(BIGNUM *out, const BIGNUM *range,
         goto err;
     }
     for (done = 0; done < num_k_bytes;) {
-        if (!RAND_priv_bytes_ex(libctx, random_bytes, sizeof(random_bytes), 0))
+        if (RAND_priv_bytes_ex(libctx, random_bytes, sizeof(random_bytes), 0) <= 0)
             goto err;
 
         if (!EVP_DigestInit_ex(mdctx, md, NULL)
diff --git a/engines/e_loader_attic.c b/engines/e_loader_attic.c
index 59f19d329f..e675b006a8 100644
--- a/engines/e_loader_attic.c
+++ b/engines/e_loader_attic.c
@@ -1347,8 +1347,8 @@ static OSSL_STORE_INFO *file_try_read_msblob(BIO *bp, int *matchcount)
 
         if (BIO_buffer_peek(bp, peekbuf, sizeof(peekbuf)) <= 0)
             return 0;
-        if (!ossl_do_blob_header(&p, sizeof(peekbuf), &magic, &bitlen,
-                                 &isdss, &ispub))
+        if (ossl_do_blob_header(&p, sizeof(peekbuf), &magic, &bitlen,
+                                 &isdss, &ispub) <= 0)
             return 0;
     }
 
diff --git a/test/acvp_test.c b/test/acvp_test.c
index 89b5400fea..d8425f0d20 100644
--- a/test/acvp_test.c
+++ b/test/acvp_test.c
@@ -1261,7 +1261,7 @@ static int rsa_decryption_primitive_test(int id)
 
     test_output_memory("n", n, n_len);
     test_output_memory("e", e, e_len);
-    if (!EVP_PKEY_decrypt(ctx, pt, &pt_len, tst->ct, tst->ct_len))
+    if (EVP_PKEY_decrypt(ctx, pt, &pt_len, tst->ct, tst->ct_len) <= 0)
         TEST_note("Decryption Failed");
     else
         test_output_memory("pt", pt, pt_len);
diff --git a/test/bio_prefix_text.c b/test/bio_prefix_text.c
index 4fc468a976..79ff8ec4a2 100644
--- a/test/bio_prefix_text.c
+++ b/test/bio_prefix_text.c
@@ -211,7 +211,7 @@ static int setup(void)
                            progname, idx, amount - 1);
                 return 0;
             }
-            if (!BIO_set_indent(chain[idx], (long)indent)) {
+            if (BIO_set_indent(chain[idx], (long)indent) <= 0) {
                 BIO_printf(bio_err, "%s: failed setting indentation: %s",
                            progname, arg);
                 return 0;
@@ -242,7 +242,7 @@ static int setup(void)
                            progname, idx, amount - 1);
                 return 0;
             }
-            if (!BIO_set_prefix(chain[idx], colon)) {
+            if (BIO_set_prefix(chain[idx], colon) <= 0) {
                 BIO_printf(bio_err, "%s: failed setting prefix: %s",
                            progname, arg);
                 return 0;
diff --git a/test/danetest.c b/test/danetest.c
index 8af31aa34e..0ed460039d 100644
--- a/test/danetest.c
+++ b/test/danetest.c
@@ -152,7 +152,7 @@ static char *read_to_eol(BIO *f)
     static char buf[4096];
     int n;
 
-    if (!BIO_gets(f, buf, sizeof(buf)))
+    if (BIO_gets(f, buf, sizeof(buf)) <= 0)
         return NULL;
 
     n = strlen(buf);
diff --git a/test/evp_extra_test.c b/test/evp_extra_test.c
index 7026753965..444b2796de 100644
--- a/test/evp_extra_test.c
+++ b/test/evp_extra_test.c
@@ -1940,8 +1940,8 @@ static int test_EVP_SM2(void)
         if (!TEST_true(EVP_PKEY_CTX_set_params(cctx, sparams)))
             goto done;
 
-        if (!TEST_true(EVP_PKEY_decrypt(cctx, plaintext, &ptext_len, ciphertext,
-                                        ctext_len)))
+        if (!TEST_int_gt(EVP_PKEY_decrypt(cctx, plaintext, &ptext_len, ciphertext,
+                                        ctext_len), 0))
             goto done;
 
         if (!TEST_true(EVP_PKEY_CTX_get_params(cctx, gparams)))
diff --git a/test/sslapitest.c b/test/sslapitest.c
index 00f27cb78e..29c125004a 100644
--- a/test/sslapitest.c
+++ b/test/sslapitest.c
@@ -6802,7 +6802,7 @@ static int create_new_vfile(char *userid, char *password, const char *filename)
 
     row = NULL;
 
-    if (!TXT_DB_write(out, db))
+    if (TXT_DB_write(out, db) <= 0)
         goto end;
 
     ret = 1;
diff --git a/test/threadstest.c b/test/threadstest.c
index cfd5991770..73cc072af1 100644
--- a/test/threadstest.c
+++ b/test/threadstest.c
@@ -410,7 +410,7 @@ static void thread_shared_evp_pkey(void)
     char *msg = "Hello World";
     unsigned char ctbuf[256];
     unsigned char ptbuf[256];
-    size_t ptlen = sizeof(ptbuf), ctlen = sizeof(ctbuf);
+    size_t ptlen, ctlen = sizeof(ctbuf);
     EVP_PKEY_CTX *ctx = NULL;
     int success = 0;
     int i;
@@ -436,8 +436,9 @@ static void thread_shared_evp_pkey(void)
         if (!TEST_ptr(ctx))
             goto err;
 
+        ptlen = sizeof(ptbuf);
         if (!TEST_int_ge(EVP_PKEY_decrypt_init(ctx), 0)
-                || !TEST_int_ge(EVP_PKEY_decrypt(ctx, ptbuf, &ptlen, ctbuf, ctlen),
+                || !TEST_int_gt(EVP_PKEY_decrypt(ctx, ptbuf, &ptlen, ctbuf, ctlen),
                                                 0)
                 || !TEST_mem_eq(msg, strlen(msg), ptbuf, ptlen))
             goto err;


More information about the openssl-commits mailing list