1
0
Fork 0
mirror of https://github.com/pgpainless/pgpainless.git synced 2024-11-23 04:42:06 +01:00

Rename MAX_RECURSION_DEPTH constant to avoid confusion

This commit is contained in:
Paul Schaub 2021-12-07 23:46:44 +01:00
parent 35462ab539
commit 710f676dc3

View file

@ -74,7 +74,8 @@ public final class DecryptionStreamFactory {
private static final Logger LOGGER = LoggerFactory.getLogger(DecryptionStreamFactory.class); 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 ConsumerOptions options;
private final OpenPgpMetadata.Builder resultBuilder = OpenPgpMetadata.getBuilder(); 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 { 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."); throw new PGPException("Maximum recursion depth of packages exceeded.");
} }
Object nextPgpObject; Object nextPgpObject;