diff options
author | Schanzenbach, Martin <mschanzenbach@posteo.de> | 2019-05-22 16:25:38 +0200 |
---|---|---|
committer | Schanzenbach, Martin <mschanzenbach@posteo.de> | 2019-05-22 16:25:38 +0200 |
commit | b2e257ecb9c82b19f6ab23431faa3605718d3f01 (patch) | |
tree | 767b8cf35d6e1c9a741ee7e87f33dc852a6593cc /src/reclaim/oidc_helper.c | |
parent | f9c41505dd2ad80d08d6b516c534df0a66ea55fc (diff) | |
download | gnunet-b2e257ecb9c82b19f6ab23431faa3605718d3f01.tar.gz gnunet-b2e257ecb9c82b19f6ab23431faa3605718d3f01.zip |
clang-format and cleanup
Diffstat (limited to 'src/reclaim/oidc_helper.c')
-rw-r--r-- | src/reclaim/oidc_helper.c | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/src/reclaim/oidc_helper.c b/src/reclaim/oidc_helper.c index 167ee1729..6a06d5440 100644 --- a/src/reclaim/oidc_helper.c +++ b/src/reclaim/oidc_helper.c | |||
@@ -1,22 +1,22 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of GNUnet | 2 | This file is part of GNUnet |
3 | Copyright (C) 2010-2015 GNUnet e.V. | 3 | Copyright (C) 2010-2015 GNUnet e.V. |
4 | 4 | ||
5 | GNUnet is free software: you can redistribute it and/or modify it | 5 | GNUnet is free software: you can redistribute it and/or modify it |
6 | under the terms of the GNU Affero General Public License as published | 6 | under the terms of the GNU Affero General Public License as published |
7 | by the Free Software Foundation, either version 3 of the License, | 7 | by the Free Software Foundation, either version 3 of the License, |
8 | or (at your option) any later version. | 8 | or (at your option) any later version. |
9 | 9 | ||
10 | GNUnet is distributed in the hope that it will be useful, but | 10 | GNUnet is distributed in the hope that it will be useful, but |
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Affero General Public License for more details. | 13 | Affero General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Affero General Public License | 15 | You should have received a copy of the GNU Affero General Public License |
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
18 | SPDX-License-Identifier: AGPL3.0-or-later | 18 | SPDX-License-Identifier: AGPL3.0-or-later |
19 | */ | 19 | */ |
20 | 20 | ||
21 | /** | 21 | /** |
22 | * @file reclaim/oidc_helper.c | 22 | * @file reclaim/oidc_helper.c |
@@ -26,13 +26,13 @@ | |||
26 | #include "platform.h" | 26 | #include "platform.h" |
27 | #include <inttypes.h> | 27 | #include <inttypes.h> |
28 | #include <jansson.h> | 28 | #include <jansson.h> |
29 | |||
30 | #include "gnunet_util_lib.h" | 29 | #include "gnunet_util_lib.h" |
31 | |||
32 | #include "gnunet_reclaim_attribute_lib.h" | 30 | #include "gnunet_reclaim_attribute_lib.h" |
33 | #include "gnunet_reclaim_service.h" | 31 | #include "gnunet_reclaim_service.h" |
34 | #include "gnunet_signatures.h" | 32 | #include "gnunet_signatures.h" |
35 | #include "oidc_helper.h" | 33 | #include "oidc_helper.h" |
34 | |||
35 | |||
36 | static char * | 36 | static char * |
37 | create_jwt_header (void) | 37 | create_jwt_header (void) |
38 | { | 38 | { |
@@ -308,7 +308,7 @@ derive_aes_key (struct GNUNET_CRYPTO_SymmetricSessionKey *key, | |||
308 | NULL); | 308 | NULL); |
309 | GNUNET_CRYPTO_kdf (iv, | 309 | GNUNET_CRYPTO_kdf (iv, |
310 | sizeof ( | 310 | sizeof ( |
311 | struct GNUNET_CRYPTO_SymmetricInitializationVector), | 311 | struct GNUNET_CRYPTO_SymmetricInitializationVector), |
312 | ctx_iv, | 312 | ctx_iv, |
313 | strlen (ctx_iv), | 313 | strlen (ctx_iv), |
314 | key_material, | 314 | key_material, |
@@ -368,7 +368,7 @@ encrypt_payload (const struct GNUNET_CRYPTO_EcdsaPublicKey *ecdsa_pub, | |||
368 | 368 | ||
369 | calculate_key_pub (&key, &iv, ecdsa_pub, ecdh_priv); | 369 | calculate_key_pub (&key, &iv, ecdsa_pub, ecdh_priv); |
370 | GNUNET_break ( | 370 | GNUNET_break ( |
371 | GNUNET_CRYPTO_symmetric_encrypt (payload, payload_len, &key, &iv, buf)); | 371 | GNUNET_CRYPTO_symmetric_encrypt (payload, payload_len, &key, &iv, buf)); |
372 | } | 372 | } |
373 | 373 | ||
374 | 374 | ||
@@ -416,9 +416,9 @@ OIDC_build_authz_code (const struct GNUNET_CRYPTO_EcdsaPrivateKey *issuer, | |||
416 | GNUNET_RECLAIM_ATTRIBUTE_list_serialize (attrs, attrs_ser); | 416 | GNUNET_RECLAIM_ATTRIBUTE_list_serialize (attrs, attrs_ser); |
417 | } | 417 | } |
418 | code_payload_len = sizeof (struct GNUNET_CRYPTO_EccSignaturePurpose) + | 418 | code_payload_len = sizeof (struct GNUNET_CRYPTO_EccSignaturePurpose) + |
419 | sizeof (struct GNUNET_CRYPTO_EcdhePublicKey) + | 419 | sizeof (struct GNUNET_CRYPTO_EcdhePublicKey) + |
420 | signature_payload_len + | 420 | signature_payload_len + |
421 | sizeof (struct GNUNET_CRYPTO_EcdsaSignature); | 421 | sizeof (struct GNUNET_CRYPTO_EcdsaSignature); |
422 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 422 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
423 | "Length of data to encode: %lu\n", | 423 | "Length of data to encode: %lu\n", |
424 | code_payload_len); | 424 | code_payload_len); |
@@ -482,7 +482,7 @@ OIDC_build_authz_code (const struct GNUNET_CRYPTO_EcdsaPrivateKey *issuer, | |||
482 | GNUNET_CRYPTO_ecdsa_sign (issuer, | 482 | GNUNET_CRYPTO_ecdsa_sign (issuer, |
483 | purpose, | 483 | purpose, |
484 | (struct GNUNET_CRYPTO_EcdsaSignature *) | 484 | (struct GNUNET_CRYPTO_EcdsaSignature *) |
485 | buf_ptr)) | 485 | buf_ptr)) |
486 | { | 486 | { |
487 | GNUNET_break (0); | 487 | GNUNET_break (0); |
488 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Unable to sign code\n"); | 488 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Unable to sign code\n"); |
@@ -532,10 +532,10 @@ OIDC_parse_authz_code (const struct GNUNET_CRYPTO_EcdsaPrivateKey *ecdsa_priv, | |||
532 | code_payload_len = | 532 | code_payload_len = |
533 | GNUNET_STRINGS_base64_decode (code, strlen (code), (void **) &code_payload); | 533 | GNUNET_STRINGS_base64_decode (code, strlen (code), (void **) &code_payload); |
534 | if (code_payload_len < sizeof (struct GNUNET_CRYPTO_EccSignaturePurpose) + | 534 | if (code_payload_len < sizeof (struct GNUNET_CRYPTO_EccSignaturePurpose) + |
535 | sizeof (struct GNUNET_CRYPTO_EcdhePublicKey) + | 535 | sizeof (struct GNUNET_CRYPTO_EcdhePublicKey) + |
536 | sizeof (struct GNUNET_RECLAIM_Ticket) + | 536 | sizeof (struct GNUNET_RECLAIM_Ticket) + |
537 | sizeof (uint32_t) + | 537 | sizeof (uint32_t) + |
538 | sizeof (struct GNUNET_CRYPTO_EcdsaSignature)) | 538 | sizeof (struct GNUNET_CRYPTO_EcdsaSignature)) |
539 | { | 539 | { |
540 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Authorization code malformed\n"); | 540 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Authorization code malformed\n"); |
541 | GNUNET_free_non_null (code_payload); | 541 | GNUNET_free_non_null (code_payload); |