From c917262957e3fd182f77fa32b9de5bd24abbd6e1 Mon Sep 17 00:00:00 2001 From: Vincent Breitmoser Date: Wed, 23 Mar 2016 17:49:26 +0100 Subject: get rid of code path for pin and notation data handling --- .../keychain/pgp/PgpKeyOperationTest.java | 42 +--------------------- 1 file changed, 1 insertion(+), 41 deletions(-) (limited to 'OpenKeychain/src/test/java/org/sufficientlysecure/keychain/pgp/PgpKeyOperationTest.java') diff --git a/OpenKeychain/src/test/java/org/sufficientlysecure/keychain/pgp/PgpKeyOperationTest.java b/OpenKeychain/src/test/java/org/sufficientlysecure/keychain/pgp/PgpKeyOperationTest.java index 19fb0345b..666adc0f6 100644 --- a/OpenKeychain/src/test/java/org/sufficientlysecure/keychain/pgp/PgpKeyOperationTest.java +++ b/OpenKeychain/src/test/java/org/sufficientlysecure/keychain/pgp/PgpKeyOperationTest.java @@ -1232,47 +1232,7 @@ public class PgpKeyOperationTest { } @Test - public void testUnlockPin() throws Exception { - - Passphrase pin = new Passphrase("5235125"); - - // change passphrase to a pin type - parcel.mNewUnlock = new ChangeUnlockParcel(null, pin); - UncachedKeyRing modified = applyModificationWithChecks(parcel, ring, onlyA, onlyB); - - Assert.assertEquals("exactly three packets should have been added (the secret keys + notation packet)", - 3, onlyA.size()); - Assert.assertEquals("exactly four packets should have been added (the secret keys + notation packet)", - 4, onlyB.size()); - - RawPacket dkSig = onlyB.get(1); - Assert.assertEquals("second modified packet should be notation data", - PacketTags.SIGNATURE, dkSig.tag); - - // check that notation data contains pin - CanonicalizedSecretKeyRing secretRing = new CanonicalizedSecretKeyRing( - modified.getEncoded(), false, 0); - Assert.assertEquals("secret key type should be 'pin' after this", - SecretKeyType.PIN, - secretRing.getSecretKey().getSecretKeyTypeSuperExpensive()); - - // need to sleep for a sec, so the timestamp changes for notation data - Thread.sleep(1000); - - { - parcel.mNewUnlock = new ChangeUnlockParcel(new Passphrase("phrayse"), null); - applyModificationWithChecks(parcel, modified, onlyA, onlyB, new CryptoInputParcel(pin), true, false); - - Assert.assertEquals("exactly four packets should have been removed (the secret keys + notation packet)", - 4, onlyA.size()); - Assert.assertEquals("exactly three packets should have been added (no more notation packet)", - 3, onlyB.size()); - } - - } - - @Test - public void testRestricted () throws Exception { + public void testRestricted() throws Exception { CanonicalizedSecretKeyRing secretRing = new CanonicalizedSecretKeyRing(ring.getEncoded(), false, 0); -- cgit v1.2.3