mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-04 20:30:38 +09:00
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>
(cherry picked from commit 7f83a1efae)
This commit is contained in:
committed by
Andreas Schneider
parent
f5e8fa5c5f
commit
a238df2436
@@ -1607,7 +1607,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);
|
||||
|
||||
@@ -1673,6 +1673,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
|
||||
|
||||
@@ -1855,7 +1855,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);
|
||||
|
||||
@@ -1921,6 +1921,7 @@ ssh_signature pki_signature_from_blob(const ssh_key pubkey,
|
||||
ssh_signature_free(sig);
|
||||
return NULL;
|
||||
}
|
||||
sig->type_c = ssh_key_signature_to_char(type, hash_type);
|
||||
break;
|
||||
case SSH_KEYTYPE_ED25519:
|
||||
rc = pki_ed25519_sig_from_blob(sig, sig_blob);
|
||||
|
||||
@@ -904,11 +904,12 @@ 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 */
|
||||
|
||||
switch(type) {
|
||||
case SSH_KEYTYPE_RSA:
|
||||
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: {
|
||||
ssh_buffer b;
|
||||
|
||||
Reference in New Issue
Block a user