]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
var-expand-crypt: Ensure iv or salt is given in raw mode
authorAki Tuomi <aki.tuomi@open-xchange.com>
Mon, 18 Nov 2024 08:19:07 +0000 (10:19 +0200)
committerAki Tuomi <aki.tuomi@open-xchange.com>
Fri, 17 Jan 2025 08:40:01 +0000 (10:40 +0200)
Would generate non-decryptable output otherwise.

src/plugins/var-expand-crypt/var-expand-crypt-plugin.c

index d864edcbc09885116336076f5263fceff8e28a1c..88f4888359072dc653bfcefe02bba621b01e31bf 100644 (file)
@@ -201,6 +201,9 @@ static int var_expand_crypt_settings(struct var_expand_state *state,
                        return -1;
                } else if (parse_parameters(ctx, parts, error_r) < 0)
                        return -1;
+       } else if (ctx->raw && ctx->iv == NULL && ctx->salt == NULL) {
+               *error_r = "In raw format, salt or IV must be given";
+               return -1;
        }
 
        if (ctx->iv == NULL) {