aboutsummaryrefslogtreecommitdiff
path: root/src/pki_crypto.c
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2019-10-28 14:26:27 +0100
committerAndreas Schneider <asn@cryptomilk.org>2019-12-09 16:08:03 +0100
commit7b9cbcebe5c1b748a7c50873d2ed8afff4e4089f (patch)
tree8c499ea44fd3d713121a538fc21cb0185fbe9d7e /src/pki_crypto.c
parent56d571ab8171a1282da0cbd4f9d5b7b9724d7aa5 (diff)
downloadlibssh-7b9cbcebe5c1b748a7c50873d2ed8afff4e4089f.tar.gz
libssh-7b9cbcebe5c1b748a7c50873d2ed8afff4e4089f.tar.xz
libssh-7b9cbcebe5c1b748a7c50873d2ed8afff4e4089f.zip
SSH-01-006: Add missing NULL checks in pki_signature_from_rsa_blob()
Fixes T193 Signed-off-by: Andreas Schneider <asn@cryptomilk.org Reviewed-by: Jakub Jelen <jjelen@redhat.com>
Diffstat (limited to 'src/pki_crypto.c')
-rw-r--r--src/pki_crypto.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/pki_crypto.c b/src/pki_crypto.c
index f3df40fc..2336ef7a 100644
--- a/src/pki_crypto.c
+++ b/src/pki_crypto.c
@@ -1614,6 +1614,10 @@ static int pki_signature_from_rsa_blob(const ssh_key pubkey,
blob_padded_data = (char *) ssh_string_data(sig_blob_padded);
blob_orig = (char *) ssh_string_data(sig_blob);
+ if (blob_padded_data == NULL || blob_orig == NULL) {
+ goto errout;
+ }
+
/* front-pad the buffer with zeroes */
explicit_bzero(blob_padded_data, pad_len);
/* fill the rest with the actual signature blob */