1
0
Fork 0
mirror of https://github.com/pgpainless/pgpainless.git synced 2025-12-05 03:41:07 +01:00

Fix spotless issues and uncomment check

This commit is contained in:
Paul Schaub 2025-11-04 23:29:50 +01:00
parent 24a251fbc2
commit 599e51d7d7
Signed by: vanitasvitae
GPG key ID: 62BEE9264BF17311
3 changed files with 16 additions and 15 deletions

View file

@ -347,13 +347,12 @@ class OpenPgpMessageInputStream(
syntaxVerifier.next(InputSymbol.ENCRYPTED_DATA)
val encDataList = packetInputStream!!.readEncryptedDataList()
/*
if (encDataList.isEmpty) {
LOGGER.debug(
"Missing encrypted session key packet.")
LOGGER.debug("Missing encrypted session key packet.")
return false
}
*/
if (!encDataList.isIntegrityProtected &&
!encDataList.isEmpty &&

View file

@ -29,13 +29,14 @@ class ArmorImpl(private val api: PGPainless) : Armor {
// Determine the nature of the given data
val openPgpIn = OpenPGPAnimalSnifferInputStream(data).apply {
try {
inspectBuffer()
} catch (e: IOException) {
// ignore
val openPgpIn =
OpenPGPAnimalSnifferInputStream(data).apply {
try {
inspectBuffer()
} catch (e: IOException) {
// ignore
}
}
}
if (openPgpIn.isAsciiArmored) {
// armoring already-armored data is an idempotent operation

View file

@ -28,11 +28,12 @@ class DetachedVerifyImpl(private val api: PGPainless) : DetachedVerify {
override fun data(data: InputStream): List<Verification> {
try {
val verificationStream = try {
api.processMessage().onInputStream(data).withOptions(options)
} catch (e: RuntimeException) {
throw SOPGPException.BadData(e)
}
val verificationStream =
try {
api.processMessage().onInputStream(data).withOptions(options)
} catch (e: RuntimeException) {
throw SOPGPException.BadData(e)
}
Streams.drain(verificationStream)
verificationStream.close()