diff options
author | Dominik Schürmann <dominik@dominikschuermann.de> | 2014-10-26 00:38:31 +0200 |
---|---|---|
committer | Dominik Schürmann <dominik@dominikschuermann.de> | 2014-10-26 00:38:31 +0200 |
commit | 825baeee1bf137c40aa52e3a00115b951c0a6171 (patch) | |
tree | 6abda71cd5855a32aefa0a4994fc11be52be703d /OpenKeychain-Test/src/test/java | |
parent | 8257e450f9c78cde1d12422f530e7bb59d3edf4d (diff) | |
parent | fb7264d7fdf10099ec74d9c4f3eddce043a421a2 (diff) | |
download | open-keychain-825baeee1bf137c40aa52e3a00115b951c0a6171.tar.gz open-keychain-825baeee1bf137c40aa52e3a00115b951c0a6171.tar.bz2 open-keychain-825baeee1bf137c40aa52e3a00115b951c0a6171.zip |
Merge branch 'development' of github.com:open-keychain/open-keychain into development
Diffstat (limited to 'OpenKeychain-Test/src/test/java')
-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"); |