diff options
author | Christian Grothoff <christian@grothoff.org> | 2024-05-01 09:42:59 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2024-05-01 09:43:34 +0200 |
commit | a97ee62dab172a39eab1bebdcd0d8512f5ce4dac (patch) | |
tree | 5c90d8b64618e5c217874b2060771077aed0d85e | |
parent | ec72fbc08ad2734831b3ee2517f0121ad27afd89 (diff) |
enforce RFC 8959 prefix for passwords
m--------- | contrib/wallet-core | 0 | ||||
-rw-r--r-- | src/merchant-tools/taler-merchant-passwd.c | 14 |
2 files changed, 12 insertions, 2 deletions
diff --git a/contrib/wallet-core b/contrib/wallet-core -Subproject 240d647da85de6b575d15c37efec04757541e3d +Subproject 68b2ef735377373da29fd20aeb9facaf91c0383 diff --git a/src/merchant-tools/taler-merchant-passwd.c b/src/merchant-tools/taler-merchant-passwd.c index bfd6534d..bcb856e5 100644 --- a/src/merchant-tools/taler-merchant-passwd.c +++ b/src/merchant-tools/taler-merchant-passwd.c @@ -54,7 +54,7 @@ run (void *cls, const char *pw = args[0]; struct TALER_MERCHANTDB_InstanceAuthSettings ias; enum GNUNET_DB_QueryStatus qs; - + if (NULL == pw) pw = getenv ("TALER_MERCHANT_PASSWORD"); if (NULL == pw) @@ -64,6 +64,16 @@ run (void *cls, global_ret = -1; return; } + if (0 != strncmp (pw, + RFC_8959_PREFIX, + strlen (RFC_8959_PREFIX))) + { + fprintf (stderr, + "Invalid password specified, does not begin with `%s'\n", + RFC_8959_PREFIX); + global_ret = 1; + return; + } if (NULL == instance) instance = GNUNET_strdup ("default"); cfg = GNUNET_CONFIGURATION_dup (config); @@ -112,7 +122,7 @@ run (void *cls, .size = ntohs (sizeof (es)), .type = ntohs (TALER_DBEVENT_MERCHANT_INSTANCE_SETTINGS) }; - + plugin->event_notify (plugin->cls, &es, instance, |