aboutsummaryrefslogtreecommitdiff
path: root/src/identity-provider
diff options
context:
space:
mode:
authorMartin Schanzenbach <mschanzenbach@posteo.de>2016-01-24 12:39:50 +0000
committerMartin Schanzenbach <mschanzenbach@posteo.de>2016-01-24 12:39:50 +0000
commit96686fc9cebc1e452a7e6b1fd2c2b739c7603577 (patch)
tree01391123474a46e0f3bba7ce313f05e7a4de422c /src/identity-provider
parent814b5e47aa0a9e154e3226539648d78d3ce2c293 (diff)
downloadgnunet-96686fc9cebc1e452a7e6b1fd2c2b739c7603577.tar.gz
gnunet-96686fc9cebc1e452a7e6b1fd2c2b739c7603577.zip
- sscanf type fix
Diffstat (limited to 'src/identity-provider')
-rw-r--r--src/identity-provider/gnunet-service-identity-provider.c5
-rw-r--r--src/identity-provider/identity_token.c5
-rw-r--r--src/identity-provider/plugin_rest_identity_provider.c5
3 files changed, 9 insertions, 6 deletions
diff --git a/src/identity-provider/gnunet-service-identity-provider.c b/src/identity-provider/gnunet-service-identity-provider.c
index 05b73db1a..3328035e6 100644
--- a/src/identity-provider/gnunet-service-identity-provider.c
+++ b/src/identity-provider/gnunet-service-identity-provider.c
@@ -35,6 +35,7 @@
35#include "gnunet_signatures.h" 35#include "gnunet_signatures.h"
36#include "identity_provider.h" 36#include "identity_provider.h"
37#include "identity_token.h" 37#include "identity_token.h"
38#include <inttypes.h>
38 39
39/** 40/**
40 * First pass state 41 * First pass state
@@ -368,11 +369,11 @@ handle_token_update (void *cls,
368 if (0 == strcmp (attr->name, "exp")) 369 if (0 == strcmp (attr->name, "exp"))
369 { 370 {
370 sscanf (attr->val_head->value, 371 sscanf (attr->val_head->value,
371 "%lu", 372 "%"SCNu64,
372 &token_exp.abs_value_us); 373 &token_exp.abs_value_us);
373 } else if (0 == strcmp (attr->name, "nbf")) { 374 } else if (0 == strcmp (attr->name, "nbf")) {
374 sscanf (attr->val_head->value, 375 sscanf (attr->val_head->value,
375 "%lu", 376 "%"SCNu64,
376 &token_nbf.abs_value_us); 377 &token_nbf.abs_value_us);
377 } 378 }
378 } 379 }
diff --git a/src/identity-provider/identity_token.c b/src/identity-provider/identity_token.c
index 41731bbf4..958597630 100644
--- a/src/identity-provider/identity_token.c
+++ b/src/identity-provider/identity_token.c
@@ -28,6 +28,7 @@
28#include "gnunet_signatures.h" 28#include "gnunet_signatures.h"
29#include "identity_token.h" 29#include "identity_token.h"
30#include <jansson.h> 30#include <jansson.h>
31#include <inttypes.h>
31 32
32#define JWT_ALG "alg" 33#define JWT_ALG "alg"
33 34
@@ -628,7 +629,7 @@ ticket_payload_serialize (struct TokenTicketPayload *payload,
628 sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey)); 629 sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey));
629 630
630 GNUNET_asprintf (result, 631 GNUNET_asprintf (result,
631 "{\"nonce\": \"%lu\",\"identity\": \"%s\",\"label\": \"%s\"}", 632 "{\"nonce\": \""SCNu64"\",\"identity\": \"%s\",\"label\": \"%s\"}",
632 payload->nonce, identity_key_str, payload->label); 633 payload->nonce, identity_key_str, payload->label);
633 GNUNET_free (identity_key_str); 634 GNUNET_free (identity_key_str);
634 635
@@ -818,7 +819,7 @@ ticket_payload_parse(const char *raw_data,
818 nonce_str = json_string_value (nonce_json); 819 nonce_str = json_string_value (nonce_json);
819 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Found nonce: %s\n", nonce_str); 820 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Found nonce: %s\n", nonce_str);
820 821
821 GNUNET_assert (0 != sscanf (nonce_str, "%lu", &nonce)); 822 GNUNET_assert (0 != sscanf (nonce_str, "%"SCNu64, &nonce));
822 823
823 *result = ticket_payload_create (nonce, 824 *result = ticket_payload_create (nonce,
824 (const struct GNUNET_CRYPTO_EcdsaPublicKey*)&id_pkey, 825 (const struct GNUNET_CRYPTO_EcdsaPublicKey*)&id_pkey,
diff --git a/src/identity-provider/plugin_rest_identity_provider.c b/src/identity-provider/plugin_rest_identity_provider.c
index 0110ba024..3a6151682 100644
--- a/src/identity-provider/plugin_rest_identity_provider.c
+++ b/src/identity-provider/plugin_rest_identity_provider.c
@@ -33,6 +33,7 @@
33#include "gnunet_rest_lib.h" 33#include "gnunet_rest_lib.h"
34#include "microhttpd.h" 34#include "microhttpd.h"
35#include <jansson.h> 35#include <jansson.h>
36#include <inttypes.h>
36#include "gnunet_signatures.h" 37#include "gnunet_signatures.h"
37#include "gnunet_identity_provider_service.h" 38#include "gnunet_identity_provider_service.h"
38 39
@@ -551,7 +552,7 @@ issue_token_cont (struct RestConnectionDataHandle *con,
551 nonce_str = GNUNET_CONTAINER_multihashmap_get (handle->conndata_handle->url_param_map, 552 nonce_str = GNUNET_CONTAINER_multihashmap_get (handle->conndata_handle->url_param_map,
552 &key); 553 &key);
553 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Request nonce: %s\n", nonce_str); 554 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Request nonce: %s\n", nonce_str);
554 sscanf (nonce_str, "%lu", &nonce); 555 sscanf (nonce_str, "%"SCNu64, &nonce);
555 556
556 //Get expiration for token from URL parameter 557 //Get expiration for token from URL parameter
557 GNUNET_CRYPTO_hash (GNUNET_IDENTITY_TOKEN_EXP_STRING, 558 GNUNET_CRYPTO_hash (GNUNET_IDENTITY_TOKEN_EXP_STRING,
@@ -799,7 +800,7 @@ exchange_cont (void *cls,
799 } 800 }
800 nonce_str = GNUNET_CONTAINER_multihashmap_get (handle->conndata_handle->url_param_map, 801 nonce_str = GNUNET_CONTAINER_multihashmap_get (handle->conndata_handle->url_param_map,
801 &key); 802 &key);
802 GNUNET_assert (1 == sscanf (nonce_str, "%lu", &expected_nonce)); 803 GNUNET_assert (1 == sscanf (nonce_str, "%"SCNu64, &expected_nonce));
803 804
804 if (ticket_nonce != expected_nonce) 805 if (ticket_nonce != expected_nonce)
805 { 806 {