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->type = type;
|
||||||
sig->hash_type = hash_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);
|
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_RSA:
|
||||||
case SSH_KEYTYPE_RSA1:
|
case SSH_KEYTYPE_RSA1:
|
||||||
sig = pki_signature_from_rsa_blob(pubkey, sig_blob, sig);
|
sig = pki_signature_from_rsa_blob(pubkey, sig_blob, sig);
|
||||||
|
sig->type_c = ssh_key_signature_to_char(type, hash_type);
|
||||||
break;
|
break;
|
||||||
case SSH_KEYTYPE_ECDSA:
|
case SSH_KEYTYPE_ECDSA:
|
||||||
#ifdef HAVE_OPENSSL_ECC
|
#ifdef HAVE_OPENSSL_ECC
|
||||||
|
@ -1855,7 +1855,7 @@ ssh_signature pki_signature_from_blob(const ssh_key pubkey,
|
|||||||
|
|
||||||
sig->type = type;
|
sig->type = type;
|
||||||
sig->hash_type = hash_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);
|
len = ssh_string_len(sig_blob);
|
||||||
|
|
||||||
@ -1921,6 +1921,7 @@ ssh_signature pki_signature_from_blob(const ssh_key pubkey,
|
|||||||
ssh_signature_free(sig);
|
ssh_signature_free(sig);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
sig->type_c = ssh_key_signature_to_char(type, hash_type);
|
||||||
break;
|
break;
|
||||||
case SSH_KEYTYPE_ED25519:
|
case SSH_KEYTYPE_ED25519:
|
||||||
rc = pki_ed25519_sig_from_blob(sig, sig_blob);
|
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->type = type;
|
||||||
sig->hash_type = hash_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) {
|
switch(type) {
|
||||||
case SSH_KEYTYPE_RSA:
|
case SSH_KEYTYPE_RSA:
|
||||||
sig = pki_signature_from_rsa_blob(pubkey, sig_blob, sig);
|
sig = pki_signature_from_rsa_blob(pubkey, sig_blob, sig);
|
||||||
|
sig->type_c = ssh_key_signature_to_char(type, hash_type);
|
||||||
break;
|
break;
|
||||||
case SSH_KEYTYPE_ECDSA: {
|
case SSH_KEYTYPE_ECDSA: {
|
||||||
ssh_buffer b;
|
ssh_buffer b;
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user