Fix test for future creation timestamps to account for loosen timestamp check

This commit is contained in:
Dominik Schürmann 2014-12-28 21:44:03 +01:00
parent a86abe04cd
commit d8e6e51452
2 changed files with 7 additions and 5 deletions

View File

@ -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);

View File

@ -14,3 +14,4 @@ include ':extern:minidns'
include ':extern:KeybaseLib:Lib'
include ':extern:TokenAutoComplete:library'
include ':extern:safeslinger-exchange'
include ':OpenKeychain-Test'