Skip to content

Commit

Permalink
changed ML-DSA/SLH-DSA Jca signatures to return null if default 0 len…
Browse files Browse the repository at this point in the history
…gth context is used, relates to github #1946.
  • Loading branch information
dghgit committed Dec 22, 2024
1 parent 185cf12 commit d3f5333
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ protected final AlgorithmParameters engineGetParameters()
{
if (engineParams == null)
{
if (paramSpec != null)
if (paramSpec != null && paramSpec != ContextParameterSpec.EMPTY_CONTEXT_SPEC)
{
try
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down

0 comments on commit d3f5333

Please sign in to comment.