summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2020-12-05 19:47:54 +0100
committerChristian Grothoff <christian@grothoff.org>2020-12-05 19:47:54 +0100
commit8170e1e9abaf00b9c27c8758998c4df37d77e757 (patch)
treed8dba0a93e22056b3b1410f9a3a824a829550312 /src/lib
parentc898ff53a24aa469bf7958081f7835bd515d7dc3 (diff)
downloadexchange-8170e1e9abaf00b9c27c8758998c4df37d77e757.tar.gz
exchange-8170e1e9abaf00b9c27c8758998c4df37d77e757.tar.bz2
exchange-8170e1e9abaf00b9c27c8758998c4df37d77e757.zip
move all TALER_SIGNATURE_SM_-operations to secmod_signatures.c
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/exchange_api_management_get_keys.c42
1 files changed, 18 insertions, 24 deletions
diff --git a/src/lib/exchange_api_management_get_keys.c b/src/lib/exchange_api_management_get_keys.c
index bfda08c7..35b191a1 100644
--- a/src/lib/exchange_api_management_get_keys.c
+++ b/src/lib/exchange_api_management_get_keys.c
@@ -25,6 +25,7 @@
#include "taler_exchange_service.h"
#include "taler_signatures.h"
#include "taler_curl_lib.h"
+#include "taler_crypto_lib.h"
#include "taler_json_lib.h"
/**
@@ -139,20 +140,14 @@ handle_ok (struct TALER_EXCHANGE_ManagementGetKeysHandle *gh,
struct GNUNET_TIME_Relative duration
= GNUNET_TIME_absolute_get_difference (sign_key->valid_from,
sign_key->valid_until);
- struct TALER_SigningKeyAnnouncementPS ska = {
- .purpose.purpose = htonl (TALER_SIGNATURE_SM_SIGNING_KEY),
- .purpose.size = htonl (sizeof (ska)),
- .exchange_pub = sign_key->key,
- .anchor_time = GNUNET_TIME_absolute_hton (sign_key->valid_from),
- .duration = GNUNET_TIME_relative_hton (duration)
- };
if (GNUNET_OK !=
- GNUNET_CRYPTO_eddsa_verify (
- TALER_SIGNATURE_SM_SIGNING_KEY,
- &ska,
- &sign_key->signkey_secmod_sig.eddsa_signature,
- &fk.signkey_secmod_public_key.eddsa_pub))
+ TALER_exchange_secmod_eddsa_verify (
+ &sign_key->key,
+ sign_key->valid_from,
+ duration,
+ &fk.signkey_secmod_public_key,
+ &sign_key->signkey_secmod_sig))
{
GNUNET_break_op (0);
ok = false;
@@ -166,7 +161,10 @@ handle_ok (struct TALER_EXCHANGE_ManagementGetKeysHandle *gh,
i);
struct TALER_EXCHANGE_FutureDenomPublicKey *denom_key
= &fk.denom_keys[i];
+ const char *section_name;
struct GNUNET_JSON_Specification spec[] = {
+ GNUNET_JSON_spec_string ("section_name",
+ &section_name),
GNUNET_JSON_spec_fixed_auto ("denom_secmod_sig",
&denom_key->denom_secmod_sig),
TALER_JSON_spec_absolute_time ("stamp_expire_deposit",
@@ -206,21 +204,17 @@ handle_ok (struct TALER_EXCHANGE_ManagementGetKeysHandle *gh,
struct GNUNET_TIME_Relative duration
= GNUNET_TIME_absolute_get_difference (denom_key->valid_from,
denom_key->withdraw_valid_until);
- struct TALER_DenominationKeyAnnouncementPS dka = {
- .purpose.purpose = htonl (TALER_SIGNATURE_SM_DENOMINATION_KEY),
- .purpose.size = htonl (sizeof (dka)),
- .anchor_time = GNUNET_TIME_absolute_hton (denom_key->valid_from),
- .duration_withdraw = GNUNET_TIME_relative_hton (duration)
- };
+ struct GNUNET_HashCode h_denom_pub;
GNUNET_CRYPTO_rsa_public_key_hash (denom_key->key.rsa_public_key,
- &dka.h_denom_pub);
+ &h_denom_pub);
if (GNUNET_OK !=
- GNUNET_CRYPTO_eddsa_verify (
- TALER_SIGNATURE_SM_DENOMINATION_KEY,
- &dka,
- &denom_key->denom_secmod_sig.eddsa_signature,
- &fk.denom_secmod_public_key.eddsa_pub))
+ TALER_exchange_secmod_rsa_verify (&h_denom_pub,
+ section_name,
+ denom_key->valid_from,
+ duration,
+ &fk.denom_secmod_public_key,
+ &denom_key->denom_secmod_sig))
{
GNUNET_break_op (0);
ok = false;