Skip to content

Commit 043caa5

Browse files
committed
added specific test for null pubExp in private CRT key.
1 parent b506184 commit 043caa5

1 file changed

Lines changed: 12 additions & 3 deletions

File tree

core/src/test/java/org/bouncycastle/crypto/test/RSABlindedTest.java

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
package org.bouncycastle.crypto.test;
22

3+
import java.math.BigInteger;
4+
import java.security.SecureRandom;
5+
36
import org.bouncycastle.crypto.AsymmetricBlockCipher;
47
import org.bouncycastle.crypto.AsymmetricCipherKeyPair;
58
import org.bouncycastle.crypto.InvalidCipherTextException;
@@ -13,9 +16,6 @@
1316
import org.bouncycastle.util.encoders.Hex;
1417
import org.bouncycastle.util.test.SimpleTest;
1518

16-
import java.math.BigInteger;
17-
import java.security.SecureRandom;
18-
1919
public class RSABlindedTest
2020
extends SimpleTest
2121
{
@@ -426,6 +426,15 @@ public void performTest()
426426
{
427427
// expected
428428
}
429+
430+
// null public exponent
431+
privParameters = new RSAPrivateCrtKeyParameters(mod, null, privExp, p, q, pExp, qExp, crtCoef);
432+
433+
RSABlindedEngine bEng = new RSABlindedEngine();
434+
435+
bEng.init(true, privParameters);
436+
437+
bEng.processBlock(new byte[]{ 1 }, 0, 1);
429438
}
430439

431440

0 commit comments

Comments
 (0)