Skip to content

Commit 3631830

Browse files
authored
[MGPG-114] Allow max key size of 16KB (#83)
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
1 parent 528fab9 commit 3631830

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main/java/org/apache/maven/plugins/gpg/BcSigner.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ public final class GpgConfLoader implements Loader {
123123
/**
124124
* Maximum key size, see <a href="https://wiki.gnupg.org/LargeKeys">Large Keys</a>.
125125
*/
126-
private static final long MAX_SIZE = 5 * 1024 + 1L;
126+
private static final long MAX_SIZE = 16 * 1024 + 1L;
127127

128128
@Override
129129
public byte[] loadKeyRingMaterial(RepositorySystemSession session) throws IOException {
@@ -137,7 +137,7 @@ public byte[] loadKeyRingMaterial(RepositorySystemSession session) throws IOExce
137137
if (Files.size(keyPath) < MAX_SIZE) {
138138
return Files.readAllBytes(keyPath);
139139
} else {
140-
throw new IOException("Refusing to load key " + keyPath + "; is larger than 5KB");
140+
throw new IOException("Refusing to load key " + keyPath + "; is larger than 16KB");
141141
}
142142
}
143143
return null;

0 commit comments

Comments
 (0)