aboutsummaryrefslogtreecommitdiff
path: root/src/pki_gcrypt.c
diff options
context:
space:
mode:
authorJakub Jelen <jjelen@redhat.com>2019-05-30 13:56:38 +0200
committerAndreas Schneider <asn@cryptomilk.org>2019-06-13 11:00:56 +0200
commit1f66414805bee4faf801e1bd2d221a990f7d25d3 (patch)
tree355e030d95ec73a350dc2ceaeb43bf60cf0b455d /src/pki_gcrypt.c
parent6d5ac15a511220d3e12843fffbe68597e3ca9a8c (diff)
downloadlibssh-1f66414805bee4faf801e1bd2d221a990f7d25d3.tar.gz
libssh-1f66414805bee4faf801e1bd2d221a990f7d25d3.tar.xz
libssh-1f66414805bee4faf801e1bd2d221a990f7d25d3.zip
pki_gcrypt: Do not compare private parts when comparing public keys
Signed-off-by: Jakub Jelen <jjelen@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
Diffstat (limited to 'src/pki_gcrypt.c')
-rw-r--r--src/pki_gcrypt.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/pki_gcrypt.c b/src/pki_gcrypt.c
index 504acf3a..705830c0 100644
--- a/src/pki_gcrypt.c
+++ b/src/pki_gcrypt.c
@@ -1518,8 +1518,10 @@ int pki_key_compare(const ssh_key k1,
return 1;
}
- if (_bignum_cmp(k1->ecdsa, k2->ecdsa, "d") != 0) {
- return 1;
+ if (what == SSH_KEY_CMP_PRIVATE) {
+ if (_bignum_cmp(k1->ecdsa, k2->ecdsa, "d") != 0) {
+ return 1;
+ }
}
break;
#endif