diff options
author | Schanzenbach, Martin <mschanzenbach@posteo.de> | 2019-04-27 09:22:00 +0200 |
---|---|---|
committer | Schanzenbach, Martin <mschanzenbach@posteo.de> | 2019-04-27 09:22:00 +0200 |
commit | fcad7dd854dd485bc992e6d29408b5b1f27907d5 (patch) | |
tree | d6d47451acd8254f7a6370e7ff78e12931644867 /src/reclaim/oidc_helper.c | |
parent | 9f4ff53b108ebb7048414d6b5ab966db4b772a09 (diff) | |
download | gnunet-fcad7dd854dd485bc992e6d29408b5b1f27907d5.tar.gz gnunet-fcad7dd854dd485bc992e6d29408b5b1f27907d5.zip |
fix corruption
Diffstat (limited to 'src/reclaim/oidc_helper.c')
-rw-r--r-- | src/reclaim/oidc_helper.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/reclaim/oidc_helper.c b/src/reclaim/oidc_helper.c index 11641e166..7b4d8ee37 100644 --- a/src/reclaim/oidc_helper.c +++ b/src/reclaim/oidc_helper.c | |||
@@ -325,6 +325,9 @@ OIDC_build_authz_code (const struct GNUNET_CRYPTO_EcdsaPrivateKey *issuer, | |||
325 | if (NULL != attrs) | 325 | if (NULL != attrs) |
326 | { | 326 | { |
327 | attr_list_len = GNUNET_RECLAIM_ATTRIBUTE_list_serialize_get_size (attrs); | 327 | attr_list_len = GNUNET_RECLAIM_ATTRIBUTE_list_serialize_get_size (attrs); |
328 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
329 | "Length of serialized attributes: %lu\n", | ||
330 | attr_list_len); | ||
328 | signature_payload_len += attr_list_len; | 331 | signature_payload_len += attr_list_len; |
329 | attrs_ser = GNUNET_malloc (attr_list_len); | 332 | attrs_ser = GNUNET_malloc (attr_list_len); |
330 | GNUNET_RECLAIM_ATTRIBUTE_list_serialize (attrs, attrs_ser); | 333 | GNUNET_RECLAIM_ATTRIBUTE_list_serialize (attrs, attrs_ser); |
@@ -332,7 +335,11 @@ OIDC_build_authz_code (const struct GNUNET_CRYPTO_EcdsaPrivateKey *issuer, | |||
332 | code_payload_len = sizeof (struct GNUNET_CRYPTO_EccSignaturePurpose) + | 335 | code_payload_len = sizeof (struct GNUNET_CRYPTO_EccSignaturePurpose) + |
333 | signature_payload_len + | 336 | signature_payload_len + |
334 | sizeof (struct GNUNET_CRYPTO_EcdsaSignature); | 337 | sizeof (struct GNUNET_CRYPTO_EcdsaSignature); |
338 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
339 | "Length of data to encode: %lu\n", | ||
340 | code_payload_len); | ||
335 | code_payload = GNUNET_malloc (code_payload_len); | 341 | code_payload = GNUNET_malloc (code_payload_len); |
342 | GNUNET_assert (NULL != code_payload); | ||
336 | purpose = (struct GNUNET_CRYPTO_EccSignaturePurpose *) code_payload; | 343 | purpose = (struct GNUNET_CRYPTO_EccSignaturePurpose *) code_payload; |
337 | purpose->size = htonl (sizeof (struct GNUNET_CRYPTO_EccSignaturePurpose) + | 344 | purpose->size = htonl (sizeof (struct GNUNET_CRYPTO_EccSignaturePurpose) + |
338 | signature_payload_len); | 345 | signature_payload_len); |
@@ -375,7 +382,7 @@ OIDC_build_authz_code (const struct GNUNET_CRYPTO_EcdsaPrivateKey *issuer, | |||
375 | GNUNET_free_non_null (attrs_ser); | 382 | GNUNET_free_non_null (attrs_ser); |
376 | return NULL; | 383 | return NULL; |
377 | } | 384 | } |
378 | code_str = base64_encode ((const char *) &code_payload, code_payload_len); | 385 | code_str = base64_encode (code_payload, code_payload_len); |
379 | GNUNET_free (code_payload); | 386 | GNUNET_free (code_payload); |
380 | GNUNET_free_non_null (attrs_ser); | 387 | GNUNET_free_non_null (attrs_ser); |
381 | return code_str; | 388 | return code_str; |