]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
SSL_export_keying_material: fix return check
authorPeiwei Hu <jlu.hpw@foxmail.com>
Sun, 14 Nov 2021 16:27:31 +0000 (00:27 +0800)
committerTomas Mraz <tomas@openssl.org>
Mon, 22 Nov 2021 14:22:03 +0000 (15:22 +0100)
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/17028)

(cherry picked from commit 40649e36c4c0c9438f62e1bf2ccb983f6854c662)

apps/s_client.c
apps/s_server.c

index 9ae2e22c1e43f5aa08492f39ea24e20634f1091e..30a9b34ccb6fb53e1f6fdc07607a8a2380c291ec 100644 (file)
@@ -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: ");
index 0e71c161ef224a4cb0e927e83a9e950f930340fa..d95bf14cbf50b4ed0ce722aa27a97be21825d90f 100644 (file)
@@ -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: ");