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:
14
src/pki.c
14
src/pki.c
@@ -2468,10 +2468,16 @@ int ssh_pki_signature_verify(ssh_session session,
|
||||
return SSH_ERROR;
|
||||
}
|
||||
|
||||
ssh_buffer_pack(sk_buffer, "PbdP",
|
||||
SHA256_DIGEST_LEN, application_hash,
|
||||
sig->sk_flags, sig->sk_counter,
|
||||
SHA256_DIGEST_LEN, input_hash);
|
||||
rc = ssh_buffer_pack(sk_buffer, "PbdP",
|
||||
SHA256_DIGEST_LEN, application_hash,
|
||||
sig->sk_flags, sig->sk_counter,
|
||||
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),
|
||||
ssh_buffer_get_len(sk_buffer));
|
||||
|
||||
Reference in New Issue
Block a user