aboutsummaryrefslogtreecommitdiff
path: root/src/pki_crypto.c
diff options
context:
space:
mode:
authorJakub Jelen <jjelen@redhat.com>2018-11-22 10:38:30 +0100
committerAndreas Schneider <asn@cryptomilk.org>2018-11-30 16:20:19 +0100
commit7f83a1efae6a7da19e18268d6298fc11b4e68c57 (patch)
tree55c1f3eecf6ac4dd6e4dbfd9e464b49e3c91d3fc /src/pki_crypto.c
parent7b725e6bc7abdc38c32a1ae26081a44a2c267ce4 (diff)
downloadlibssh-7f83a1efae6a7da19e18268d6298fc11b4e68c57.tar.gz
libssh-7f83a1efae6a7da19e18268d6298fc11b4e68c57.tar.xz
libssh-7f83a1efae6a7da19e18268d6298fc11b4e68c57.zip
pki: Set correct type for imported signatures
Issue reported by Tilo Eckert <tilo.eckert@flam.de> Signed-off-by: Jakub Jelen <jjelen@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
Diffstat (limited to 'src/pki_crypto.c')
-rw-r--r--src/pki_crypto.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/pki_crypto.c b/src/pki_crypto.c
index 0c9f8ab4..8f3b21ea 100644
--- a/src/pki_crypto.c
+++ b/src/pki_crypto.c
@@ -1608,7 +1608,7 @@ ssh_signature pki_signature_from_blob(const ssh_key pubkey,
sig->type = type;
sig->hash_type = hash_type;
- sig->type_c = ssh_key_signature_to_char(type, hash_type);
+ sig->type_c = pubkey->type_c; /* for all types but RSA */
len = ssh_string_len(sig_blob);
@@ -1674,6 +1674,7 @@ ssh_signature pki_signature_from_blob(const ssh_key pubkey,
case SSH_KEYTYPE_RSA:
case SSH_KEYTYPE_RSA1:
sig = pki_signature_from_rsa_blob(pubkey, sig_blob, sig);
+ sig->type_c = ssh_key_signature_to_char(type, hash_type);
break;
case SSH_KEYTYPE_ECDSA:
#ifdef HAVE_OPENSSL_ECC