WiP: age-withdraw, finalize_age_withdraw_and_sign continued, 9/n
This commit is contained in:
parent
ed57e6dc86
commit
9ffb7e2fd8
@ -796,24 +796,51 @@ verify_commitment_and_max_age (
|
|||||||
* @return GNUNET_OK on success, GNUNET_SYSERR otherwise
|
* @return GNUNET_OK on success, GNUNET_SYSERR otherwise
|
||||||
*/
|
*/
|
||||||
static enum GNUNET_GenericReturnValue
|
static enum GNUNET_GenericReturnValue
|
||||||
sign_and_persist_blinded_coins (
|
finalize_age_withdraw_and_sign (
|
||||||
struct MHD_Connection *connection,
|
struct MHD_Connection *connection,
|
||||||
const struct TALER_AgeWithdrawCommitmentHashP *h_commitment_orig,
|
const struct TALER_AgeWithdrawCommitmentHashP *h_commitment,
|
||||||
const uint32_t num_coins,
|
const uint32_t num_coins,
|
||||||
const struct TALER_BlindedPlanchet *coin_evs,
|
const struct TALER_BlindedPlanchet *coin_evs,
|
||||||
const struct TEH_DenominationKey *denom_keys,
|
const struct TEH_DenominationKey *denom_keys,
|
||||||
MHD_RESULT *result)
|
MHD_RESULT *result)
|
||||||
{
|
{
|
||||||
enum GNUNET_GenericReturnValue ret = GNUNET_SYSERR;
|
enum GNUNET_GenericReturnValue ret = GNUNET_SYSERR;
|
||||||
|
struct TEH_CoinSignData csds[num_coins];
|
||||||
|
struct TALER_BlindedDenominationSignature bss[num_coins];
|
||||||
|
|
||||||
|
for (uint32_t i = 0; i<num_coins; i++)
|
||||||
|
{
|
||||||
|
csds[i].h_denom_pub = &denom_keys[i].h_denom_pub;
|
||||||
|
csds[i].bp = &coin_evs[i];
|
||||||
|
}
|
||||||
|
|
||||||
|
/* First, sign the the blinded coins */
|
||||||
|
{
|
||||||
|
enum TALER_ErrorCode ec;
|
||||||
|
ec = TEH_keys_denomination_batch_sign (csds,
|
||||||
|
num_coins,
|
||||||
|
false,
|
||||||
|
bss);
|
||||||
|
if (TALER_EC_NONE != ec)
|
||||||
|
{
|
||||||
|
GNUNET_break (0);
|
||||||
|
*result = TALER_MHD_reply_with_ec (connection,
|
||||||
|
ec,
|
||||||
|
NULL);
|
||||||
|
return GNUNET_SYSERR;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* TODO[oec]:
|
/* TODO[oec]:
|
||||||
* - sign the planchets
|
|
||||||
* - in a transaction: save the coins.
|
* - in a transaction: save the coins.
|
||||||
|
* - add signature response
|
||||||
*/
|
*/
|
||||||
#pragma message "FIXME[oec]: implement sign_and_persist_blinded_coins"
|
|
||||||
|
#pragma message "FIXME[oec]: implement finalize_age_withdraw_and_sign"
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
MHD_RESULT
|
MHD_RESULT
|
||||||
TEH_handler_age_withdraw_reveal (
|
TEH_handler_age_withdraw_reveal (
|
||||||
struct TEH_RequestContext *rc,
|
struct TEH_RequestContext *rc,
|
||||||
@ -895,7 +922,7 @@ TEH_handler_age_withdraw_reveal (
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
/* Finally, sign and persist the coins */
|
/* Finally, sign and persist the coins */
|
||||||
if (GNUNET_OK != sign_and_persist_blinded_coins (
|
if (GNUNET_OK != finalize_age_withdraw_and_sign (
|
||||||
rc->connection,
|
rc->connection,
|
||||||
&actx.commitment.h_commitment,
|
&actx.commitment.h_commitment,
|
||||||
actx.num_coins,
|
actx.num_coins,
|
||||||
|
Loading…
Reference in New Issue
Block a user