diff --git a/yubihsm-shell-2.0.0-gcc9.patch b/yubihsm-shell-2.0.0-gcc9.patch index 71d5898..48b5ddc 100644 --- a/yubihsm-shell-2.0.0-gcc9.patch +++ b/yubihsm-shell-2.0.0-gcc9.patch @@ -1,6 +1,6 @@ diff -up yubihsm-shell-2.0.0/pkcs11/tests/ecdh_derive_test.c.gcc9 yubihsm-shell-2.0.0/pkcs11/tests/ecdh_derive_test.c --- yubihsm-shell-2.0.0/pkcs11/tests/ecdh_derive_test.c.gcc9 2019-02-13 14:40:19.972274817 +0100 -+++ yubihsm-shell-2.0.0/pkcs11/tests/ecdh_derive_test.c 2019-02-13 14:40:54.957601833 +0100 ++++ yubihsm-shell-2.0.0/pkcs11/tests/ecdh_derive_test.c 2019-02-13 14:56:04.310083669 +0100 @@ -365,7 +365,10 @@ static bool test_ecdh_value(const char * } @@ -21,7 +21,7 @@ diff -up yubihsm-shell-2.0.0/pkcs11/tests/ecdh_derive_test.c.gcc9 yubihsm-shell- if (!equal) { fail("ECDH keys derived with yubi library and with openssl do not have the " "same value"); -@@ -416,7 +420,11 @@ static bool test_dublicate_ecdh(const ch +@@ -416,7 +420,12 @@ static bool test_dublicate_ecdh(const ch return false; } @@ -29,8 +29,18 @@ diff -up yubihsm-shell-2.0.0/pkcs11/tests/ecdh_derive_test.c.gcc9 yubihsm-shell- + unsigned char *ecdh1_value = malloc(ecdh1_len); + unsigned char *ecdh2_value = malloc(ecdh2_len); + if (ecdh1_value == NULL || ecdh2_value == NULL) { ++ free(ecdh1_value); + return false; + } if (get_yhvalue(*ecdh2, ecdh1_value, ecdh1_len) == 0) { return false; } +@@ -431,6 +440,8 @@ static bool test_dublicate_ecdh(const ch + break; + } + } ++ free(ecdh1_value); ++ free(ecdh2_value); + if (!equal) { + fail( + "ECDH keys derived from the same base keys do not have the same value");