[openssl] openssl-3.0 update

tomas at openssl.org tomas at openssl.org
Mon Nov 22 14:22:52 UTC 2021


The branch openssl-3.0 has been updated
       via  fd6a1e21f906883d0cc7ebef7826cf2f55f87832 (commit)
       via  bcb8c7eeae5b81316104799f401f8c2e6f5156cd (commit)
       via  431ce76537667e921d3f5dfc81eef5367e5a2cd4 (commit)
       via  005f5a8f402cfc0f915063071f7c13e2e528b00c (commit)
       via  8db2ffc4facdf0d5a420d838b890b3a7cd011227 (commit)
       via  f169b1e685bc242d21a36c582ea3f740d24592ba (commit)
       via  0cc5074e93dfcb4d44ece4cd21d3175a5a51f6f5 (commit)
       via  12cdadb9f43e6e989bea7e9384884c5deca340a5 (commit)
       via  8b7c2c77df29de5dc2aae62fe32a8e7ba755ceb0 (commit)
      from  301c525ee90bfc04f04ccf3241c8b141af0bb46d (commit)


- Log -----------------------------------------------------------------
commit fd6a1e21f906883d0cc7ebef7826cf2f55f87832
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)
    
    (cherry picked from commit 40649e36c4c0c9438f62e1bf2ccb983f6854c662)

commit bcb8c7eeae5b81316104799f401f8c2e6f5156cd
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)
    
    (cherry picked from commit a9ed63f1d1d8993a8b30fc978ce09674f97f061d)

commit 431ce76537667e921d3f5dfc81eef5367e5a2cd4
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)
    
    (cherry picked from commit ac6568ecc6050bc526adc6a7245835fd95d8dfed)

commit 005f5a8f402cfc0f915063071f7c13e2e528b00c
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)
    
    (cherry picked from commit a8f4cdd70c9d9ebe4553d7a72c67f73eaf0c169d)

commit 8db2ffc4facdf0d5a420d838b890b3a7cd011227
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)
    
    (cherry picked from commit 7f608e4b1d9473258445144ba66216fb0e63aebe)

commit f169b1e685bc242d21a36c582ea3f740d24592ba
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)
    
    (cherry picked from commit aba9943fef8dcc8416ac9a219c97c616c1fd6344)

commit 0cc5074e93dfcb4d44ece4cd21d3175a5a51f6f5
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)
    
    (cherry picked from commit 0650ac437b529274aca094c516a5a0127bbaf48c)

commit 12cdadb9f43e6e989bea7e9384884c5deca340a5
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)
    
    (cherry picked from commit 546b9f6b5cf6d0fde60aa37084eec1bb7d0fbc72)

commit 8b7c2c77df29de5dc2aae62fe32a8e7ba755ceb0
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)
    
    (cherry picked from commit 7264068a15e7c4955efa25753430595a45caa16f)

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

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 9ae2e22c1e..30a9b34ccb 100644
--- a/apps/s_client.c
+++ b/apps/s_client.c
@@ -3278,11 +3278,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 0e71c161ef..d95bf14cbf 100644
--- a/apps/s_server.c
+++ b/apps/s_server.c
@@ -2940,11 +2940,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 74f297400b..391ed33d5e 100644
--- a/engines/e_loader_attic.c
+++ b/engines/e_loader_attic.c
@@ -1354,8 +1354,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 965de2e2c8..8efe051f20 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 4017d47a77..041bc5f210 100644
--- a/test/sslapitest.c
+++ b/test/sslapitest.c
@@ -6786,7 +6786,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 505dd79e95..b7e781fb6b 100644
--- a/test/threadstest.c
+++ b/test/threadstest.c
@@ -293,7 +293,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;
@@ -319,8 +319,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