diff options
Diffstat (limited to 'src/reclaim/oidc_helper.c')
-rw-r--r-- | src/reclaim/oidc_helper.c | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/src/reclaim/oidc_helper.c b/src/reclaim/oidc_helper.c index 90c33375f..a2da7312b 100644 --- a/src/reclaim/oidc_helper.c +++ b/src/reclaim/oidc_helper.c | |||
@@ -158,7 +158,7 @@ fix_base64 (char *str) | |||
158 | 158 | ||
159 | 159 | ||
160 | static json_t* | 160 | static json_t* |
161 | generate_userinfo_json (const struct GNUNET_IDENTITY_PublicKey *sub_key, | 161 | generate_userinfo_json (const struct GNUNET_CRYPTO_PublicKey *sub_key, |
162 | const struct GNUNET_RECLAIM_AttributeList *attrs, | 162 | const struct GNUNET_RECLAIM_AttributeList *attrs, |
163 | const struct | 163 | const struct |
164 | GNUNET_RECLAIM_PresentationList *presentations) | 164 | GNUNET_RECLAIM_PresentationList *presentations) |
@@ -184,7 +184,7 @@ generate_userinfo_json (const struct GNUNET_IDENTITY_PublicKey *sub_key, | |||
184 | subject = | 184 | subject = |
185 | GNUNET_STRINGS_data_to_string_alloc (sub_key, | 185 | GNUNET_STRINGS_data_to_string_alloc (sub_key, |
186 | sizeof(struct | 186 | sizeof(struct |
187 | GNUNET_IDENTITY_PublicKey)); | 187 | GNUNET_CRYPTO_PublicKey)); |
188 | body = json_object (); | 188 | body = json_object (); |
189 | aggr_names = json_object (); | 189 | aggr_names = json_object (); |
190 | aggr_sources = json_object (); | 190 | aggr_sources = json_object (); |
@@ -343,7 +343,7 @@ generate_userinfo_json (const struct GNUNET_IDENTITY_PublicKey *sub_key, | |||
343 | * @return Userinfo JSON | 343 | * @return Userinfo JSON |
344 | */ | 344 | */ |
345 | char * | 345 | char * |
346 | OIDC_generate_userinfo (const struct GNUNET_IDENTITY_PublicKey *sub_key, | 346 | OIDC_generate_userinfo (const struct GNUNET_CRYPTO_PublicKey *sub_key, |
347 | const struct GNUNET_RECLAIM_AttributeList *attrs, | 347 | const struct GNUNET_RECLAIM_AttributeList *attrs, |
348 | const struct | 348 | const struct |
349 | GNUNET_RECLAIM_PresentationList *presentations) | 349 | GNUNET_RECLAIM_PresentationList *presentations) |
@@ -359,8 +359,8 @@ OIDC_generate_userinfo (const struct GNUNET_IDENTITY_PublicKey *sub_key, | |||
359 | 359 | ||
360 | 360 | ||
361 | char * | 361 | char * |
362 | generate_id_token_body (const struct GNUNET_IDENTITY_PublicKey *aud_key, | 362 | generate_id_token_body (const struct GNUNET_CRYPTO_PublicKey *aud_key, |
363 | const struct GNUNET_IDENTITY_PublicKey *sub_key, | 363 | const struct GNUNET_CRYPTO_PublicKey *sub_key, |
364 | const struct GNUNET_RECLAIM_AttributeList *attrs, | 364 | const struct GNUNET_RECLAIM_AttributeList *attrs, |
365 | const struct | 365 | const struct |
366 | GNUNET_RECLAIM_PresentationList *presentations, | 366 | GNUNET_RECLAIM_PresentationList *presentations, |
@@ -387,11 +387,11 @@ generate_id_token_body (const struct GNUNET_IDENTITY_PublicKey *aud_key, | |||
387 | subject = | 387 | subject = |
388 | GNUNET_STRINGS_data_to_string_alloc (sub_key, | 388 | GNUNET_STRINGS_data_to_string_alloc (sub_key, |
389 | sizeof(struct | 389 | sizeof(struct |
390 | GNUNET_IDENTITY_PublicKey)); | 390 | GNUNET_CRYPTO_PublicKey)); |
391 | audience = | 391 | audience = |
392 | GNUNET_STRINGS_data_to_string_alloc (aud_key, | 392 | GNUNET_STRINGS_data_to_string_alloc (aud_key, |
393 | sizeof(struct | 393 | sizeof(struct |
394 | GNUNET_IDENTITY_PublicKey)); | 394 | GNUNET_CRYPTO_PublicKey)); |
395 | 395 | ||
396 | // aud REQUIRED public key client_id must be there | 396 | // aud REQUIRED public key client_id must be there |
397 | json_object_set_new (body, "aud", json_string (audience)); | 397 | json_object_set_new (body, "aud", json_string (audience)); |
@@ -424,8 +424,8 @@ generate_id_token_body (const struct GNUNET_IDENTITY_PublicKey *aud_key, | |||
424 | 424 | ||
425 | 425 | ||
426 | char * | 426 | char * |
427 | OIDC_generate_id_token_rsa (const struct GNUNET_IDENTITY_PublicKey *aud_key, | 427 | OIDC_generate_id_token_rsa (const struct GNUNET_CRYPTO_PublicKey *aud_key, |
428 | const struct GNUNET_IDENTITY_PublicKey *sub_key, | 428 | const struct GNUNET_CRYPTO_PublicKey *sub_key, |
429 | const struct GNUNET_RECLAIM_AttributeList *attrs, | 429 | const struct GNUNET_RECLAIM_AttributeList *attrs, |
430 | const struct | 430 | const struct |
431 | GNUNET_RECLAIM_PresentationList *presentations, | 431 | GNUNET_RECLAIM_PresentationList *presentations, |
@@ -486,8 +486,8 @@ OIDC_generate_id_token_rsa (const struct GNUNET_IDENTITY_PublicKey *aud_key, | |||
486 | * @return a new base64-encoded JWT string. | 486 | * @return a new base64-encoded JWT string. |
487 | */ | 487 | */ |
488 | char * | 488 | char * |
489 | OIDC_generate_id_token_hmac (const struct GNUNET_IDENTITY_PublicKey *aud_key, | 489 | OIDC_generate_id_token_hmac (const struct GNUNET_CRYPTO_PublicKey *aud_key, |
490 | const struct GNUNET_IDENTITY_PublicKey *sub_key, | 490 | const struct GNUNET_CRYPTO_PublicKey *sub_key, |
491 | const struct GNUNET_RECLAIM_AttributeList *attrs, | 491 | const struct GNUNET_RECLAIM_AttributeList *attrs, |
492 | const struct | 492 | const struct |
493 | GNUNET_RECLAIM_PresentationList *presentations, | 493 | GNUNET_RECLAIM_PresentationList *presentations, |
@@ -578,7 +578,7 @@ OIDC_generate_id_token_hmac (const struct GNUNET_IDENTITY_PublicKey *aud_key, | |||
578 | * @return a new authorization code (caller must free) | 578 | * @return a new authorization code (caller must free) |
579 | */ | 579 | */ |
580 | char * | 580 | char * |
581 | OIDC_build_authz_code (const struct GNUNET_IDENTITY_PrivateKey *issuer, | 581 | OIDC_build_authz_code (const struct GNUNET_CRYPTO_PrivateKey *issuer, |
582 | const struct GNUNET_RECLAIM_Ticket *ticket, | 582 | const struct GNUNET_RECLAIM_Ticket *ticket, |
583 | const struct GNUNET_RECLAIM_AttributeList *attrs, | 583 | const struct GNUNET_RECLAIM_AttributeList *attrs, |
584 | const struct | 584 | const struct |
@@ -671,7 +671,7 @@ OIDC_build_authz_code (const struct GNUNET_IDENTITY_PrivateKey *issuer, | |||
671 | // Get length | 671 | // Get length |
672 | code_payload_len = sizeof(struct GNUNET_CRYPTO_EccSignaturePurpose) | 672 | code_payload_len = sizeof(struct GNUNET_CRYPTO_EccSignaturePurpose) |
673 | + payload_len + sizeof(struct | 673 | + payload_len + sizeof(struct |
674 | GNUNET_IDENTITY_Signature); | 674 | GNUNET_CRYPTO_Signature); |
675 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 675 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
676 | "Length of data to encode: %lu\n", | 676 | "Length of data to encode: %lu\n", |
677 | code_payload_len); | 677 | code_payload_len); |
@@ -690,9 +690,9 @@ OIDC_build_authz_code (const struct GNUNET_IDENTITY_PrivateKey *issuer, | |||
690 | buf_ptr += payload_len; | 690 | buf_ptr += payload_len; |
691 | // Sign and store signature | 691 | // Sign and store signature |
692 | if (GNUNET_SYSERR == | 692 | if (GNUNET_SYSERR == |
693 | GNUNET_IDENTITY_sign_ (issuer, | 693 | GNUNET_CRYPTO_sign_ (issuer, |
694 | purpose, | 694 | purpose, |
695 | (struct GNUNET_IDENTITY_Signature *) | 695 | (struct GNUNET_CRYPTO_Signature *) |
696 | buf_ptr)) | 696 | buf_ptr)) |
697 | { | 697 | { |
698 | GNUNET_break (0); | 698 | GNUNET_break (0); |
@@ -764,7 +764,7 @@ check_code_challenge (const char *code_challenge, | |||
764 | * @return GNUNET_OK if successful, else GNUNET_SYSERR | 764 | * @return GNUNET_OK if successful, else GNUNET_SYSERR |
765 | */ | 765 | */ |
766 | int | 766 | int |
767 | OIDC_parse_authz_code (const struct GNUNET_IDENTITY_PublicKey *audience, | 767 | OIDC_parse_authz_code (const struct GNUNET_CRYPTO_PublicKey *audience, |
768 | const char *code, | 768 | const char *code, |
769 | const char *code_verifier, | 769 | const char *code_verifier, |
770 | struct GNUNET_RECLAIM_Ticket *ticket, | 770 | struct GNUNET_RECLAIM_Ticket *ticket, |
@@ -780,7 +780,7 @@ OIDC_parse_authz_code (const struct GNUNET_IDENTITY_PublicKey *audience, | |||
780 | char *presentations_ser; | 780 | char *presentations_ser; |
781 | char *code_challenge; | 781 | char *code_challenge; |
782 | struct GNUNET_CRYPTO_EccSignaturePurpose *purpose; | 782 | struct GNUNET_CRYPTO_EccSignaturePurpose *purpose; |
783 | struct GNUNET_IDENTITY_Signature *signature; | 783 | struct GNUNET_CRYPTO_Signature *signature; |
784 | uint32_t code_challenge_len; | 784 | uint32_t code_challenge_len; |
785 | uint32_t attrs_ser_len; | 785 | uint32_t attrs_ser_len; |
786 | uint32_t pres_ser_len; | 786 | uint32_t pres_ser_len; |
@@ -796,7 +796,7 @@ OIDC_parse_authz_code (const struct GNUNET_IDENTITY_PublicKey *audience, | |||
796 | (void **) &code_payload); | 796 | (void **) &code_payload); |
797 | if (code_payload_len < sizeof(struct GNUNET_CRYPTO_EccSignaturePurpose) | 797 | if (code_payload_len < sizeof(struct GNUNET_CRYPTO_EccSignaturePurpose) |
798 | + sizeof(struct OIDC_Parameters) | 798 | + sizeof(struct OIDC_Parameters) |
799 | + sizeof(struct GNUNET_IDENTITY_Signature)) | 799 | + sizeof(struct GNUNET_CRYPTO_Signature)) |
800 | { | 800 | { |
801 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Authorization code malformed\n"); | 801 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Authorization code malformed\n"); |
802 | GNUNET_free (code_payload); | 802 | GNUNET_free (code_payload); |
@@ -807,10 +807,10 @@ OIDC_parse_authz_code (const struct GNUNET_IDENTITY_PublicKey *audience, | |||
807 | plaintext_len = code_payload_len; | 807 | plaintext_len = code_payload_len; |
808 | plaintext_len -= sizeof(struct GNUNET_CRYPTO_EccSignaturePurpose); | 808 | plaintext_len -= sizeof(struct GNUNET_CRYPTO_EccSignaturePurpose); |
809 | ptr = (char *) &purpose[1]; | 809 | ptr = (char *) &purpose[1]; |
810 | plaintext_len -= sizeof(struct GNUNET_IDENTITY_Signature); | 810 | plaintext_len -= sizeof(struct GNUNET_CRYPTO_Signature); |
811 | plaintext = ptr; | 811 | plaintext = ptr; |
812 | ptr += plaintext_len; | 812 | ptr += plaintext_len; |
813 | signature = (struct GNUNET_IDENTITY_Signature *) ptr; | 813 | signature = (struct GNUNET_CRYPTO_Signature *) ptr; |
814 | params = (struct OIDC_Parameters *) plaintext; | 814 | params = (struct OIDC_Parameters *) plaintext; |
815 | 815 | ||
816 | // cmp code_challenge code_verifier | 816 | // cmp code_challenge code_verifier |
@@ -848,7 +848,7 @@ OIDC_parse_authz_code (const struct GNUNET_IDENTITY_PublicKey *audience, | |||
848 | return GNUNET_SYSERR; | 848 | return GNUNET_SYSERR; |
849 | } | 849 | } |
850 | if (GNUNET_OK != | 850 | if (GNUNET_OK != |
851 | GNUNET_IDENTITY_signature_verify_ ( | 851 | GNUNET_CRYPTO_signature_verify_ ( |
852 | GNUNET_SIGNATURE_PURPOSE_RECLAIM_CODE_SIGN, | 852 | GNUNET_SIGNATURE_PURPOSE_RECLAIM_CODE_SIGN, |
853 | purpose, | 853 | purpose, |
854 | signature, | 854 | signature, |