Skip to content

SHA-3 and Jarsigner #753

@jonwltn

Description

@jonwltn

Following on from #293, when using the SHA-3 RSA signature algorithms when signing a JAR in KSE 5.6.1 or with jarsigner 17, produces the following output (Java 11): Signature algorithm: SHA3256withSHA3-256withRSA, 2048-bit key

m  ?     43 Tue Sep 22 17:09:52 PDT 2009 xmltask.properties

 s = signature was verified 
 m = entry is listed in manifest
 k = at least one certificate was found in keystore
 ? = unsigned entry

- Signed by "CN=RSA, O=Example"
   Digest algorithm: SHA-256
   Signature algorithm: SHA3256withSHA3-256withRSA, 2048-bit key

WARNING: Signature is either not parsable or not verifiable, and the jar will be treated as unsigned. For more information, re-run jarsigner with debug enabled (-J-Djava.security.debug=jar).

And the following output for Java 8: Signature algorithm: 2.16.840.1.101.3.4.2.8with2.16.840.1.101.3.4.3.14, 2048-bit key

 m   ?     43 Tue Sep 22 17:09:52 PDT 2009 xmltask.properties

  s = signature was verified 
  m = entry is listed in manifest
  k = at least one certificate was found in keystore
  i = at least one certificate was found in identity scope
  ? = unsigned entry

- Signed by "CN=RSA, O=Example"
    Digest algorithm: SHA-256
    Signature algorithm: 2.16.840.1.101.3.4.2.8withRSA, 2048-bit key
    Warning: nonexistent signed entries: [<<< list of classes here>>>>]

KSE 5.6.1 and jarsigner 17+ operate the same for SHA-3 with RSA signatures, but KSE 5.6.1 and jarsigner 17+ do not operate the same for SHA-2 with RSA signatures. KSE generates signed JARs that produce the user expected output when verifying with jarsigner 11 and 8 (that is, SHA256withRSA).

The two main options that I see are:

  1. Update KSE to align with jarsigner 17+ for consistency with jarsigner, that is, remove the workaround added in # 293.
  2. Update KSE to add the SHA-3 with RSA signatures to the workaround in # 293.

As a developer, I prefer option 1, but as a user, I can understand the preference for having better display of the signature algorithm.

jarsigner 15+ is needed for verfying any JAR file signed with a SHA-3 based signature algorithm.

For what it's worth, I still think it was the correct decision to always allow the SHA-3 based signature algorithms as an option in KSE 5.6.1 even though there could be compatibility concerns when using an older JDK.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions