Fix signers not propagated to class if present #1097
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi, this PR aim to fix signed jar class returning null signers for
CodeSource.getCodeSigner/getCertificatefromClass.getProtectionDomainandClass.getSignersThe existing signer support is broken as currently in 0.17.3 (in the commented todo).
fabric-loader/src/main/java/net/fabricmc/loader/impl/launch/knot/KnotClassDelegate.java
Lines 391 to 408 in fd56b9b
I have changed
Metadatato show if the codeSource has signed manifest.It is used to return early if not signed to avoid future processing.
If manifest is signed, it will get signer for the specified filename from
jar:uri and create a signed CodeSource with it.- should not be cached since file will have different signer/no signer depending on the manifest. (ie, appended class file)
I also added a property flag to disables this if there is compatibility issue arise.
I have tested this using
-Djava.debug.security=scl(valid before jdk24) with expected behavior when loading signed jars.