diff --git a/dap_chain_net_srv_common.c b/dap_chain_net_srv_common.c index e0a98b1993837fa2167aae2d6e57cba0154fac74..8e11977568307a6719aadb712a2f4713e5c178e7 100755 --- a/dap_chain_net_srv_common.c +++ b/dap_chain_net_srv_common.c @@ -106,9 +106,9 @@ uint64_t dap_chain_net_srv_client_auth(dap_ledger_t *a_ledger, dap_chain_addr_t *l_addr = (l_addr_base58) ? dap_chain_addr_from_str(l_addr_base58) : NULL; dap_chain_tx_out_cond_t *l_tx_out_cond = NULL; - dap_chain_sign_type_t l_sig_type; + dap_sign_type_t l_sig_type; if(l_addr) - memcpy(&l_sig_type, &l_addr->sig_type, sizeof(dap_chain_sign_type_t)); + memcpy(&l_sig_type, &l_addr->sig_type, sizeof(dap_sign_type_t)); // Search all value in transactions with l_addr in 'out_cond' item uint64_t l_value = dap_chain_ledger_tx_cache_get_out_cond_value(a_ledger, l_addr, &l_tx_out_cond); diff --git a/dap_chain_net_srv_key.c b/dap_chain_net_srv_key.c index bdf924a347845ea4c24be66b3dfcfc558683c3d8..0e4789ac9561c8bfe3248c697cfdde38c312f350 100644 --- a/dap_chain_net_srv_key.c +++ b/dap_chain_net_srv_key.c @@ -33,7 +33,7 @@ #include "dap_hash.h" #include "dap_chain_common.h" -#include "dap_chain_sign.h" +#include "dap_sign.h" #include "dap_chain_wallet.h" #include "dap_chain_net_srv_key.h" @@ -98,8 +98,8 @@ char* dap_chain_net_srv_key_create_hash(const char *a_wallet_name, char **a_addr // make signature const void *l_data = l_addr_base58; const size_t l_data_size = strlen(l_data); - dap_chain_sign_t *l_chain_sign = dap_chain_sign_create(l_key, l_data, l_data_size, 0); - size_t l_chain_sign_size = dap_chain_sign_get_size(l_chain_sign); + dap_sign_t *l_chain_sign = dap_sign_create(l_key, l_data, l_data_size, 0); + size_t l_chain_sign_size = dap_sign_get_size(l_chain_sign); dap_chain_wallet_close(l_wallet); if(a_addr_base58) @@ -107,7 +107,7 @@ char* dap_chain_net_srv_key_create_hash(const char *a_wallet_name, char **a_addr else DAP_DELETE(l_addr_base58); - // make dap_chain_sign_t hash + // make dap_sign_t hash dap_chain_hash_fast_t l_sign_hash; if(!dap_hash_fast(l_chain_sign, l_chain_sign_size, &l_sign_hash) ) { return NULL; @@ -130,18 +130,18 @@ bool dap_chain_net_srv_key_check(char *a_addr_base58, const char *a_sign_hash_st return false; /* // create l_chain_sign for check a_sign - dap_chain_sign_t *l_chain_sign = DAP_NEW_Z_SIZE(dap_chain_sign_t, - sizeof(dap_chain_sign_t) + a_sign_size + l_pkey_size); + dap_sign_t *l_chain_sign = DAP_NEW_Z_SIZE(dap_sign_t, + sizeof(dap_sign_t) + a_sign_size + l_pkey_size); l_chain_sign->header.type = l_sig_type; l_chain_sign->header.sign_size = l_pkey_size; l_chain_sign->header.sign_pkey_size = l_pkey_size; - // write serialized public key to dap_chain_sign_t + // write serialized public key to dap_sign_t memcpy(l_chain_sign->pkey_n_sign, l_pkey, l_pkey_size); - // write serialized signature to dap_chain_sign_t + // write serialized signature to dap_sign_t memcpy(l_chain_sign->pkey_n_sign + l_pkey_size, a_sign, a_sign_size); // check signature - if(dap_chain_sign_verify(l_chain_sign, a_sign, a_sign_size) != 1) { + if(dap_sign_verify(l_chain_sign, a_sign, a_sign_size) != 1) { // invalid signature return 0; }*/ diff --git a/dap_chain_net_srv_order.c b/dap_chain_net_srv_order.c index a45682fc8c0522e7ab74387a7a00fcfcfb92a415..6a02b1301a88735ac90d043b560c3edabcf6b60f 100644 --- a/dap_chain_net_srv_order.c +++ b/dap_chain_net_srv_order.c @@ -217,8 +217,10 @@ int dap_chain_net_srv_order_delete_by_hash_str(dap_chain_net_t * a_net, const ch int ret = -2; if ( a_net && a_hash_str ){ char * l_gdb_group_str = dap_chain_net_srv_order_get_gdb_group( a_net); - ret = dap_chain_global_db_gr_del( a_hash_str, l_gdb_group_str ) ? 0 : -1; + char * l_hash_str = strdup( a_hash_str ); + ret = dap_chain_global_db_gr_del( l_hash_str, l_gdb_group_str ) ? 0 : -1; DAP_DELETE( l_gdb_group_str ); + DAP_DELETE( l_hash_str ); } return ret; }