diff options
| -rw-r--r-- | src/tls/pkcs1.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/tls/pkcs1.c b/src/tls/pkcs1.c index af58a429..ea3e6171 100644 --- a/src/tls/pkcs1.c +++ b/src/tls/pkcs1.c @@ -113,6 +113,11 @@ int pkcs1_v15_private_key_decrypt(struct crypto_rsa_key *key, pos++; if (pos == end) return -1; + if (pos - out - 2 < 8) { + /* PKCS #1 v1.5, 8.1: At least eight octets long PS */ + wpa_printf(MSG_INFO, "LibTomCrypt: Too short padding"); + return -1; + } pos++; *outlen -= pos - out; |
