From 0f5bed39fe90659615b192d9a88d7d206d349fff Mon Sep 17 00:00:00 2001 From: Peter Wu Date: Mon, 25 Jan 2016 19:19:19 +0100 Subject: [PATCH] ssl: fix RSA key matching with Client certs Avoid a RSA private key lookup for client certificates, the RSA private key is only valid for the server certificate. The lookup based on the client cert resulted in overwriting the server match. Bug: 12042 Change-Id: I60aa79f8f2b941bfde032e20ab11446ae4e6c81b Reviewed-on: https://code.wireshark.org/review/13530 Petri-Dish: Peter Wu Tested-by: Petri Dish Buildbot Reviewed-by: Peter Wu --- epan/dissectors/packet-ssl-utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epan/dissectors/packet-ssl-utils.c b/epan/dissectors/packet-ssl-utils.c index a72e350fbe..3c40f53f72 100644 --- a/epan/dissectors/packet-ssl-utils.c +++ b/epan/dissectors/packet-ssl-utils.c @@ -5978,7 +5978,7 @@ ssl_dissect_hnd_cert(ssl_common_dissect_t *hf, tvbuff_t *tvb, proto_tree *tree, } #if defined(HAVE_LIBGNUTLS) && defined(HAVE_LIBGCRYPT) - if (ssl) + if (is_from_server && ssl) ssl_find_private_key_by_pubkey(ssl, key_hash, &subjectPublicKeyInfo); #endif }