]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
DPP: Fix a memory leak in testing sequence
authorJouni Malinen <jouni@codeaurora.org>
Wed, 8 May 2019 17:38:10 +0000 (20:38 +0300)
committerJouni Malinen <j@w1.fi>
Wed, 8 May 2019 17:38:10 +0000 (20:38 +0300)
Do not allow auth->own_protocol_key to be overridden without having
freed the previously stored key in case a test sequence in
dpp_proto_auth_conf_replaced_by_resp is used.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
src/common/dpp.c

index 4b8d83811dbd9681f0f7e0f95165b983592399ee..14934de7cad0e2871c4bf833506c36b6db334efc 100644 (file)
@@ -2787,6 +2787,7 @@ static int dpp_auth_build_resp_ok(struct dpp_authentication *auth)
 #endif /* CONFIG_TESTING_OPTIONS */
        wpa_hexdump(MSG_DEBUG, "DPP: R-nonce", auth->r_nonce, nonce_len);
 
+       EVP_PKEY_free(auth->own_protocol_key);
 #ifdef CONFIG_TESTING_OPTIONS
        if (dpp_protocol_key_override_len) {
                const struct dpp_curve_params *tmp_curve;