diff options
author | Dimitri Staessens <dimitri@ouroboros.rocks> | 2025-06-28 11:27:50 +0200 |
---|---|---|
committer | Sander Vrijders <sander@ouroboros.rocks> | 2025-07-04 10:12:15 +0200 |
commit | 84134b93c1fc1c670f52ab199dcda6fc9c42626f (patch) | |
tree | 92375d0d9d656b7ccfb003ba7cf30c54171cd847 /src/ipcpd/unicast/dir/dht.c | |
parent | d2295c1c228f05beaf3ec8abe44a4ae114742076 (diff) | |
download | ouroboros-84134b93c1fc1c670f52ab199dcda6fc9c42626f.tar.gz ouroboros-84134b93c1fc1c670f52ab199dcda6fc9c42626f.zip |
lib: Add authentication functions
Adds functions needed for authentication using X509 certificates,
implemented using OpenSSL.
Refactors some library internals, and adds some unit tests for them.
Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks>
Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
Diffstat (limited to 'src/ipcpd/unicast/dir/dht.c')
-rw-r--r-- | src/ipcpd/unicast/dir/dht.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/ipcpd/unicast/dir/dht.c b/src/ipcpd/unicast/dir/dht.c index 08a5a5a9..95c5f19a 100644 --- a/src/ipcpd/unicast/dir/dht.c +++ b/src/ipcpd/unicast/dir/dht.c @@ -884,12 +884,12 @@ static void lookup_update(struct dht * dht, contact_destroy(c); } else { struct contact * d; - list_add_tail(&c->next, p); d = list_last_entry(&lu->contacts, struct contact, next); list_del(&d->next); assert(lu->contacts.prv != &d->next); contact_destroy(d); + list_add_tail(&c->next, p); mod = true; } } @@ -2503,7 +2503,7 @@ static void * dht_handle_packet(void * o) continue; } - tpm_dec(dht->tpm); + tpm_begin_work(dht->tpm); addr = msg->s_addr; @@ -2604,7 +2604,7 @@ static void * dht_handle_packet(void * o) free(resp_msg.addrs); if (resp_msg.n_contacts == 0) { - tpm_inc(dht->tpm); + tpm_end_work(dht->tpm); continue; } @@ -2613,7 +2613,7 @@ static void * dht_handle_packet(void * o) NULL); free(resp_msg.contacts); - tpm_inc(dht->tpm); + tpm_end_work(dht->tpm); } return (void *) 0; |