]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
EC_get_buildin_curves does not return an error, this check is unnecessary.
authorotherddn1978 <other_ddn@mail.ru>
Wed, 12 Feb 2025 10:54:46 +0000 (13:54 +0300)
committerTomas Mraz <tomas@openssl.org>
Thu, 20 Feb 2025 14:15:46 +0000 (15:15 +0100)
Found by Linux Verification Center (linuxtesting.org) with SVACE.

unused code has been removed

delete whitespace

Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26719)

apps/ecparam.c

index 9c9b3e050636a26d1043fee7bca7f55b833dad4e..b05a0804527b40cdb1490ee3a4fe8179c6c0f6c5 100644 (file)
@@ -67,13 +67,11 @@ const OPTIONS ecparam_options[] = {
 
 static int list_builtin_curves(BIO *out)
 {
-    int ret = 0;
     EC_builtin_curve *curves = NULL;
     size_t n, crv_len = EC_get_builtin_curves(NULL, 0);
 
     curves = app_malloc((int)sizeof(*curves) * crv_len, "list curves");
-    if (!EC_get_builtin_curves(curves, crv_len))
-        goto end;
+    EC_get_builtin_curves(curves, crv_len);
 
     for (n = 0; n < crv_len; n++) {
         const char *comment = curves[n].comment;
@@ -87,10 +85,8 @@ static int list_builtin_curves(BIO *out)
         BIO_printf(out, "  %-10s: ", sname);
         BIO_printf(out, "%s\n", comment);
     }
-    ret = 1;
-end:
     OPENSSL_free(curves);
-    return ret;
+    return 1;
 }
 
 int ecparam_main(int argc, char **argv)