]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Correctly detect error from SSL_CTX_set1_groups_list.
authorNick Mathewson <nickm@torproject.org>
Wed, 23 Apr 2025 12:46:17 +0000 (08:46 -0400)
committerNick Mathewson <nickm@torproject.org>
Wed, 23 Apr 2025 12:46:17 +0000 (08:46 -0400)
Previously our code was checking for '< 0', but the error return value for
this function _is_ zero.

src/lib/tls/tortls_openssl.c

index 9bd0b72b961f083160719b6d53b31333c48ab257..3d20453c0716169dd3aca2d72178be5c5cc4538f 100644 (file)
@@ -673,7 +673,7 @@ tor_tls_context_new(crypto_pk_t *identity, unsigned int key_lifetime,
     const char *list;
     list = "P-256:P-224";
     int r = (int) SSL_CTX_set1_groups_list(result->ctx, list);
-    if (r < 0)
+    if (r == 0)
       goto error;
   }
 #else /* !(defined(SSL_CTX_set1_groups_list) || defined(HAVE_SSL_CTX_SE...)) */