diff options
author | Uros Majstorovic <majstor@majstor.org> | 2024-04-20 22:04:44 +0200 |
---|---|---|
committer | Uros Majstorovic <majstor@majstor.org> | 2024-04-20 22:04:44 +0200 |
commit | 5cd8070d7a74e4da29f9ae833533c5109efaccfd (patch) | |
tree | c7c640a20d55dbc33781c6c6a25577ffd9c2aadc /ecp/src | |
parent | 60357fa2e584459ec4cf0926440bd2920ffe11d4 (diff) |
fixed pub key comparison
Diffstat (limited to 'ecp/src')
-rw-r--r-- | ecp/src/ecp/core.c | 4 |
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; } } |