Open Bug 2091629 Opened 14 days ago

Make the mozilla::pkix CheckSignatureAlgorithm test trust domain clearer and check the parsed ML-DSA parameter set

Categories

(NSS :: Libraries, enhancement, P3)

enhancement

Tracking

(Not tracked)

People

(Reporter: jschanck, Unassigned)

References

Details

Follow-up from review of D337328 (bug 2068282).

The test trust domain in gtests/mozpkix_gtest/pkixcheck_CheckSignatureAlgorithm_tests.cpp, pkixcheck_CheckSignatureAlgorithm_TrustDomain, takes a single constructor argument, publicKeySizeInBits, that only matters when CheckSignatureAlgorithm reaches the RSA modulus-size check. That is not clear from the class or from its call sites, and the ML-DSA tests pass 0 for it because the value is irrelevant to them.

The ML-DSA tests in that file also only check the overall result and whether the digest and modulus checks ran. They do not check which ML-DSA parameter set (44, 65 or 87) was parsed from the signature algorithm. The OID-to-parameter-set mapping is covered by pkixder_pki_types_tests.cpp, but not through CheckSignatureAlgorithm.

Possible cleanup:

  • Make the RSA-only nature of the trust domain explicit, e.g. a named expected modulus size that the non-RSA tests do not need to supply.
  • Have the trust domain (or the test) record the algorithm CheckSignatureAlgorithm saw, so the ML-DSA tests can assert the expected parameter set.

This touches the existing RSA/ECDSA test cases as well, which is why it was left out of D337328.

You need to log in before you can comment on or make changes to this bug.