aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/pki.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/pki.c b/src/pki.c
index a386b1f6..f3ad4a98 100644
--- a/src/pki.c
+++ b/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));