Browse Source

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.
Steffen Jaeckel 8 years ago
parent
commit
ab02d2e450
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/pk/rsa/rsa_import.c

+ 1 - 1
src/pk/rsa/rsa_import.c

@@ -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 */
-   tmpbuf_len = MAX_RSA_SIZE / 8;
+   tmpbuf_len = inlen;
    tmpbuf = XCALLOC(1, tmpbuf_len);
    if (tmpbuf == NULL) {
        err = CRYPT_MEM;