resolves merge conflicts
This commit is contained in:
parent
8674f32aec
commit
a67786078b
@ -1 +1 @@
|
|||||||
Subproject commit c12314df0f82e192c6829a9c6cf3e9663b586da1
|
Subproject commit 6b74d0faa173bbb220cdd82dcf3915dadd241e1e
|
@ -1386,19 +1386,19 @@ handle_admin_add_incoming (struct TALER_FAKEBANK_Handle *h,
|
|||||||
&json);
|
&json);
|
||||||
switch (pr)
|
switch (pr)
|
||||||
{
|
{
|
||||||
case GNUNET_JSON_PR_OUT_OF_MEMORY:
|
case GNUNET_JSON_PR_OUT_OF_MEMORY:
|
||||||
GNUNET_break (0);
|
GNUNET_break (0);
|
||||||
return MHD_NO;
|
return MHD_NO;
|
||||||
case GNUNET_JSON_PR_CONTINUE:
|
case GNUNET_JSON_PR_CONTINUE:
|
||||||
return MHD_YES;
|
return MHD_YES;
|
||||||
case GNUNET_JSON_PR_REQUEST_TOO_LARGE:
|
case GNUNET_JSON_PR_REQUEST_TOO_LARGE:
|
||||||
GNUNET_break (0);
|
GNUNET_break (0);
|
||||||
return MHD_NO;
|
return MHD_NO;
|
||||||
case GNUNET_JSON_PR_JSON_INVALID:
|
case GNUNET_JSON_PR_JSON_INVALID:
|
||||||
GNUNET_break (0);
|
GNUNET_break (0);
|
||||||
return MHD_NO;
|
return MHD_NO;
|
||||||
case GNUNET_JSON_PR_SUCCESS:
|
case GNUNET_JSON_PR_SUCCESS:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
const char *debit_account;
|
const char *debit_account;
|
||||||
@ -1510,19 +1510,19 @@ handle_transfer (struct TALER_FAKEBANK_Handle *h,
|
|||||||
&json);
|
&json);
|
||||||
switch (pr)
|
switch (pr)
|
||||||
{
|
{
|
||||||
case GNUNET_JSON_PR_OUT_OF_MEMORY:
|
case GNUNET_JSON_PR_OUT_OF_MEMORY:
|
||||||
GNUNET_break (0);
|
GNUNET_break (0);
|
||||||
return MHD_NO;
|
return MHD_NO;
|
||||||
case GNUNET_JSON_PR_CONTINUE:
|
case GNUNET_JSON_PR_CONTINUE:
|
||||||
return MHD_YES;
|
return MHD_YES;
|
||||||
case GNUNET_JSON_PR_REQUEST_TOO_LARGE:
|
case GNUNET_JSON_PR_REQUEST_TOO_LARGE:
|
||||||
GNUNET_break (0);
|
GNUNET_break (0);
|
||||||
return MHD_NO;
|
return MHD_NO;
|
||||||
case GNUNET_JSON_PR_JSON_INVALID:
|
case GNUNET_JSON_PR_JSON_INVALID:
|
||||||
GNUNET_break (0);
|
GNUNET_break (0);
|
||||||
return MHD_NO;
|
return MHD_NO;
|
||||||
case GNUNET_JSON_PR_SUCCESS:
|
case GNUNET_JSON_PR_SUCCESS:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
struct GNUNET_HashCode uuid;
|
struct GNUNET_HashCode uuid;
|
||||||
|
@ -94,7 +94,6 @@ TEH_handler_csr (struct TEH_RequestContext *rc,
|
|||||||
return TEH_RESPONSE_reply_expired_denom_pub_hash (
|
return TEH_RESPONSE_reply_expired_denom_pub_hash (
|
||||||
rc->connection,
|
rc->connection,
|
||||||
&denom_pub_hash,
|
&denom_pub_hash,
|
||||||
GNUNET_TIME_timestamp_get (),
|
|
||||||
TALER_EC_EXCHANGE_GENERIC_DENOMINATION_EXPIRED,
|
TALER_EC_EXCHANGE_GENERIC_DENOMINATION_EXPIRED,
|
||||||
"CSR");
|
"CSR");
|
||||||
}
|
}
|
||||||
@ -105,7 +104,6 @@ TEH_handler_csr (struct TEH_RequestContext *rc,
|
|||||||
return TEH_RESPONSE_reply_expired_denom_pub_hash (
|
return TEH_RESPONSE_reply_expired_denom_pub_hash (
|
||||||
rc->connection,
|
rc->connection,
|
||||||
&denom_pub_hash,
|
&denom_pub_hash,
|
||||||
GNUNET_TIME_timestamp_get (),
|
|
||||||
TALER_EC_EXCHANGE_GENERIC_DENOMINATION_VALIDITY_IN_FUTURE,
|
TALER_EC_EXCHANGE_GENERIC_DENOMINATION_VALIDITY_IN_FUTURE,
|
||||||
"CSR");
|
"CSR");
|
||||||
}
|
}
|
||||||
@ -115,7 +113,6 @@ TEH_handler_csr (struct TEH_RequestContext *rc,
|
|||||||
return TEH_RESPONSE_reply_expired_denom_pub_hash (
|
return TEH_RESPONSE_reply_expired_denom_pub_hash (
|
||||||
rc->connection,
|
rc->connection,
|
||||||
&denom_pub_hash,
|
&denom_pub_hash,
|
||||||
GNUNET_TIME_timestamp_get (),
|
|
||||||
TALER_EC_EXCHANGE_GENERIC_DENOMINATION_REVOKED,
|
TALER_EC_EXCHANGE_GENERIC_DENOMINATION_REVOKED,
|
||||||
"CSR");
|
"CSR");
|
||||||
}
|
}
|
||||||
|
@ -241,18 +241,17 @@ verify_and_execute_recoup_refresh (
|
|||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
void *coin_ev;
|
|
||||||
size_t coin_ev_size;
|
|
||||||
struct TALER_CoinPubHash c_hash;
|
struct TALER_CoinPubHash c_hash;
|
||||||
|
struct TALER_BlindedPlanchet blinded_planchet;
|
||||||
|
|
||||||
if (GNUNET_OK !=
|
if (GNUNET_OK !=
|
||||||
TALER_denom_blind (&dk->denom_pub,
|
TALER_denom_blind (&dk->denom_pub,
|
||||||
coin_bks,
|
coin_bks,
|
||||||
NULL, /* FIXME-Oec: TALER_AgeHash * */
|
NULL, /* FIXME-Oec: TALER_AgeHash * */
|
||||||
&coin->coin_pub,
|
&coin->coin_pub,
|
||||||
|
NULL, /* FIXME: Implement CS */
|
||||||
&c_hash,
|
&c_hash,
|
||||||
&coin_ev,
|
&blinded_planchet))
|
||||||
&coin_ev_size))
|
|
||||||
{
|
{
|
||||||
GNUNET_break (0);
|
GNUNET_break (0);
|
||||||
return TALER_MHD_reply_with_error (
|
return TALER_MHD_reply_with_error (
|
||||||
@ -261,10 +260,10 @@ verify_and_execute_recoup_refresh (
|
|||||||
TALER_EC_EXCHANGE_RECOUP_REFRESH_BLINDING_FAILED,
|
TALER_EC_EXCHANGE_RECOUP_REFRESH_BLINDING_FAILED,
|
||||||
NULL);
|
NULL);
|
||||||
}
|
}
|
||||||
TALER_coin_ev_hash (coin_ev,
|
TALER_coin_ev_hash (&blinded_planchet,
|
||||||
coin_ev_size,
|
&coin->denom_pub_hash,
|
||||||
&h_blind);
|
&h_blind);
|
||||||
GNUNET_free (coin_ev);
|
TALER_blinded_planchet_free (&blinded_planchet);
|
||||||
}
|
}
|
||||||
|
|
||||||
pc.coin_sig = coin_sig;
|
pc.coin_sig = coin_sig;
|
||||||
|
@ -243,9 +243,6 @@ verify_and_execute_recoup (
|
|||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
//FIXME:
|
|
||||||
void *coin_ev;
|
|
||||||
size_t coin_ev_size;
|
|
||||||
struct TALER_CoinPubHash c_hash;
|
struct TALER_CoinPubHash c_hash;
|
||||||
struct TALER_BlindedPlanchet blinded_planchet;
|
struct TALER_BlindedPlanchet blinded_planchet;
|
||||||
|
|
||||||
@ -254,7 +251,7 @@ verify_and_execute_recoup (
|
|||||||
coin_bks,
|
coin_bks,
|
||||||
NULL, /* FIXME-Oec: TALER_AgeHash * */
|
NULL, /* FIXME-Oec: TALER_AgeHash * */
|
||||||
&coin->coin_pub,
|
&coin->coin_pub,
|
||||||
NULL, /* in RSA Case not needed*/
|
NULL, /* FIXME: handle CS */
|
||||||
&c_hash,
|
&c_hash,
|
||||||
&blinded_planchet))
|
&blinded_planchet))
|
||||||
{
|
{
|
||||||
|
@ -510,23 +510,17 @@ resolve_refreshes_reveal_denominations (struct MHD_Connection *connection,
|
|||||||
for (unsigned int i = 0; i<rctx->num_fresh_coins; i++)
|
for (unsigned int i = 0; i<rctx->num_fresh_coins; i++)
|
||||||
{
|
{
|
||||||
enum TALER_ErrorCode ec = TALER_EC_NONE;
|
enum TALER_ErrorCode ec = TALER_EC_NONE;
|
||||||
//FIXME:
|
|
||||||
|
|
||||||
rrcs[i].coin_sig
|
|
||||||
= TEH_keys_denomination_sign (
|
|
||||||
&rrcs[i].h_denom_pub,
|
|
||||||
rcds[i].coin_ev,
|
|
||||||
rcds[i].coin_ev_size,
|
|
||||||
&ec);
|
|
||||||
struct TEH_SignDetails sign_details;
|
struct TEH_SignDetails sign_details;
|
||||||
|
|
||||||
// FIXME: implement cipher handling
|
// FIXME: implement cipher handling
|
||||||
sign_details.cipher = TALER_DENOMINATION_RSA;
|
sign_details.cipher = TALER_DENOMINATION_RSA;
|
||||||
sign_details.details.rsa_message.msg = rctx->rcds[i].coin_ev;
|
sign_details.details.rsa_message.msg = rcds[i].coin_ev;
|
||||||
sign_details.details.rsa_message.msg_size = rctx->rcds[i].coin_ev_size;
|
sign_details.details.rsa_message.msg_size = rcds[i].coin_ev_size;
|
||||||
rctx->ev_sigs[i] = TEH_keys_denomination_sign (&dk_h[i],
|
rrcs[i].coin_sig
|
||||||
&sign_details,
|
= TEH_keys_denomination_sign (
|
||||||
&ec);
|
&rrcs[i].h_denom_pub,
|
||||||
|
&sign_details,
|
||||||
|
&ec);
|
||||||
if (TALER_EC_NONE != ec)
|
if (TALER_EC_NONE != ec)
|
||||||
{
|
{
|
||||||
GNUNET_break (0);
|
GNUNET_break (0);
|
||||||
|
@ -98,13 +98,10 @@ struct WithdrawContext
|
|||||||
/**
|
/**
|
||||||
* Blinded planchet.
|
* Blinded planchet.
|
||||||
*/
|
*/
|
||||||
//FIXME:
|
struct TALER_BlindedPlanchet blinded_planchet;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Number of bytes in @e blinded_msg.
|
* Set to the resulting signed coin data to be returned to the client.
|
||||||
*/
|
|
||||||
size_t blinded_msg_len;
|
|
||||||
struct TALER_BlindedPlanchet blinded_planchet;
|
|
||||||
*/
|
*/
|
||||||
struct TALER_EXCHANGEDB_CollectableBlindcoin collectable;
|
struct TALER_EXCHANGEDB_CollectableBlindcoin collectable;
|
||||||
|
|
||||||
@ -322,12 +319,6 @@ TEH_handler_withdraw (struct TEH_RequestContext *rc,
|
|||||||
{
|
{
|
||||||
struct WithdrawContext wc;
|
struct WithdrawContext wc;
|
||||||
struct GNUNET_JSON_Specification spec[] = {
|
struct GNUNET_JSON_Specification spec[] = {
|
||||||
//FIXME:
|
|
||||||
GNUNET_JSON_spec_varsize ("coin_ev",
|
|
||||||
&wc.blinded_msg,
|
|
||||||
&wc.blinded_msg_len),
|
|
||||||
// field "coin_ev" will be parsed later due to different parsing depending
|
|
||||||
// on denomination cipher, see coin_ev_..._spec
|
|
||||||
GNUNET_JSON_spec_fixed_auto ("reserve_sig",
|
GNUNET_JSON_spec_fixed_auto ("reserve_sig",
|
||||||
&wc.collectable.reserve_sig),
|
&wc.collectable.reserve_sig),
|
||||||
GNUNET_JSON_spec_fixed_auto ("denom_pub_hash",
|
GNUNET_JSON_spec_fixed_auto ("denom_pub_hash",
|
||||||
@ -447,24 +438,6 @@ TEH_handler_withdraw (struct TEH_RequestContext *rc,
|
|||||||
GNUNET_JSON_parse_free (spec);
|
GNUNET_JSON_parse_free (spec);
|
||||||
return mret;
|
return mret;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
//FIXME:
|
|
||||||
if (0 >
|
|
||||||
TALER_amount_add (&wc.collectable.amount_with_fee,
|
|
||||||
&dk->meta.value,
|
|
||||||
&dk->meta.fee_withdraw))
|
|
||||||
{
|
|
||||||
GNUNET_JSON_parse_free (spec);
|
|
||||||
return TALER_MHD_reply_with_error (rc->connection,
|
|
||||||
MHD_HTTP_INTERNAL_SERVER_ERROR,
|
|
||||||
TALER_EC_EXCHANGE_WITHDRAW_AMOUNT_FEE_OVERFLOW,
|
|
||||||
NULL);
|
|
||||||
// parse coin_ev field, must be done after dk lookup to know denom cipher
|
|
||||||
{
|
|
||||||
enum GNUNET_GenericReturnValue res;
|
|
||||||
wc.blinded_planchet.cipher = dk->denom_pub.cipher;
|
|
||||||
switch (wc.blinded_planchet.cipher)
|
|
||||||
|
|
||||||
if (dk->denom_pub.cipher != wc.blinded_planchet.cipher)
|
if (dk->denom_pub.cipher != wc.blinded_planchet.cipher)
|
||||||
{
|
{
|
||||||
/* denomination cipher and blinded planchet cipher not the same */
|
/* denomination cipher and blinded planchet cipher not the same */
|
||||||
@ -476,20 +449,16 @@ TEH_handler_withdraw (struct TEH_RequestContext *rc,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (0 >
|
||||||
|
TALER_amount_add (&wc.collectable.amount_with_fee,
|
||||||
|
&dk->meta.value,
|
||||||
|
&dk->meta.fee_withdraw))
|
||||||
{
|
{
|
||||||
if (0 >
|
GNUNET_JSON_parse_free (spec);
|
||||||
TALER_amount_add (&wc.collectable.amount_with_fee,
|
return TALER_MHD_reply_with_error (rc->connection,
|
||||||
&dk->meta.value,
|
MHD_HTTP_INTERNAL_SERVER_ERROR,
|
||||||
&dk->meta.fee_withdraw))
|
TALER_EC_EXCHANGE_WITHDRAW_AMOUNT_FEE_OVERFLOW,
|
||||||
{
|
NULL);
|
||||||
GNUNET_JSON_parse_free (spec);
|
|
||||||
return TALER_MHD_reply_with_error (rc->connection,
|
|
||||||
MHD_HTTP_INTERNAL_SERVER_ERROR,
|
|
||||||
TALER_EC_EXCHANGE_WITHDRAW_AMOUNT_FEE_OVERFLOW,
|
|
||||||
NULL);
|
|
||||||
}
|
|
||||||
TALER_amount_hton (&wc.wsrd.amount_with_fee,
|
|
||||||
&wc.collectable.amount_with_fee);
|
|
||||||
}
|
}
|
||||||
TALER_amount_hton (&wc.wsrd.amount_with_fee,
|
TALER_amount_hton (&wc.wsrd.amount_with_fee,
|
||||||
&wc.collectable.amount_with_fee);
|
&wc.collectable.amount_with_fee);
|
||||||
|
@ -531,7 +531,7 @@ handle_link_data_cb (void *cls,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//FIXME:
|
// FIXME:
|
||||||
GNUNET_assert (GNUNET_NO != found);
|
GNUNET_assert (GNUNET_NO != found);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1690,7 +1690,7 @@ run (void *cls)
|
|||||||
struct TALER_CoinSpendPublicKeyP coin_pub;
|
struct TALER_CoinSpendPublicKeyP coin_pub;
|
||||||
struct TALER_AgeHash age_hash;
|
struct TALER_AgeHash age_hash;
|
||||||
struct TALER_AgeHash *p_ah[2] = {NULL, &age_hash};
|
struct TALER_AgeHash *p_ah[2] = {NULL, &age_hash};
|
||||||
//FIXME:
|
// FIXME:
|
||||||
/* Call TALER_denom_blind()/TALER_denom_sign_blinded() twice, once without
|
/* Call TALER_denom_blind()/TALER_denom_sign_blinded() twice, once without
|
||||||
* age_hash, once with age_hash */
|
* age_hash, once with age_hash */
|
||||||
RND_BLK (&age_hash);
|
RND_BLK (&age_hash);
|
||||||
|
@ -444,7 +444,7 @@ TALER_yna_to_string (enum TALER_EXCHANGE_YesNoAll yna);
|
|||||||
* @param c the character to search for
|
* @param c the character to search for
|
||||||
* @return char* the first occurence of `c` in `s`
|
* @return char* the first occurence of `c` in `s`
|
||||||
*/
|
*/
|
||||||
char * strchrnul (const char *s, int c);
|
char *strchrnul (const char *s, int c);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -845,7 +845,7 @@ TALER_JSON_spec_i18n_str (const char *name,
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
//FIXME:
|
|
||||||
enum GNUNET_GenericReturnValue
|
enum GNUNET_GenericReturnValue
|
||||||
TALER_JSON_parse_agemask (const json_t *root,
|
TALER_JSON_parse_agemask (const json_t *root,
|
||||||
struct TALER_AgeMask *mask)
|
struct TALER_AgeMask *mask)
|
||||||
@ -873,56 +873,7 @@ TALER_JSON_parse_agemask (const json_t *root,
|
|||||||
{
|
{
|
||||||
return GNUNET_SYSERR;
|
return GNUNET_SYSERR;
|
||||||
}
|
}
|
||||||
//FIXME:
|
|
||||||
return GNUNET_OK;
|
return GNUNET_OK;
|
||||||
/**
|
|
||||||
* Parse given JSON object to CS R.
|
|
||||||
*
|
|
||||||
* @param cls closure, NULL
|
|
||||||
* @param root the json object representing data
|
|
||||||
* @param[out] spec where to write the data
|
|
||||||
* @return #GNUNET_OK upon successful parsing; #GNUNET_SYSERR upon error
|
|
||||||
*/
|
|
||||||
static enum GNUNET_GenericReturnValue
|
|
||||||
parse_csr (void *cls,
|
|
||||||
json_t *root,
|
|
||||||
struct GNUNET_JSON_Specification *spec)
|
|
||||||
{
|
|
||||||
struct GNUNET_CRYPTO_CsRPublic *r_pub = spec->ptr;
|
|
||||||
|
|
||||||
struct GNUNET_JSON_Specification dspec[] = {
|
|
||||||
GNUNET_JSON_spec_fixed (spec->field, r_pub, sizeof (struct
|
|
||||||
GNUNET_CRYPTO_CsRPublic)),
|
|
||||||
GNUNET_JSON_spec_end ()
|
|
||||||
};
|
|
||||||
const char *emsg;
|
|
||||||
unsigned int eline;
|
|
||||||
|
|
||||||
if (GNUNET_OK !=
|
|
||||||
GNUNET_JSON_parse (root,
|
|
||||||
dspec,
|
|
||||||
&emsg,
|
|
||||||
&eline))
|
|
||||||
{
|
|
||||||
GNUNET_break_op (0);
|
|
||||||
return GNUNET_SYSERR;
|
|
||||||
}
|
|
||||||
return GNUNET_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
struct GNUNET_JSON_Specification
|
|
||||||
TALER_JSON_spec_csr (const char *field,
|
|
||||||
struct GNUNET_CRYPTO_CsRPublic *r_pub)
|
|
||||||
{
|
|
||||||
struct GNUNET_JSON_Specification ret = {
|
|
||||||
.parser = &parse_csr,
|
|
||||||
.cleaner = NULL,
|
|
||||||
.field = field,
|
|
||||||
.ptr = r_pub
|
|
||||||
};
|
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -156,18 +156,13 @@ parse_link_coin (const struct TALER_EXCHANGE_LinkHandle *lh,
|
|||||||
GNUNET_JSON_parse_free (spec);
|
GNUNET_JSON_parse_free (spec);
|
||||||
return GNUNET_SYSERR;
|
return GNUNET_SYSERR;
|
||||||
}
|
}
|
||||||
GNUNET_CRYPTO_hash (pd.coin_ev,
|
TALER_coin_ev_hash (&pd.blinded_planchet,
|
||||||
pd.coin_ev_size,
|
&pd.denom_pub_hash,
|
||||||
&coin_envelope_hash.hash);
|
&coin_envelope_hash);
|
||||||
//FIXME:
|
|
||||||
if (GNUNET_OK !=
|
if (GNUNET_OK !=
|
||||||
TALER_wallet_link_verify (&pd.denom_pub_hash,
|
TALER_wallet_link_verify (&pd.denom_pub_hash,
|
||||||
trans_pub,
|
trans_pub,
|
||||||
&coin_envelope_hash,
|
&coin_envelope_hash,
|
||||||
pd.blinded_planchet.details.
|
|
||||||
rsa_blinded_planchet.blinded_msg,
|
|
||||||
pd.blinded_planchet.details.
|
|
||||||
rsa_blinded_planchet.blinded_msg_size,
|
|
||||||
&old_coin_pub,
|
&old_coin_pub,
|
||||||
&link_sig))
|
&link_sig))
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user