Minor cleanups.

git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@3672 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
2021-10-24 19:23:21 +00:00
parent f4f6bb8333
commit 08e32c0de4
5 changed files with 12 additions and 20 deletions

View File

@ -25,9 +25,9 @@
#include <time.h>
#include <uv.h>
static_assert(ID_BASE64_LEN == sodium_base64_ENCODED_LEN(9 + crypto_box_PUBLICKEYBYTES, sodium_base64_VARIANT_ORIGINAL), "ID_BASE64_LEN");
static_assert(ID_BIN_LEN == crypto_box_PUBLICKEYBYTES, "ID_BIN_LEN");
static_assert(BLOB_ID_LEN == (sodium_base64_ENCODED_LEN(crypto_hash_sha256_BYTES, sodium_base64_VARIANT_ORIGINAL) + 8), "BLOB_ID_LEN");
static_assert(k_id_base64_len == sodium_base64_ENCODED_LEN(9 + crypto_box_PUBLICKEYBYTES, sodium_base64_VARIANT_ORIGINAL), "k_id_base64_len");
static_assert(k_id_bin_len == crypto_box_PUBLICKEYBYTES, "k_id_bin_len");
static_assert(k_blob_id_len == (sodium_base64_ENCODED_LEN(crypto_hash_sha256_BYTES, sodium_base64_VARIANT_ORIGINAL) + 8), "k_blob_id_len");
const uint8_t k_ssb_network[] = {
0xd4, 0xa1, 0xcb, 0x88, 0xa6, 0x6f, 0x02, 0xf8,
@ -1981,7 +1981,7 @@ static void _tf_ssb_add_broadcast(tf_ssb_t* ssb, const tf_ssb_broadcast_t* broad
}
}
char key[ID_BASE64_LEN];
char key[k_id_base64_len];
if (tf_ssb_id_bin_to_str(key, sizeof(key), broadcast->pub))
{
tf_ssb_connections_store(ssb->connections_tracker, broadcast->host, ntohs(broadcast->addr.sin_port), key);