]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Fixes issue 28885
authorshridhar kalavagunta <coolshrid@hotmail.com>
Tue, 2 Dec 2025 23:31:58 +0000 (17:31 -0600)
committerMatt Caswell <matt@openssl.org>
Mon, 19 Jan 2026 11:55:39 +0000 (11:55 +0000)
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <paul.dale@oracle.com>
MergeDate: Mon Jan 19 11:55:58 2026
(Merged from https://github.com/openssl/openssl/pull/29297)

ssl/tls_srp.c

index 51f0950a16f1d3c0d3cb222732f834f949a6d62b..0de08270dd8b3b73b5c538201e8ecfba157e35b9 100644 (file)
@@ -193,12 +193,15 @@ int ssl_srp_server_param_with_username_intern(SSL_CONNECTION *s, int *ad)
     OPENSSL_cleanse(b, sizeof(b));
 
     /* Calculate:  B = (kv + g^b) % N  */
+    s->srp_ctx.B = SRP_Calc_B_ex(s->srp_ctx.b, s->srp_ctx.N, s->srp_ctx.g,
+        s->srp_ctx.v, sctx->libctx, sctx->propq);
+    if (s->srp_ctx.B == NULL) {
+        BN_clear_free(s->srp_ctx.b);
+        s->srp_ctx.b = NULL;
+        return SSL3_AL_FATAL;
+    }
 
-    return ((s->srp_ctx.B = SRP_Calc_B_ex(s->srp_ctx.b, s->srp_ctx.N, s->srp_ctx.g,
-                 s->srp_ctx.v, sctx->libctx, sctx->propq))
-               != NULL)
-        ? SSL_ERROR_NONE
-        : SSL3_AL_FATAL;
+    return SSL_ERROR_NONE;
 }
 
 int SSL_srp_server_param_with_username(SSL *s, int *ad)