diff --git a/lib/des/rsa-imath.c b/lib/des/rsa-imath.c index 4e445db78..bdd087f84 100644 --- a/lib/des/rsa-imath.c +++ b/lib/des/rsa-imath.c @@ -187,6 +187,8 @@ imath_rsa_public_decrypt(int flen, const unsigned char* from, mp_int_clear(&us); /* head zero was skipped by mp_int_to_unsigned */ + if (*p == 0) + return -7; if (*p != 1) return -6; size--; p++;