apache / apache/maven-jarsigner-plugin

decrypt(null) called when storepass/keypass is not configured

Open Beginner friendly
#150 0 comments 0 reactions 0 assignees View on GitHub
bug priority:minor
Dominant language
Java
Stars
23
Forks
18
Avg merge
4h 23m
Merged PRs (30d)
2

Description

**Affected version:** HEAD

**Files:**
- `src/main/java/org/apache/maven/plugins/jarsigner/AbstractJarsignerMojo.java:540`
- `src/main/java/org/apache/maven/plugins/jarsigner/JarsignerSignMojo.java:313`

Both `processArchive()` and `createRequest()` call `decrypt(null)` when `storepass` or `keypass` are not configured:

```java
// AbstractJarsignerMojo.java:540
request.setStorepass(decrypt(storepass));

// JarsignerSignMojo.java:313
request.setKeypass(decrypt(keypass));
```

The `decrypt()` method passes this null to `securityDispatcher.decrypt(null)`. While the default `SecDispatcher` implementation may handle null gracefully, this is an unnecessary call that depends on implementation-specific behavior. The fix should skip the `decrypt()` call if the password is null.

Contributor guide

No contributing guide indexed for this repository

Research direction

Read processArchive() in src/main/java/org/apache/maven/plugins/jarsigner/AbstractJarsignerMojo.java and createRequest() in src/main/java/org/apache/maven/plugins/jarsigner/JarsignerSignMojo.java. Verify the password values before the decrypt() calls and confirm that null storepass or keypass values no longer reach securityDispatcher.decrypt(null).

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
build-system
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
76/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.