summaryrefslogtreecommitdiff
path: root/src/util
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2022-08-23 14:36:03 +0200
committerChristian Grothoff <christian@grothoff.org>2022-08-23 14:36:03 +0200
commitb231cc94df3d533ac323ec562e8e8a193084302d (patch)
treeb2d490835f7a48081cd6414f249f5252892fc9f6 /src/util
parent624c5fda989e36df48537aac2a63c6ee80e350d4 (diff)
downloadexchange-b231cc94df3d533ac323ec562e8e8a193084302d.tar.gz
exchange-b231cc94df3d533ac323ec562e8e8a193084302d.tar.bz2
exchange-b231cc94df3d533ac323ec562e8e8a193084302d.zip
enforce syntax of reserve_uri
Diffstat (limited to 'src/util')
-rw-r--r--src/util/wallet_signatures.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/src/util/wallet_signatures.c b/src/util/wallet_signatures.c
index 4761ab6e7..1b16731f5 100644
--- a/src/util/wallet_signatures.c
+++ b/src/util/wallet_signatures.c
@@ -1009,7 +1009,7 @@ struct TALER_PurseMergePS
void
TALER_wallet_purse_merge_sign (
- const char *reserve_url,
+ const char *reserve_uri,
struct GNUNET_TIME_Timestamp merge_timestamp,
const struct TALER_PurseContractPublicKeyP *purse_pub,
const struct TALER_PurseMergePrivateKeyP *merge_priv,
@@ -1022,7 +1022,11 @@ TALER_wallet_purse_merge_sign (
.purse_pub = *purse_pub
};
- TALER_payto_hash (reserve_url,
+ GNUNET_assert (0 ==
+ strcasecmp (reserve_uri,
+ "payto://taler-reserve",
+ strlen ("payto://taler-reserve")));
+ TALER_payto_hash (reserve_uri,
&pm.h_payto);
GNUNET_CRYPTO_eddsa_sign (&merge_priv->eddsa_priv,
&pm,
@@ -1032,7 +1036,7 @@ TALER_wallet_purse_merge_sign (
enum GNUNET_GenericReturnValue
TALER_wallet_purse_merge_verify (
- const char *reserve_url,
+ const char *reserve_uri,
struct GNUNET_TIME_Timestamp merge_timestamp,
const struct TALER_PurseContractPublicKeyP *purse_pub,
const struct TALER_PurseMergePublicKeyP *merge_pub,
@@ -1045,7 +1049,15 @@ TALER_wallet_purse_merge_verify (
.purse_pub = *purse_pub
};
- TALER_payto_hash (reserve_url,
+ if (0 !=
+ strcasecmp (reserve_uri,
+ "payto://taler-reserve",
+ strlen ("payto://taler-reserve")))
+ {
+ GNUNET_break (0);
+ return GNUNET_NO;
+ }
+ TALER_payto_hash (reserve_uri,
&pm.h_payto);
return GNUNET_CRYPTO_eddsa_verify (
TALER_SIGNATURE_WALLET_PURSE_MERGE,