summaryrefslogtreecommitdiff
path: root/src/authorization/anastasis_authorization_plugin_totp.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/authorization/anastasis_authorization_plugin_totp.c')
-rw-r--r--src/authorization/anastasis_authorization_plugin_totp.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/authorization/anastasis_authorization_plugin_totp.c b/src/authorization/anastasis_authorization_plugin_totp.c
index b3d5bc0..74d7b7c 100644
--- a/src/authorization/anastasis_authorization_plugin_totp.c
+++ b/src/authorization/anastasis_authorization_plugin_totp.c
@@ -144,7 +144,6 @@ compute_totp (int time_off,
uint8_t hmac[20]; /* SHA1: 20 bytes */
now = GNUNET_TIME_absolute_get ();
- (void) GNUNET_TIME_round_abs (&now);
while (time_off < 0)
{
now = GNUNET_TIME_absolute_subtract (now,
@@ -300,10 +299,9 @@ totp_process (struct ANASTASIS_AUTHORIZATION_State *as,
/* Build HTTP response */
{
struct MHD_Response *resp;
- struct GNUNET_TIME_Absolute now;
+ struct GNUNET_TIME_Timestamp now;
- now = GNUNET_TIME_absolute_get ();
- (void) GNUNET_TIME_round_abs (&now);
+ now = GNUNET_TIME_timestamp_get ();
if (TALER_MHD_xmime_matches (mime,
"application/json"))
{
@@ -313,8 +311,8 @@ totp_process (struct ANASTASIS_AUTHORIZATION_State *as,
GNUNET_JSON_pack_string ("hint",
TALER_ErrorCode_get_hint (
TALER_EC_ANASTASIS_TRUTH_CHALLENGE_FAILED)),
- GNUNET_JSON_pack_time_abs ("server_time",
- now));
+ GNUNET_JSON_pack_timestamp ("server_time",
+ now));
}
else
{
@@ -325,7 +323,7 @@ totp_process (struct ANASTASIS_AUTHORIZATION_State *as,
response_size
= GNUNET_asprintf (&response,
"Server time: %s",
- GNUNET_STRINGS_absolute_time_to_string (now));
+ GNUNET_TIME_timestamp2s (now));
resp = MHD_create_response_from_buffer (response_size,
response,
MHD_RESPMEM_MUST_COPY);