-
Notifications
You must be signed in to change notification settings - Fork 20
Add Check for PQCPrivateKey in Decapsulator and add tests. #1042
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
jasonkatonica
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some tests are also failing with the following unused variables:
Error: /home/runner/work/OpenJCEPlus/OpenJCEPlus/src/test/java/ibm/jceplus/junit/base/BaseTestKEM.java:190:16: Unused local variable 'encr'. [UnusedLocalVariable]
Error: /home/runner/work/OpenJCEPlus/OpenJCEPlus/src/test/java/ibm/jceplus/junit/base/BaseTestKEM.java:197:16: Unused local variable 'decr'. [UnusedLocalVariable]
Error: /home/runner/work/OpenJCEPlus/OpenJCEPlus/src/test/java/ibm/jceplus/junit/base/BaseTestKEM.java:208:16: Unused local variable 'encr'. [UnusedLocalVariable]
Error: /home/runner/work/OpenJCEPlus/OpenJCEPlus/src/test/java/ibm/jceplus/junit/base/BaseTestKEM.java:215:16: Unused local variable 'decr'. [UnusedLocalVariable]
src/test/java/ibm/jceplus/junit/base/BaseTestPQCKeyInterop.java
Outdated
Show resolved
Hide resolved
src/test/java/ibm/jceplus/junit/base/BaseTestPQCKeyInterop.java
Outdated
Show resolved
Hide resolved
e85ad9f to
990a310
Compare
jasonkatonica
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
f455242 to
ccf3001
Compare
fd780cf to
8ff682c
Compare
aaaffcf to
7ec7db1
Compare
… keys. Signed-off-by: John Peck <140550562+johnpeck-us-ibm@users.noreply.github.com>
7ec7db1 to
fdd1142
Compare
|
|
||
| try { | ||
| kem.newDecapsulator(pqcKeyPair.getPrivate()); | ||
| fail("testKEMKeys failed - RSA Private key did not cause an Invalid Key Excepton."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a typo. Saying Invalid Key Excepton instead of InvalidKeyException.
|
|
||
| try { | ||
| kem.newEncapsulator(pqcKeyPair.getPublic()); | ||
| fail("testKEMKeys failed - RSA Public key did not cause an Invalid Key Excepton."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a typo. Saying Invalid Key Excepton instead of InvalidKeyException.
|
|
||
| try { | ||
| kem.newEncapsulator(pub); | ||
| fail("testKEMKeys failed - NULL Public key did not cause an Invalid Key Excepton."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a typo. Saying Invalid Key Excepton instead of InvalidKeyException.
|
|
||
| try { | ||
| kem.newDecapsulator(priv); | ||
| fail("testKEMKeys failed - NULL Private key did not cause an Invalid Key Excepton."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a typo. Saying Invalid Key Excepton instead of InvalidKeyException.
|
|
||
| if (getProviderName().equals("OpenJCEPlusFIPS") || | ||
| getInteropProviderName().equals(Utils.PROVIDER_BC)) { | ||
| //This is not in the FIPS provider yet and Boucy Castle does not support this test. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BouncyCastle instead of Boucy Castle.
| public void testPQCKeyGenKEMAutoKeyConvertion() throws Exception { | ||
| String pqcAlgorithm = "ML-KEM-512"; | ||
|
|
||
| if (getProviderName().equals("OpenJCEPlusFIPS") || |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could substitute this with:
assumeFalse("OpenJCEPlusFIPS".equals(getProviderName()));
assumeFalse(Utils.PROVIDER_BC.equals(getProviderName()));
Add Check for PQCPrivateKey in Decapsulator and add tests for invalid keys.
Signed-off-by: John Peck 140550562+johnpeck-us-ibm@users.noreply.github.com