diff --git a/prov/src/main/java/org/bouncycastle/jcajce/provider/asymmetric/util/BaseDeterministicOrRandomSignature.java b/prov/src/main/java/org/bouncycastle/jcajce/provider/asymmetric/util/BaseDeterministicOrRandomSignature.java index 64ab0d104e..cc3178676b 100644 --- a/prov/src/main/java/org/bouncycastle/jcajce/provider/asymmetric/util/BaseDeterministicOrRandomSignature.java +++ b/prov/src/main/java/org/bouncycastle/jcajce/provider/asymmetric/util/BaseDeterministicOrRandomSignature.java @@ -162,7 +162,7 @@ protected final AlgorithmParameters engineGetParameters() { if (engineParams == null) { - if (paramSpec != null) + if (paramSpec != null && paramSpec != ContextParameterSpec.EMPTY_CONTEXT_SPEC) { try { diff --git a/prov/src/test/java/org/bouncycastle/pqc/jcajce/provider/test/MLDSATest.java b/prov/src/test/java/org/bouncycastle/pqc/jcajce/provider/test/MLDSATest.java index bbca68b213..44939fadd2 100644 --- a/prov/src/test/java/org/bouncycastle/pqc/jcajce/provider/test/MLDSATest.java +++ b/prov/src/test/java/org/bouncycastle/pqc/jcajce/provider/test/MLDSATest.java @@ -531,10 +531,8 @@ public void testHashMLDSAKATSig() assertTrue(sig.verify(genS)); AlgorithmParameters algP = sig.getParameters(); - - ContextParameterSpec cSpec = algP.getParameterSpec(ContextParameterSpec.class); - - assertTrue(Arrays.areEqual(new byte[0], cSpec.getContext())); + + assertTrue(null == algP); // test using ml-dsa-44 for the key, should be the same.