From 710f676dc3959f6a98f57b8116d789cacfd22800 Mon Sep 17 00:00:00 2001 From: Paul Schaub Date: Tue, 7 Dec 2021 23:46:44 +0100 Subject: [PATCH] Rename MAX_RECURSION_DEPTH constant to avoid confusion --- .../decryption_verification/DecryptionStreamFactory.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pgpainless-core/src/main/java/org/pgpainless/decryption_verification/DecryptionStreamFactory.java b/pgpainless-core/src/main/java/org/pgpainless/decryption_verification/DecryptionStreamFactory.java index 459bfb8d..d6864104 100644 --- a/pgpainless-core/src/main/java/org/pgpainless/decryption_verification/DecryptionStreamFactory.java +++ b/pgpainless-core/src/main/java/org/pgpainless/decryption_verification/DecryptionStreamFactory.java @@ -74,7 +74,8 @@ public final class DecryptionStreamFactory { private static final Logger LOGGER = LoggerFactory.getLogger(DecryptionStreamFactory.class); - private static final int MAX_RECURSION_DEPTH = 16; + // Maximum nesting depth of packets (e.g. compression, encryption...) + private static final int MAX_PACKET_NESTING_DEPTH = 16; private final ConsumerOptions options; private final OpenPgpMetadata.Builder resultBuilder = OpenPgpMetadata.getBuilder(); @@ -188,7 +189,7 @@ public final class DecryptionStreamFactory { } private InputStream processPGPPackets(@Nonnull PGPObjectFactory objectFactory, int depth) throws IOException, PGPException { - if (depth >= MAX_RECURSION_DEPTH) { + if (depth >= MAX_PACKET_NESTING_DEPTH) { throw new PGPException("Maximum recursion depth of packages exceeded."); } Object nextPgpObject;