diff options
Diffstat (limited to 'src/reclaim/plugin_rest_pabc.c')
-rw-r--r-- | src/reclaim/plugin_rest_pabc.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/src/reclaim/plugin_rest_pabc.c b/src/reclaim/plugin_rest_pabc.c index 9c1ac3c47..6603fb888 100644 --- a/src/reclaim/plugin_rest_pabc.c +++ b/src/reclaim/plugin_rest_pabc.c | |||
@@ -259,9 +259,23 @@ set_attributes_from_idtoken (const struct pabc_context *ctx, | |||
259 | continue; | 259 | continue; |
260 | if (0 == strcmp ("aud", key)) | 260 | if (0 == strcmp ("aud", key)) |
261 | continue; | 261 | continue; |
262 | char *tmp_val; | ||
263 | if (json_is_string (value)) | ||
264 | tmp_val = GNUNET_strdup (json_string_value (value)); | ||
265 | else | ||
266 | tmp_val = json_dumps (value, JSON_ENCODE_ANY); | ||
267 | if (NULL == tmp_val) | ||
268 | { | ||
269 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | ||
270 | "Unable to encode JSON value for `%s'\n", key); | ||
271 | continue; | ||
272 | } | ||
273 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | ||
274 | "Setting `%s' to `%s'\n", key, tmp_val); | ||
262 | status = pabc_set_attribute_value_by_name (ctx, pp, usr_ctx, | 275 | status = pabc_set_attribute_value_by_name (ctx, pp, usr_ctx, |
263 | pabc_key, | 276 | pabc_key, |
264 | json_string_value (value)); | 277 | tmp_val); |
278 | GNUNET_free (tmp_val); | ||
265 | if (PABC_OK != status) | 279 | if (PABC_OK != status) |
266 | { | 280 | { |
267 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | 281 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, |
@@ -501,7 +515,8 @@ cr_cont (struct GNUNET_REST_RequestHandle *con_handle, | |||
501 | } | 515 | } |
502 | handle->resp_object = json_object (); | 516 | handle->resp_object = json_object (); |
503 | GNUNET_assert (PABC_OK == pabc_cred_encode_cr (ctx, pp, cr, | 517 | GNUNET_assert (PABC_OK == pabc_cred_encode_cr (ctx, pp, cr, |
504 | json_string_value (identity_json), | 518 | json_string_value ( |
519 | identity_json), | ||
505 | ppid, &response_str)); | 520 | ppid, &response_str)); |
506 | if (PABC_OK != status) | 521 | if (PABC_OK != status) |
507 | { | 522 | { |