mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2026-01-27 02:52:19 +01:00
Merge pull request #9302 from effbiae/wc_FreeRng
wc_FreeRng called multiple times in wolfSSL_CTX_set_srp_password
This commit is contained in:
@@ -12848,19 +12848,16 @@ cleanup:
|
||||
srp_g, sizeof(srp_g)/sizeof(srp_g[0]),
|
||||
salt, sizeof(salt)/sizeof(salt[0])) < 0){
|
||||
WOLFSSL_MSG("wc_SrpSetParam failed");
|
||||
wc_FreeRng(&rng);
|
||||
return WOLFSSL_FAILURE;
|
||||
}
|
||||
r = wc_SrpSetPassword(ctx->srp, (const byte*)password,
|
||||
(word32)XSTRLEN(password));
|
||||
if (r < 0) {
|
||||
WOLFSSL_MSG("wc_SrpSetPassword failed.");
|
||||
wc_FreeRng(&rng);
|
||||
return WOLFSSL_FAILURE;
|
||||
}
|
||||
XFREE(ctx->srp_password, NULL, DYNAMIC_TYPE_SRP);
|
||||
ctx->srp_password = NULL;
|
||||
wc_FreeRng(&rng);
|
||||
} else {
|
||||
/* save password for wolfSSL_set_srp_username */
|
||||
XFREE(ctx->srp_password, ctx->heap, DYNAMIC_TYPE_SRP);
|
||||
|
||||
Reference in New Issue
Block a user