diff options
author | Dominik Schürmann <dominik@dominikschuermann.de> | 2014-12-28 21:44:03 +0100 |
---|---|---|
committer | Dominik Schürmann <dominik@dominikschuermann.de> | 2014-12-28 21:44:48 +0100 |
commit | d8e6e5145281ceb048f02d0b2c0ad69440364757 (patch) | |
tree | 9193c35b777c1276c41eb5081d5ded61aa9a6084 /OpenKeychain-Test | |
parent | a86abe04cdea48dd0c736e5b4d3e42463452c6a0 (diff) | |
download | open-keychain-d8e6e5145281ceb048f02d0b2c0ad69440364757.tar.gz open-keychain-d8e6e5145281ceb048f02d0b2c0ad69440364757.tar.bz2 open-keychain-d8e6e5145281ceb048f02d0b2c0ad69440364757.zip |
Fix test for future creation timestamps to account for loosen timestamp check
Diffstat (limited to 'OpenKeychain-Test')
-rw-r--r-- | OpenKeychain-Test/src/test/java/org/sufficientlysecure/keychain/pgp/UncachedKeyringCanonicalizeTest.java | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/OpenKeychain-Test/src/test/java/org/sufficientlysecure/keychain/pgp/UncachedKeyringCanonicalizeTest.java b/OpenKeychain-Test/src/test/java/org/sufficientlysecure/keychain/pgp/UncachedKeyringCanonicalizeTest.java index e66026246..a4b6edac8 100644 --- a/OpenKeychain-Test/src/test/java/org/sufficientlysecure/keychain/pgp/UncachedKeyringCanonicalizeTest.java +++ b/OpenKeychain-Test/src/test/java/org/sufficientlysecure/keychain/pgp/UncachedKeyringCanonicalizeTest.java @@ -64,6 +64,7 @@ import org.sufficientlysecure.keychain.support.KeyringTestingHelper.RawPacket; import java.io.ByteArrayInputStream; import java.security.Security; import java.util.ArrayList; +import java.util.Calendar; import java.util.Date; import java.util.Iterator; @@ -355,18 +356,18 @@ public class UncachedKeyringCanonicalizeTest { @Test public void testSignatureFuture() throws Exception { - // generate future - subHashedPacketsGen.setSignatureCreationTime(false, new Date(new Date().getTime() + 1000 * 1000)); + // generate future timestamp (we allow up to one day future timestamps) + Calendar cal = Calendar.getInstance(); + cal.add(Calendar.DAY_OF_YEAR, 2); + subHashedPacketsGen.setSignatureCreationTime(false, cal.getTime()); injectEverytype(secretKey, ring, subHashedPacketsGen); - } @Test public void testSignatureLocal() throws Exception { - // generate future - subHashedPacketsGen.setSignatureCreationTime(false, new Date()); + // make key local only subHashedPacketsGen.setExportable(false, false); injectEverytype(secretKey, ring, subHashedPacketsGen); |