ssl/tls_srp.c: Add check for BN_dup

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)
This commit is contained in:
Jiasheng Jiang 2022-07-01 16:23:58 +08:00 committed by Todd Short
parent 65523758e5
commit 12e488367d
1 changed files with 1 additions and 1 deletions

View 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); BN_clear_free(s->srp_ctx.s);
s->srp_ctx.s = NULL; s->srp_ctx.s = NULL;
if (!SRP_create_verifier_BN_ex(user, pass, &s->srp_ctx.s, &s->srp_ctx.v, 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)) s->ctx->propq))
return -1; return -1;