-
CSR
-
Resolution: Unresolved
-
P5
-
None
-
None
-
behavioral
-
medium
-
-
Other
-
Implementation
Summary
Fix the jarsigner aliasNotInStore
warning implementation and no longer treat it as a severe warning.
Problem
According to description of the aliasNotInStore
warning code in the jarsigner man page, when jarsigner -verify -keystore ksfile
detects that one or more signers are not inside the specified keystore, it should print out a warning "This jar contains signed entries that are not signed by alias in this keystore" and exit with a non-zero code if -strict
is also on the command line.
This was not implemented correctly as the exit code and the warning message are controlled by different (but related) flags. Sometimes the warning is shown but the exit code is still zero.
Furthermore, the flags not only depend on the certificate of the signer itself, but might also on CAs that issue the certificate to the signer. Sometimes when a signer is not in the keystore but one of its CAs is inside, the exit code is zero, although the warning is still shown.
At last, the aliasNotInStore
warning should not have been categorized as "severe" at all. In a real world a signed JAR file should be verified by someone other than the signer. Thus we should not expect the verifier having the signer's key or certificate in their local keystore.
Solution
- Change the warning from severe to informational, i.e. do not emit a non-zero exit code even when
-strict
is on. - Only detect whether the signer itself is in the keystore and not any of its CAs (if they exists).
Specification
In the man page from jarsigner
, move the aliasNotInStore
warning from the "Severe Warnings" section to the "Informational Warnings" section, and remove its related exit code. See https://docs.oracle.com/en/java/javase/23/docs/specs/man/jarsigner.html#severe-warnings.
- csr of
-
JDK-8330217 Spurious warning from jarsigner -verify when keystore with intermediate CA is used
-
- Open
-