mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-10 10:26:47 +09:00
pki: Support RSA verification using different hash algorithms
This changes the private API by adding one more argument to function
pki_signature_from_blob()
Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
(cherry picked from commit fa60827840)
This commit is contained in:
committed by
Andreas Schneider
parent
f9d60e1360
commit
cf660fe27c
@@ -374,7 +374,7 @@ static void torture_pki_ed25519_verify(void **state){
|
||||
assert_true(rc == SSH_OK);
|
||||
|
||||
ssh_string_fill(blob, ref_signature, ED25519_SIG_LEN);
|
||||
sig = pki_signature_from_blob(pubkey, blob, SSH_KEYTYPE_ED25519);
|
||||
sig = pki_signature_from_blob(pubkey, blob, SSH_KEYTYPE_ED25519, SSH_DIGEST_AUTO);
|
||||
assert_true(sig != NULL);
|
||||
|
||||
rc = pki_ed25519_verify(pubkey, sig, HASH, sizeof(HASH));
|
||||
@@ -411,7 +411,7 @@ static void torture_pki_ed25519_verify_bad(void **state){
|
||||
for (i=0; i < ED25519_SIG_LEN; ++i){
|
||||
ssh_string_fill(blob, ref_signature, ED25519_SIG_LEN);
|
||||
((uint8_t *)ssh_string_data(blob))[i] ^= 0xff;
|
||||
sig = pki_signature_from_blob(pubkey, blob, SSH_KEYTYPE_ED25519);
|
||||
sig = pki_signature_from_blob(pubkey, blob, SSH_KEYTYPE_ED25519, SSH_DIGEST_AUTO);
|
||||
assert_true(sig != NULL);
|
||||
|
||||
rc = pki_ed25519_verify(pubkey, sig, HASH, sizeof(HASH));
|
||||
|
||||
Reference in New Issue
Block a user