consistently use payto URI instead of URL
This commit is contained in:
parent
9f522baadc
commit
fc8bdb9b97
@ -79,7 +79,7 @@ CURRENCY = TESTKUDOS
|
|||||||
|
|
||||||
[account-1]
|
[account-1]
|
||||||
WIRE_RESPONSE = ${TALER_DATA_HOME}/exchange/account-1.json
|
WIRE_RESPONSE = ${TALER_DATA_HOME}/exchange/account-1.json
|
||||||
url = payto://x-taler-bank/localhost/Exchange
|
PAYTO_URI = payto://x-taler-bank/localhost/Exchange
|
||||||
METHOD = x-taler-bank
|
METHOD = x-taler-bank
|
||||||
enable_debit = yes
|
enable_debit = yes
|
||||||
enable_credit = yes
|
enable_credit = yes
|
||||||
@ -89,7 +89,7 @@ USERNAME = Exchange
|
|||||||
PASSWORD = x
|
PASSWORD = x
|
||||||
|
|
||||||
[account-merchant]
|
[account-merchant]
|
||||||
URL = payto://x-taler-bank/localhost/42
|
PAYTO_URI = payto://x-taler-bank/localhost/42
|
||||||
WIRE_RESPONSE = ${TALER_CONFIG_HOME}/merchant/account-3.json
|
WIRE_RESPONSE = ${TALER_CONFIG_HOME}/merchant/account-3.json
|
||||||
METHOD = x-taler-bank
|
METHOD = x-taler-bank
|
||||||
HONOR_default = YES
|
HONOR_default = YES
|
||||||
|
@ -1076,10 +1076,10 @@ wire_out_cb (void *cls,
|
|||||||
return GNUNET_OK;
|
return GNUNET_OK;
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
char *payto_url;
|
char *payto_uri;
|
||||||
|
|
||||||
payto_url = TALER_JSON_wire_to_payto (wire);
|
payto_uri = TALER_JSON_wire_to_payto (wire);
|
||||||
if (0 != strcasecmp (payto_url,
|
if (0 != strcasecmp (payto_uri,
|
||||||
roi->details.credit_account_url))
|
roi->details.credit_account_url))
|
||||||
{
|
{
|
||||||
/* Destination bank account is wrong in actual wire transfer, so
|
/* Destination bank account is wrong in actual wire transfer, so
|
||||||
@ -1112,10 +1112,10 @@ wire_out_cb (void *cls,
|
|||||||
TALER_amount_add (&total_bad_amount_out_minus,
|
TALER_amount_add (&total_bad_amount_out_minus,
|
||||||
&total_bad_amount_out_minus,
|
&total_bad_amount_out_minus,
|
||||||
amount));
|
amount));
|
||||||
GNUNET_free (payto_url);
|
GNUNET_free (payto_uri);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
GNUNET_free (payto_url);
|
GNUNET_free (payto_uri);
|
||||||
}
|
}
|
||||||
if (0 != TALER_amount_cmp (&roi->details.amount,
|
if (0 != TALER_amount_cmp (&roi->details.amount,
|
||||||
amount))
|
amount))
|
||||||
|
@ -4,7 +4,7 @@ TINY_AMOUNT = TESTKUDOS:0.01
|
|||||||
|
|
||||||
[account-1]
|
[account-1]
|
||||||
WIRE_RESPONSE = ${TALER_DATA_HOME}/exchange/account-1.json
|
WIRE_RESPONSE = ${TALER_DATA_HOME}/exchange/account-1.json
|
||||||
url = payto://x-taler-bank/localhost/Exchange
|
PAYTO_URI = payto://x-taler-bank/localhost/Exchange
|
||||||
METHOD = x-taler-bank
|
METHOD = x-taler-bank
|
||||||
enable_debit = yes
|
enable_debit = yes
|
||||||
enable_credit = yes
|
enable_credit = yes
|
||||||
|
@ -218,7 +218,7 @@ main (int argc, char *const *argv)
|
|||||||
(GNUNET_GETOPT_option_string ('C',
|
(GNUNET_GETOPT_option_string ('C',
|
||||||
"credit",
|
"credit",
|
||||||
"ACCOUNT",
|
"ACCOUNT",
|
||||||
"payto URL of the bank account to credit",
|
"payto URI of the bank account to credit",
|
||||||
&credit_account)),
|
&credit_account)),
|
||||||
GNUNET_GETOPT_option_mandatory
|
GNUNET_GETOPT_option_mandatory
|
||||||
(GNUNET_GETOPT_option_string ('s',
|
(GNUNET_GETOPT_option_string ('s',
|
||||||
|
@ -45,7 +45,7 @@ USER_PAYTO_URI = payto://x-taler-bank/localhost:8082/42
|
|||||||
|
|
||||||
[account-2]
|
[account-2]
|
||||||
# What is the payto://-URL of the exchange (to generate wire response)
|
# What is the payto://-URL of the exchange (to generate wire response)
|
||||||
URL = "payto://x-taler-bank/localhost:8082/2"
|
PAYTO_URI = "payto://x-taler-bank/localhost:8082/2"
|
||||||
# What is the bank account (with the "Taler Bank" demo system)? Must end with "/".
|
# What is the bank account (with the "Taler Bank" demo system)? Must end with "/".
|
||||||
WIRE_GATEWAY_URL = http://localhost:8082/2/
|
WIRE_GATEWAY_URL = http://localhost:8082/2/
|
||||||
# This is the response we give out for the /wire request. It provides
|
# This is the response we give out for the /wire request. It provides
|
||||||
|
@ -92,7 +92,7 @@ static struct TALER_TESTING_ExchangeConfiguration ec;
|
|||||||
/**
|
/**
|
||||||
* Hold information about a user at the bank.
|
* Hold information about a user at the bank.
|
||||||
*/
|
*/
|
||||||
static char *user_payto_url;
|
static char *user_payto_uri;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Time snapshot taken right before executing the CMDs.
|
* Time snapshot taken right before executing the CMDs.
|
||||||
@ -184,7 +184,7 @@ CMD_TRANSFER_TO_EXCHANGE (char *label, char *amount)
|
|||||||
(TALER_TESTING_cmd_admin_add_incoming (label,
|
(TALER_TESTING_cmd_admin_add_incoming (label,
|
||||||
amount,
|
amount,
|
||||||
&exchange_bank_account,
|
&exchange_bank_account,
|
||||||
user_payto_url));
|
user_payto_uri));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -318,7 +318,7 @@ run (void *cls,
|
|||||||
("deposit",
|
("deposit",
|
||||||
withdraw_label,
|
withdraw_label,
|
||||||
0, /* Index of the one withdrawn coin in the traits. */
|
0, /* Index of the one withdrawn coin in the traits. */
|
||||||
user_payto_url,
|
user_payto_uri,
|
||||||
order_enc,
|
order_enc,
|
||||||
GNUNET_TIME_UNIT_ZERO,
|
GNUNET_TIME_UNIT_ZERO,
|
||||||
AMOUNT_1,
|
AMOUNT_1,
|
||||||
@ -813,7 +813,7 @@ main (int argc,
|
|||||||
GNUNET_CONFIGURATION_get_value_string (cfg,
|
GNUNET_CONFIGURATION_get_value_string (cfg,
|
||||||
"benchmark",
|
"benchmark",
|
||||||
"USER_PAYTO_URI",
|
"USER_PAYTO_URI",
|
||||||
&user_payto_url))
|
&user_payto_uri))
|
||||||
{
|
{
|
||||||
GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR,
|
GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR,
|
||||||
"benchmark",
|
"benchmark",
|
||||||
|
@ -72,7 +72,7 @@ sign_account_data (void *cls,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
wire = TALER_JSON_exchange_wire_signature_make (ai->payto_url,
|
wire = TALER_JSON_exchange_wire_signature_make (ai->payto_uri,
|
||||||
&master_priv);
|
&master_priv);
|
||||||
GNUNET_assert (NULL != wire);
|
GNUNET_assert (NULL != wire);
|
||||||
json_out = json_dumps (wire,
|
json_out = json_dumps (wire,
|
||||||
|
@ -110,13 +110,13 @@ load_account (void *cls,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (0 != strcasecmp (url,
|
if (0 != strcasecmp (url,
|
||||||
ai->payto_url))
|
ai->payto_uri))
|
||||||
{
|
{
|
||||||
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
|
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
|
||||||
"URL in Wire response file `%s' does not match URL in configuration (%s vs %s)!\n",
|
"URL in Wire response file `%s' does not match URL in configuration (%s vs %s)!\n",
|
||||||
ai->wire_response_filename,
|
ai->wire_response_filename,
|
||||||
url,
|
url,
|
||||||
ai->payto_url);
|
ai->payto_uri);
|
||||||
json_decref (wire_s);
|
json_decref (wire_s);
|
||||||
GNUNET_free (url);
|
GNUNET_free (url);
|
||||||
*ret = GNUNET_SYSERR;
|
*ret = GNUNET_SYSERR;
|
||||||
@ -146,7 +146,7 @@ load_account (void *cls,
|
|||||||
*ret = GNUNET_SYSERR;
|
*ret = GNUNET_SYSERR;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
method = TALER_payto_get_method (ai->payto_url);
|
method = TALER_payto_get_method (ai->payto_uri);
|
||||||
if (GNUNET_OK ==
|
if (GNUNET_OK ==
|
||||||
load_fee (method))
|
load_fee (method))
|
||||||
{
|
{
|
||||||
|
@ -47,18 +47,11 @@ IDLE_RESERVE_EXPIRATION_TIME = 4 weeks
|
|||||||
CONFIG = "postgres:///talercheck"
|
CONFIG = "postgres:///talercheck"
|
||||||
|
|
||||||
[account-1]
|
[account-1]
|
||||||
|
PAYTO_URI = "payto://x-taler-bank/localhost:8082/3"
|
||||||
# What is the main website of the bank?
|
|
||||||
URL = "payto://x-taler-bank/localhost:8082/3"
|
|
||||||
|
|
||||||
WIRE_RESPONSE = ${TALER_CONFIG_HOME}/account-1.json
|
WIRE_RESPONSE = ${TALER_CONFIG_HOME}/account-1.json
|
||||||
|
|
||||||
METHOD = "x-taler-bank"
|
METHOD = "x-taler-bank"
|
||||||
|
|
||||||
ENABLE_DEBIT = YES
|
ENABLE_DEBIT = YES
|
||||||
|
|
||||||
ENABLE_CREDIT = YES
|
ENABLE_CREDIT = YES
|
||||||
|
|
||||||
TALER_BANK_AUTH_METHOD = NONE
|
TALER_BANK_AUTH_METHOD = NONE
|
||||||
|
|
||||||
|
|
||||||
|
@ -62,7 +62,7 @@ check_for_account (void *cls,
|
|||||||
{
|
{
|
||||||
struct FindAccountContext *ctx = cls;
|
struct FindAccountContext *ctx = cls;
|
||||||
char *method;
|
char *method;
|
||||||
char *payto_url;
|
char *payto_uri;
|
||||||
char *wire_response_filename;
|
char *wire_response_filename;
|
||||||
struct TALER_EXCHANGEDB_AccountInfo ai;
|
struct TALER_EXCHANGEDB_AccountInfo ai;
|
||||||
|
|
||||||
@ -73,12 +73,12 @@ check_for_account (void *cls,
|
|||||||
if (GNUNET_OK !=
|
if (GNUNET_OK !=
|
||||||
GNUNET_CONFIGURATION_get_value_string (ctx->cfg,
|
GNUNET_CONFIGURATION_get_value_string (ctx->cfg,
|
||||||
section,
|
section,
|
||||||
"URL",
|
"PAYTO_URI",
|
||||||
&payto_url))
|
&payto_uri))
|
||||||
{
|
{
|
||||||
GNUNET_log_config_missing (GNUNET_ERROR_TYPE_WARNING,
|
GNUNET_log_config_missing (GNUNET_ERROR_TYPE_WARNING,
|
||||||
section,
|
section,
|
||||||
"URL");
|
"PAYTO_URI");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (GNUNET_OK !=
|
if (GNUNET_OK !=
|
||||||
@ -90,7 +90,7 @@ check_for_account (void *cls,
|
|||||||
GNUNET_log_config_missing (GNUNET_ERROR_TYPE_WARNING,
|
GNUNET_log_config_missing (GNUNET_ERROR_TYPE_WARNING,
|
||||||
section,
|
section,
|
||||||
"METHOD");
|
"METHOD");
|
||||||
GNUNET_free (payto_url);
|
GNUNET_free (payto_uri);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (GNUNET_OK !=
|
if (GNUNET_OK !=
|
||||||
@ -101,7 +101,7 @@ check_for_account (void *cls,
|
|||||||
wire_response_filename = NULL;
|
wire_response_filename = NULL;
|
||||||
ai.section_name = section;
|
ai.section_name = section;
|
||||||
ai.method = method;
|
ai.method = method;
|
||||||
ai.payto_url = payto_url;
|
ai.payto_uri = payto_uri;
|
||||||
ai.wire_response_filename = wire_response_filename;
|
ai.wire_response_filename = wire_response_filename;
|
||||||
|
|
||||||
ai.debit_enabled = (GNUNET_YES ==
|
ai.debit_enabled = (GNUNET_YES ==
|
||||||
@ -114,7 +114,7 @@ check_for_account (void *cls,
|
|||||||
"ENABLE_CREDIT"));
|
"ENABLE_CREDIT"));
|
||||||
ctx->cb (ctx->cb_cls,
|
ctx->cb (ctx->cb_cls,
|
||||||
&ai);
|
&ai);
|
||||||
GNUNET_free (payto_url);
|
GNUNET_free (payto_uri);
|
||||||
GNUNET_free (method);
|
GNUNET_free (method);
|
||||||
GNUNET_free_non_null (wire_response_filename);
|
GNUNET_free_non_null (wire_response_filename);
|
||||||
}
|
}
|
||||||
|
@ -760,7 +760,7 @@ cb_wt_check (void *cls,
|
|||||||
GNUNET_assert (0 == GNUNET_memcmp (merchant_pub,
|
GNUNET_assert (0 == GNUNET_memcmp (merchant_pub,
|
||||||
&merchant_pub_wt));
|
&merchant_pub_wt));
|
||||||
GNUNET_assert (0 == strcmp (json_string_value (json_object_get (wire,
|
GNUNET_assert (0 == strcmp (json_string_value (json_object_get (wire,
|
||||||
"url")),
|
"payto_uri")),
|
||||||
"payto://sepa/DE67830654080004822650"));
|
"payto://sepa/DE67830654080004822650"));
|
||||||
GNUNET_assert (0 == GNUNET_memcmp (h_wire,
|
GNUNET_assert (0 == GNUNET_memcmp (h_wire,
|
||||||
&h_wire_wt));
|
&h_wire_wt));
|
||||||
@ -1257,7 +1257,7 @@ test_wire_out (struct TALER_EXCHANGEDB_Session *session,
|
|||||||
json_t *wire_out_account;
|
json_t *wire_out_account;
|
||||||
|
|
||||||
wire_out_account = json_pack ("{s:s,s:s}",
|
wire_out_account = json_pack ("{s:s,s:s}",
|
||||||
"url",
|
"payto_uri",
|
||||||
"payto://x-taler-bank/localhost:8080/1",
|
"payto://x-taler-bank/localhost:8080/1",
|
||||||
"salt", "this-is-my-salt");
|
"salt", "this-is-my-salt");
|
||||||
if (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT !=
|
if (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT !=
|
||||||
@ -1473,7 +1473,7 @@ run (void *cls)
|
|||||||
session = NULL;
|
session = NULL;
|
||||||
deposit.coin.denom_sig.rsa_signature = NULL;
|
deposit.coin.denom_sig.rsa_signature = NULL;
|
||||||
wire = json_pack ("{s:s, s:s}",
|
wire = json_pack ("{s:s, s:s}",
|
||||||
"url", "payto://sepa/DE67830654080004822650",
|
"payto_uri", "payto://sepa/DE67830654080004822650",
|
||||||
"salt", "this-is-a-salt-value");
|
"salt", "this-is-a-salt-value");
|
||||||
ZR_BLK (&cbc);
|
ZR_BLK (&cbc);
|
||||||
ZR_BLK (&cbc2);
|
ZR_BLK (&cbc2);
|
||||||
|
@ -741,24 +741,24 @@ TALER_refresh_get_commitment (struct TALER_RefreshCommitmentP *rc,
|
|||||||
* Compute the hash of the given wire details. The resulting
|
* Compute the hash of the given wire details. The resulting
|
||||||
* hash is what is put into the contract.
|
* hash is what is put into the contract.
|
||||||
*
|
*
|
||||||
* @param payto_url bank account
|
* @param payto_uri bank account
|
||||||
* @param[out] hc set to the hash
|
* @param[out] hc set to the hash
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
TALER_exchange_wire_signature_hash (const char *payto_url,
|
TALER_exchange_wire_signature_hash (const char *payto_uri,
|
||||||
struct GNUNET_HashCode *hc);
|
struct GNUNET_HashCode *hc);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check the signature in @a wire_s.
|
* Check the signature in @a wire_s.
|
||||||
*
|
*
|
||||||
* @param payto_url URL that is signed
|
* @param payto_uri URL that is signed
|
||||||
* @param master_pub master public key of the exchange
|
* @param master_pub master public key of the exchange
|
||||||
* @param master_sig signature of the exchange
|
* @param master_sig signature of the exchange
|
||||||
* @return #GNUNET_OK if signature is valid
|
* @return #GNUNET_OK if signature is valid
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
TALER_exchange_wire_signature_check (const char *payto_url,
|
TALER_exchange_wire_signature_check (const char *payto_uri,
|
||||||
const struct
|
const struct
|
||||||
TALER_MasterPublicKeyP *master_pub,
|
TALER_MasterPublicKeyP *master_pub,
|
||||||
const struct
|
const struct
|
||||||
@ -768,12 +768,12 @@ TALER_exchange_wire_signature_check (const char *payto_url,
|
|||||||
/**
|
/**
|
||||||
* Create a signed wire statement for the given account.
|
* Create a signed wire statement for the given account.
|
||||||
*
|
*
|
||||||
* @param payto_url account specification
|
* @param payto_uri account specification
|
||||||
* @param master_priv private key to sign with
|
* @param master_priv private key to sign with
|
||||||
* @param[out] master_sig where to write the signature
|
* @param[out] master_sig where to write the signature
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
TALER_exchange_wire_signature_make (const char *payto_url,
|
TALER_exchange_wire_signature_make (const char *payto_uri,
|
||||||
const struct
|
const struct
|
||||||
TALER_MasterPrivateKeyP *master_priv,
|
TALER_MasterPrivateKeyP *master_priv,
|
||||||
struct TALER_MasterSignatureP *master_sig);
|
struct TALER_MasterSignatureP *master_sig);
|
||||||
@ -783,12 +783,12 @@ TALER_exchange_wire_signature_make (const char *payto_url,
|
|||||||
* Compute the hash of the given wire details. The resulting
|
* Compute the hash of the given wire details. The resulting
|
||||||
* hash is what is put into the contract.
|
* hash is what is put into the contract.
|
||||||
*
|
*
|
||||||
* @param payto_url bank account
|
* @param payto_uri bank account
|
||||||
* @param salt salt used to eliminate brute-force inversion
|
* @param salt salt used to eliminate brute-force inversion
|
||||||
* @param[out] hc set to the hash
|
* @param[out] hc set to the hash
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
TALER_merchant_wire_signature_hash (const char *payto_url,
|
TALER_merchant_wire_signature_hash (const char *payto_uri,
|
||||||
const char *salt,
|
const char *salt,
|
||||||
struct GNUNET_HashCode *hc);
|
struct GNUNET_HashCode *hc);
|
||||||
|
|
||||||
@ -796,14 +796,14 @@ TALER_merchant_wire_signature_hash (const char *payto_url,
|
|||||||
/**
|
/**
|
||||||
* Check the signature in @a wire_s.
|
* Check the signature in @a wire_s.
|
||||||
*
|
*
|
||||||
* @param payto_url URL that is signed
|
* @param payto_uri URL that is signed
|
||||||
* @param salt the salt used to salt the @a payto_url when hashing
|
* @param salt the salt used to salt the @a payto_uri when hashing
|
||||||
* @param merch_pub public key of the merchant
|
* @param merch_pub public key of the merchant
|
||||||
* @param merch_sig signature of the merchant
|
* @param merch_sig signature of the merchant
|
||||||
* @return #GNUNET_OK if signature is valid
|
* @return #GNUNET_OK if signature is valid
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
TALER_merchant_wire_signature_check (const char *payto_url,
|
TALER_merchant_wire_signature_check (const char *payto_uri,
|
||||||
const char *salt,
|
const char *salt,
|
||||||
const struct
|
const struct
|
||||||
TALER_MerchantPublicKeyP *merch_pub,
|
TALER_MerchantPublicKeyP *merch_pub,
|
||||||
@ -814,13 +814,13 @@ TALER_merchant_wire_signature_check (const char *payto_url,
|
|||||||
/**
|
/**
|
||||||
* Create a signed wire statement for the given account.
|
* Create a signed wire statement for the given account.
|
||||||
*
|
*
|
||||||
* @param payto_url account specification
|
* @param payto_uri account specification
|
||||||
* @param salt the salt used to salt the @a payto_url when hashing
|
* @param salt the salt used to salt the @a payto_uri when hashing
|
||||||
* @param merch_priv private key to sign with
|
* @param merch_priv private key to sign with
|
||||||
* @param[out] merch_sig where to write the signature
|
* @param[out] merch_sig where to write the signature
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
TALER_merchant_wire_signature_make (const char *payto_url,
|
TALER_merchant_wire_signature_make (const char *payto_uri,
|
||||||
const char *salt,
|
const char *salt,
|
||||||
const struct
|
const struct
|
||||||
TALER_MerchantPrivateKeyP *merch_priv,
|
TALER_MerchantPrivateKeyP *merch_priv,
|
||||||
|
@ -628,9 +628,9 @@ struct TALER_EXCHANGE_WireAggregateFees
|
|||||||
struct TALER_EXCHANGE_WireAccount
|
struct TALER_EXCHANGE_WireAccount
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* payto://-URL of the exchange.
|
* payto://-URI of the exchange.
|
||||||
*/
|
*/
|
||||||
const char *url;
|
const char *payto_uri;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Signature of the exchange over the account (was checked by the API).
|
* Signature of the exchange over the account (was checked by the API).
|
||||||
@ -639,7 +639,7 @@ struct TALER_EXCHANGE_WireAccount
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Linked list of wire fees the exchange charges for
|
* Linked list of wire fees the exchange charges for
|
||||||
* accounts of the wire method matching @e url.
|
* accounts of the wire method matching @e payto_uri.
|
||||||
*/
|
*/
|
||||||
const struct TALER_EXCHANGE_WireAggregateFees *fees;
|
const struct TALER_EXCHANGE_WireAggregateFees *fees;
|
||||||
|
|
||||||
|
@ -401,7 +401,7 @@ struct TALER_EXCHANGEDB_AccountInfo
|
|||||||
/**
|
/**
|
||||||
* payto://-URL of the account.
|
* payto://-URL of the account.
|
||||||
*/
|
*/
|
||||||
const char *payto_url;
|
const char *payto_uri;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Filename containing the signed /wire response, or NULL
|
* Filename containing the signed /wire response, or NULL
|
||||||
|
@ -170,11 +170,11 @@ TALER_JSON_exchange_wire_signature_check (const json_t *wire_s,
|
|||||||
/**
|
/**
|
||||||
* Create a signed wire statement for the given account.
|
* Create a signed wire statement for the given account.
|
||||||
*
|
*
|
||||||
* @param payto_url account specification
|
* @param payto_uri account specification
|
||||||
* @param master_priv private key to sign with, NULL to not sign
|
* @param master_priv private key to sign with, NULL to not sign
|
||||||
*/
|
*/
|
||||||
json_t *
|
json_t *
|
||||||
TALER_JSON_exchange_wire_signature_make (const char *payto_url,
|
TALER_JSON_exchange_wire_signature_make (const char *payto_uri,
|
||||||
const struct
|
const struct
|
||||||
TALER_MasterPrivateKeyP *master_priv);
|
TALER_MasterPrivateKeyP *master_priv);
|
||||||
|
|
||||||
|
@ -237,13 +237,13 @@ TALER_url_absolute_mhd (struct MHD_Connection *connection,
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Obtain the payment method from a @a payto_url
|
* Obtain the payment method from a @a payto_uri
|
||||||
*
|
*
|
||||||
* @param payto_url the URL to parse
|
* @param payto_uri the URL to parse
|
||||||
* @return NULL on error (malformed @a payto_url)
|
* @return NULL on error (malformed @a payto_uri)
|
||||||
*/
|
*/
|
||||||
char *
|
char *
|
||||||
TALER_payto_get_method (const char *payto_url);
|
TALER_payto_get_method (const char *payto_uri);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -367,10 +367,10 @@ int
|
|||||||
TALER_JSON_merchant_wire_signature_hash (const json_t *wire_s,
|
TALER_JSON_merchant_wire_signature_hash (const json_t *wire_s,
|
||||||
struct GNUNET_HashCode *hc)
|
struct GNUNET_HashCode *hc)
|
||||||
{
|
{
|
||||||
const char *payto_url;
|
const char *payto_uri;
|
||||||
const char *salt;
|
const char *salt;
|
||||||
struct GNUNET_JSON_Specification spec[] = {
|
struct GNUNET_JSON_Specification spec[] = {
|
||||||
GNUNET_JSON_spec_string ("url", &payto_url),
|
GNUNET_JSON_spec_string ("payto_uri", &payto_uri),
|
||||||
GNUNET_JSON_spec_string ("salt", &salt),
|
GNUNET_JSON_spec_string ("salt", &salt),
|
||||||
GNUNET_JSON_spec_end ()
|
GNUNET_JSON_spec_end ()
|
||||||
};
|
};
|
||||||
@ -383,7 +383,7 @@ TALER_JSON_merchant_wire_signature_hash (const json_t *wire_s,
|
|||||||
GNUNET_break_op (0);
|
GNUNET_break_op (0);
|
||||||
return GNUNET_SYSERR;
|
return GNUNET_SYSERR;
|
||||||
}
|
}
|
||||||
TALER_merchant_wire_signature_hash (payto_url,
|
TALER_merchant_wire_signature_hash (payto_uri,
|
||||||
salt,
|
salt,
|
||||||
hc);
|
hc);
|
||||||
return GNUNET_OK;
|
return GNUNET_OK;
|
||||||
@ -402,10 +402,10 @@ TALER_JSON_exchange_wire_signature_check (const json_t *wire_s,
|
|||||||
const struct
|
const struct
|
||||||
TALER_MasterPublicKeyP *master_pub)
|
TALER_MasterPublicKeyP *master_pub)
|
||||||
{
|
{
|
||||||
const char *payto_url;
|
const char *payto_uri;
|
||||||
struct TALER_MasterSignatureP master_sig;
|
struct TALER_MasterSignatureP master_sig;
|
||||||
struct GNUNET_JSON_Specification spec[] = {
|
struct GNUNET_JSON_Specification spec[] = {
|
||||||
GNUNET_JSON_spec_string ("url", &payto_url),
|
GNUNET_JSON_spec_string ("payto_uri", &payto_uri),
|
||||||
GNUNET_JSON_spec_fixed_auto ("master_sig", &master_sig),
|
GNUNET_JSON_spec_fixed_auto ("master_sig", &master_sig),
|
||||||
GNUNET_JSON_spec_end ()
|
GNUNET_JSON_spec_end ()
|
||||||
};
|
};
|
||||||
@ -419,13 +419,13 @@ TALER_JSON_exchange_wire_signature_check (const json_t *wire_s,
|
|||||||
return GNUNET_SYSERR;
|
return GNUNET_SYSERR;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GNUNET_SYSERR == validate_payto_iban (payto_url))
|
if (GNUNET_SYSERR == validate_payto_iban (payto_uri))
|
||||||
{
|
{
|
||||||
GNUNET_break_op (0);
|
GNUNET_break_op (0);
|
||||||
return GNUNET_SYSERR;
|
return GNUNET_SYSERR;
|
||||||
}
|
}
|
||||||
|
|
||||||
return TALER_exchange_wire_signature_check (payto_url,
|
return TALER_exchange_wire_signature_check (payto_uri,
|
||||||
master_pub,
|
master_pub,
|
||||||
&master_sig);
|
&master_sig);
|
||||||
}
|
}
|
||||||
@ -434,21 +434,21 @@ TALER_JSON_exchange_wire_signature_check (const json_t *wire_s,
|
|||||||
/**
|
/**
|
||||||
* Create a signed wire statement for the given account.
|
* Create a signed wire statement for the given account.
|
||||||
*
|
*
|
||||||
* @param payto_url account specification
|
* @param payto_uri account specification
|
||||||
* @param master_priv private key to sign with, NULL to not sign
|
* @param master_priv private key to sign with, NULL to not sign
|
||||||
*/
|
*/
|
||||||
json_t *
|
json_t *
|
||||||
TALER_JSON_exchange_wire_signature_make (const char *payto_url,
|
TALER_JSON_exchange_wire_signature_make (const char *payto_uri,
|
||||||
const struct
|
const struct
|
||||||
TALER_MasterPrivateKeyP *master_priv)
|
TALER_MasterPrivateKeyP *master_priv)
|
||||||
{
|
{
|
||||||
struct TALER_MasterSignatureP master_sig;
|
struct TALER_MasterSignatureP master_sig;
|
||||||
|
|
||||||
TALER_exchange_wire_signature_make (payto_url,
|
TALER_exchange_wire_signature_make (payto_uri,
|
||||||
master_priv,
|
master_priv,
|
||||||
&master_sig);
|
&master_sig);
|
||||||
return json_pack ("{s:s, s:o}",
|
return json_pack ("{s:s, s:o}",
|
||||||
"url", payto_url,
|
"payto_uri", payto_uri,
|
||||||
"master_sig", GNUNET_JSON_from_data_auto (&master_sig));
|
"master_sig", GNUNET_JSON_from_data_auto (&master_sig));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -467,7 +467,7 @@ TALER_JSON_wire_to_payto (const json_t *wire_s)
|
|||||||
const char *payto_str;
|
const char *payto_str;
|
||||||
|
|
||||||
payto_o = json_object_get (wire_s,
|
payto_o = json_object_get (wire_s,
|
||||||
"url");
|
"payto_uri");
|
||||||
if ( (NULL == payto_o) ||
|
if ( (NULL == payto_o) ||
|
||||||
(NULL == (payto_str = json_string_value (payto_o))) )
|
(NULL == (payto_str = json_string_value (payto_o))) )
|
||||||
{
|
{
|
||||||
@ -493,7 +493,7 @@ TALER_JSON_wire_to_method (const json_t *wire_s)
|
|||||||
const char *payto_str;
|
const char *payto_str;
|
||||||
|
|
||||||
payto_o = json_object_get (wire_s,
|
payto_o = json_object_get (wire_s,
|
||||||
"url");
|
"payto_uri");
|
||||||
if ( (NULL == payto_o) ||
|
if ( (NULL == payto_o) ||
|
||||||
(NULL == (payto_str = json_string_value (payto_o))) )
|
(NULL == (payto_str = json_string_value (payto_o))) )
|
||||||
{
|
{
|
||||||
|
@ -1534,7 +1534,7 @@ deserialize_data (struct TALER_EXCHANGE_Handle *exchange,
|
|||||||
&version),
|
&version),
|
||||||
GNUNET_JSON_spec_json ("keys",
|
GNUNET_JSON_spec_json ("keys",
|
||||||
&keys),
|
&keys),
|
||||||
GNUNET_JSON_spec_string ("url",
|
GNUNET_JSON_spec_string ("exchange_url",
|
||||||
&url),
|
&url),
|
||||||
GNUNET_JSON_spec_absolute_time ("expire",
|
GNUNET_JSON_spec_absolute_time ("expire",
|
||||||
&expire),
|
&expire),
|
||||||
@ -1829,7 +1829,7 @@ TALER_EXCHANGE_serialize_data
|
|||||||
(json_int_t) TALER_SERIALIZATION_FORMAT_VERSION,
|
(json_int_t) TALER_SERIALIZATION_FORMAT_VERSION,
|
||||||
"expire",
|
"expire",
|
||||||
GNUNET_JSON_from_time_abs (exchange->key_data_expiration),
|
GNUNET_JSON_from_time_abs (exchange->key_data_expiration),
|
||||||
"url",
|
"exchange_url",
|
||||||
exchange->url,
|
exchange->url,
|
||||||
"keys",
|
"keys",
|
||||||
keys);
|
keys);
|
||||||
|
@ -271,7 +271,7 @@ handle_wire_finished (void *cls,
|
|||||||
struct TALER_EXCHANGE_WireAccount *wa = &was[i];
|
struct TALER_EXCHANGE_WireAccount *wa = &was[i];
|
||||||
json_t *account;
|
json_t *account;
|
||||||
struct GNUNET_JSON_Specification spec_account[] = {
|
struct GNUNET_JSON_Specification spec_account[] = {
|
||||||
GNUNET_JSON_spec_string ("url", &wa->url),
|
GNUNET_JSON_spec_string ("payto_uri", &wa->payto_uri),
|
||||||
GNUNET_JSON_spec_fixed_auto ("master_sig", &wa->master_sig),
|
GNUNET_JSON_spec_fixed_auto ("master_sig", &wa->master_sig),
|
||||||
GNUNET_JSON_spec_end ()
|
GNUNET_JSON_spec_end ()
|
||||||
};
|
};
|
||||||
@ -300,7 +300,7 @@ handle_wire_finished (void *cls,
|
|||||||
ec = TALER_EC_SERVER_JSON_INVALID;
|
ec = TALER_EC_SERVER_JSON_INVALID;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (NULL == (method = TALER_payto_get_method (wa->url)))
|
if (NULL == (method = TALER_payto_get_method (wa->payto_uri)))
|
||||||
{
|
{
|
||||||
/* bogus reply */
|
/* bogus reply */
|
||||||
GNUNET_break_op (0);
|
GNUNET_break_op (0);
|
||||||
|
@ -57,7 +57,7 @@ LEGAL_RESERVE_EXPIRATION_TIME = 7 years
|
|||||||
[account-1]
|
[account-1]
|
||||||
|
|
||||||
# What is the account URL?
|
# What is the account URL?
|
||||||
URL = "payto://x-taler-bank/localhost/2"
|
PAYTO_URI = "payto://x-taler-bank/localhost/2"
|
||||||
WIRE_GATEWAY_URL = "http://localhost:8082/2/"
|
WIRE_GATEWAY_URL = "http://localhost:8082/2/"
|
||||||
WIRE_GATEWAY_AUTH_METHOD = basic
|
WIRE_GATEWAY_AUTH_METHOD = basic
|
||||||
USERNAME = Exchange
|
USERNAME = Exchange
|
||||||
|
@ -46,7 +46,7 @@ PORT = 8083
|
|||||||
[account-1]
|
[account-1]
|
||||||
|
|
||||||
# What is the account URL?
|
# What is the account URL?
|
||||||
URL = "payto://x-taler-bank/localhost/2"
|
PAYTO_URI = "payto://x-taler-bank/localhost/2"
|
||||||
WIRE_GATEWAY_URL = "http://localhost:8082/2/"
|
WIRE_GATEWAY_URL = "http://localhost:8082/2/"
|
||||||
|
|
||||||
WIRE_GATEWAY_AUTH_METHOD = basic
|
WIRE_GATEWAY_AUTH_METHOD = basic
|
||||||
|
@ -59,7 +59,7 @@ CONFIG = "postgres:///talercheck"
|
|||||||
# advertised in /wire.
|
# advertised in /wire.
|
||||||
[account-1]
|
[account-1]
|
||||||
# What is the URL of our account?
|
# What is the URL of our account?
|
||||||
URL = "payto://x-taler-bank/localhost/42"
|
PAYTO_URI = "payto://x-taler-bank/localhost/42"
|
||||||
WIRE_GATEWAY_URL = "http://localhost:8082/42/"
|
WIRE_GATEWAY_URL = "http://localhost:8082/42/"
|
||||||
# This is the response we give out for the /wire request. It provides
|
# This is the response we give out for the /wire request. It provides
|
||||||
# wallets with the bank information for transfers to the exchange.
|
# wallets with the bank information for transfers to the exchange.
|
||||||
@ -76,7 +76,7 @@ HTTP_PORT = 8082
|
|||||||
[account-2]
|
[account-2]
|
||||||
# What is the bank account (with the "Taler Bank" demo system)?
|
# What is the bank account (with the "Taler Bank" demo system)?
|
||||||
WIRE_GATEWAY_URL = "http://localhost:8082/2/"
|
WIRE_GATEWAY_URL = "http://localhost:8082/2/"
|
||||||
URL = "payto://x-taler-bank/localhost/2"
|
PAYTO_URI = "payto://x-taler-bank/localhost/2"
|
||||||
|
|
||||||
# This is the response we give out for the /wire request. It provides
|
# This is the response we give out for the /wire request. It provides
|
||||||
# wallets with the bank information for transfers to the exchange.
|
# wallets with the bank information for transfers to the exchange.
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
currency = KUDOS
|
currency = KUDOS
|
||||||
|
|
||||||
[account-2]
|
[account-2]
|
||||||
URL = payto://x-taler-bank/localhost/2
|
PAYTO_URI = payto://x-taler-bank/localhost/2
|
||||||
METHOD = x-taler-bank
|
METHOD = x-taler-bank
|
||||||
WIRE_GATEWAY_URL = "http://localhost:8081/2/"
|
WIRE_GATEWAY_URL = "http://localhost:8081/2/"
|
||||||
WIRE_GATEWAY_AUTH_METHOD = basic
|
WIRE_GATEWAY_AUTH_METHOD = basic
|
||||||
|
@ -28,7 +28,7 @@ http_port = 8081
|
|||||||
database = postgres:///talercheck
|
database = postgres:///talercheck
|
||||||
|
|
||||||
[account-1]
|
[account-1]
|
||||||
URL = payto://x-taler-bank/localhost:8081/1
|
PAYTO_URI = payto://x-taler-bank/localhost:8081/1
|
||||||
|
|
||||||
[account-2]
|
[account-2]
|
||||||
URL = payto://x-taler-bank/localhost:8081/2
|
PAYTO_URI = payto://x-taler-bank/localhost:8081/2
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
currency = KUDOS
|
currency = KUDOS
|
||||||
|
|
||||||
[account-2]
|
[account-2]
|
||||||
URL = payto://x-taler-bank/localhost/Exchange
|
PAYTO_URI = payto://x-taler-bank/localhost/Exchange
|
||||||
METHOD = x-taler-bank
|
METHOD = x-taler-bank
|
||||||
WIRE_GATEWAY_URL = "http://localhost:8081/taler-wire-gateway/Exchange/"
|
WIRE_GATEWAY_URL = "http://localhost:8081/taler-wire-gateway/Exchange/"
|
||||||
WIRE_GATEWAY_AUTH_METHOD = basic
|
WIRE_GATEWAY_AUTH_METHOD = basic
|
||||||
|
@ -30,11 +30,11 @@ database = postgres:///talercheck
|
|||||||
|
|
||||||
|
|
||||||
[account-1]
|
[account-1]
|
||||||
URL = payto://x-taler-bank/localhost/1
|
PAYTO_URI = payto://x-taler-bank/localhost/1
|
||||||
|
|
||||||
|
|
||||||
[account-2]
|
[account-2]
|
||||||
URL = payto://x-taler-bank/localhost/Exchange
|
PAYTO_URI = payto://x-taler-bank/localhost/Exchange
|
||||||
METHOD = x-taler-bank
|
METHOD = x-taler-bank
|
||||||
WIRE_GATEWAY_URL = "http://localhost:8888/taler-wire-gateway/Exchange/"
|
WIRE_GATEWAY_URL = "http://localhost:8888/taler-wire-gateway/Exchange/"
|
||||||
WIRE_GATEWAY_AUTH_METHOD = basic
|
WIRE_GATEWAY_AUTH_METHOD = basic
|
||||||
|
@ -60,7 +60,7 @@ CONFIG = "postgres:///talercheck"
|
|||||||
# advertised in /wire.
|
# advertised in /wire.
|
||||||
[account-1]
|
[account-1]
|
||||||
# What is the URL of our account?
|
# What is the URL of our account?
|
||||||
URL = "payto://x-taler-bank/localhost/42"
|
PAYTO_URI = "payto://x-taler-bank/localhost/42"
|
||||||
# This is the response we give out for the /wire request. It provides
|
# This is the response we give out for the /wire request. It provides
|
||||||
# wallets with the bank information for transfers to the exchange.
|
# wallets with the bank information for transfers to the exchange.
|
||||||
WIRE_RESPONSE = ${TALER_CONFIG_HOME}/account-1.json
|
WIRE_RESPONSE = ${TALER_CONFIG_HOME}/account-1.json
|
||||||
@ -74,7 +74,7 @@ WIRE_GATEWAY_URL = "http://localhost:9081/42/"
|
|||||||
|
|
||||||
[account-2]
|
[account-2]
|
||||||
# What is the bank account (with the "Taler Bank" demo system)?
|
# What is the bank account (with the "Taler Bank" demo system)?
|
||||||
URL = "payto://x-taler-bank/localhost/2"
|
PAYTO_URI = "payto://x-taler-bank/localhost/2"
|
||||||
|
|
||||||
# This is the response we give out for the /wire request. It provides
|
# This is the response we give out for the /wire request. It provides
|
||||||
# wallets with the bank information for transfers to the exchange.
|
# wallets with the bank information for transfers to the exchange.
|
||||||
|
@ -1,5 +0,0 @@
|
|||||||
{
|
|
||||||
"url": "payto://sepa/CH9300762011623852957",
|
|
||||||
"salt": "N83T9J9202WCC8TQFDMJDWEGZNBEKA33C1ZM241VNYH88RZNTHPW509Y1M2YF7Y098R8VRESWQ05H03BK1SPAZCWE54KARDCKT5N8AG",
|
|
||||||
"master_sig": "D4V5GJ998YK7D6N0N56AD0J6MZNFEW6MRZT2CFPVQ5ME3NMQ59AA2007CXYESSFGRN70CNCFM06858QSSENCWTZM8VHEJ93YQ20ZJ1R"
|
|
||||||
}
|
|
@ -1,4 +1,4 @@
|
|||||||
{
|
{
|
||||||
"url": "payto://x-taler-bank/localhost/2",
|
"payto_uri": "payto://x-taler-bank/localhost/2",
|
||||||
"master_sig": "HEWC1XDS0QZ53YQR451VRKD4N968NXWGZXS30HJ59MJ0PESACK1ZYPYCAT15P08WD58C7D7F6EVN26D59JKA75XEBDQCM8VYFETK82R"
|
"master_sig": "HEWC1XDS0QZ53YQR451VRKD4N968NXWGZXS30HJ59MJ0PESACK1ZYPYCAT15P08WD58C7D7F6EVN26D59JKA75XEBDQCM8VYFETK82R"
|
||||||
}
|
}
|
@ -1,8 +0,0 @@
|
|||||||
{
|
|
||||||
"salt": "AZPRFVJ58NM6M7J5CZQPJAH3EW5DYM52AEZ9Y1C1ER3W94QV8D8TQKF6CK8MYQRA9QMSKDQTGZ306ZS9GQ0M6R01CJ20KPP49WFDZK8",
|
|
||||||
"name": "The exchange",
|
|
||||||
"account_number": 3,
|
|
||||||
"bank_url": "http://localhost:8082/",
|
|
||||||
"type": "test",
|
|
||||||
"sig": "RPQXP9S4P8PQP7HEZQNRSZCT0ATNEP8GW0P5TPM34V5RX86FCD670V44R9NETSYDDKB8SZV7TKY9PAJYTY51D3VDWY9XXQ5BPFRXR28"
|
|
||||||
}
|
|
@ -1,5 +0,0 @@
|
|||||||
{
|
|
||||||
"url": "payto://x-taler-bank/http://localhost:8082/2",
|
|
||||||
"master_sig": "KQ0BWSCNVR7HGGSAMCYK8ZM30RBS1MHMXT3QBN01PZWC9TV72FEE5RJ7T84C8134EPV6WEBXXY2MTFNE8ZXST6JEJQKR8HX6FQPVY10",
|
|
||||||
"master_pub": "98NJW3CQHZQGQXTY3K85K531XKPAPAVV4Q5V8PYYRR00NJGZWNVG"
|
|
||||||
}
|
|
@ -71,7 +71,7 @@ CONFIG = "postgres:///talercheck"
|
|||||||
WIRE_RESPONSE = ${TALER_CONFIG_HOME}/iban.json
|
WIRE_RESPONSE = ${TALER_CONFIG_HOME}/iban.json
|
||||||
|
|
||||||
# What is the URL of our bank account? Must match WIRE_RESPONSE above!
|
# What is the URL of our bank account? Must match WIRE_RESPONSE above!
|
||||||
URL = payto://x-taler-bank/localhost/42
|
PAYTO_URI = payto://x-taler-bank/localhost/42
|
||||||
|
|
||||||
METHOD = "x-taler-bank"
|
METHOD = "x-taler-bank"
|
||||||
|
|
||||||
@ -84,7 +84,7 @@ WIRE_GATEWAY_URL = "http://localhost:9082/42/"
|
|||||||
WIRE_RESPONSE = ${TALER_CONFIG_HOME}/x-taler-bank.json
|
WIRE_RESPONSE = ${TALER_CONFIG_HOME}/x-taler-bank.json
|
||||||
|
|
||||||
# What is the URL of our bank account? Must match WIRE_RESPONSE above!
|
# What is the URL of our bank account? Must match WIRE_RESPONSE above!
|
||||||
URL = payto://x-taler-bank/localhost/2
|
PAYTO_URI = payto://x-taler-bank/localhost/2
|
||||||
|
|
||||||
WIRE_GATEWAY_URL = "http://localhost:9082/2/"
|
WIRE_GATEWAY_URL = "http://localhost:9082/2/"
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{
|
{
|
||||||
"url": "payto://x-taler-bank/localhost/2",
|
"payto_uri": "payto://x-taler-bank/localhost/2",
|
||||||
"master_sig": "HEWC1XDS0QZ53YQR451VRKD4N968NXWGZXS30HJ59MJ0PESACK1ZYPYCAT15P08WD58C7D7F6EVN26D59JKA75XEBDQCM8VYFETK82R"
|
"master_sig": "HEWC1XDS0QZ53YQR451VRKD4N968NXWGZXS30HJ59MJ0PESACK1ZYPYCAT15P08WD58C7D7F6EVN26D59JKA75XEBDQCM8VYFETK82R"
|
||||||
}
|
}
|
@ -58,7 +58,7 @@ CONFIG = "postgres:///talercheck"
|
|||||||
|
|
||||||
[account-1]
|
[account-1]
|
||||||
# What is the URL of our account?
|
# What is the URL of our account?
|
||||||
URL = "payto://x-taler-bank/localhost/42"
|
PAYTO_URI = "payto://x-taler-bank/localhost/42"
|
||||||
# This is the response we give out for the /wire request. It provides
|
# This is the response we give out for the /wire request. It provides
|
||||||
# wallets with the bank information for transfers to the exchange.
|
# wallets with the bank information for transfers to the exchange.
|
||||||
WIRE_RESPONSE = ${TALER_CONFIG_HOME}/account-1.json
|
WIRE_RESPONSE = ${TALER_CONFIG_HOME}/account-1.json
|
||||||
@ -69,7 +69,7 @@ WIRE_GATEWAY_AUTH_METHOD = NONE
|
|||||||
|
|
||||||
|
|
||||||
[account-2]
|
[account-2]
|
||||||
URL = payto://x-taler-bank/localhost/2
|
PAYTO_URI = payto://x-taler-bank/localhost/2
|
||||||
WIRE_GATEWAY_URL = "http://localhost:8082/2/"
|
WIRE_GATEWAY_URL = "http://localhost:8082/2/"
|
||||||
WIRE_RESPONSE = ${TALER_CONFIG_HOME}/account-2.json
|
WIRE_RESPONSE = ${TALER_CONFIG_HOME}/account-2.json
|
||||||
WIRE_GATEWAY_AUTH_METHOD = BASIC
|
WIRE_GATEWAY_AUTH_METHOD = BASIC
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{
|
{
|
||||||
"url": "payto://x-taler-bank/localhost/2",
|
"payto_uri": "payto://x-taler-bank/localhost/2",
|
||||||
"master_sig": "HEWC1XDS0QZ53YQR451VRKD4N968NXWGZXS30HJ59MJ0PESACK1ZYPYCAT15P08WD58C7D7F6EVN26D59JKA75XEBDQCM8VYFETK82R"
|
"master_sig": "HEWC1XDS0QZ53YQR451VRKD4N968NXWGZXS30HJ59MJ0PESACK1ZYPYCAT15P08WD58C7D7F6EVN26D59JKA75XEBDQCM8VYFETK82R"
|
||||||
}
|
}
|
@ -184,7 +184,7 @@ insert_deposit_run (void *cls,
|
|||||||
deposit.receiver_wire_account
|
deposit.receiver_wire_account
|
||||||
= json_pack ("{s:s, s:s}",
|
= json_pack ("{s:s, s:s}",
|
||||||
"salt", "this-is-a-salt-value",
|
"salt", "this-is-a-salt-value",
|
||||||
"url", str);
|
"payto_uri", str);
|
||||||
GNUNET_free (str);
|
GNUNET_free (str);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -105,7 +105,7 @@ wire_cb (void *cls,
|
|||||||
{
|
{
|
||||||
char *method;
|
char *method;
|
||||||
|
|
||||||
method = TALER_payto_get_method (accounts[i].url);
|
method = TALER_payto_get_method (accounts[i].payto_uri);
|
||||||
if (0 == strcmp (ws->expected_method,
|
if (0 == strcmp (ws->expected_method,
|
||||||
method))
|
method))
|
||||||
{
|
{
|
||||||
|
@ -263,12 +263,12 @@ TALER_TESTING_prepare_bank (const char *config_filename,
|
|||||||
if (GNUNET_OK !=
|
if (GNUNET_OK !=
|
||||||
GNUNET_CONFIGURATION_get_value_string (cfg,
|
GNUNET_CONFIGURATION_get_value_string (cfg,
|
||||||
config_section,
|
config_section,
|
||||||
"URL", /* FIXME: config should be renamed to payto_uri, it's not an url even! */
|
"PAYTO_URI",
|
||||||
&exchange_payto_uri))
|
&exchange_payto_uri))
|
||||||
{
|
{
|
||||||
GNUNET_log_config_missing (GNUNET_ERROR_TYPE_WARNING,
|
GNUNET_log_config_missing (GNUNET_ERROR_TYPE_WARNING,
|
||||||
config_section,
|
config_section,
|
||||||
"URL");
|
"PAYTO_URI");
|
||||||
GNUNET_CONFIGURATION_destroy (cfg);
|
GNUNET_CONFIGURATION_destroy (cfg);
|
||||||
return GNUNET_SYSERR;
|
return GNUNET_SYSERR;
|
||||||
}
|
}
|
||||||
@ -418,12 +418,12 @@ TALER_TESTING_prepare_fakebank (const char *config_filename,
|
|||||||
if (GNUNET_OK !=
|
if (GNUNET_OK !=
|
||||||
GNUNET_CONFIGURATION_get_value_string (cfg,
|
GNUNET_CONFIGURATION_get_value_string (cfg,
|
||||||
config_section,
|
config_section,
|
||||||
"URL", /* FIXME: config should be renamed to payto_uri, it's not an url even! */
|
"PAYTO_URI",
|
||||||
&exchange_payto_uri))
|
&exchange_payto_uri))
|
||||||
{
|
{
|
||||||
GNUNET_log_config_missing (GNUNET_ERROR_TYPE_WARNING,
|
GNUNET_log_config_missing (GNUNET_ERROR_TYPE_WARNING,
|
||||||
config_section,
|
config_section,
|
||||||
"URL");
|
"PAYTO_URI");
|
||||||
GNUNET_CONFIGURATION_destroy (cfg);
|
GNUNET_CONFIGURATION_destroy (cfg);
|
||||||
return GNUNET_SYSERR;
|
return GNUNET_SYSERR;
|
||||||
}
|
}
|
||||||
@ -485,7 +485,7 @@ json_t *
|
|||||||
TALER_TESTING_make_wire_details (const char *payto)
|
TALER_TESTING_make_wire_details (const char *payto)
|
||||||
{
|
{
|
||||||
return json_pack ("{s:s, s:s}",
|
return json_pack ("{s:s, s:s}",
|
||||||
"url", payto,
|
"payto_uri", payto,
|
||||||
"salt",
|
"salt",
|
||||||
"test-salt (must be constant for aggregation tests)");
|
"test-salt (must be constant for aggregation tests)");
|
||||||
}
|
}
|
||||||
|
@ -27,18 +27,18 @@
|
|||||||
* Compute the hash of the given wire details. The resulting
|
* Compute the hash of the given wire details. The resulting
|
||||||
* hash is what is put into the contract.
|
* hash is what is put into the contract.
|
||||||
*
|
*
|
||||||
* @param payto_url bank account
|
* @param payto_uri bank account
|
||||||
* @param[out] hc set to the hash
|
* @param[out] hc set to the hash
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
TALER_exchange_wire_signature_hash (const char *payto_url,
|
TALER_exchange_wire_signature_hash (const char *payto_uri,
|
||||||
struct GNUNET_HashCode *hc)
|
struct GNUNET_HashCode *hc)
|
||||||
{
|
{
|
||||||
GNUNET_assert (GNUNET_YES ==
|
GNUNET_assert (GNUNET_YES ==
|
||||||
GNUNET_CRYPTO_kdf (hc,
|
GNUNET_CRYPTO_kdf (hc,
|
||||||
sizeof (*hc),
|
sizeof (*hc),
|
||||||
payto_url,
|
payto_uri,
|
||||||
strlen (payto_url) + 1,
|
strlen (payto_uri) + 1,
|
||||||
"exchange-wire-signature",
|
"exchange-wire-signature",
|
||||||
strlen ("exchange-wire-signature"),
|
strlen ("exchange-wire-signature"),
|
||||||
NULL, 0));
|
NULL, 0));
|
||||||
@ -48,13 +48,13 @@ TALER_exchange_wire_signature_hash (const char *payto_url,
|
|||||||
/**
|
/**
|
||||||
* Check the signature in @a wire_s.
|
* Check the signature in @a wire_s.
|
||||||
*
|
*
|
||||||
* @param payto_url URL that is signed
|
* @param payto_uri URL that is signed
|
||||||
* @param master_pub master public key of the exchange
|
* @param master_pub master public key of the exchange
|
||||||
* @param master_sig signature of the exchange
|
* @param master_sig signature of the exchange
|
||||||
* @return #GNUNET_OK if signature is valid
|
* @return #GNUNET_OK if signature is valid
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
TALER_exchange_wire_signature_check (const char *payto_url,
|
TALER_exchange_wire_signature_check (const char *payto_uri,
|
||||||
const struct
|
const struct
|
||||||
TALER_MasterPublicKeyP *master_pub,
|
TALER_MasterPublicKeyP *master_pub,
|
||||||
const struct
|
const struct
|
||||||
@ -64,7 +64,7 @@ TALER_exchange_wire_signature_check (const char *payto_url,
|
|||||||
|
|
||||||
wd.purpose.purpose = htonl (TALER_SIGNATURE_MASTER_WIRE_DETAILS);
|
wd.purpose.purpose = htonl (TALER_SIGNATURE_MASTER_WIRE_DETAILS);
|
||||||
wd.purpose.size = htonl (sizeof (wd));
|
wd.purpose.size = htonl (sizeof (wd));
|
||||||
TALER_exchange_wire_signature_hash (payto_url,
|
TALER_exchange_wire_signature_hash (payto_uri,
|
||||||
&wd.h_wire_details);
|
&wd.h_wire_details);
|
||||||
return GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_MASTER_WIRE_DETAILS,
|
return GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_MASTER_WIRE_DETAILS,
|
||||||
&wd.purpose,
|
&wd.purpose,
|
||||||
@ -76,12 +76,12 @@ TALER_exchange_wire_signature_check (const char *payto_url,
|
|||||||
/**
|
/**
|
||||||
* Create a signed wire statement for the given account.
|
* Create a signed wire statement for the given account.
|
||||||
*
|
*
|
||||||
* @param payto_url account specification
|
* @param payto_uri account specification
|
||||||
* @param master_priv private key to sign with
|
* @param master_priv private key to sign with
|
||||||
* @param[out] master_sig where to write the signature
|
* @param[out] master_sig where to write the signature
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
TALER_exchange_wire_signature_make (const char *payto_url,
|
TALER_exchange_wire_signature_make (const char *payto_uri,
|
||||||
const struct
|
const struct
|
||||||
TALER_MasterPrivateKeyP *master_priv,
|
TALER_MasterPrivateKeyP *master_priv,
|
||||||
struct TALER_MasterSignatureP *master_sig)
|
struct TALER_MasterSignatureP *master_sig)
|
||||||
@ -90,7 +90,7 @@ TALER_exchange_wire_signature_make (const char *payto_url,
|
|||||||
|
|
||||||
wd.purpose.purpose = htonl (TALER_SIGNATURE_MASTER_WIRE_DETAILS);
|
wd.purpose.purpose = htonl (TALER_SIGNATURE_MASTER_WIRE_DETAILS);
|
||||||
wd.purpose.size = htonl (sizeof (wd));
|
wd.purpose.size = htonl (sizeof (wd));
|
||||||
TALER_exchange_wire_signature_hash (payto_url,
|
TALER_exchange_wire_signature_hash (payto_uri,
|
||||||
&wd.h_wire_details);
|
&wd.h_wire_details);
|
||||||
GNUNET_assert (GNUNET_OK ==
|
GNUNET_assert (GNUNET_OK ==
|
||||||
GNUNET_CRYPTO_eddsa_sign (&master_priv->eddsa_priv,
|
GNUNET_CRYPTO_eddsa_sign (&master_priv->eddsa_priv,
|
||||||
@ -103,12 +103,12 @@ TALER_exchange_wire_signature_make (const char *payto_url,
|
|||||||
* Compute the hash of the given wire details. The resulting
|
* Compute the hash of the given wire details. The resulting
|
||||||
* hash is what is put into the contract.
|
* hash is what is put into the contract.
|
||||||
*
|
*
|
||||||
* @param payto_url bank account
|
* @param payto_uri bank account
|
||||||
* @param salt salt used to eliminate brute-force inversion
|
* @param salt salt used to eliminate brute-force inversion
|
||||||
* @param[out] hc set to the hash
|
* @param[out] hc set to the hash
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
TALER_merchant_wire_signature_hash (const char *payto_url,
|
TALER_merchant_wire_signature_hash (const char *payto_uri,
|
||||||
const char *salt,
|
const char *salt,
|
||||||
struct GNUNET_HashCode *hc)
|
struct GNUNET_HashCode *hc)
|
||||||
{
|
{
|
||||||
@ -117,8 +117,8 @@ TALER_merchant_wire_signature_hash (const char *payto_url,
|
|||||||
sizeof (*hc),
|
sizeof (*hc),
|
||||||
salt,
|
salt,
|
||||||
strlen (salt) + 1,
|
strlen (salt) + 1,
|
||||||
payto_url,
|
payto_uri,
|
||||||
strlen (payto_url) + 1,
|
strlen (payto_uri) + 1,
|
||||||
"merchant-wire-signature",
|
"merchant-wire-signature",
|
||||||
strlen ("merchant-wire-signature"),
|
strlen ("merchant-wire-signature"),
|
||||||
NULL, 0));
|
NULL, 0));
|
||||||
@ -128,14 +128,14 @@ TALER_merchant_wire_signature_hash (const char *payto_url,
|
|||||||
/**
|
/**
|
||||||
* Check the signature in @a merch_sig. (Not yet used anywhere.)
|
* Check the signature in @a merch_sig. (Not yet used anywhere.)
|
||||||
*
|
*
|
||||||
* @param payto_url URL that is signed
|
* @param payto_uri URL that is signed
|
||||||
* @param salt the salt used to salt the @a payto_url when hashing
|
* @param salt the salt used to salt the @a payto_uri when hashing
|
||||||
* @param merch_pub master public key of the merchant
|
* @param merch_pub master public key of the merchant
|
||||||
* @param merch_sig signature of the merchant
|
* @param merch_sig signature of the merchant
|
||||||
* @return #GNUNET_OK if signature is valid
|
* @return #GNUNET_OK if signature is valid
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
TALER_merchant_wire_signature_check (const char *payto_url,
|
TALER_merchant_wire_signature_check (const char *payto_uri,
|
||||||
const char *salt,
|
const char *salt,
|
||||||
const struct
|
const struct
|
||||||
TALER_MerchantPublicKeyP *merch_pub,
|
TALER_MerchantPublicKeyP *merch_pub,
|
||||||
@ -146,7 +146,7 @@ TALER_merchant_wire_signature_check (const char *payto_url,
|
|||||||
|
|
||||||
wd.purpose.purpose = htonl (TALER_SIGNATURE_MERCHANT_WIRE_DETAILS);
|
wd.purpose.purpose = htonl (TALER_SIGNATURE_MERCHANT_WIRE_DETAILS);
|
||||||
wd.purpose.size = htonl (sizeof (wd));
|
wd.purpose.size = htonl (sizeof (wd));
|
||||||
TALER_merchant_wire_signature_hash (payto_url,
|
TALER_merchant_wire_signature_hash (payto_uri,
|
||||||
salt,
|
salt,
|
||||||
&wd.h_wire_details);
|
&wd.h_wire_details);
|
||||||
return GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_MERCHANT_WIRE_DETAILS,
|
return GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_MERCHANT_WIRE_DETAILS,
|
||||||
@ -159,13 +159,13 @@ TALER_merchant_wire_signature_check (const char *payto_url,
|
|||||||
/**
|
/**
|
||||||
* Create a signed wire statement for the given account. (Not yet used anywhere.)
|
* Create a signed wire statement for the given account. (Not yet used anywhere.)
|
||||||
*
|
*
|
||||||
* @param payto_url account specification
|
* @param payto_uri account specification
|
||||||
* @param salt the salt used to salt the @a payto_url when hashing
|
* @param salt the salt used to salt the @a payto_uri when hashing
|
||||||
* @param merch_priv private key to sign with
|
* @param merch_priv private key to sign with
|
||||||
* @param[out] merch_sig where to write the signature
|
* @param[out] merch_sig where to write the signature
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
TALER_merchant_wire_signature_make (const char *payto_url,
|
TALER_merchant_wire_signature_make (const char *payto_uri,
|
||||||
const char *salt,
|
const char *salt,
|
||||||
const struct
|
const struct
|
||||||
TALER_MerchantPrivateKeyP *merch_priv,
|
TALER_MerchantPrivateKeyP *merch_priv,
|
||||||
@ -175,7 +175,7 @@ TALER_merchant_wire_signature_make (const char *payto_url,
|
|||||||
|
|
||||||
wd.purpose.purpose = htonl (TALER_SIGNATURE_MERCHANT_WIRE_DETAILS);
|
wd.purpose.purpose = htonl (TALER_SIGNATURE_MERCHANT_WIRE_DETAILS);
|
||||||
wd.purpose.size = htonl (sizeof (wd));
|
wd.purpose.size = htonl (sizeof (wd));
|
||||||
TALER_merchant_wire_signature_hash (payto_url,
|
TALER_merchant_wire_signature_hash (payto_uri,
|
||||||
salt,
|
salt,
|
||||||
&wd.h_wire_details);
|
&wd.h_wire_details);
|
||||||
GNUNET_assert (GNUNET_OK ==
|
GNUNET_assert (GNUNET_OK ==
|
||||||
|
@ -546,22 +546,22 @@ TALER_url_absolute_mhd (struct MHD_Connection *connection,
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Obtain the payment method from a @a payto_url
|
* Obtain the payment method from a @a payto_uri
|
||||||
*
|
*
|
||||||
* @param payto_url the URL to parse
|
* @param payto_uri the URL to parse
|
||||||
* @return NULL on error (malformed @a payto_url)
|
* @return NULL on error (malformed @a payto_uri)
|
||||||
*/
|
*/
|
||||||
char *
|
char *
|
||||||
TALER_payto_get_method (const char *payto_url)
|
TALER_payto_get_method (const char *payto_uri)
|
||||||
{
|
{
|
||||||
const char *start;
|
const char *start;
|
||||||
const char *end;
|
const char *end;
|
||||||
|
|
||||||
if (0 != strncmp (payto_url,
|
if (0 != strncmp (payto_uri,
|
||||||
PAYTO,
|
PAYTO,
|
||||||
strlen (PAYTO)))
|
strlen (PAYTO)))
|
||||||
return NULL;
|
return NULL;
|
||||||
start = &payto_url[strlen (PAYTO)];
|
start = &payto_uri[strlen (PAYTO)];
|
||||||
end = strchr (start,
|
end = strchr (start,
|
||||||
(unsigned char) '/');
|
(unsigned char) '/');
|
||||||
if (NULL == end)
|
if (NULL == end)
|
||||||
|
Loading…
Reference in New Issue
Block a user