[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnunet] branch master updated: -fix IPC format again; parse JWT slightl
From: |
gnunet |
Subject: |
[gnunet] branch master updated: -fix IPC format again; parse JWT slightly more safely |
Date: |
Sat, 05 Nov 2022 13:09:42 +0100 |
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 d68327a90 -fix IPC format again; parse JWT slightly more safely
d68327a90 is described below
commit d68327a9085cbc9b871fa92d23a09d1cb2b6f6b0
Author: Martin Schanzenbach <schanzen@gnunet.org>
AuthorDate: Sat Nov 5 21:09:36 2022 +0900
-fix IPC format again; parse JWT slightly more safely
---
src/reclaim/plugin_reclaim_credential_jwt.c | 12 ++++++++++++
src/reclaim/reclaim.h | 16 +++-------------
2 files changed, 15 insertions(+), 13 deletions(-)
diff --git a/src/reclaim/plugin_reclaim_credential_jwt.c
b/src/reclaim/plugin_reclaim_credential_jwt.c
index 5d5e221f9..3c33d4076 100644
--- a/src/reclaim/plugin_reclaim_credential_jwt.c
+++ b/src/reclaim/plugin_reclaim_credential_jwt.c
@@ -167,7 +167,19 @@ jwt_parse_attributes (void *cls,
jwt_string = GNUNET_strndup (data, data_size);
const char *jwt_body = strtok (jwt_string, delim);
+ if (NULL == jwt_body)
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "Failed to parse JSON %s\n", jwt_string);
+ return attrs;
+ }
jwt_body = strtok (NULL, delim);
+ if (NULL == jwt_body)
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "Failed to parse JSON %s\n", jwt_string);
+ return attrs;
+ }
GNUNET_STRINGS_base64url_decode (jwt_body, strlen (jwt_body),
(void **) &decoded_jwt);
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Decoded JWT: %s\n", decoded_jwt);
diff --git a/src/reclaim/reclaim.h b/src/reclaim/reclaim.h
index d2d2d4b89..f457f47a8 100644
--- a/src/reclaim/reclaim.h
+++ b/src/reclaim/reclaim.h
@@ -175,12 +175,7 @@ struct CredentialResultMessage
/**
* Length of serialized attribute data
*/
- uint16_t credential_len GNUNET_PACKED;
-
- /**
- * always zero (for alignment)
- */
- uint16_t reserved GNUNET_PACKED;
+ uint32_t credential_len GNUNET_PACKED;
/**
* The length of the public key
@@ -550,17 +545,12 @@ struct ConsumeTicketResultMessage
/**
* Length of serialized attribute data
*/
- uint16_t attrs_len GNUNET_PACKED;
+ uint32_t attrs_len GNUNET_PACKED;
/**
* Length of presentation data
*/
- uint16_t presentations_len;
-
- /**
- * always zero (for alignment)
- */
- uint16_t reserved GNUNET_PACKED;
+ uint32_t presentations_len;
/**
* The length of the private key
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [gnunet] branch master updated: -fix IPC format again; parse JWT slightly more safely,
gnunet <=