[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [gnunet] branch master updated: compact JWT serialization
From: |
gnunet |
Subject: |
[GNUnet-SVN] [gnunet] branch master updated: compact JWT serialization |
Date: |
Sat, 21 Jul 2018 09:21:04 +0200 |
This is an automated email from the git hooks/post-receive script.
martin-schanzenbach pushed a commit to branch master
in repository gnunet.
The following commit(s) were added to refs/heads/master by this push:
new 8b5994b08 compact JWT serialization
8b5994b08 is described below
commit 8b5994b08ab970ba291b1d39847d0284cd9b323e
Author: Schanzenbach, Martin <address@hidden>
AuthorDate: Sat Jul 21 09:21:01 2018 +0200
compact JWT serialization
---
src/reclaim/jwt.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/src/reclaim/jwt.c b/src/reclaim/jwt.c
index d23c6a2a9..d9c2447bc 100644
--- a/src/reclaim/jwt.c
+++ b/src/reclaim/jwt.c
@@ -49,7 +49,7 @@ create_jwt_header(void)
json_object_set_new (root, JWT_ALG, json_string (JWT_ALG_VALUE));
json_object_set_new (root, JWT_TYP, json_string (JWT_TYP_VALUE));
- json_str = json_dumps (root, JSON_INDENT(0));
+ json_str = json_dumps (root, JSON_INDENT(0) | JSON_COMPACT);
json_decref (root);
return json_str;
}
@@ -115,7 +115,7 @@ jwt_create_from_list (const struct
GNUNET_CRYPTO_EcdsaPublicKey *aud_key,
json_string (attr_val_str));
GNUNET_free (attr_val_str);
}
- body_str = json_dumps (body, JSON_INDENT(0));
+ body_str = json_dumps (body, JSON_INDENT(0) | JSON_COMPACT);
json_decref (body);
GNUNET_STRINGS_base64_encode (header,
@@ -147,6 +147,12 @@ jwt_create_from_list (const struct
GNUNET_CRYPTO_EcdsaPublicKey *aud_key,
GNUNET_STRINGS_base64_encode ((const char*)&signature,
sizeof (struct GNUNET_HashCode),
&signature_base64);
+
+ //Remove GNUNET padding of base64
+ padding = strtok(signature_base64, "=");
+ while (NULL != padding)
+ padding = strtok(NULL, "=");
+
GNUNET_asprintf (&result, "%s.%s.%s",
header_base64, body_base64, signature_base64);
--
To stop receiving notification emails like this one, please contact
address@hidden
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] [gnunet] branch master updated: compact JWT serialization,
gnunet <=