decrypt: Do not throw NoSignature exception when verifications is empty

This commit is contained in:
Paul Schaub 2023-11-22 17:11:48 +01:00
parent 51d9c29837
commit e5e64003f3
Signed by: vanitasvitae
GPG Key ID: 62BEE9264BF17311
1 changed files with 4 additions and 7 deletions

View File

@ -85,13 +85,10 @@ class DecryptCmd : AbstractSopCmd() {
@Throws(IOException::class) @Throws(IOException::class)
private fun writeVerifyOut(result: DecryptionResult) { private fun writeVerifyOut(result: DecryptionResult) {
verifyOut?.let { verifyOut?.let {
if (result.verifications.isEmpty()) { getOutput(it).use { out ->
val errorMsg = getMsg("sop.error.runtime.no_verifiable_signature_found") PrintWriter(out).use { pw ->
throw NoSignature(errorMsg) result.verifications.forEach { verification -> pw.println(verification) }
} }
getOutput(verifyOut).use { out ->
PrintWriter(out).use { pw -> result.verifications.forEach { pw.println(it) } }
} }
} }
} }