]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
ssl/tls_srp.c: Add check for BN_dup
authorJiasheng Jiang <jiasheng@iscas.ac.cn>
Fri, 1 Jul 2022 08:23:58 +0000 (16:23 +0800)
committerTodd Short <todd.short@me.com>
Fri, 8 Jul 2022 17:05:03 +0000 (13:05 -0400)
As the potential failure of the BN_dup,
it should be better to check the return value
in order to guarantee the success.

Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Todd Short <todd.short@me.com>
(Merged from https://github.com/openssl/openssl/pull/18699)

ssl/tls_srp.c

index e69ddfe9d589bea3a4979582772cd3d99886d58d..a4ec363cfba62628774aa87b8c2096301ca5f8e5 100644 (file)
@@ -238,7 +238,7 @@ int SSL_set_srp_server_param_pw(SSL *s, const char *user, const char *pass,
     BN_clear_free(s->srp_ctx.s);
     s->srp_ctx.s = NULL;
     if (!SRP_create_verifier_BN_ex(user, pass, &s->srp_ctx.s, &s->srp_ctx.v,
-                                   GN->N, GN->g, s->ctx->libctx,
+                                   s->srp_ctx.N, s->srp_ctx.g, s->ctx->libctx,
                                    s->ctx->propq))
         return -1;