fix type of transfer keys
This commit is contained in:
commit
5f879c0b4b
@ -514,11 +514,8 @@ refresh_accept_melts (struct MHD_Connection *connection,
|
|||||||
|
|
||||||
if (NULL == dki)
|
if (NULL == dki)
|
||||||
return (MHD_YES ==
|
return (MHD_YES ==
|
||||||
TMH_RESPONSE_reply_json_pack (connection,
|
TMH_RESPONSE_reply_arg_unknown (connection,
|
||||||
MHD_HTTP_NOT_FOUND,
|
"denom_pub"))
|
||||||
"{s:s}",
|
|
||||||
"error",
|
|
||||||
"denom not found"))
|
|
||||||
? GNUNET_NO : GNUNET_SYSERR;
|
? GNUNET_NO : GNUNET_SYSERR;
|
||||||
|
|
||||||
TALER_amount_ntoh (&coin_value,
|
TALER_amount_ntoh (&coin_value,
|
||||||
@ -652,6 +649,23 @@ TMH_DB_execute_refresh_melt (struct MHD_Connection *connection,
|
|||||||
return TMH_RESPONSE_reply_internal_db_error (connection);
|
return TMH_RESPONSE_reply_internal_db_error (connection);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* store 'global' session data */
|
||||||
|
refresh_session.num_oldcoins = coin_count;
|
||||||
|
refresh_session.num_newcoins = num_new_denoms;
|
||||||
|
refresh_session.noreveal_index
|
||||||
|
= GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_STRONG,
|
||||||
|
TALER_CNC_KAPPA);
|
||||||
|
if (GNUNET_OK !=
|
||||||
|
(res = TMH_plugin->create_refresh_session (TMH_plugin->cls,
|
||||||
|
session,
|
||||||
|
session_hash,
|
||||||
|
&refresh_session)))
|
||||||
|
{
|
||||||
|
TMH_plugin->rollback (TMH_plugin->cls,
|
||||||
|
session);
|
||||||
|
return TMH_RESPONSE_reply_internal_db_error (connection);
|
||||||
|
}
|
||||||
|
|
||||||
/* Melt old coins and check that they had enough residual value */
|
/* Melt old coins and check that they had enough residual value */
|
||||||
key_state = TMH_KS_acquire ();
|
key_state = TMH_KS_acquire ();
|
||||||
for (i=0;i<coin_count;i++)
|
for (i=0;i<coin_count;i++)
|
||||||
@ -716,26 +730,6 @@ TMH_DB_execute_refresh_melt (struct MHD_Connection *connection,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* store 'global' session data */
|
|
||||||
refresh_session.num_oldcoins = coin_count;
|
|
||||||
refresh_session.num_newcoins = num_new_denoms;
|
|
||||||
refresh_session.noreveal_index
|
|
||||||
= GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_STRONG,
|
|
||||||
TALER_CNC_KAPPA);
|
|
||||||
if (GNUNET_OK !=
|
|
||||||
(res = TMH_plugin->create_refresh_session (TMH_plugin->cls,
|
|
||||||
session,
|
|
||||||
session_hash,
|
|
||||||
&refresh_session)))
|
|
||||||
{
|
|
||||||
TMH_plugin->rollback (TMH_plugin->cls,
|
|
||||||
session);
|
|
||||||
return TMH_RESPONSE_reply_internal_db_error (connection);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (GNUNET_OK !=
|
if (GNUNET_OK !=
|
||||||
TMH_plugin->commit (TMH_plugin->cls,
|
TMH_plugin->commit (TMH_plugin->cls,
|
||||||
session))
|
session))
|
||||||
@ -1245,11 +1239,8 @@ TMH_DB_execute_refresh_link (struct MHD_Connection *connection,
|
|||||||
}
|
}
|
||||||
if (GNUNET_NO == res)
|
if (GNUNET_NO == res)
|
||||||
{
|
{
|
||||||
return TMH_RESPONSE_reply_json_pack (connection,
|
return TMH_RESPONSE_reply_arg_unknown (connection,
|
||||||
MHD_HTTP_NOT_FOUND,
|
"coin_pub");
|
||||||
"{s:s}",
|
|
||||||
"error",
|
|
||||||
"link data not found (transfer)");
|
|
||||||
}
|
}
|
||||||
GNUNET_assert (GNUNET_OK == res);
|
GNUNET_assert (GNUNET_OK == res);
|
||||||
|
|
||||||
|
@ -198,10 +198,8 @@ get_coin_public_info (struct MHD_Connection *connection,
|
|||||||
r_melt_detail->coin_info.denom_sig.rsa_signature = NULL;
|
r_melt_detail->coin_info.denom_sig.rsa_signature = NULL;
|
||||||
r_melt_detail->coin_info.denom_pub.rsa_public_key = NULL;
|
r_melt_detail->coin_info.denom_pub.rsa_public_key = NULL;
|
||||||
return (MHD_YES ==
|
return (MHD_YES ==
|
||||||
TMH_RESPONSE_reply_json_pack (connection,
|
TMH_RESPONSE_reply_signature_invalid (connection,
|
||||||
MHD_HTTP_NOT_FOUND,
|
"denom_sig"))
|
||||||
"{s:s}",
|
|
||||||
"error", "coin invalid"))
|
|
||||||
? GNUNET_NO : GNUNET_SYSERR;
|
? GNUNET_NO : GNUNET_SYSERR;
|
||||||
}
|
}
|
||||||
r_melt_detail->melt_sig = melt_sig;
|
r_melt_detail->melt_sig = melt_sig;
|
||||||
@ -242,7 +240,7 @@ verify_coin_public_info (struct MHD_Connection *connection,
|
|||||||
{
|
{
|
||||||
TMH_KS_release (key_state);
|
TMH_KS_release (key_state);
|
||||||
TALER_LOG_WARNING ("Unknown denomination key in /refresh/melt request\n");
|
TALER_LOG_WARNING ("Unknown denomination key in /refresh/melt request\n");
|
||||||
return TMH_RESPONSE_reply_arg_invalid (connection,
|
return TMH_RESPONSE_reply_arg_unknown (connection,
|
||||||
"denom_pub");
|
"denom_pub");
|
||||||
}
|
}
|
||||||
/* FIXME: need to check if denomination key is still
|
/* FIXME: need to check if denomination key is still
|
||||||
@ -275,10 +273,8 @@ verify_coin_public_info (struct MHD_Connection *connection,
|
|||||||
&melt_detail->coin_info.coin_pub.ecdsa_pub))
|
&melt_detail->coin_info.coin_pub.ecdsa_pub))
|
||||||
{
|
{
|
||||||
if (MHD_YES !=
|
if (MHD_YES !=
|
||||||
TMH_RESPONSE_reply_json_pack (connection,
|
TMH_RESPONSE_reply_signature_invalid (connection,
|
||||||
MHD_HTTP_UNAUTHORIZED,
|
"confirm_sig"))
|
||||||
"{s:s}",
|
|
||||||
"error", "signature invalid"))
|
|
||||||
return GNUNET_SYSERR;
|
return GNUNET_SYSERR;
|
||||||
return GNUNET_NO;
|
return GNUNET_NO;
|
||||||
}
|
}
|
||||||
@ -558,7 +554,7 @@ handle_refresh_melt_json (struct MHD_Connection *connection,
|
|||||||
TMH_PARSE_JNC_INDEX, (int) j,
|
TMH_PARSE_JNC_INDEX, (int) j,
|
||||||
TMH_PARSE_JNC_RET_DATA,
|
TMH_PARSE_JNC_RET_DATA,
|
||||||
&rcl->shared_secret_enc,
|
&rcl->shared_secret_enc,
|
||||||
sizeof (struct GNUNET_HashCode));
|
sizeof (struct TALER_EncryptedLinkSecretP));
|
||||||
|
|
||||||
if (GNUNET_OK != res)
|
if (GNUNET_OK != res)
|
||||||
{
|
{
|
||||||
|
@ -442,7 +442,7 @@ TMH_RESPONSE_reply_deposit_insufficient_funds (struct MHD_Connection *connection
|
|||||||
|
|
||||||
history = compile_transaction_history (tl);
|
history = compile_transaction_history (tl);
|
||||||
return TMH_RESPONSE_reply_json_pack (connection,
|
return TMH_RESPONSE_reply_json_pack (connection,
|
||||||
MHD_HTTP_FORBIDDEN,
|
MHD_HTTP_PRECONDITION_FAILED,
|
||||||
"{s:s, s:o}",
|
"{s:s, s:o}",
|
||||||
"error", "insufficient funds",
|
"error", "insufficient funds",
|
||||||
"history", history);
|
"history", history);
|
||||||
@ -625,7 +625,7 @@ TMH_RESPONSE_reply_withdraw_sign_insufficient_funds (struct MHD_Connection *conn
|
|||||||
"balance calculation failure");
|
"balance calculation failure");
|
||||||
json_balance = TALER_json_from_amount (&balance);
|
json_balance = TALER_json_from_amount (&balance);
|
||||||
ret = TMH_RESPONSE_reply_json_pack (connection,
|
ret = TMH_RESPONSE_reply_json_pack (connection,
|
||||||
MHD_HTTP_PAYMENT_REQUIRED,
|
MHD_HTTP_FORBIDDEN,
|
||||||
"{s:s, s:o, s:o}",
|
"{s:s, s:o, s:o}",
|
||||||
"error", "Insufficient funds"
|
"error", "Insufficient funds"
|
||||||
"balance", json_balance,
|
"balance", json_balance,
|
||||||
@ -794,7 +794,7 @@ TMH_RESPONSE_reply_refresh_reveal_missmatch (struct MHD_Connection *connection,
|
|||||||
const char *missmatch_object)
|
const char *missmatch_object)
|
||||||
{
|
{
|
||||||
return TMH_RESPONSE_reply_json_pack (connection,
|
return TMH_RESPONSE_reply_json_pack (connection,
|
||||||
MHD_HTTP_BAD_REQUEST,
|
MHD_HTTP_CONFLICT,
|
||||||
"{s:s, s:i, s:i, s:s}",
|
"{s:s, s:i, s:i, s:s}",
|
||||||
"error", "commitment violation",
|
"error", "commitment violation",
|
||||||
"offset", (int) off,
|
"offset", (int) off,
|
||||||
@ -829,7 +829,8 @@ TMH_RESPONSE_reply_refresh_link_success (struct MHD_Connection *connection,
|
|||||||
json_t *obj;
|
json_t *obj;
|
||||||
|
|
||||||
obj = json_object ();
|
obj = json_object ();
|
||||||
json_object_set_new (obj, "link_enc",
|
json_object_set_new (obj,
|
||||||
|
"link_enc",
|
||||||
TALER_json_from_data (ldl->link_data_enc->coin_priv_enc,
|
TALER_json_from_data (ldl->link_data_enc->coin_priv_enc,
|
||||||
sizeof (union TALER_CoinSpendPrivateKeyP) +
|
sizeof (union TALER_CoinSpendPrivateKeyP) +
|
||||||
ldl->link_data_enc->blinding_key_enc_size));
|
ldl->link_data_enc->blinding_key_enc_size));
|
||||||
|
@ -223,11 +223,18 @@ postgres_create_tables (void *cls,
|
|||||||
",expended_currency VARCHAR(4) NOT NULL"
|
",expended_currency VARCHAR(4) NOT NULL"
|
||||||
",refresh_session_hash BYTEA"
|
",refresh_session_hash BYTEA"
|
||||||
")");
|
")");
|
||||||
|
/**
|
||||||
|
* The DB will show negative values for some values of the following fields as
|
||||||
|
* we use them as 16 bit unsigned integers
|
||||||
|
* @a num_oldcoins
|
||||||
|
* @a num_newcoins
|
||||||
|
* Do not do arithmetic in SQL on these fields
|
||||||
|
*/
|
||||||
SQLEXEC("CREATE TABLE IF NOT EXISTS refresh_sessions "
|
SQLEXEC("CREATE TABLE IF NOT EXISTS refresh_sessions "
|
||||||
"("
|
"("
|
||||||
" session_hash BYTEA PRIMARY KEY CHECK (length(session_hash) = 32)"
|
" session_hash BYTEA PRIMARY KEY CHECK (length(session_hash) = 32)"
|
||||||
",session_melt_sig BYTEA"
|
",num_oldcoins INT2 NOT NULL"
|
||||||
",session_commit_sig BYTEA"
|
",num_newcoins INT2 NOT NULL"
|
||||||
",noreveal_index INT2 NOT NULL"
|
",noreveal_index INT2 NOT NULL"
|
||||||
// non-zero if all reveals were ok
|
// non-zero if all reveals were ok
|
||||||
// and the new coin signatures are ready
|
// and the new coin signatures are ready
|
||||||
@ -389,23 +396,24 @@ postgres_prepare (PGconn *db_conn)
|
|||||||
" FROM collectable_blindcoins"
|
" FROM collectable_blindcoins"
|
||||||
" WHERE reserve_pub=$1;",
|
" WHERE reserve_pub=$1;",
|
||||||
1, NULL);
|
1, NULL);
|
||||||
|
/* refreshing */
|
||||||
/* FIXME: does it make sense to store these computed values in the DB? */
|
|
||||||
#if 0
|
|
||||||
PREPARE ("get_refresh_session",
|
PREPARE ("get_refresh_session",
|
||||||
"SELECT "
|
"SELECT "
|
||||||
" (SELECT count(*) FROM refresh_melt WHERE session_hash = $1)::INT2 as num_oldcoins "
|
" num_oldcoins"
|
||||||
",(SELECT count(*) FROM refresh_blind_session_keys "
|
",num_newcoins"
|
||||||
" WHERE session_hash = $1 and cnc_index = 0)::INT2 as num_newcoins "
|
|
||||||
",(SELECT count(*) FROM refresh_blind_session_keys "
|
|
||||||
" WHERE session_hash = $1 and newcoin_index = 0)::INT2 as kappa "
|
|
||||||
",noreveal_index"
|
",noreveal_index"
|
||||||
",session_commit_sig "
|
|
||||||
",reveal_ok "
|
|
||||||
" FROM refresh_sessions "
|
" FROM refresh_sessions "
|
||||||
" WHERE session_hash = $1 ",
|
" WHERE session_hash = $1 ",
|
||||||
1, NULL);
|
1, NULL);
|
||||||
#endif
|
PREPARE ("insert_refresh_session",
|
||||||
|
"INSERT INTO refresh_sessions ( "
|
||||||
|
" session_hash "
|
||||||
|
",num_oldcoins "
|
||||||
|
",num_newcoins "
|
||||||
|
",noreveal_index "
|
||||||
|
") "
|
||||||
|
"VALUES ($1, $2, $3, $4) ",
|
||||||
|
4, NULL);
|
||||||
|
|
||||||
PREPARE ("get_known_coin",
|
PREPARE ("get_known_coin",
|
||||||
"SELECT "
|
"SELECT "
|
||||||
@ -485,13 +493,6 @@ postgres_prepare (PGconn *db_conn)
|
|||||||
"FROM refresh_melt "
|
"FROM refresh_melt "
|
||||||
"WHERE session_hash = $1 AND oldcoin_index = $2",
|
"WHERE session_hash = $1 AND oldcoin_index = $2",
|
||||||
2, NULL);
|
2, NULL);
|
||||||
PREPARE ("insert_refresh_session",
|
|
||||||
"INSERT INTO refresh_sessions ( "
|
|
||||||
" session_hash "
|
|
||||||
",noreveal_index "
|
|
||||||
") "
|
|
||||||
"VALUES ($1, $2) ",
|
|
||||||
2, NULL);
|
|
||||||
PREPARE ("insert_refresh_commit_link",
|
PREPARE ("insert_refresh_commit_link",
|
||||||
"INSERT INTO refresh_commit_link ( "
|
"INSERT INTO refresh_commit_link ( "
|
||||||
" session_hash "
|
" session_hash "
|
||||||
@ -1451,61 +1452,59 @@ postgres_get_refresh_session (void *cls,
|
|||||||
const struct GNUNET_HashCode *session_hash,
|
const struct GNUNET_HashCode *session_hash,
|
||||||
struct TALER_MINTDB_RefreshSession *refresh_session)
|
struct TALER_MINTDB_RefreshSession *refresh_session)
|
||||||
{
|
{
|
||||||
// FIXME: check logic!
|
PGresult *result;
|
||||||
int res;
|
|
||||||
struct TALER_PQ_QueryParam params[] = {
|
struct TALER_PQ_QueryParam params[] = {
|
||||||
TALER_PQ_QUERY_PARAM_PTR(session_hash),
|
TALER_PQ_QUERY_PARAM_PTR(session_hash),
|
||||||
TALER_PQ_QUERY_PARAM_END
|
TALER_PQ_QUERY_PARAM_END
|
||||||
};
|
};
|
||||||
|
int ret;
|
||||||
|
uint16_t num_oldcoins;
|
||||||
|
uint16_t num_newcoins;
|
||||||
|
uint16_t noreveal_index;
|
||||||
|
|
||||||
PGresult *result = TALER_PQ_exec_prepared (session->conn,
|
ret = GNUNET_SYSERR;
|
||||||
|
result = TALER_PQ_exec_prepared (session->conn,
|
||||||
"get_refresh_session",
|
"get_refresh_session",
|
||||||
params);
|
params);
|
||||||
|
|
||||||
if (PGRES_TUPLES_OK != PQresultStatus (result))
|
if (PGRES_TUPLES_OK != PQresultStatus (result))
|
||||||
{
|
{
|
||||||
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
|
BREAK_DB_ERR (result);
|
||||||
"Query failed: %s\n",
|
goto cleanup;
|
||||||
PQresultErrorMessage (result));
|
|
||||||
PQclear (result);
|
|
||||||
return GNUNET_SYSERR;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (0 == PQntuples (result))
|
if (0 == PQntuples (result))
|
||||||
return GNUNET_NO;
|
{
|
||||||
|
ret = GNUNET_NO;
|
||||||
|
goto cleanup;
|
||||||
|
}
|
||||||
GNUNET_assert (1 == PQntuples (result));
|
GNUNET_assert (1 == PQntuples (result));
|
||||||
|
/* We're done if the caller is only interested in whether the session exists
|
||||||
/* We're done if the caller is only interested in
|
* or not */
|
||||||
* whether the session exists or not */
|
|
||||||
|
|
||||||
if (NULL == refresh_session)
|
if (NULL == refresh_session)
|
||||||
return GNUNET_YES;
|
{
|
||||||
|
ret = GNUNET_YES;
|
||||||
memset (session, 0, sizeof (struct TALER_MINTDB_RefreshSession));
|
goto cleanup;
|
||||||
|
}
|
||||||
|
memset (refresh_session, 0, sizeof (struct TALER_MINTDB_RefreshSession));
|
||||||
struct TALER_PQ_ResultSpec rs[] = {
|
struct TALER_PQ_ResultSpec rs[] = {
|
||||||
TALER_PQ_RESULT_SPEC("num_oldcoins", &refresh_session->num_oldcoins),
|
TALER_PQ_RESULT_SPEC("num_oldcoins", &num_oldcoins),
|
||||||
TALER_PQ_RESULT_SPEC("num_newcoins", &refresh_session->num_newcoins),
|
TALER_PQ_RESULT_SPEC("num_newcoins", &num_newcoins),
|
||||||
TALER_PQ_RESULT_SPEC("noreveal_index", &refresh_session->noreveal_index),
|
TALER_PQ_RESULT_SPEC("noreveal_index", &noreveal_index),
|
||||||
TALER_PQ_RESULT_SPEC_END
|
TALER_PQ_RESULT_SPEC_END
|
||||||
};
|
};
|
||||||
|
if (GNUNET_OK != TALER_PQ_extract_result (result, rs, 0))
|
||||||
res = TALER_PQ_extract_result (result, rs, 0);
|
|
||||||
|
|
||||||
if (GNUNET_OK != res)
|
|
||||||
{
|
{
|
||||||
GNUNET_break (0);
|
GNUNET_break (0);
|
||||||
PQclear (result);
|
goto cleanup;
|
||||||
return GNUNET_SYSERR;
|
|
||||||
}
|
}
|
||||||
|
refresh_session->num_oldcoins = ntohs (num_oldcoins);
|
||||||
|
refresh_session->num_newcoins = ntohs (num_newcoins);
|
||||||
|
refresh_session->noreveal_index = ntohs (noreveal_index);
|
||||||
|
ret = GNUNET_YES;
|
||||||
|
|
||||||
refresh_session->num_oldcoins = ntohs (refresh_session->num_oldcoins);
|
cleanup:
|
||||||
refresh_session->num_newcoins = ntohs (refresh_session->num_newcoins);
|
if (NULL != result)
|
||||||
refresh_session->noreveal_index = ntohs (refresh_session->noreveal_index);
|
|
||||||
|
|
||||||
PQclear (result);
|
PQclear (result);
|
||||||
return GNUNET_YES;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1525,28 +1524,29 @@ postgres_create_refresh_session (void *cls,
|
|||||||
const struct GNUNET_HashCode *session_hash,
|
const struct GNUNET_HashCode *session_hash,
|
||||||
const struct TALER_MINTDB_RefreshSession *refresh_session)
|
const struct TALER_MINTDB_RefreshSession *refresh_session)
|
||||||
{
|
{
|
||||||
// FIXME: actually store session data!
|
PGresult *result;
|
||||||
|
uint16_t num_oldcoins;
|
||||||
|
uint16_t num_newcoins;
|
||||||
uint16_t noreveal_index;
|
uint16_t noreveal_index;
|
||||||
struct TALER_PQ_QueryParam params[] = {
|
struct TALER_PQ_QueryParam params[] = {
|
||||||
TALER_PQ_QUERY_PARAM_PTR(session_hash),
|
TALER_PQ_QUERY_PARAM_PTR(session_hash),
|
||||||
|
TALER_PQ_QUERY_PARAM_PTR(&num_oldcoins),
|
||||||
|
TALER_PQ_QUERY_PARAM_PTR(&num_newcoins),
|
||||||
TALER_PQ_QUERY_PARAM_PTR(&noreveal_index),
|
TALER_PQ_QUERY_PARAM_PTR(&noreveal_index),
|
||||||
TALER_PQ_QUERY_PARAM_END
|
TALER_PQ_QUERY_PARAM_END
|
||||||
};
|
};
|
||||||
|
num_oldcoins = htons (refresh_session->num_oldcoins);
|
||||||
noreveal_index = GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK, 1<<15);
|
num_newcoins = htons (refresh_session->num_newcoins);
|
||||||
noreveal_index = htonl (noreveal_index);
|
noreveal_index = htons (refresh_session->noreveal_index);
|
||||||
|
result = TALER_PQ_exec_prepared (session->conn,
|
||||||
PGresult *result = TALER_PQ_exec_prepared (session->conn,
|
|
||||||
"insert_refresh_session",
|
"insert_refresh_session",
|
||||||
params);
|
params);
|
||||||
|
|
||||||
if (PGRES_COMMAND_OK != PQresultStatus (result))
|
if (PGRES_COMMAND_OK != PQresultStatus (result))
|
||||||
{
|
{
|
||||||
BREAK_DB_ERR (result);
|
BREAK_DB_ERR (result);
|
||||||
PQclear (result);
|
PQclear (result);
|
||||||
return GNUNET_SYSERR;
|
return GNUNET_SYSERR;
|
||||||
}
|
}
|
||||||
|
|
||||||
PQclear (result);
|
PQclear (result);
|
||||||
return GNUNET_OK;
|
return GNUNET_OK;
|
||||||
}
|
}
|
||||||
|
@ -325,6 +325,28 @@ run (void *cls,
|
|||||||
plugin->have_deposit (plugin->cls,
|
plugin->have_deposit (plugin->cls,
|
||||||
session,
|
session,
|
||||||
&deposit2));
|
&deposit2));
|
||||||
|
/* Tests for refreshing */
|
||||||
|
{
|
||||||
|
struct TALER_MINTDB_RefreshSession refresh_session;
|
||||||
|
struct TALER_MINTDB_RefreshSession ret_refresh_session;
|
||||||
|
struct GNUNET_HashCode session_hash;
|
||||||
|
RND_BLK (&refresh_session);
|
||||||
|
RND_BLK (&session_hash);
|
||||||
|
refresh_session.num_oldcoins = UINT16_MAX;
|
||||||
|
refresh_session.num_newcoins = 1;
|
||||||
|
refresh_session.noreveal_index = 1;
|
||||||
|
FAILIF (GNUNET_OK != plugin->create_refresh_session (plugin->cls,
|
||||||
|
session,
|
||||||
|
&session_hash,
|
||||||
|
&refresh_session));
|
||||||
|
FAILIF (GNUNET_OK != plugin->get_refresh_session (plugin->cls,
|
||||||
|
session,
|
||||||
|
&session_hash,
|
||||||
|
&ret_refresh_session));
|
||||||
|
FAILIF (0 != memcmp (&ret_refresh_session,
|
||||||
|
&refresh_session,
|
||||||
|
sizeof (refresh_session)));
|
||||||
|
}
|
||||||
result = 0;
|
result = 0;
|
||||||
|
|
||||||
drop:
|
drop:
|
||||||
|
Loading…
Reference in New Issue
Block a user