aboutsummaryrefslogtreecommitdiffstats
path: root/src/libcryptobox
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rspamd.com>2024-08-09 12:46:17 +0100
committerVsevolod Stakhov <vsevolod@rspamd.com>2024-08-09 12:46:17 +0100
commit03aa3490726177fb3cf9da5b80f63dc9bf5993dc (patch)
treec3a2cd1ccb3a4eae0571744d5e3b61cb67aa75fd /src/libcryptobox
parent12c12bdf0c00438d0cb37d02dae5a34f41066865 (diff)
downloadrspamd-03aa3490726177fb3cf9da5b80f63dc9bf5993dc.tar.gz
rspamd-03aa3490726177fb3cf9da5b80f63dc9bf5993dc.zip
[Minor] Oops, fix pubkey loading
Diffstat (limited to 'src/libcryptobox')
-rw-r--r--src/libcryptobox/keypair.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/libcryptobox/keypair.c b/src/libcryptobox/keypair.c
index f6f932957..96389dce8 100644
--- a/src/libcryptobox/keypair.c
+++ b/src/libcryptobox/keypair.c
@@ -325,16 +325,13 @@ rspamd_pubkey_from_bin(const unsigned char *raw,
gsize len,
enum rspamd_cryptobox_keypair_type type)
{
- gsize expected_len;
unsigned int pklen;
struct rspamd_cryptobox_pubkey *pk;
unsigned char *pk_data;
g_assert(raw != NULL && len > 0);
- (type == RSPAMD_KEYPAIR_KEX) ? crypto_box_PUBLICKEYBYTES : crypto_sign_PUBLICKEYBYTES;
-
- if (len != expected_len) {
+ if (len != crypto_box_PUBLICKEYBYTES) {
return NULL;
}