fix rsa_import() of MAX_RSA_SIZE'ed keys

The ASN1 encoded RSA key contains two MPI's therefore MAX_RSA_SIZE / 8
isn't enough.
This commit is contained in:
Steffen Jaeckel 2017-09-29 18:18:35 +02:00
parent 0500aaec45
commit ab02d2e450

View File

@ -40,7 +40,7 @@ int rsa_import(const unsigned char *in, unsigned long inlen, rsa_key *key)
} }
/* see if the OpenSSL DER format RSA public key will work */ /* see if the OpenSSL DER format RSA public key will work */
tmpbuf_len = MAX_RSA_SIZE / 8; tmpbuf_len = inlen;
tmpbuf = XCALLOC(1, tmpbuf_len); tmpbuf = XCALLOC(1, tmpbuf_len);
if (tmpbuf == NULL) { if (tmpbuf == NULL) {
err = CRYPT_MEM; err = CRYPT_MEM;