From 5336fdb46a6e679207cb232ade25312baab6c5fd Mon Sep 17 00:00:00 2001 From: cryptozoidberg Date: Tue, 13 Feb 2024 16:19:46 +0400 Subject: [PATCH] signing prefix with ado --- src/currency_core/blockchain_storage.cpp | 2 +- src/currency_core/currency_basic.h | 2 -- src/currency_core/currency_format_utils.cpp | 4 +++- src/currency_core/currency_format_utils.h | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/currency_core/blockchain_storage.cpp b/src/currency_core/blockchain_storage.cpp index 954f2fe5..e4e4824e 100644 --- a/src/currency_core/blockchain_storage.cpp +++ b/src/currency_core/blockchain_storage.cpp @@ -4096,7 +4096,7 @@ bool blockchain_storage::validate_ado_ownership(asset_op_verification_context& a CHECK_AND_ASSERT_MES(avc.asset_op_history->size() != 0, false, "asset with id " << avc.asset_id << " has invalid history size() == 0"); crypto::public_key owner_key = avc.asset_op_history->back().descriptor.owner; - return crypto::verify_schnorr_sig(tx_id, owner_key, aoop.gss); + return crypto::verify_schnorr_sig(avc.tx_id, owner_key, aoop.gss); } //------------------------------------------------------------------ bool blockchain_storage::put_asset_info(const transaction& tx, const crypto::hash& tx_id, const asset_descriptor_operation& ado) diff --git a/src/currency_core/currency_basic.h b/src/currency_core/currency_basic.h index f677742b..b5aa7fab 100644 --- a/src/currency_core/currency_basic.h +++ b/src/currency_core/currency_basic.h @@ -783,7 +783,6 @@ namespace currency FIELD(descriptor) FIELD(amount_commitment) END_VERSION_UNDER(1) - FIELD(opt_proof) FIELD(opt_asset_id) END_SERIALIZE() @@ -792,7 +791,6 @@ namespace currency BOOST_SERIALIZE(descriptor) BOOST_SERIALIZE(amount_commitment) BOOST_END_VERSION_UNDER(1) - BOOST_SERIALIZE(opt_proof) BOOST_SERIALIZE(opt_asset_id) END_BOOST_SERIALIZATION() }; diff --git a/src/currency_core/currency_format_utils.cpp b/src/currency_core/currency_format_utils.cpp index 112f1de4..709fc5d1 100644 --- a/src/currency_core/currency_format_utils.cpp +++ b/src/currency_core/currency_format_utils.cpp @@ -1151,6 +1151,7 @@ namespace currency return true; } //--------------------------------------------------------------- + /* crypto::hash get_signature_hash_for_asset_operation(const asset_descriptor_operation& ado) { asset_descriptor_operation ado_local = ado; @@ -1164,6 +1165,7 @@ namespace currency { op.opt_proof = boost::none; } + */ //--------------------------------------------------------------- bool construct_tx_out(const tx_destination_entry& de, const crypto::secret_key& tx_sec_key, size_t output_index, transaction& tx, std::set& deriv_cache, const account_keys& self, uint8_t tx_outs_attr /* = CURRENCY_TO_KEY_OUT_RELAXED */) @@ -2706,7 +2708,7 @@ namespace currency else { //generate signature by wallet account - + crypto::generate_schnorr_sig(tx_prefix_hash, ftp.ado_current_asset_owner, sender_account_keys.spend_secret_key, aoop.gss); } tx.proofs.emplace_back(aoop); } diff --git a/src/currency_core/currency_format_utils.h b/src/currency_core/currency_format_utils.h index 7d2c761b..620bc91c 100644 --- a/src/currency_core/currency_format_utils.h +++ b/src/currency_core/currency_format_utils.h @@ -168,7 +168,7 @@ namespace currency //crypto::secret_key asset_control_key = currency::null_skey; crypto::public_key ado_current_asset_owner = null_pkey; thirdparty_sign_handler* pthirdparty_sign_handler = nullptr; - bool need_to_generate_ado_proof = false; + mutable bool need_to_generate_ado_proof = false; BEGIN_SERIALIZE_OBJECT()