RECLAIM/OIDC: simplify access token
authorSchanzenbach, Martin <mschanzenbach@posteo.de>
Sat, 27 Apr 2019 08:04:01 +0000 (10:04 +0200)
committerSchanzenbach, Martin <mschanzenbach@posteo.de>
Sat, 27 Apr 2019 08:04:01 +0000 (10:04 +0200)
src/reclaim/oidc_helper.c

index 7b4d8ee375b45aaa38dd561cc6d4331e9862a080..f0691796b8e9bb06ee419135530fda2deac79e5a 100644 (file)
@@ -513,15 +513,13 @@ OIDC_build_token_response (const char *access_token,
 char *
 OIDC_access_token_new ()
 {
-  char *access_token_number;
   char *access_token;
   uint64_t random_number;
 
   random_number =
     GNUNET_CRYPTO_random_u64 (GNUNET_CRYPTO_QUALITY_NONCE, UINT64_MAX);
-  GNUNET_asprintf (&access_token_number, "%" PRIu64, random_number);
-  GNUNET_STRINGS_base64_encode (access_token_number,
-                                strlen (access_token_number),
+  GNUNET_STRINGS_base64_encode (&random_number,
+                                sizeof (uint64_t),
                                 &access_token);
   return access_token;
 }