mirror of
https://github.com/moparisthebest/open-keychain
synced 2024-11-27 11:12:15 -05:00
Fix test for future creation timestamps to account for loosen timestamp check
This commit is contained in:
parent
a86abe04cd
commit
d8e6e51452
@ -64,6 +64,7 @@ import org.sufficientlysecure.keychain.support.KeyringTestingHelper.RawPacket;
|
|||||||
import java.io.ByteArrayInputStream;
|
import java.io.ByteArrayInputStream;
|
||||||
import java.security.Security;
|
import java.security.Security;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Calendar;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
|
|
||||||
@ -355,18 +356,18 @@ public class UncachedKeyringCanonicalizeTest {
|
|||||||
|
|
||||||
@Test public void testSignatureFuture() throws Exception {
|
@Test public void testSignatureFuture() throws Exception {
|
||||||
|
|
||||||
// generate future
|
// generate future timestamp (we allow up to one day future timestamps)
|
||||||
subHashedPacketsGen.setSignatureCreationTime(false, new Date(new Date().getTime() + 1000 * 1000));
|
Calendar cal = Calendar.getInstance();
|
||||||
|
cal.add(Calendar.DAY_OF_YEAR, 2);
|
||||||
|
subHashedPacketsGen.setSignatureCreationTime(false, cal.getTime());
|
||||||
|
|
||||||
injectEverytype(secretKey, ring, subHashedPacketsGen);
|
injectEverytype(secretKey, ring, subHashedPacketsGen);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test public void testSignatureLocal() throws Exception {
|
@Test public void testSignatureLocal() throws Exception {
|
||||||
|
|
||||||
// generate future
|
// make key local only
|
||||||
subHashedPacketsGen.setSignatureCreationTime(false, new Date());
|
|
||||||
subHashedPacketsGen.setExportable(false, false);
|
subHashedPacketsGen.setExportable(false, false);
|
||||||
|
|
||||||
injectEverytype(secretKey, ring, subHashedPacketsGen);
|
injectEverytype(secretKey, ring, subHashedPacketsGen);
|
||||||
|
@ -14,3 +14,4 @@ include ':extern:minidns'
|
|||||||
include ':extern:KeybaseLib:Lib'
|
include ':extern:KeybaseLib:Lib'
|
||||||
include ':extern:TokenAutoComplete:library'
|
include ':extern:TokenAutoComplete:library'
|
||||||
include ':extern:safeslinger-exchange'
|
include ':extern:safeslinger-exchange'
|
||||||
|
include ':OpenKeychain-Test'
|
||||||
|
Loading…
Reference in New Issue
Block a user