/*
This file is part of GNUnet.
- Copyright (C) 2012-2015 Christian Grothoff (and other contributing authors)
+ Copyright (C) 2012-2015 GNUnet e.V.
GNUnet is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published
#include "gnunet_signatures.h"
#include "identity_provider.h"
#include "identity_token.h"
+#include <inttypes.h>
/**
* First pass state
if (0 == strcmp (attr->name, "exp"))
{
sscanf (attr->val_head->value,
- "%lu",
+ "%"SCNu64,
&token_exp.abs_value_us);
} else if (0 == strcmp (attr->name, "nbf")) {
sscanf (attr->val_head->value,
- "%lu",
+ "%"SCNu64,
&token_nbf.abs_value_us);
}
}
static struct GNUNET_IDENTITY_PROVIDER_ExchangeResultMessage*
create_exchange_result_message (const char* token,
- const char* label)
+ const char* label,
+ uint64_t ticket_nonce)
{
struct GNUNET_IDENTITY_PROVIDER_ExchangeResultMessage *erm;
uint16_t token_len = strlen (token) + 1;
erm->header.type = htons (GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_EXCHANGE_RESULT);
erm->header.size = htons (sizeof (struct GNUNET_IDENTITY_PROVIDER_ExchangeResultMessage)
+ token_len);
+ erm->ticket_nonce = htonl (ticket_nonce);
memcpy (&erm[1], token, token_len);
return erm;
}
//Remote nonce
nonce_str = NULL;
- GNUNET_asprintf (&nonce_str, "%d", handle->nonce);
+ GNUNET_asprintf (&nonce_str, "%lu", handle->nonce);
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Request nonce: %s\n", nonce_str);
GNUNET_CRYPTO_ecdsa_key_get_public (&handle->iss_key,
&pub_key);
- handle->ticket = ticket_create (nonce_str,
+ handle->ticket = ticket_create (handle->nonce,
&pub_key,
handle->label,
&handle->aud_key);
&token_str));
erm = create_exchange_result_message (token_str,
- handle->label);
+ handle->label,
+ handle->ticket->payload->nonce);
GNUNET_SERVER_notification_context_unicast (nc,
handle->client,
&erm->header,