Skip to content

Commit 9b10323

Browse files
committed
Adjust regex
1 parent b108ece commit 9b10323

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

distribution/tools/plugin-cli/src/main/java/org/elasticsearch/plugins/InstallPluginCommand.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -560,12 +560,12 @@ void verifySignature(final Path zip, final String urlString) throws IOException,
560560
// skip armor headers and possible blank line
561561
int index = 1;
562562
for (; index < lines.size(); index++) {
563-
if (lines.get(index).matches("\\w: \\w") == false && lines.get(index).matches("\\s*")) {
563+
if (lines.get(index).matches(".*: .*") == false && lines.get(index).matches("\\s*") == false) {
564564
break;
565565
}
566566
}
567567
final byte[] armoredData =
568-
lines.subList(index + 1, lines.size() - 1).stream().collect(Collectors.joining("\n")).getBytes(StandardCharsets.UTF_8);
568+
lines.subList(index, lines.size() - 1).stream().collect(Collectors.joining("\n")).getBytes(StandardCharsets.UTF_8);
569569
final InputStream ain = Base64.getMimeDecoder().wrap(new ByteArrayInputStream(armoredData));
570570
final PGPPublicKeyRingCollection collection = new PGPPublicKeyRingCollection(ain, new JcaKeyFingerprintCalculator());
571571
final PGPPublicKey key = collection.getPublicKey(signature.getKeyID());

0 commit comments

Comments
 (0)