gnunet-svn
[Top][All Lists]
Advanced

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

[exchange] branch master updated: fix bug in account_pub matching logic


From: Admin
Subject: [exchange] branch master updated: fix bug in account_pub matching logic for #10044 (bad left-over memset to 0)
Date: Tue, 03 Jun 2025 23:05:26 +0200

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 6c9a0ce92 fix bug in account_pub matching logic for #10044 (bad 
left-over memset to 0)
6c9a0ce92 is described below

commit 6c9a0ce92cdf301d045ec48b50149c023a959ed9
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Tue Jun 3 23:05:16 2025 +0200

    fix bug in account_pub matching logic for #10044 (bad left-over memset to 0)
---
 src/exchange/taler-exchange-httpd_kyc-check.c      |  5 +++--
 .../exchange_do_lookup_kyc_requirement_by_row.sql  | 22 +++++++++++++++++-----
 src/exchangedb/pg_lookup_kyc_requirement_by_row.c  |  3 ---
 3 files changed, 20 insertions(+), 10 deletions(-)

diff --git a/src/exchange/taler-exchange-httpd_kyc-check.c 
b/src/exchange/taler-exchange-httpd_kyc-check.c
index 6d3b35654..777b91c97 100644
--- a/src/exchange/taler-exchange-httpd_kyc-check.c
+++ b/src/exchange/taler-exchange-httpd_kyc-check.c
@@ -318,8 +318,9 @@ TEH_handler_kyc_check (
     bool do_suspend;
 
     GNUNET_log (GNUNET_ERROR_TYPE_INFO,
-                "Looking up KYC requirements for account %s\n",
-                TALER_B2S (&kyp->h_payto));
+                "Looking up KYC requirements for account %s (%s)\n",
+                TALER_B2S (&kyp->h_payto),
+                kyp->have_pub ? "with account-pub" : "legacy wallet");
     qs = TEH_plugin->lookup_kyc_requirement_by_row (
       TEH_plugin->cls,
       &kyp->h_payto,
diff --git a/src/exchangedb/exchange_do_lookup_kyc_requirement_by_row.sql 
b/src/exchangedb/exchange_do_lookup_kyc_requirement_by_row.sql
index 562541f72..36106d65c 100644
--- a/src/exchangedb/exchange_do_lookup_kyc_requirement_by_row.sql
+++ b/src/exchangedb/exchange_do_lookup_kyc_requirement_by_row.sql
@@ -45,17 +45,27 @@ SELECT access_token
   FROM kyc_targets
  WHERE h_normalized_payto=in_h_normalized_payto;
 
-my_ok = FOUND;
+IF NOT FOUND
+THEN
+-- RAISE WARNING 'kyc_target % not found', in_h_normalized_payto;
+  out_not_found = TRUE;
+  out_kyc_required = FALSE;
+  RETURN;
+END IF;
+
+my_ok = (in_account_pub IS NOT NULL) AND
+        (my_wtrec.target_pub = in_account_pub);
 
 IF ( (NOT my_ok) AND
-     (in_account_pub IS NOT NULL) AND
-     (my_wtrec.target_pub!=in_account_pub) )
+     (in_account_pub IS NOT NULL) )
 THEN
+-- RAISE WARNING 'target_pub % does not match', in_account_pub;
   -- Try to see if the in_account_pub appears in ANY reserve_in
   -- for this account.
   PERFORM
      FROM reserves_in
-   WHERE wire_source_h_payto IN
+    WHERE reserve_pub=in_account_pub
+      AND wire_source_h_payto IN
      (SELECT wire_target_h_payto
         FROM wire_targets
        WHERE h_normalized_payto=in_h_normalized_payto);
@@ -66,7 +76,7 @@ THEN
   END IF;
 END IF;
 
-IF NOT my_ok
+IF (NOT my_ok)
 THEN
   out_not_found = TRUE;
   out_kyc_required = FALSE;
@@ -78,6 +88,8 @@ out_is_wallet = my_wtrec.is_wallet;
 out_account_pub = my_wtrec.target_pub;
 out_access_token = my_wtrec.access_token;
 
+-- RAISE WARNING 'account_pub established, checking measures for %', 
out_access_token;
+
 -- Check if there are active measures for the account.
 PERFORM
   FROM legitimization_measures
diff --git a/src/exchangedb/pg_lookup_kyc_requirement_by_row.c 
b/src/exchangedb/pg_lookup_kyc_requirement_by_row.c
index 67eddb742..5854b8d29 100644
--- a/src/exchangedb/pg_lookup_kyc_requirement_by_row.c
+++ b/src/exchangedb/pg_lookup_kyc_requirement_by_row.c
@@ -93,9 +93,6 @@ TEH_PG_lookup_kyc_requirement_by_row (
   *aml_review = false;
   *is_wallet = false;
   *rule_gen = 0;
-  memset (account_pub,
-          0,
-          sizeof (*account_pub));
   memset (reserve_pub,
           0,
           sizeof (*reserve_pub));

-- 
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]