1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-11-29 01:03:57 +03:00

pki: Add missing return check for ssh_buffer_pack()

CID #1419376

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
This commit is contained in:
Andreas Schneider
2020-02-12 09:44:17 +01:00
parent 9fcb559301
commit f208e4b332

View File

@@ -2468,10 +2468,16 @@ int ssh_pki_signature_verify(ssh_session session,
return SSH_ERROR; return SSH_ERROR;
} }
ssh_buffer_pack(sk_buffer, "PbdP", rc = ssh_buffer_pack(sk_buffer, "PbdP",
SHA256_DIGEST_LEN, application_hash, SHA256_DIGEST_LEN, application_hash,
sig->sk_flags, sig->sk_counter, sig->sk_flags, sig->sk_counter,
SHA256_DIGEST_LEN, input_hash); SHA256_DIGEST_LEN, input_hash);
if (rc != SSH_OK) {
SSH_BUFFER_FREE(sk_buffer);
explicit_bzero(input_hash, SHA256_DIGEST_LEN);
explicit_bzero(application_hash, SHA256_DIGEST_LEN);
return SSH_ERROR;
}
rc = pki_verify_data_signature(sig, key, ssh_buffer_get(sk_buffer), rc = pki_verify_data_signature(sig, key, ssh_buffer_get(sk_buffer),
ssh_buffer_get_len(sk_buffer)); ssh_buffer_get_len(sk_buffer));