Skip to content

Commit ab02d2e

Browse files
committed
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.
1 parent 0500aae commit ab02d2e

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/pk/rsa/rsa_import.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ int rsa_import(const unsigned char *in, unsigned long inlen, rsa_key *key)
4040
}
4141

4242
/* see if the OpenSSL DER format RSA public key will work */
43-
tmpbuf_len = MAX_RSA_SIZE / 8;
43+
tmpbuf_len = inlen;
4444
tmpbuf = XCALLOC(1, tmpbuf_len);
4545
if (tmpbuf == NULL) {
4646
err = CRYPT_MEM;

0 commit comments

Comments
 (0)