diff options
author | Vincent Breitmoser <valodim@mugenguild.com> | 2014-10-26 00:34:16 +0200 |
---|---|---|
committer | Vincent Breitmoser <valodim@mugenguild.com> | 2014-10-26 00:34:16 +0200 |
commit | 8b778809bf2799319980063600fb175d9f0d541f (patch) | |
tree | 1c32a91f3c7db251c695ab054709ade2f11b5a67 /OpenKeychain-Test/src/test/java/org/sufficientlysecure/keychain | |
parent | 33738b1f520802124821faae12471c4019add17a (diff) | |
download | open-keychain-8b778809bf2799319980063600fb175d9f0d541f.tar.gz open-keychain-8b778809bf2799319980063600fb175d9f0d541f.tar.bz2 open-keychain-8b778809bf2799319980063600fb175d9f0d541f.zip |
add test case for symantec secret keys (#974)
Diffstat (limited to 'OpenKeychain-Test/src/test/java/org/sufficientlysecure/keychain')
-rw-r--r-- | OpenKeychain-Test/src/test/java/org/sufficientlysecure/keychain/provider/ProviderHelperSaveTest.java | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/OpenKeychain-Test/src/test/java/org/sufficientlysecure/keychain/provider/ProviderHelperSaveTest.java b/OpenKeychain-Test/src/test/java/org/sufficientlysecure/keychain/provider/ProviderHelperSaveTest.java index 364e559e6..8e72b3c35 100644 --- a/OpenKeychain-Test/src/test/java/org/sufficientlysecure/keychain/provider/ProviderHelperSaveTest.java +++ b/OpenKeychain-Test/src/test/java/org/sufficientlysecure/keychain/provider/ProviderHelperSaveTest.java @@ -77,6 +77,28 @@ public class ProviderHelperSaveTest { } + @Test public void testImportSymantec() throws Exception { + + // insert two keys with same long key id, make sure the second one gets rejected either way! + UncachedKeyRing seckey = + readRingFromResource("/test-keys/symantec_secret.asc"); + UncachedKeyRing pubkey = + readRingFromResource("/test-keys/symantec_public.asc"); + + SaveKeyringResult result; + + // insert secret, this should fail because of missing self-cert + result = new ProviderHelper(Robolectric.application).saveSecretKeyRing(seckey, new ProgressScaler()); + Assert.assertFalse("secret keyring import before pubring import should fail", result.success()); + + // insert pubkey, then seckey - both should succeed + result = new ProviderHelper(Robolectric.application).savePublicKeyRing(pubkey); + Assert.assertTrue("public keyring import should succeed", result.success()); + result = new ProviderHelper(Robolectric.application).saveSecretKeyRing(seckey, new ProgressScaler()); + Assert.assertTrue("secret keyring import after pubring import should succeed", result.success()); + + } + @Test public void testImportNoFlagKey() throws Exception { UncachedKeyRing pub = readRingFromResource("/test-keys/mailvelope_07_no_key_flags.asc"); |