apache / apache/maven-jarsigner-plugin
Misleading tsapolicyid validation warning when no TSA servers configured
- Dominant language
- Java
- Stars
- 23
- Forks
- 18
- Avg merge
- 4h 23m
- Merged PRs (30d)
- 2
Description
**Affected version:** HEAD
**File:** `src/main/java/org/apache/maven/plugins/jarsigner/JarsignerSignMojo.java:290-292`
The validation of `tsapolicyid` length produces a misleading warning when neither `tsa` nor `tsacert` are configured:
```java
if (tsapolicyid.length > tsa.length || tsapolicyid.length > tsacert.length) {
getLog().warn(getMessage("warnUsageTsapolicyidTooMany", tsapolicyid.length, tsa.length, tsacert.length));
}
```
If both `tsa` and `tsacert` are length 0 (user didn't configure any TSA servers), the condition `tsapolicyid.length > 0` is true whenever the user has configured any policy IDs. The warning says "Too many OIDs" (implying the count is excessive) but the actual problem is that zero TSA servers are configured, so all OIDs will be silently ignored regardless.
The fix should first check if at least one TSA source is configured before comparing counts, or adjust the warning message to reflect the actual problem.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start in src/main/java/org/apache/maven/plugins/jarsigner/JarsignerSignMojo.java at lines 290-292 and inspect how tsapolicyid, tsa, and tsacert are validated. Confirm the warning behavior when no TSA source is configured, then verify that count validation still works when TSA sources are present. Done means the message no longer misleadingly reports too many OIDs when all configured OIDs will be ignored.
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
- Mostly clear
- Newbie friendliness
- 74/100