include MAX_RSA_INT_SZ in wc_RsaKeyToPublicDer(), for 4096-bit keys

This commit is contained in:
Chris Conlon 2016-09-09 16:11:56 -06:00
parent a0b02236b8
commit a149d83bff

View File

@ -5572,7 +5572,7 @@ static int SetRsaPublicKey(byte* output, RsaKey* key,
n[0] = ASN_INTEGER;
nSz = SetLength(rawLen, n + 1) + 1; /* int tag */
if ( (nSz + rawLen) < MAX_RSA_INT_SZ) {
if ( (nSz + rawLen) <= MAX_RSA_INT_SZ) {
if (leadingBit)
n[nSz] = 0;
#ifdef HAVE_USER_RSA