]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-dcrypt: dcrypt_openssl_decrypt_point_password_v1() - Fix crash if pbkdf2 generati...
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Thu, 7 Oct 2021 16:36:17 +0000 (19:36 +0300)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Tue, 12 Oct 2021 11:07:27 +0000 (11:07 +0000)
src/lib-dcrypt/dcrypt-openssl.c

index 18e32d215e0c459ca47b2a3ab47e5f8e23fea610..1cbe352541f3ea907ce885f881597cc31cedcec8 100644 (file)
@@ -1021,7 +1021,6 @@ dcrypt_openssl_decrypt_point_password_v1(const char *data_hex,
                                         const char **error_r)
 {
        buffer_t *salt, *data, *password, *key;
-       struct dcrypt_context_symmetric *dctx;
 
        data = t_buffer_create(128);
        salt = t_buffer_create(16);
@@ -1035,10 +1034,8 @@ dcrypt_openssl_decrypt_point_password_v1(const char *data_hex,
        /* aes-256-ctr uses 32 byte key, and v1 uses all-zero IV */
        if (!dcrypt_openssl_pbkdf2(password->data, password->used,
                                   salt->data, salt->used,
-                                  "sha256", 16, key, 32, error_r)) {
-               dcrypt_ctx_sym_destroy(&dctx);
+                                  "sha256", 16, key, 32, error_r))
                return FALSE;
-       }
 
        return dcrypt_openssl_decrypt_point_v1(data, key, point_r, error_r);
 }