aboutsummaryrefslogtreecommitdiff
path: root/src/util/crypto_wire.c
diff options
context:
space:
mode:
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);
}