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:
parent
24a251fbc2
commit
599e51d7d7
3 changed files with 16 additions and 15 deletions
|
|
@ -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 &&
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue