Skip to content

Commit

Permalink
[MGPG-114] Allow max key size of 16KB (#83)
Browse files Browse the repository at this point in the history
This insanely huge key size is mentioned as some extreme example
on page https://wiki.gnupg.org/LargeKeys

---

https://issues.apache.org/jira/browse/MGPG-114
  • Loading branch information
cstamas authored Mar 23, 2024
1 parent 528fab9 commit 3631830
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/java/org/apache/maven/plugins/gpg/BcSigner.java
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ public final class GpgConfLoader implements Loader {
/**
* Maximum key size, see <a href="https://wiki.gnupg.org/LargeKeys">Large Keys</a>.
*/
private static final long MAX_SIZE = 5 * 1024 + 1L;
private static final long MAX_SIZE = 16 * 1024 + 1L;

@Override
public byte[] loadKeyRingMaterial(RepositorySystemSession session) throws IOException {
Expand All @@ -137,7 +137,7 @@ public byte[] loadKeyRingMaterial(RepositorySystemSession session) throws IOExce
if (Files.size(keyPath) < MAX_SIZE) {
return Files.readAllBytes(keyPath);
} else {
throw new IOException("Refusing to load key " + keyPath + "; is larger than 5KB");
throw new IOException("Refusing to load key " + keyPath + "; is larger than 16KB");
}
}
return null;
Expand Down

0 comments on commit 3631830

Please sign in to comment.