From 15f2489550e0503b429cc243a31823fd843d4959 Mon Sep 17 00:00:00 2001 From: Harsh Shandilya Date: Mon, 18 Jul 2022 00:01:06 +0530 Subject: crypto: consistently use secret key nomenclature --- .../app/passwordstore/crypto/KeyUtilsTest.kt | 4 +- .../app/passwordstore/crypto/PGPKeyManagerTest.kt | 55 +++++++------ .../crypto/PGPainlessCryptoHandlerTest.kt | 10 +-- .../kotlin/app/passwordstore/crypto/TestUtils.kt | 6 +- crypto-pgpainless/src/test/resources/private_key | 26 ------ .../test/resources/private_key_multiple_identities | 93 ---------------------- crypto-pgpainless/src/test/resources/secret_key | 26 ++++++ .../test/resources/secret_key_multiple_identities | 93 ++++++++++++++++++++++ 8 files changed, 156 insertions(+), 157 deletions(-) delete mode 100644 crypto-pgpainless/src/test/resources/private_key delete mode 100644 crypto-pgpainless/src/test/resources/private_key_multiple_identities create mode 100644 crypto-pgpainless/src/test/resources/secret_key create mode 100644 crypto-pgpainless/src/test/resources/secret_key_multiple_identities (limited to 'crypto-pgpainless/src/test') diff --git a/crypto-pgpainless/src/test/kotlin/app/passwordstore/crypto/KeyUtilsTest.kt b/crypto-pgpainless/src/test/kotlin/app/passwordstore/crypto/KeyUtilsTest.kt index 209865ea..f7bf46d9 100644 --- a/crypto-pgpainless/src/test/kotlin/app/passwordstore/crypto/KeyUtilsTest.kt +++ b/crypto-pgpainless/src/test/kotlin/app/passwordstore/crypto/KeyUtilsTest.kt @@ -2,7 +2,7 @@ package app.passwordstore.crypto import app.passwordstore.crypto.KeyUtils.tryGetId import app.passwordstore.crypto.KeyUtils.tryParseKeyring -import app.passwordstore.crypto.TestUtils.getArmoredPrivateKeyWithMultipleIdentities +import app.passwordstore.crypto.TestUtils.getArmoredSecretKeyWithMultipleIdentities import kotlin.test.Test import kotlin.test.assertEquals import kotlin.test.assertIs @@ -12,7 +12,7 @@ import org.bouncycastle.openpgp.PGPSecretKeyRing class KeyUtilsTest { @Test fun parseKeyWithMultipleIdentities() { - val key = PGPKey(getArmoredPrivateKeyWithMultipleIdentities()) + val key = PGPKey(getArmoredSecretKeyWithMultipleIdentities()) val keyring = tryParseKeyring(key) assertNotNull(keyring) assertIs(keyring) diff --git a/crypto-pgpainless/src/test/kotlin/app/passwordstore/crypto/PGPKeyManagerTest.kt b/crypto-pgpainless/src/test/kotlin/app/passwordstore/crypto/PGPKeyManagerTest.kt index 91a9dc47..5c2ee7ef 100644 --- a/crypto-pgpainless/src/test/kotlin/app/passwordstore/crypto/PGPKeyManagerTest.kt +++ b/crypto-pgpainless/src/test/kotlin/app/passwordstore/crypto/PGPKeyManagerTest.kt @@ -2,7 +2,6 @@ package app.passwordstore.crypto import app.passwordstore.crypto.GpgIdentifier.KeyId import app.passwordstore.crypto.GpgIdentifier.UserId -import app.passwordstore.crypto.TestUtils.getArmoredPrivateKeyWithMultipleIdentities import app.passwordstore.crypto.errors.KeyAlreadyExistsException import app.passwordstore.crypto.errors.KeyNotFoundException import app.passwordstore.crypto.errors.NoKeysAvailableException @@ -32,12 +31,12 @@ import org.junit.rules.TemporaryFolder class PGPKeyManagerTest { @get:Rule val temporaryFolder: TemporaryFolder = TemporaryFolder() - private val filesDir by unsafeLazy { temporaryFolder.root } - private val keysDir by unsafeLazy { File(filesDir, PGPKeyManager.KEY_DIR_NAME) } private val dispatcher = StandardTestDispatcher() private val scope = TestScope(dispatcher) + private val filesDir by unsafeLazy { temporaryFolder.root } + private val keysDir by unsafeLazy { File(filesDir, PGPKeyManager.KEY_DIR_NAME) } private val keyManager by unsafeLazy { PGPKeyManager(filesDir.absolutePath, dispatcher) } - private val privateKey = PGPKey(TestUtils.getArmoredPrivateKey()) + private val secretKey = PGPKey(TestUtils.getArmoredSecretKey()) private val publicKey = PGPKey(TestUtils.getArmoredPublicKey()) private fun unsafeLazy(initializer: () -> T) = @@ -57,7 +56,7 @@ class PGPKeyManagerTest { fun addKey() = scope.runTest { // Check if the key id returned is correct - val keyId = keyManager.getKeyId(keyManager.addKey(privateKey).unwrap()) + val keyId = keyManager.getKeyId(keyManager.addKey(secretKey).unwrap()) assertEquals(KeyId(CryptoConstants.KEY_ID), keyId) // Check if the keys directory have one file @@ -72,8 +71,8 @@ class PGPKeyManagerTest { fun addKeyWithoutReplaceFlag() = scope.runTest { // Check adding the keys twice - keyManager.addKey(privateKey, false).unwrap() - val error = keyManager.addKey(privateKey, false).unwrapError() + keyManager.addKey(secretKey, false).unwrap() + val error = keyManager.addKey(secretKey, false).unwrapError() assertIs(error) } @@ -82,8 +81,8 @@ class PGPKeyManagerTest { fun addKeyWithReplaceFlag() = scope.runTest { // Check adding the keys twice - keyManager.addKey(privateKey, true).unwrap() - val keyId = keyManager.getKeyId(keyManager.addKey(privateKey, true).unwrap()) + keyManager.addKey(secretKey, true).unwrap() + val keyId = keyManager.getKeyId(keyManager.addKey(secretKey, true).unwrap()) assertEquals(KeyId(CryptoConstants.KEY_ID), keyId) } @@ -92,10 +91,10 @@ class PGPKeyManagerTest { fun removeKey() = scope.runTest { // Add key using KeyManager - keyManager.addKey(privateKey).unwrap() + keyManager.addKey(secretKey).unwrap() // Check if the key id returned is correct - val keyId = keyManager.getKeyId(keyManager.removeKey(privateKey).unwrap()) + val keyId = keyManager.getKeyId(keyManager.removeKey(secretKey).unwrap()) assertEquals(KeyId(CryptoConstants.KEY_ID), keyId) // Check if the keys directory have 0 files @@ -107,42 +106,42 @@ class PGPKeyManagerTest { fun getKeyById() = scope.runTest { // Add key using KeyManager - keyManager.addKey(privateKey).unwrap() + keyManager.addKey(secretKey).unwrap() - val keyId = keyManager.getKeyId(privateKey) + val keyId = keyManager.getKeyId(secretKey) assertNotNull(keyId) - assertEquals(KeyId(CryptoConstants.KEY_ID), keyManager.getKeyId(privateKey)) + assertEquals(KeyId(CryptoConstants.KEY_ID), keyManager.getKeyId(secretKey)) // Check returned key id matches the expected id and the created key id val returnedKey = keyManager.getKeyById(keyId).unwrap() - assertEquals(keyManager.getKeyId(privateKey), keyManager.getKeyId(returnedKey)) + assertEquals(keyManager.getKeyId(secretKey), keyManager.getKeyId(returnedKey)) } @Test fun getKeyByFullUserId() = scope.runTest { - keyManager.addKey(privateKey).unwrap() + keyManager.addKey(secretKey).unwrap() val keyId = "${CryptoConstants.KEY_NAME} <${CryptoConstants.KEY_EMAIL}>" val returnedKey = keyManager.getKeyById(UserId(keyId)).unwrap() - assertEquals(keyManager.getKeyId(privateKey), keyManager.getKeyId(returnedKey)) + assertEquals(keyManager.getKeyId(secretKey), keyManager.getKeyId(returnedKey)) } @Test fun getKeyByEmailUserId() = scope.runTest { - keyManager.addKey(privateKey).unwrap() + keyManager.addKey(secretKey).unwrap() val keyId = CryptoConstants.KEY_EMAIL val returnedKey = keyManager.getKeyById(UserId(keyId)).unwrap() - assertEquals(keyManager.getKeyId(privateKey), keyManager.getKeyId(returnedKey)) + assertEquals(keyManager.getKeyId(secretKey), keyManager.getKeyId(returnedKey)) } @Test fun getNonExistentKey() = scope.runTest { // Add key using KeyManager - keyManager.addKey(privateKey).unwrap() + keyManager.addKey(secretKey).unwrap() val keyId = KeyId(0x08edf7567183ce44) @@ -169,8 +168,8 @@ class PGPKeyManagerTest { assertEquals(0, noKeyList.size) // Add key using KeyManager - keyManager.addKey(privateKey).unwrap() - keyManager.addKey(PGPKey(getArmoredPrivateKeyWithMultipleIdentities())).unwrap() + keyManager.addKey(secretKey).unwrap() + keyManager.addKey(PGPKey(TestUtils.getArmoredSecretKeyWithMultipleIdentities())).unwrap() // Check if KeyManager returns one key val singleKeyList = keyManager.getAllKeys().unwrap() @@ -180,7 +179,7 @@ class PGPKeyManagerTest { @Test fun getMultipleIdentityKeyWithAllIdentities() { scope.runTest { - val key = PGPKey(getArmoredPrivateKeyWithMultipleIdentities()) + val key = PGPKey(TestUtils.getArmoredSecretKeyWithMultipleIdentities()) keyManager.addKey(key).unwrap() val johnKey = keyManager.getKeyById(UserId("john@doe.org")).unwrap() @@ -191,9 +190,9 @@ class PGPKeyManagerTest { } @Test - fun replacePrivateKeyWithPublicKey() { + fun replaceSecretKeyWithPublicKey() { scope.runTest { - assertIs>(keyManager.addKey(privateKey)) + assertIs>(keyManager.addKey(secretKey)) assertIs>(keyManager.addKey(publicKey)) } } @@ -202,7 +201,7 @@ class PGPKeyManagerTest { fun replacePublicKeyWithSecretKey() { scope.runTest { assertIs>(keyManager.addKey(publicKey)) - assertIs>(keyManager.addKey(privateKey)) + assertIs>(keyManager.addKey(secretKey)) } } @@ -222,8 +221,8 @@ class PGPKeyManagerTest { @Test fun replaceSecretKeyWithSecretKey() { scope.runTest { - assertIs>(keyManager.addKey(privateKey)) - assertIs>(keyManager.addKey(privateKey)) + assertIs>(keyManager.addKey(secretKey)) + assertIs>(keyManager.addKey(secretKey)) } } } diff --git a/crypto-pgpainless/src/test/kotlin/app/passwordstore/crypto/PGPainlessCryptoHandlerTest.kt b/crypto-pgpainless/src/test/kotlin/app/passwordstore/crypto/PGPainlessCryptoHandlerTest.kt index 68335a28..6a20fe25 100644 --- a/crypto-pgpainless/src/test/kotlin/app/passwordstore/crypto/PGPainlessCryptoHandlerTest.kt +++ b/crypto-pgpainless/src/test/kotlin/app/passwordstore/crypto/PGPainlessCryptoHandlerTest.kt @@ -22,8 +22,8 @@ import org.junit.runner.RunWith @Suppress("Unused") // Test runner handles it internally enum class EncryptionKey(val keySet: List) { PUBLIC(listOf(PGPKey(TestUtils.getArmoredPublicKey()))), - SECRET(listOf(PGPKey(TestUtils.getArmoredPrivateKey()))), - ALL(listOf(PGPKey(TestUtils.getArmoredPublicKey()), PGPKey(TestUtils.getArmoredPrivateKey()))), + SECRET(listOf(PGPKey(TestUtils.getArmoredSecretKey()))), + ALL(listOf(PGPKey(TestUtils.getArmoredPublicKey()), PGPKey(TestUtils.getArmoredSecretKey()))), } @RunWith(TestParameterInjector::class) @@ -31,7 +31,7 @@ class PGPainlessCryptoHandlerTest { @TestParameter private lateinit var encryptionKey: EncryptionKey private val cryptoHandler = PGPainlessCryptoHandler() - private val privateKey = PGPKey(TestUtils.getArmoredPrivateKey()) + private val secretKey = PGPKey(TestUtils.getArmoredSecretKey()) @Test fun encryptAndDecrypt() { @@ -46,7 +46,7 @@ class PGPainlessCryptoHandlerTest { val plaintextStream = ByteArrayOutputStream() val decryptRes = cryptoHandler.decrypt( - privateKey, + secretKey, CryptoConstants.KEY_PASSPHRASE, ciphertextStream.toByteArray().inputStream(), plaintextStream, @@ -68,7 +68,7 @@ class PGPainlessCryptoHandlerTest { val plaintextStream = ByteArrayOutputStream() val result = cryptoHandler.decrypt( - privateKey, + secretKey, "very incorrect passphrase", ciphertextStream.toByteArray().inputStream(), plaintextStream, diff --git a/crypto-pgpainless/src/test/kotlin/app/passwordstore/crypto/TestUtils.kt b/crypto-pgpainless/src/test/kotlin/app/passwordstore/crypto/TestUtils.kt index 1e5aea8c..2c1b8851 100644 --- a/crypto-pgpainless/src/test/kotlin/app/passwordstore/crypto/TestUtils.kt +++ b/crypto-pgpainless/src/test/kotlin/app/passwordstore/crypto/TestUtils.kt @@ -7,10 +7,10 @@ package app.passwordstore.crypto object TestUtils { - fun getArmoredPrivateKey() = this::class.java.classLoader.getResource("private_key").readBytes() + fun getArmoredSecretKey() = this::class.java.classLoader.getResource("secret_key").readBytes() fun getArmoredPublicKey() = this::class.java.classLoader.getResource("public_key").readBytes() - fun getArmoredPrivateKeyWithMultipleIdentities() = - this::class.java.classLoader.getResource("private_key_multiple_identities").readBytes() + fun getArmoredSecretKeyWithMultipleIdentities() = + this::class.java.classLoader.getResource("secret_key_multiple_identities").readBytes() fun getArmoredPublicKeyWithMultipleIdentities() = this::class.java.classLoader.getResource("public_key_multiple_identities").readBytes() } diff --git a/crypto-pgpainless/src/test/resources/private_key b/crypto-pgpainless/src/test/resources/private_key deleted file mode 100644 index 61334b01..00000000 --- a/crypto-pgpainless/src/test/resources/private_key +++ /dev/null @@ -1,26 +0,0 @@ ------BEGIN PGP PRIVATE KEY BLOCK----- -Version: PGPainless -Comment: BC98 82EF 93DC 22F8 D7D4 47AD 08ED F756 7183 CE27 -Comment: John Doe - -lIYEY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STqAHF+zU8/ezzHeoilyBYgxLS9Q2q -elDeDAAKCRAI7fdWcYPOJ7aHAP9EBq0rzV3c6GtVl8bPnk+llpV/1aodxTSnijQt -VSMuMAD+JMUDJd2bimlhuVwpu0DFiF7IF64SAxmVifTwsTWYiQs= -=/dDf ------END PGP PRIVATE KEY BLOCK----- diff --git a/crypto-pgpainless/src/test/resources/private_key_multiple_identities b/crypto-pgpainless/src/test/resources/private_key_multiple_identities deleted file mode 100644 index 5da8ac81..00000000 --- a/crypto-pgpainless/src/test/resources/private_key_multiple_identities +++ /dev/null @@ -1,93 +0,0 @@ ------BEGIN PGP PRIVATE KEY BLOCK----- - -lQWGBF8ZYcsBDADN7uFG6b/GZYK4zaBXEJ0ZTV1AmNCRDVHyp2GY/TSJYYLCpiyl -PhAlgems44L55XkDjFnAUkNqEmeB1j/nt277LLU6mr+OyT1ONvUCSonGCJpvLy04 -PesX8TmPrzYHxIXeeeEAG5FzajHeR7IKczihBYJCIBw8k9jq2Xw6MgeYwNOkewcC -8sXp7DJm4lvlJTr7myZQZSzU1fQVj1cvtEFV6Ui2ga3zXqGvJpyvkltr0n7E0qhV -awQP8WJZR2+GvloIGocYSWgnHcV6hIOLyns4JrGOUbOXejiH7LxdeSFWCl6RBnGq -BfH8bFIuy9p2Js81kgyvO4iKBGWUNLLwBA++0h1RNVKupQOopgJfFvxT1brhEYpi -DCm2Nh4z210Xf+cvbbRS5r+8PVJJtTu9njFZOgkhAoDPyisSwGIkjowR34xZWaGk -0vUq6cgy++UzXagStdh+TBMHnUrofHzZi8rZ7neGdv5BEO05VH069ypCq//M6jFv -sCXPcfSGppSGIVcAEQEAAf4HAwJGnM7pyd6sHP8ul8z3RUNSllTOHU/oeTqwOEBd -8QAZio7eAeL8NiJW8jlhwLGNKxSeQSwtfxlCsb8VvXmqVyFkOXdUdeFTA5/LRZzF -JceWRjGTfkLz4Eon7dNTkypU6+K1QUSaENtNtX2/e2LOdv6eacln+Vvfqeztk9EB -9pvuKe9LbpX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GOIdbsTRoShjBsss7i2BG2Bcei4frtq/gDeL4fHoD6FSMADdMFYn4eJPNMSoz -UQmFkrUe7L41x6yOkduSfrgjVvzxF0RXfBkpbQV9e8W8dc+/YkRdUmkrEbo+hWxV -Ncr+iiruGxQXcdWcHzMHnEfriQG2BBgBCgAgFiEENqB685cbzZMvs9TfuVCuKBOE -FYUFAl8ZYcsCGwwACgkQuVCuKBOEFYU/ZQv8CC+OvaElxo0zWbPZeHAxmTKl++R0 -g++B28SAyWU7rsb4Y89ihqUs8ZrvI9mtwl8w305yGrOvRIAr/DyNYbWfZdhb8so7 -+4tL3IglYMeK01AMxXhzrbHse+Lu9BoJByHIZJEZmMCyf6ZjICWoPixqPSsOOsts -h7mNMU6XcxoRzt1JbN3aFYsPLnSUxS9CRaemVrE5kkSdbtp5TRbX0OjaxirMeAVQ -MoBdTo9XhIBnvwmmgb3ScySlyz5yYk+2sF+Zv02dIpOxXB4mrJ1zyFBXZ/9Y0Ju0 -JeZmVu+5y9gDNkvLvl50UwY5qOZjxXPKx5WoLy1CagUnzZwSUHnT+kePMe01DfgR -DGD90GONne6oV1cjyzXaMY9p6rhvP4ATHKv5fd9QOHww7qBm4qIeuJYY8yfauMPv -Vh/I5B+kyLK7uSTPAs/i2yIlhOj7y4MUr+tR8wdFHSYxMLR/dhod+GIu7YYaUarR -hmaBvZKKiR6/QRMyZMQ34dx9GorvBkqXcIR7 -=8IuC ------END PGP PRIVATE KEY BLOCK----- diff --git a/crypto-pgpainless/src/test/resources/secret_key b/crypto-pgpainless/src/test/resources/secret_key new file mode 100644 index 00000000..61334b01 --- /dev/null +++ b/crypto-pgpainless/src/test/resources/secret_key @@ -0,0 +1,26 @@ +-----BEGIN PGP PRIVATE KEY BLOCK----- +Version: PGPainless +Comment: BC98 82EF 93DC 22F8 D7D4 47AD 08ED F756 7183 CE27 +Comment: John Doe + +lIYEYT33+BYJKwYBBAHaRw8BAQdAoofwCvOfKJ4pGxEO4s64wFD+QnePpNY5zXgW +TTO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q0rzV3c6GtVl8bPnk+llpV/1aodxTSnijQt +VSMuMAD+JMUDJd2bimlhuVwpu0DFiF7IF64SAxmVifTwsTWYiQs= +=/dDf +-----END PGP PRIVATE KEY BLOCK----- diff --git a/crypto-pgpainless/src/test/resources/secret_key_multiple_identities b/crypto-pgpainless/src/test/resources/secret_key_multiple_identities new file mode 100644 index 00000000..5da8ac81 --- /dev/null +++ b/crypto-pgpainless/src/test/resources/secret_key_multiple_identities @@ -0,0 +1,93 @@ +-----BEGIN PGP PRIVATE KEY BLOCK----- + +lQWGBF8ZYcsBDADN7uFG6b/GZYK4zaBXEJ0ZTV1AmNCRDVHyp2GY/TSJYYLCpiyl +PhAlgems44L55XkDjFnAUkNqEmeB1j/nt277LLU6mr+OyT1ONvUCSonGCJpvLy04 +PesX8TmPrzYHxIXeeeEAG5FzajHeR7IKczihBYJCIBw8k9jq2Xw6MgeYwNOkewcC +8sXp7DJm4lvlJTr7myZQZSzU1fQVj1cvtEFV6Ui2ga3zXqGvJpyvkltr0n7E0qhV +awQP8WJZR2+GvloIGocYSWgnHcV6hIOLyns4JrGOUbOXejiH7LxdeSFWCl6RBnGq +BfH8bFIuy9p2Js81kgyvO4iKBGWUNLLwBA++0h1RNVKupQOopgJfFvxT1brhEYpi +DCm2Nh4z210Xf+cvbbRS5r+8PVJJtTu9njFZOgkhAoDPyisSwGIkjowR34xZWaGk +0vUq6cgy++UzXagStdh+TBMHnUrofHzZi8rZ7neGdv5BEO05VH069ypCq//M6jFv +sCXPcfSGppSGIVcAEQEAAf4HAwJGnM7pyd6sHP8ul8z3RUNSllTOHU/oeTqwOEBd +8QAZio7eAeL8NiJW8jlhwLGNKxSeQSwtfxlCsb8VvXmqVyFkOXdUdeFTA5/LRZzF +JceWRjGTfkLz4Eon7dNTkypU6+K1QUSaENtNtX2/e2LOdv6eacln+Vvfqeztk9EB +9pvuKe9LbpXUxBLD4Flw5okizSO0tnrYKwtcePV1jXIVdPIzzojfK8LWC77F/h6Q +mmI1vCc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