From d2a5287effcf60a44084568a37c9c9091d336178 Mon Sep 17 00:00:00 2001 From: fiaxh Date: Thu, 31 Aug 2017 18:40:58 +0200 Subject: Use utc time everywhere --- plugins/signal-protocol/src/context.vala | 4 ++-- plugins/signal-protocol/tests/session_builder.vala | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'plugins/signal-protocol') diff --git a/plugins/signal-protocol/src/context.vala b/plugins/signal-protocol/src/context.vala index 38ac3662..c36bf010 100644 --- a/plugins/signal-protocol/src/context.vala +++ b/plugins/signal-protocol/src/context.vala @@ -34,7 +34,7 @@ public class Context { } public SignedPreKeyRecord generate_signed_pre_key(IdentityKeyPair identity_key_pair, int32 id, uint64 timestamp = 0) throws Error { - if (timestamp == 0) timestamp = new DateTime.now_local().to_unix(); + if (timestamp == 0) timestamp = new DateTime.now_utc().to_unix(); SignedPreKeyRecord res; throw_by_code(Protocol.KeyHelper.generate_signed_pre_key(out res, identity_key_pair, id, timestamp, native_context)); return res; @@ -98,4 +98,4 @@ public class Context { } } -} \ No newline at end of file +} diff --git a/plugins/signal-protocol/tests/session_builder.vala b/plugins/signal-protocol/tests/session_builder.vala index 246cbd1c..c9f9c828 100644 --- a/plugins/signal-protocol/tests/session_builder.vala +++ b/plugins/signal-protocol/tests/session_builder.vala @@ -95,7 +95,7 @@ class SessionBuilderTest : Gee.TestCase { PreKeyRecord bob_pre_key_record = new PreKeyRecord(bob_pre_key.pre_key_id, bob_pre_key_pair); bob_store.store_pre_key(bob_pre_key_record); - SignedPreKeyRecord bob_signed_pre_key_record = new SignedPreKeyRecord(22, new DateTime.now_local().to_unix(), bob_signed_pre_key_pair, bob_signed_pre_key_signature); + SignedPreKeyRecord bob_signed_pre_key_record = new SignedPreKeyRecord(22, new DateTime.now_utc().to_unix(), bob_signed_pre_key_pair, bob_signed_pre_key_signature); bob_store.store_signed_pre_key(bob_signed_pre_key_record); /* Create Bob's session cipher and decrypt the message from Alice */ @@ -163,7 +163,7 @@ class SessionBuilderTest : Gee.TestCase { bob_pre_key_record = new PreKeyRecord(bob_pre_key.pre_key_id, bob_pre_key_pair); bob_store.store_pre_key(bob_pre_key_record); - bob_signed_pre_key_record = new SignedPreKeyRecord(23, new DateTime.now_local().to_unix(), bob_signed_pre_key_pair, bob_signed_pre_key_signature); + bob_signed_pre_key_record = new SignedPreKeyRecord(23, new DateTime.now_utc().to_unix(), bob_signed_pre_key_pair, bob_signed_pre_key_signature); bob_store.store_signed_pre_key(bob_signed_pre_key_record); /* Have Alice process Bob's pre key bundle */ @@ -262,7 +262,7 @@ class SessionBuilderTest : Gee.TestCase { /* Add Bob's pre keys to Bob's data store */ PreKeyRecord bob_pre_key_record = new PreKeyRecord(bob_pre_key.pre_key_id, bob_pre_key_pair); bob_store.store_pre_key(bob_pre_key_record); - SignedPreKeyRecord bob_signed_pre_key_record = new SignedPreKeyRecord(22, new DateTime.now_local().to_unix(), bob_signed_pre_key_pair, bob_signed_pre_key_signature); + SignedPreKeyRecord bob_signed_pre_key_record = new SignedPreKeyRecord(22, new DateTime.now_utc().to_unix(), bob_signed_pre_key_pair, bob_signed_pre_key_signature); bob_store.store_signed_pre_key(bob_signed_pre_key_record); /* @@ -393,4 +393,4 @@ class SessionBuilderTest : Gee.TestCase { */ } -} \ No newline at end of file +} -- cgit v1.2.3-70-g09d2