From: Vsevolod Stakhov Date: Fri, 9 Aug 2024 11:46:17 +0000 (+0100) Subject: [Minor] Oops, fix pubkey loading X-Git-Tag: 3.10.0~42^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=refs%2Fpull%2F5099%2Fhead;p=rspamd.git [Minor] Oops, fix pubkey loading --- 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; }