-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Description
When using SLHDSA algorithm, If the algorithm name is already parameterized (e.g. SLH-DSA-SHA2-128S) and initialization is skipped, we get this error:
Cannot invoke "org.openssl.jostle.jcajce.spec.OSSLKeyType.getKsType()" because "this.keyType" is null
java.lang.NullPointerException: Cannot invoke "org.openssl.jostle.jcajce.spec.OSSLKeyType.getKsType()" because "this.keyType" is null
at org.openssl.jostle.jcajce.provider.slhdsa.SLHDSAKeyPairGenerator.generateKeyPair(SLHDSAKeyPairGenerator.java:99)
at org.openssl.jostle.test.slhdsa.SLHDSATest.testSignVerifyWithContextAndReuse(SLHDSATest.java:303)To reproduce:
KeyPairGenerator keyGen = KeyPairGenerator.getInstance("SLH-DSA-SHA2-128s", JostleProvider.PROVIDER_NAME);
// we should skip this step
// keyGen.initialize(SLHDSAParameterSpec.slh_dsa_sha2_128s);
KeyPair keyPair = keyGen.generateKeyPair();The fix would be to add this section:
if (forcedType != OSSLKeyType.NONE)
{
keyType = forcedType;
}to the constructor:
Line 55 in 7ddd316
| public SLHDSAKeyPairGenerator(Object algorithm) |
Metadata
Metadata
Assignees
Labels
No labels