enforce syntax of reserve_uri
This commit is contained in:
parent
624c5fda98
commit
b231cc94df
@ -2929,7 +2929,7 @@ TALER_wallet_purse_deposit_verify (
|
|||||||
/**
|
/**
|
||||||
* Sign a request by a purse to merge it into an account.
|
* Sign a request by a purse to merge it into an account.
|
||||||
*
|
*
|
||||||
* @param reserve_url identifies the location of the reserve
|
* @param reserve_uri identifies the location of the reserve
|
||||||
* @param merge_timestamp time when the merge happened
|
* @param merge_timestamp time when the merge happened
|
||||||
* @param purse_pub key identifying the purse
|
* @param purse_pub key identifying the purse
|
||||||
* @param merge_priv key identifying the merge capability
|
* @param merge_priv key identifying the merge capability
|
||||||
@ -2937,7 +2937,7 @@ TALER_wallet_purse_deposit_verify (
|
|||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
TALER_wallet_purse_merge_sign (
|
TALER_wallet_purse_merge_sign (
|
||||||
const char *reserve_url,
|
const char *reserve_uri,
|
||||||
struct GNUNET_TIME_Timestamp merge_timestamp,
|
struct GNUNET_TIME_Timestamp merge_timestamp,
|
||||||
const struct TALER_PurseContractPublicKeyP *purse_pub,
|
const struct TALER_PurseContractPublicKeyP *purse_pub,
|
||||||
const struct TALER_PurseMergePrivateKeyP *merge_priv,
|
const struct TALER_PurseMergePrivateKeyP *merge_priv,
|
||||||
@ -2947,7 +2947,7 @@ TALER_wallet_purse_merge_sign (
|
|||||||
/**
|
/**
|
||||||
* Verify a purse merge request.
|
* Verify a purse merge request.
|
||||||
*
|
*
|
||||||
* @param reserve_url identifies the location of the reserve
|
* @param reserve_uri identifies the location of the reserve
|
||||||
* @param merge_timestamp time when the merge happened
|
* @param merge_timestamp time when the merge happened
|
||||||
* @param purse_pub public key of the purse to merge
|
* @param purse_pub public key of the purse to merge
|
||||||
* @param merge_pub public key of the merge capability
|
* @param merge_pub public key of the merge capability
|
||||||
@ -2956,7 +2956,7 @@ TALER_wallet_purse_merge_sign (
|
|||||||
*/
|
*/
|
||||||
enum GNUNET_GenericReturnValue
|
enum GNUNET_GenericReturnValue
|
||||||
TALER_wallet_purse_merge_verify (
|
TALER_wallet_purse_merge_verify (
|
||||||
const char *reserve_url,
|
const char *reserve_uri,
|
||||||
struct GNUNET_TIME_Timestamp merge_timestamp,
|
struct GNUNET_TIME_Timestamp merge_timestamp,
|
||||||
const struct TALER_PurseContractPublicKeyP *purse_pub,
|
const struct TALER_PurseContractPublicKeyP *purse_pub,
|
||||||
const struct TALER_PurseMergePublicKeyP *merge_pub,
|
const struct TALER_PurseMergePublicKeyP *merge_pub,
|
||||||
|
@ -1009,7 +1009,7 @@ struct TALER_PurseMergePS
|
|||||||
|
|
||||||
void
|
void
|
||||||
TALER_wallet_purse_merge_sign (
|
TALER_wallet_purse_merge_sign (
|
||||||
const char *reserve_url,
|
const char *reserve_uri,
|
||||||
struct GNUNET_TIME_Timestamp merge_timestamp,
|
struct GNUNET_TIME_Timestamp merge_timestamp,
|
||||||
const struct TALER_PurseContractPublicKeyP *purse_pub,
|
const struct TALER_PurseContractPublicKeyP *purse_pub,
|
||||||
const struct TALER_PurseMergePrivateKeyP *merge_priv,
|
const struct TALER_PurseMergePrivateKeyP *merge_priv,
|
||||||
@ -1022,7 +1022,11 @@ TALER_wallet_purse_merge_sign (
|
|||||||
.purse_pub = *purse_pub
|
.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);
|
&pm.h_payto);
|
||||||
GNUNET_CRYPTO_eddsa_sign (&merge_priv->eddsa_priv,
|
GNUNET_CRYPTO_eddsa_sign (&merge_priv->eddsa_priv,
|
||||||
&pm,
|
&pm,
|
||||||
@ -1032,7 +1036,7 @@ TALER_wallet_purse_merge_sign (
|
|||||||
|
|
||||||
enum GNUNET_GenericReturnValue
|
enum GNUNET_GenericReturnValue
|
||||||
TALER_wallet_purse_merge_verify (
|
TALER_wallet_purse_merge_verify (
|
||||||
const char *reserve_url,
|
const char *reserve_uri,
|
||||||
struct GNUNET_TIME_Timestamp merge_timestamp,
|
struct GNUNET_TIME_Timestamp merge_timestamp,
|
||||||
const struct TALER_PurseContractPublicKeyP *purse_pub,
|
const struct TALER_PurseContractPublicKeyP *purse_pub,
|
||||||
const struct TALER_PurseMergePublicKeyP *merge_pub,
|
const struct TALER_PurseMergePublicKeyP *merge_pub,
|
||||||
@ -1045,7 +1049,15 @@ TALER_wallet_purse_merge_verify (
|
|||||||
.purse_pub = *purse_pub
|
.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);
|
&pm.h_payto);
|
||||||
return GNUNET_CRYPTO_eddsa_verify (
|
return GNUNET_CRYPTO_eddsa_verify (
|
||||||
TALER_SIGNATURE_WALLET_PURSE_MERGE,
|
TALER_SIGNATURE_WALLET_PURSE_MERGE,
|
||||||
|
Loading…
Reference in New Issue
Block a user