aboutsummaryrefslogtreecommitdiff
path: root/src/reclaim/oidc_helper.c
diff options
context:
space:
mode:
authorTheJackiMonster <thejackimonster@gmail.com>2020-11-05 22:04:41 +0100
committerTheJackiMonster <thejackimonster@gmail.com>2020-11-05 22:04:41 +0100
commitbd73336f5d7168f92574cf19703ec242c97e6062 (patch)
tree7fdb248c9a76ec78406406cf6f10faa79d8416c4 /src/reclaim/oidc_helper.c
parentc07ae5c8d29202466f066e4dcddbfd091513db7c (diff)
downloadgnunet-bd73336f5d7168f92574cf19703ec242c97e6062.tar.gz
gnunet-bd73336f5d7168f92574cf19703ec242c97e6062.zip
revocation and reclaim updated verification
Signed-off-by: TheJackiMonster <thejackimonster@gmail.com>
Diffstat (limited to 'src/reclaim/oidc_helper.c')
-rw-r--r--src/reclaim/oidc_helper.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/reclaim/oidc_helper.c b/src/reclaim/oidc_helper.c
index c3ff07976..0caa46b90 100644
--- a/src/reclaim/oidc_helper.c
+++ b/src/reclaim/oidc_helper.c
@@ -525,7 +525,7 @@ OIDC_build_authz_code (const struct GNUNET_IDENTITY_PrivateKey *issuer,
525 // Get length 525 // Get length
526 code_payload_len = sizeof(struct GNUNET_CRYPTO_EccSignaturePurpose) 526 code_payload_len = sizeof(struct GNUNET_CRYPTO_EccSignaturePurpose)
527 + payload_len + sizeof(struct 527 + payload_len + sizeof(struct
528 GNUNET_CRYPTO_EcdsaSignature); 528 GNUNET_IDENTITY_Signature);
529 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 529 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
530 "Length of data to encode: %lu\n", 530 "Length of data to encode: %lu\n",
531 code_payload_len); 531 code_payload_len);
@@ -544,10 +544,10 @@ OIDC_build_authz_code (const struct GNUNET_IDENTITY_PrivateKey *issuer,
544 buf_ptr += payload_len; 544 buf_ptr += payload_len;
545 // Sign and store signature 545 // Sign and store signature
546 if (GNUNET_SYSERR == 546 if (GNUNET_SYSERR ==
547 GNUNET_CRYPTO_ecdsa_sign_ (&issuer->ecdsa_key, 547 GNUNET_IDENTITY_private_key_sign_ (issuer,
548 purpose, 548 purpose,
549 (struct GNUNET_CRYPTO_EcdsaSignature *) 549 (struct GNUNET_IDENTITY_Signature *)
550 buf_ptr)) 550 buf_ptr))
551 { 551 {
552 GNUNET_break (0); 552 GNUNET_break (0);
553 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Unable to sign code\n"); 553 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Unable to sign code\n");
@@ -593,7 +593,7 @@ OIDC_parse_authz_code (const struct GNUNET_IDENTITY_PublicKey *audience,
593 char *code_challenge; 593 char *code_challenge;
594 char *code_verifier_hash; 594 char *code_verifier_hash;
595 struct GNUNET_CRYPTO_EccSignaturePurpose *purpose; 595 struct GNUNET_CRYPTO_EccSignaturePurpose *purpose;
596 struct GNUNET_CRYPTO_EcdsaSignature *signature; 596 struct GNUNET_IDENTITY_Signature *signature;
597 uint32_t code_challenge_len; 597 uint32_t code_challenge_len;
598 uint32_t attrs_ser_len; 598 uint32_t attrs_ser_len;
599 uint32_t pres_ser_len; 599 uint32_t pres_ser_len;
@@ -609,7 +609,7 @@ OIDC_parse_authz_code (const struct GNUNET_IDENTITY_PublicKey *audience,
609 (void **) &code_payload); 609 (void **) &code_payload);
610 if (code_payload_len < sizeof(struct GNUNET_CRYPTO_EccSignaturePurpose) 610 if (code_payload_len < sizeof(struct GNUNET_CRYPTO_EccSignaturePurpose)
611 + sizeof(struct OIDC_Parameters) 611 + sizeof(struct OIDC_Parameters)
612 + sizeof(struct GNUNET_CRYPTO_EcdsaSignature)) 612 + sizeof(struct GNUNET_IDENTITY_Signature))
613 { 613 {
614 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Authorization code malformed\n"); 614 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Authorization code malformed\n");
615 GNUNET_free (code_payload); 615 GNUNET_free (code_payload);
@@ -620,10 +620,10 @@ OIDC_parse_authz_code (const struct GNUNET_IDENTITY_PublicKey *audience,
620 plaintext_len = code_payload_len; 620 plaintext_len = code_payload_len;
621 plaintext_len -= sizeof(struct GNUNET_CRYPTO_EccSignaturePurpose); 621 plaintext_len -= sizeof(struct GNUNET_CRYPTO_EccSignaturePurpose);
622 ptr = (char *) &purpose[1]; 622 ptr = (char *) &purpose[1];
623 plaintext_len -= sizeof(struct GNUNET_CRYPTO_EcdsaSignature); 623 plaintext_len -= sizeof(struct GNUNET_IDENTITY_Signature);
624 plaintext = ptr; 624 plaintext = ptr;
625 ptr += plaintext_len; 625 ptr += plaintext_len;
626 signature = (struct GNUNET_CRYPTO_EcdsaSignature *) ptr; 626 signature = (struct GNUNET_IDENTITY_Signature *) ptr;
627 params = (struct OIDC_Parameters *) plaintext; 627 params = (struct OIDC_Parameters *) plaintext;
628 628
629 // cmp code_challenge code_verifier 629 // cmp code_challenge code_verifier
@@ -684,10 +684,10 @@ OIDC_parse_authz_code (const struct GNUNET_IDENTITY_PublicKey *audience,
684 return GNUNET_SYSERR; 684 return GNUNET_SYSERR;
685 } 685 }
686 if (GNUNET_OK != 686 if (GNUNET_OK !=
687 GNUNET_CRYPTO_ecdsa_verify_ (GNUNET_SIGNATURE_PURPOSE_RECLAIM_CODE_SIGN, 687 GNUNET_IDENTITY_public_key_verify_ (GNUNET_SIGNATURE_PURPOSE_RECLAIM_CODE_SIGN,
688 purpose, 688 purpose,
689 signature, 689 signature,
690 &ticket->identity.ecdsa_key)) 690 &(ticket->identity)))
691 { 691 {
692 GNUNET_free (code_payload); 692 GNUNET_free (code_payload);
693 if (NULL != *nonce_str) 693 if (NULL != *nonce_str)