HomePhabricator

dh: fix libcrypto dh_ctx leak in ssh_dh_cleanup

Authored by simonsj on Apr 30 2019, 8:54 PM.

Description

dh: fix libcrypto dh_ctx leak in ssh_dh_cleanup

Ensure to free the dh_ctx member in ssh_dh_cleanup to match
the allocation in ssh_dh_init_common.

The before-and-after of this change can be observed with the pkd
tests and valgrind:

valgrind --leak-check=full \
  ./pkd_hello -i1 -t torture_pkd_openssh_dsa_rsa_diffie_hellman_group16_sha512

Signed-off-by: Jon Simons <jon@jonsimons.org>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>

Details

Committed
asnMay 9 2019, 5:37 PM
Parents
rLIBSSHee82bab80166: auth: Avoid memory on error in ssh_userauth_agent_publickey()
Branches
Unknown
Tags
Unknown