gnunet-svn
[Top][All Lists]
Advanced

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

[taler-merchant] branch master updated: auto-prefix -a password override


From: gnunet
Subject: [taler-merchant] branch master updated: auto-prefix -a password overrides with RFC 8959 prefix
Date: Wed, 08 Dec 2021 09:27:57 +0100

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

grothoff pushed a commit to branch master
in repository merchant.

The following commit(s) were added to refs/heads/master by this push:
     new ae18c202 auto-prefix -a password overrides with RFC 8959 prefix
ae18c202 is described below

commit ae18c202557cebfba21f2193e2d5df1a267c1b96
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Wed Dec 8 09:27:39 2021 +0100

    auto-prefix -a password overrides with RFC 8959 prefix
---
 src/backend/taler-merchant-httpd.c | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/src/backend/taler-merchant-httpd.c 
b/src/backend/taler-merchant-httpd.c
index e7f4dc2f..7bd99de3 100644
--- a/src/backend/taler-merchant-httpd.c
+++ b/src/backend/taler-merchant-httpd.c
@@ -164,6 +164,10 @@ TMH_check_auth (const char *token,
   dec_len = GNUNET_STRINGS_urldecode (token,
                                       strlen (token),
                                       &dec);
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+              "Checking against token %s with salt %s\n",
+              dec,
+              TALER_B2S (salt));
   GNUNET_assert (GNUNET_YES ==
                  GNUNET_CRYPTO_kdf (&val,
                                     sizeof (val),
@@ -191,6 +195,10 @@ TMH_compute_auth (const char *token,
   GNUNET_CRYPTO_random_block (GNUNET_CRYPTO_QUALITY_NONCE,
                               salt,
                               sizeof (*salt));
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+              "Computing initial auth using token %s with salt %s\n",
+              token,
+              TALER_B2S (salt));
   GNUNET_assert (GNUNET_YES ==
                  GNUNET_CRYPTO_kdf (hash,
                                     sizeof (*hash),
@@ -1174,6 +1182,8 @@ url_handler (void *cls,
            (NULL != hc->instance) )
       {
         /* Override default instance access control */
+        GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+                    "Overriding access control\n");
         TMH_compute_auth (TMH_default_auth,
                           &hc->instance->auth.auth_salt,
                           &hc->instance->auth.auth_hash);
@@ -1681,6 +1691,20 @@ run (void *cls,
   if ( (NULL != tok) &&
        (NULL == TMH_default_auth) )
     TMH_default_auth = GNUNET_strdup (tok);
+  if ( (NULL != TMH_default_auth) &&
+       (0 != strcasecmp (TMH_default_auth,
+                         RFC_8959_PREFIX,
+                         strlen (RFC_8959_PREFIX))) )
+  {
+    char *tmp;
+
+    GNUNET_asprintf (&tmp,
+                     "%s%s",
+                     RFC_8959_PREFIX,
+                     TMH_default_auth);
+    GNUNET_free (TMH_default_auth);
+    TMH_default_auth = tmp;
+  }
   cfg = config;
   GNUNET_log (GNUNET_ERROR_TYPE_INFO,
               "Starting taler-merchant-httpd\n");

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