Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,14 @@ else if (keysize == 8192) {
}

if (type == KeyType.WC_RSA || type == KeyType.WC_RSA_PSS) {

/* Sanity check on key size */
if (keysize < Rsa.RSA_MIN_SIZE) {
throw new InvalidParameterException(
"RSA key size too small, min is " +
Rsa.RSA_MIN_SIZE);
}

/* Set default RSA exponent for wolfSSL */
this.publicExponent = Rsa.getDefaultRsaExponent();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ public void testKeyPairGeneratorRsaInitializeWithKeySize()
/* bad key size should fail */
try {
kpg.initialize(10);
} catch (WolfCryptException e) {}
} catch (InvalidParameterException e) {}
}
}

Expand Down
Loading