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>
Этот коммит содержится в:
родитель
7b725e6bc7
Коммит
7f83a1efae
@ -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
|
||||
|
@ -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;
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user