From 50bc862a684f8c5d4e3ece2712322bf078fe604f Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Wed, 8 Apr 2020 18:18:20 +0200 Subject: adapt to new GNUnet sign API (#6164) --- src/util/crypto_wire.c | 46 ++++++++++++++++++++++++---------------------- 1 file changed, 24 insertions(+), 22 deletions(-) (limited to 'src/util') 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); } -- cgit v1.2.3