From adf9fc4639592d6ee30d662058ae34b94e4d127b Mon Sep 17 00:00:00 2001 From: Paul Schaub Date: Mon, 14 Jul 2025 21:33:51 +0200 Subject: [PATCH] Fix IndexOutOfBounds, but keep decryption with only SK working --- .../decryption_verification/OpenPgpMessageInputStream.kt | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/pgpainless-core/src/main/kotlin/org/pgpainless/decryption_verification/OpenPgpMessageInputStream.kt b/pgpainless-core/src/main/kotlin/org/pgpainless/decryption_verification/OpenPgpMessageInputStream.kt index 5524dcae..9112273e 100644 --- a/pgpainless-core/src/main/kotlin/org/pgpainless/decryption_verification/OpenPgpMessageInputStream.kt +++ b/pgpainless-core/src/main/kotlin/org/pgpainless/decryption_verification/OpenPgpMessageInputStream.kt @@ -347,12 +347,7 @@ class OpenPgpMessageInputStream( "Symmetrically Encrypted Data Packet at depth ${layerMetadata.depth} encountered.") syntaxVerifier.next(InputSymbol.ENCRYPTED_DATA) val encDataList = packetInputStream!!.readEncryptedDataList() - if (encDataList.isEmpty) { - LOGGER.debug( - "Missing encrypted session key packet.") - return false - } - if (!encDataList.isIntegrityProtected && !encDataList.get(0).isAEAD) { + if (!encDataList.isIntegrityProtected && !encDataList.isEmpty && !encDataList.get(0).isAEAD) { LOGGER.warn("Symmetrically Encrypted Data Packet is not integrity-protected.") if (!options.isIgnoreMDCErrors()) { throw MessageNotIntegrityProtectedException()