Let ecdsatest exercise ECParameters_dup() a bit
authortb <tb@openbsd.org>
Thu, 4 May 2023 13:49:29 +0000 (13:49 +0000)
committertb <tb@openbsd.org>
Thu, 4 May 2023 13:49:29 +0000 (13:49 +0000)
This currently leaks, which will fixed in a follow-on commit.

regress/lib/libcrypto/ecdsa/ecdsatest.c

index 5f3edc5..bc908ce 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: ecdsatest.c,v 1.15 2023/05/04 13:41:20 tb Exp $       */
+/*     $OpenBSD: ecdsatest.c,v 1.16 2023/05/04 13:49:29 tb Exp $       */
 /*
  * Written by Nils Larsch for the OpenSSL project.
  */
@@ -154,7 +154,8 @@ test_builtin(void)
                        goto err;
                }
 
-               if ((wrong_eckey = EC_KEY_new()) == NULL)
+               /* Exercise ECParameters_dup() and let ASAN test for leaks. */
+               if ((wrong_eckey = ECParameters_dup(key)) == NULL)
                        goto err;
                group = EC_GROUP_new_by_curve_name(nid);
                if (group == NULL)