donau

Donation authority for GNU Taler (experimental)
Log | Files | Refs | Submodules | README | LICENSE

commit 1d1fd4d2ab2e0c132b7c738c2f58d6d7e69a81f8
parent 9f848d7f8239cb28a36e682f689e8221f9f67a06
Author: Matyja Lukas Adam <lukas.matyja@students.bfh.ch>
Date:   Wed, 12 Jun 2024 13:18:08 +0200

eddsa return public key correctly

Diffstat:
Msrc/donau/donau-httpd_keys.c | 39+++++++--------------------------------
Msrc/testing/testing_api_cmd_donation_statement_get.c | 31++++++++++++++++---------------
2 files changed, 23 insertions(+), 47 deletions(-)

diff --git a/src/donau/donau-httpd_keys.c b/src/donau/donau-httpd_keys.c @@ -1246,43 +1246,18 @@ DH_keys_donau_sign_ ( } /* need to "cast" because TALER_CRYPTO works with TALER_Exchange.. */ - struct TALER_ExchangePublicKeyP donau_pub = { - .eddsa_pub = pub->eddsa_pub - }; - struct TALER_ExchangeSignatureP donau_sig = { - .eddsa_signature = sig->eddsa_sig - }; + struct TALER_ExchangePublicKeyP donau_pub; + struct TALER_ExchangeSignatureP donau_sig; ec = TALER_CRYPTO_helper_esign_sign_ (esh, purpose, &donau_pub, &donau_sig); - // FIXME: To delete: We dont have offline keys! - // if (TALER_EC_NONE != ec) - // return ec; - // { - // /* Here we check here that 'pub' is set to an exchange public key that is - // actually signed by the master key! Otherwise, we happily continue to - // use key material even if the offline signatures have not been made - // yet! */ - // struct GNUNET_PeerIdentity pid; - // struct SigningKey *sk; - - // pid.public_key = pub->eddsa_pub; - // sk = GNUNET_CONTAINER_multipeermap_get (esign_keys, - // &pid); - // if (NULL == sk) - // { - // /* just to be safe, zero out the (valid) signature, as the key - // should not or no longer be used */ - // GNUNET_log (GNUNET_ERROR_TYPE_WARNING, - // "Cannot sign, offline key signatures are missing!\n"); - // memset (sig, - // 0, - // sizeof (*sig)); - // return TALER_EC_DONAU_SIGNKEY_HELPER_BUG; - // } - // } + if (TALER_EC_NONE != ec) + return ec; + pub->eddsa_pub = donau_pub.eddsa_pub; + sig->eddsa_sig = donau_sig.eddsa_signature; + return ec; } diff --git a/src/testing/testing_api_cmd_donation_statement_get.c b/src/testing/testing_api_cmd_donation_statement_get.c @@ -111,23 +111,24 @@ donation_statement_status_cb (void *cls, ss->donation_statement.donation_statement_sig = dsr->details.ok.donation_statement_sig; - //FIXME: check the authenticity of the eddsa key (existence in ss->keys) - for (unsigned int i = 0; i < ss->keys->num_sign_keys; i++) { - if (GNUNET_OK == DONAU_donation_statement_verify ( - &ss->donation_statement.total_amount, - ss->donation_statement.year, - ss->donation_statement. - h_donor_tax_id, - &ss->keys->sign_keys[i].key, - &ss->donation_statement. - donation_statement_sig)) - { - TALER_TESTING_interpreter_next (ss->is); - return; - } + // FIXME: check the authenticity of the eddsa key (existence in ss->keys) + for (unsigned int i = 0; i < ss->keys->num_sign_keys; i++) + { + if (GNUNET_OK == DONAU_donation_statement_verify ( + &ss->donation_statement.total_amount, + ss->donation_statement.year, + ss->donation_statement. + h_donor_tax_id, + &ss->keys->sign_keys[i].key, + &ss->donation_statement. + donation_statement_sig)) + { + TALER_TESTING_interpreter_next (ss->is); + return; + } } GNUNET_log (GNUNET_ERROR_TYPE_ERROR, - "Verify donation statement signature failed!"); + "Verify donation statement signature failed!"); TALER_TESTING_interpreter_fail (ss->is); return; }