summaryrefslogtreecommitdiff
path: root/ecp/src
diff options
context:
space:
mode:
authorUros Majstorovic <majstor@majstor.org>2024-04-20 22:04:44 +0200
committerUros Majstorovic <majstor@majstor.org>2024-04-20 22:04:44 +0200
commit5cd8070d7a74e4da29f9ae833533c5109efaccfd (patch)
treec7c640a20d55dbc33781c6c6a25577ffd9c2aadc /ecp/src
parent60357fa2e584459ec4cf0926440bd2920ffe11d4 (diff)
fixed pub key comparison
Diffstat (limited to 'ecp/src')
-rw-r--r--ecp/src/ecp/core.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ecp/src/ecp/core.c b/ecp/src/ecp/core.c
index 2088e32..be70614 100644
--- a/ecp/src/ecp/core.c
+++ b/ecp/src/ecp/core.c
@@ -306,7 +306,7 @@ static ECPConnection *conn_table_search_pub(ECPSocket *sock, unsigned char c_idx
if (ecp_conn_is_outb(conn)) {
if (c_idx >= ECP_MAX_CONN_KEY) continue;
- if (conn->key[c_idx].valid && ecp_ecdh_pub_eq(c_public, &conn->key[c_idx].public)) {
+ if (conn->key[c_idx].valid && (memcmp(c_public, &conn->key[c_idx].public, sizeof(conn->key[c_idx].public)) == 0)) {
return conn;
}
} else {
@@ -315,7 +315,7 @@ static ECPConnection *conn_table_search_pub(ECPSocket *sock, unsigned char c_idx
if (c_idx & ~ECP_ECDH_IDX_MASK) continue;
_c_idx = c_idx % ECP_MAX_NODE_KEY;
- if (conn->rkey[_c_idx].valid && ecp_ecdh_pub_eq(c_public, &conn->rkey[_c_idx].public)) {
+ if (conn->rkey[_c_idx].valid && (memcmp(c_public, &conn->rkey[_c_idx].public, sizeof(conn->key[c_idx].public) == 0)) {
return conn;
}
}