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);
|
||||
switch (pr)
|
||||
{
|
||||
case GNUNET_JSON_PR_OUT_OF_MEMORY:
|
||||
GNUNET_break (0);
|
||||
return MHD_NO;
|
||||
case GNUNET_JSON_PR_CONTINUE:
|
||||
return MHD_YES;
|
||||
case GNUNET_JSON_PR_REQUEST_TOO_LARGE:
|
||||
GNUNET_break (0);
|
||||
return MHD_NO;
|
||||
case GNUNET_JSON_PR_JSON_INVALID:
|
||||
GNUNET_break (0);
|
||||
return MHD_NO;
|
||||
case GNUNET_JSON_PR_SUCCESS:
|
||||
break;
|
||||
case GNUNET_JSON_PR_OUT_OF_MEMORY:
|
||||
GNUNET_break (0);
|
||||
return MHD_NO;
|
||||
case GNUNET_JSON_PR_CONTINUE:
|
||||
return MHD_YES;
|
||||
case GNUNET_JSON_PR_REQUEST_TOO_LARGE:
|
||||
GNUNET_break (0);
|
||||
return MHD_NO;
|
||||
case GNUNET_JSON_PR_JSON_INVALID:
|
||||
GNUNET_break (0);
|
||||
return MHD_NO;
|
||||
case GNUNET_JSON_PR_SUCCESS:
|
||||
break;
|
||||
}
|
||||
{
|
||||
const char *debit_account;
|
||||
@ -1510,19 +1510,19 @@ handle_transfer (struct TALER_FAKEBANK_Handle *h,
|
||||
&json);
|
||||
switch (pr)
|
||||
{
|
||||
case GNUNET_JSON_PR_OUT_OF_MEMORY:
|
||||
GNUNET_break (0);
|
||||
return MHD_NO;
|
||||
case GNUNET_JSON_PR_CONTINUE:
|
||||
return MHD_YES;
|
||||
case GNUNET_JSON_PR_REQUEST_TOO_LARGE:
|
||||
GNUNET_break (0);
|
||||
return MHD_NO;
|
||||
case GNUNET_JSON_PR_JSON_INVALID:
|
||||
GNUNET_break (0);
|
||||
return MHD_NO;
|
||||
case GNUNET_JSON_PR_SUCCESS:
|
||||
break;
|
||||
case GNUNET_JSON_PR_OUT_OF_MEMORY:
|
||||
GNUNET_break (0);
|
||||
return MHD_NO;
|
||||
case GNUNET_JSON_PR_CONTINUE:
|
||||
return MHD_YES;
|
||||
case GNUNET_JSON_PR_REQUEST_TOO_LARGE:
|
||||
GNUNET_break (0);
|
||||
return MHD_NO;
|
||||
case GNUNET_JSON_PR_JSON_INVALID:
|
||||
GNUNET_break (0);
|
||||
return MHD_NO;
|
||||
case GNUNET_JSON_PR_SUCCESS:
|
||||
break;
|
||||
}
|
||||
{
|
||||
struct GNUNET_HashCode uuid;
|
||||
|
@ -94,7 +94,6 @@ TEH_handler_csr (struct TEH_RequestContext *rc,
|
||||
return TEH_RESPONSE_reply_expired_denom_pub_hash (
|
||||
rc->connection,
|
||||
&denom_pub_hash,
|
||||
GNUNET_TIME_timestamp_get (),
|
||||
TALER_EC_EXCHANGE_GENERIC_DENOMINATION_EXPIRED,
|
||||
"CSR");
|
||||
}
|
||||
@ -105,7 +104,6 @@ TEH_handler_csr (struct TEH_RequestContext *rc,
|
||||
return TEH_RESPONSE_reply_expired_denom_pub_hash (
|
||||
rc->connection,
|
||||
&denom_pub_hash,
|
||||
GNUNET_TIME_timestamp_get (),
|
||||
TALER_EC_EXCHANGE_GENERIC_DENOMINATION_VALIDITY_IN_FUTURE,
|
||||
"CSR");
|
||||
}
|
||||
@ -115,7 +113,6 @@ TEH_handler_csr (struct TEH_RequestContext *rc,
|
||||
return TEH_RESPONSE_reply_expired_denom_pub_hash (
|
||||
rc->connection,
|
||||
&denom_pub_hash,
|
||||
GNUNET_TIME_timestamp_get (),
|
||||
TALER_EC_EXCHANGE_GENERIC_DENOMINATION_REVOKED,
|
||||
"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_BlindedPlanchet blinded_planchet;
|
||||
|
||||
if (GNUNET_OK !=
|
||||
TALER_denom_blind (&dk->denom_pub,
|
||||
coin_bks,
|
||||
NULL, /* FIXME-Oec: TALER_AgeHash * */
|
||||
&coin->coin_pub,
|
||||
NULL, /* FIXME: Implement CS */
|
||||
&c_hash,
|
||||
&coin_ev,
|
||||
&coin_ev_size))
|
||||
&blinded_planchet))
|
||||
{
|
||||
GNUNET_break (0);
|
||||
return TALER_MHD_reply_with_error (
|
||||
@ -261,10 +260,10 @@ verify_and_execute_recoup_refresh (
|
||||
TALER_EC_EXCHANGE_RECOUP_REFRESH_BLINDING_FAILED,
|
||||
NULL);
|
||||
}
|
||||
TALER_coin_ev_hash (coin_ev,
|
||||
coin_ev_size,
|
||||
TALER_coin_ev_hash (&blinded_planchet,
|
||||
&coin->denom_pub_hash,
|
||||
&h_blind);
|
||||
GNUNET_free (coin_ev);
|
||||
TALER_blinded_planchet_free (&blinded_planchet);
|
||||
}
|
||||
|
||||
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_BlindedPlanchet blinded_planchet;
|
||||
|
||||
@ -254,7 +251,7 @@ verify_and_execute_recoup (
|
||||
coin_bks,
|
||||
NULL, /* FIXME-Oec: TALER_AgeHash * */
|
||||
&coin->coin_pub,
|
||||
NULL, /* in RSA Case not needed*/
|
||||
NULL, /* FIXME: handle CS */
|
||||
&c_hash,
|
||||
&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++)
|
||||
{
|
||||
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;
|
||||
|
||||
// FIXME: implement cipher handling
|
||||
sign_details.cipher = TALER_DENOMINATION_RSA;
|
||||
sign_details.details.rsa_message.msg = rctx->rcds[i].coin_ev;
|
||||
sign_details.details.rsa_message.msg_size = rctx->rcds[i].coin_ev_size;
|
||||
rctx->ev_sigs[i] = TEH_keys_denomination_sign (&dk_h[i],
|
||||
&sign_details,
|
||||
&ec);
|
||||
sign_details.details.rsa_message.msg = rcds[i].coin_ev;
|
||||
sign_details.details.rsa_message.msg_size = rcds[i].coin_ev_size;
|
||||
rrcs[i].coin_sig
|
||||
= TEH_keys_denomination_sign (
|
||||
&rrcs[i].h_denom_pub,
|
||||
&sign_details,
|
||||
&ec);
|
||||
if (TALER_EC_NONE != ec)
|
||||
{
|
||||
GNUNET_break (0);
|
||||
|
@ -98,13 +98,10 @@ struct WithdrawContext
|
||||
/**
|
||||
* Blinded planchet.
|
||||
*/
|
||||
//FIXME:
|
||||
struct TALER_BlindedPlanchet blinded_planchet;
|
||||
|
||||
/**
|
||||
* Number of bytes in @e blinded_msg.
|
||||
*/
|
||||
size_t blinded_msg_len;
|
||||
struct TALER_BlindedPlanchet blinded_planchet;
|
||||
* Set to the resulting signed coin data to be returned to the client.
|
||||
*/
|
||||
struct TALER_EXCHANGEDB_CollectableBlindcoin collectable;
|
||||
|
||||
@ -322,12 +319,6 @@ TEH_handler_withdraw (struct TEH_RequestContext *rc,
|
||||
{
|
||||
struct WithdrawContext wc;
|
||||
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",
|
||||
&wc.collectable.reserve_sig),
|
||||
GNUNET_JSON_spec_fixed_auto ("denom_pub_hash",
|
||||
@ -447,24 +438,6 @@ TEH_handler_withdraw (struct TEH_RequestContext *rc,
|
||||
GNUNET_JSON_parse_free (spec);
|
||||
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)
|
||||
{
|
||||
/* 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 >
|
||||
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);
|
||||
}
|
||||
TALER_amount_hton (&wc.wsrd.amount_with_fee,
|
||||
&wc.collectable.amount_with_fee);
|
||||
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);
|
||||
|
@ -531,7 +531,7 @@ handle_link_data_cb (void *cls,
|
||||
break;
|
||||
}
|
||||
}
|
||||
//FIXME:
|
||||
// FIXME:
|
||||
GNUNET_assert (GNUNET_NO != found);
|
||||
}
|
||||
}
|
||||
@ -1690,7 +1690,7 @@ run (void *cls)
|
||||
struct TALER_CoinSpendPublicKeyP coin_pub;
|
||||
struct TALER_AgeHash age_hash;
|
||||
struct TALER_AgeHash *p_ah[2] = {NULL, &age_hash};
|
||||
//FIXME:
|
||||
// FIXME:
|
||||
/* Call TALER_denom_blind()/TALER_denom_sign_blinded() twice, once without
|
||||
* age_hash, once with 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
|
||||
* @return char* the first occurence of `c` in `s`
|
||||
*/
|
||||
char * strchrnul (const char *s, int c);
|
||||
char *strchrnul (const char *s, int c);
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -845,7 +845,7 @@ TALER_JSON_spec_i18n_str (const char *name,
|
||||
return ret;
|
||||
}
|
||||
|
||||
//FIXME:
|
||||
|
||||
enum GNUNET_GenericReturnValue
|
||||
TALER_JSON_parse_agemask (const json_t *root,
|
||||
struct TALER_AgeMask *mask)
|
||||
@ -873,56 +873,7 @@ TALER_JSON_parse_agemask (const json_t *root,
|
||||
{
|
||||
return GNUNET_SYSERR;
|
||||
}
|
||||
//FIXME:
|
||||
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);
|
||||
return GNUNET_SYSERR;
|
||||
}
|
||||
GNUNET_CRYPTO_hash (pd.coin_ev,
|
||||
pd.coin_ev_size,
|
||||
&coin_envelope_hash.hash);
|
||||
//FIXME:
|
||||
TALER_coin_ev_hash (&pd.blinded_planchet,
|
||||
&pd.denom_pub_hash,
|
||||
&coin_envelope_hash);
|
||||
if (GNUNET_OK !=
|
||||
TALER_wallet_link_verify (&pd.denom_pub_hash,
|
||||
trans_pub,
|
||||
&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,
|
||||
&link_sig))
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user