diff options
Diffstat (limited to 'src/reclaim/plugin_reclaim_credential_jwt.c')
-rw-r--r-- | src/reclaim/plugin_reclaim_credential_jwt.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/reclaim/plugin_reclaim_credential_jwt.c b/src/reclaim/plugin_reclaim_credential_jwt.c index 5d5e221f9..3eb4bfebf 100644 --- a/src/reclaim/plugin_reclaim_credential_jwt.c +++ b/src/reclaim/plugin_reclaim_credential_jwt.c | |||
@@ -167,7 +167,20 @@ jwt_parse_attributes (void *cls, | |||
167 | 167 | ||
168 | jwt_string = GNUNET_strndup (data, data_size); | 168 | jwt_string = GNUNET_strndup (data, data_size); |
169 | const char *jwt_body = strtok (jwt_string, delim); | 169 | const char *jwt_body = strtok (jwt_string, delim); |
170 | if (NULL == jwt_body) | ||
171 | { | ||
172 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | ||
173 | "Failed to parse JSON %s\n", jwt_string); | ||
174 | return attrs; | ||
175 | } | ||
170 | jwt_body = strtok (NULL, delim); | 176 | jwt_body = strtok (NULL, delim); |
177 | if (NULL == jwt_body) | ||
178 | { | ||
179 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | ||
180 | "Failed to parse JSON %s\n", jwt_string); | ||
181 | GNUNET_free (jwt_string); | ||
182 | return attrs; | ||
183 | } | ||
171 | GNUNET_STRINGS_base64url_decode (jwt_body, strlen (jwt_body), | 184 | GNUNET_STRINGS_base64url_decode (jwt_body, strlen (jwt_body), |
172 | (void **) &decoded_jwt); | 185 | (void **) &decoded_jwt); |
173 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Decoded JWT: %s\n", decoded_jwt); | 186 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Decoded JWT: %s\n", decoded_jwt); |