summaryrefslogtreecommitdiff
path: root/firmware/lib/cryptolib/rsa.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/lib/cryptolib/rsa.c')
-rw-r--r--firmware/lib/cryptolib/rsa.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/firmware/lib/cryptolib/rsa.c b/firmware/lib/cryptolib/rsa.c
index adc0dc05..bad01d83 100644
--- a/firmware/lib/cryptolib/rsa.c
+++ b/firmware/lib/cryptolib/rsa.c
@@ -134,6 +134,9 @@ int RSAVerify(const RSAPublicKey *key,
const uint8_t* padding;
int success = 1;
+ if (!key || !sig || !hash)
+ return 0;
+
if (sig_len != (key->len * sizeof(uint32_t))) {
VBDEBUG(("Signature is of incorrect length!\n"));
return 0;