gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-exchange] branch master updated: -refactor to address FIXME


From: gnunet
Subject: [taler-exchange] branch master updated: -refactor to address FIXME
Date: Sat, 12 Feb 2022 12:20:14 +0100

This is an automated email from the git hooks/post-receive script.

grothoff pushed a commit to branch master
in repository exchange.

The following commit(s) were added to refs/heads/master by this push:
     new a0d9d59b -refactor to address FIXME
a0d9d59b is described below

commit a0d9d59b73a35f3060914372a70fbcc57e66998f
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Sat Feb 12 12:20:12 2022 +0100

    -refactor to address FIXME
---
 src/include/taler_crypto_lib.h    | 11 +++++++++++
 src/lib/exchange_api_kyc_wallet.c | 12 ++----------
 src/util/wallet_signatures.c      | 19 ++++++++++++++++++-
 3 files changed, 31 insertions(+), 11 deletions(-)

diff --git a/src/include/taler_crypto_lib.h b/src/include/taler_crypto_lib.h
index d6014259..959169cf 100644
--- a/src/include/taler_crypto_lib.h
+++ b/src/include/taler_crypto_lib.h
@@ -2151,6 +2151,17 @@ TALER_exchange_deposit_confirm_verify (
 
 /* ********************* wallet signing ************************** */
 
+/**
+ * Sign a request by a wallet to perform a KYC check.
+ *
+ * @param reserve_priv key identifying the wallet/account
+ * @param reserve_sig resulting signature
+ */
+void
+TALER_wallet_account_setup_sign (
+  const struct TALER_ReservePrivateKeyP *reserve_priv,
+  struct TALER_ReserveSignatureP *reserve_sig);
+
 
 /**
  * Sign a deposit permission.  Function for wallets.
diff --git a/src/lib/exchange_api_kyc_wallet.c 
b/src/lib/exchange_api_kyc_wallet.c
index 4a41fd59..7a78ceb2 100644
--- a/src/lib/exchange_api_kyc_wallet.c
+++ b/src/lib/exchange_api_kyc_wallet.c
@@ -161,19 +161,11 @@ TALER_EXCHANGE_kyc_wallet (struct TALER_EXCHANGE_Handle 
*exchange,
   struct GNUNET_CURL_Context *ctx;
   struct TALER_ReservePublicKeyP reserve_pub;
   struct TALER_ReserveSignatureP reserve_sig;
-  struct GNUNET_CRYPTO_EccSignaturePurpose purpose = {
-    .size = htonl (sizeof (purpose)),
-    .purpose = htonl (TALER_SIGNATURE_WALLET_ACCOUNT_SETUP)
-  };
 
-  /* FIXME: move to util/wallet-signatures.c! */
   GNUNET_CRYPTO_eddsa_key_get_public (&reserve_priv->eddsa_priv,
                                       &reserve_pub.eddsa_pub);
-
-  GNUNET_assert (GNUNET_OK ==
-                 GNUNET_CRYPTO_eddsa_sign_ (&reserve_priv->eddsa_priv,
-                                            &purpose,
-                                            &reserve_sig.eddsa_signature));
+  TALER_wallet_account_setup_sign (reserve_priv,
+                                   &reserve_sig);
   req = GNUNET_JSON_PACK (
     GNUNET_JSON_pack_data_auto ("reserve_pub",
                                 &reserve_pub),
diff --git a/src/util/wallet_signatures.c b/src/util/wallet_signatures.c
index 1dd2302b..01f33ae8 100644
--- a/src/util/wallet_signatures.c
+++ b/src/util/wallet_signatures.c
@@ -1,6 +1,6 @@
 /*
   This file is part of TALER
-  Copyright (C) 2021 Taler Systems SA
+  Copyright (C) 2021, 2022 Taler Systems SA
 
   TALER is free software; you can redistribute it and/or modify it under the
   terms of the GNU General Public License as published by the Free Software
@@ -333,4 +333,21 @@ TALER_wallet_withdraw_verify (
 }
 
 
+void
+TALER_wallet_account_setup_sign (
+  const struct TALER_ReservePrivateKeyP *reserve_priv,
+  struct TALER_ReserveSignatureP *reserve_sig)
+{
+  struct GNUNET_CRYPTO_EccSignaturePurpose purpose = {
+    .size = htonl (sizeof (purpose)),
+    .purpose = htonl (TALER_SIGNATURE_WALLET_ACCOUNT_SETUP)
+  };
+
+  GNUNET_assert (GNUNET_OK ==
+                 GNUNET_CRYPTO_eddsa_sign_ (&reserve_priv->eddsa_priv,
+                                            &purpose,
+                                            &reserve_sig->eddsa_signature));
+}
+
+
 /* end of wallet_signatures.c */

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]