]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Oops, fix pubkey loading 5099/head
authorVsevolod Stakhov <vsevolod@rspamd.com>
Fri, 9 Aug 2024 11:46:17 +0000 (12:46 +0100)
committerVsevolod Stakhov <vsevolod@rspamd.com>
Fri, 9 Aug 2024 11:46:17 +0000 (12:46 +0100)
src/libcryptobox/keypair.c

index f6f932957162c941c8cf16f6cf57832b3784834c..96389dce85e08aa59ffe6bd634a6de5d8f390ced 100644 (file)
@@ -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;
        }