summaryrefslogtreecommitdiff
path: root/src/util/crypto_wire.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2020-04-08 18:18:20 +0200
committerChristian Grothoff <christian@grothoff.org>2020-04-08 18:18:20 +0200
commit50bc862a684f8c5d4e3ece2712322bf078fe604f (patch)
tree54d4facce006a8437c58e64e7f2106a3487cba83 /src/util/crypto_wire.c
parentb22ec7570e830a3f71ed7c33b23879b2c3385387 (diff)
downloadexchange-50bc862a684f8c5d4e3ece2712322bf078fe604f.tar.gz
exchange-50bc862a684f8c5d4e3ece2712322bf078fe604f.tar.bz2
exchange-50bc862a684f8c5d4e3ece2712322bf078fe604f.zip
adapt to new GNUnet sign API (#6164)
Diffstat (limited to 'src/util/crypto_wire.c')
-rw-r--r--src/util/crypto_wire.c46
1 files changed, 24 insertions, 22 deletions
diff --git a/src/util/crypto_wire.c b/src/util/crypto_wire.c
index 6fdf65511..7aaf7d15d 100644
--- a/src/util/crypto_wire.c
+++ b/src/util/crypto_wire.c
@@ -59,14 +59,15 @@ TALER_exchange_wire_signature_check (
const struct TALER_MasterPublicKeyP *master_pub,
const struct TALER_MasterSignatureP *master_sig)
{
- struct TALER_MasterWireDetailsPS wd;
+ struct TALER_MasterWireDetailsPS wd = {
+ .purpose.purpose = htonl (TALER_SIGNATURE_MASTER_WIRE_DETAILS),
+ .purpose.size = htonl (sizeof (wd))
+ };
- wd.purpose.purpose = htonl (TALER_SIGNATURE_MASTER_WIRE_DETAILS);
- wd.purpose.size = htonl (sizeof (wd));
TALER_exchange_wire_signature_hash (payto_uri,
&wd.h_wire_details);
return GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_MASTER_WIRE_DETAILS,
- &wd.purpose,
+ &wd,
&master_sig->eddsa_signature,
&master_pub->eddsa_pub);
}
@@ -85,16 +86,16 @@ TALER_exchange_wire_signature_make (
const struct TALER_MasterPrivateKeyP *master_priv,
struct TALER_MasterSignatureP *master_sig)
{
- struct TALER_MasterWireDetailsPS wd;
+ struct TALER_MasterWireDetailsPS wd = {
+ .purpose.purpose = htonl (TALER_SIGNATURE_MASTER_WIRE_DETAILS),
+ .purpose.size = htonl (sizeof (wd))
+ };
- wd.purpose.purpose = htonl (TALER_SIGNATURE_MASTER_WIRE_DETAILS);
- wd.purpose.size = htonl (sizeof (wd));
TALER_exchange_wire_signature_hash (payto_uri,
&wd.h_wire_details);
- GNUNET_assert (GNUNET_OK ==
- GNUNET_CRYPTO_eddsa_sign (&master_priv->eddsa_priv,
- &wd.purpose,
- &master_sig->eddsa_signature));
+ GNUNET_CRYPTO_eddsa_sign (&master_priv->eddsa_priv,
+ &wd,
+ &master_sig->eddsa_signature);
}
@@ -149,15 +150,16 @@ TALER_merchant_wire_signature_check (
const struct TALER_MerchantPublicKeyP *merch_pub,
const struct TALER_MerchantSignatureP *merch_sig)
{
- struct TALER_MasterWireDetailsPS wd;
+ struct TALER_MasterWireDetailsPS wd = {
+ .purpose.purpose = htonl (TALER_SIGNATURE_MERCHANT_WIRE_DETAILS),
+ .purpose.size = htonl (sizeof (wd))
+ };
- wd.purpose.purpose = htonl (TALER_SIGNATURE_MERCHANT_WIRE_DETAILS);
- wd.purpose.size = htonl (sizeof (wd));
TALER_merchant_wire_signature_hash (payto_uri,
salt,
&wd.h_wire_details);
return GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_MERCHANT_WIRE_DETAILS,
- &wd.purpose,
+ &wd,
&merch_sig->eddsa_sig,
&merch_pub->eddsa_pub);
}
@@ -178,17 +180,17 @@ TALER_merchant_wire_signature_make (
const struct TALER_MerchantPrivateKeyP *merch_priv,
struct TALER_MerchantSignatureP *merch_sig)
{
- struct TALER_MasterWireDetailsPS wd;
+ struct TALER_MasterWireDetailsPS wd = {
+ .purpose.purpose = htonl (TALER_SIGNATURE_MERCHANT_WIRE_DETAILS),
+ .purpose.size = htonl (sizeof (wd))
+ };
- wd.purpose.purpose = htonl (TALER_SIGNATURE_MERCHANT_WIRE_DETAILS);
- wd.purpose.size = htonl (sizeof (wd));
TALER_merchant_wire_signature_hash (payto_uri,
salt,
&wd.h_wire_details);
- GNUNET_assert (GNUNET_OK ==
- GNUNET_CRYPTO_eddsa_sign (&merch_priv->eddsa_priv,
- &wd.purpose,
- &merch_sig->eddsa_sig));
+ GNUNET_CRYPTO_eddsa_sign (&merch_priv->eddsa_priv,
+ &wd,
+ &merch_sig->eddsa_sig);
}