From ef39ef94cfe4d1c1d04901695b9a91b441108bff Mon Sep 17 00:00:00 2001 From: Harsh Shandilya Date: Wed, 27 Dec 2023 23:57:49 +0530 Subject: Revert "fix: check if passphrase is necessary before asking for it" Didn't fix the issue. This reverts commit d8f76b33e9ea74eb567a115dd63559f6b27b2fce. --- .../src/main/kotlin/app/passwordstore/crypto/PGPKeyManager.kt | 8 -------- .../kotlin/app/passwordstore/crypto/PGPainlessCryptoHandler.kt | 6 ------ 2 files changed, 14 deletions(-) (limited to 'crypto/pgpainless') diff --git a/crypto/pgpainless/src/main/kotlin/app/passwordstore/crypto/PGPKeyManager.kt b/crypto/pgpainless/src/main/kotlin/app/passwordstore/crypto/PGPKeyManager.kt index 41a797b6..8aa11803 100644 --- a/crypto/pgpainless/src/main/kotlin/app/passwordstore/crypto/PGPKeyManager.kt +++ b/crypto/pgpainless/src/main/kotlin/app/passwordstore/crypto/PGPKeyManager.kt @@ -139,14 +139,6 @@ constructor( /** @see KeyManager.getKeyById */ override suspend fun getKeyId(key: PGPKey): PGPIdentifier? = tryGetId(key) - public suspend fun isPasswordProtected(key: PGPKey): Boolean { - val keyring = tryParseKeyring(key) - if (keyring is PGPSecretKeyRing) { - keyring.secretKey.keyEncryptionAlgorithm - } - return false - } - /** Checks if [keyDir] exists and attempts to create it if not. */ private fun keyDirExists(): Boolean { return keyDir.exists() || keyDir.mkdirs() diff --git a/crypto/pgpainless/src/main/kotlin/app/passwordstore/crypto/PGPainlessCryptoHandler.kt b/crypto/pgpainless/src/main/kotlin/app/passwordstore/crypto/PGPainlessCryptoHandler.kt index 72baa81a..a7087acf 100644 --- a/crypto/pgpainless/src/main/kotlin/app/passwordstore/crypto/PGPainlessCryptoHandler.kt +++ b/crypto/pgpainless/src/main/kotlin/app/passwordstore/crypto/PGPainlessCryptoHandler.kt @@ -22,7 +22,6 @@ import org.bouncycastle.openpgp.PGPSecretKeyRingCollection import org.bouncycastle.util.io.Streams import org.pgpainless.PGPainless import org.pgpainless.decryption_verification.ConsumerOptions -import org.pgpainless.decryption_verification.MessageInspector import org.pgpainless.encryption_signing.EncryptionOptions import org.pgpainless.encryption_signing.ProducerOptions import org.pgpainless.exception.WrongPassphraseException @@ -137,9 +136,4 @@ public class PGPainlessCryptoHandler @Inject constructor() : public override fun canHandle(fileName: String): Boolean { return fileName.substringAfterLast('.', "") == "gpg" } - - public override fun isPassphraseProtected(message: InputStream): Boolean { - val info = MessageInspector.determineEncryptionInfoForMessage(message) - return info.isPassphraseEncrypted - } } -- cgit v1.2.3