This is now consistent with fs_compress_read_plain_fallback setting.
#define DEF(type, name) \
SETTING_DEFINE_STRUCT_##type(#name, name, struct crypt_settings)
static const struct setting_define crypt_setting_defines[] = {
+ DEF(BOOL, fs_crypt_read_plain_fallback),
+
DEF(STR, crypt_global_public_key),
{ .type = SET_FILTER_ARRAY, .key = "crypt_global_private_key",
.offset = offsetof(struct crypt_settings, crypt_global_private_keys),
DEF(STR, crypt_write_algorithm),
DEF(UINT, crypt_write_version),
- DEF(BOOL, crypt_plain_fallback),
{ .type = SET_FILTER_ARRAY, .key = "crypt_user_key_encryption_key",
.offset = offsetof(struct crypt_settings, crypt_user_key_encryption_keys),
};
static const struct crypt_settings crypt_default_settings = {
+ .fs_crypt_read_plain_fallback = FALSE,
+
.crypt_global_public_key = "",
.crypt_global_private_keys = ARRAY_INIT,
.crypt_write_algorithm = "aes-256-gcm-sha256",
.crypt_write_version = UINT_MAX,
- .crypt_plain_fallback = FALSE,
.crypt_user_key_encryption_keys = ARRAY_INIT,
.crypt_user_key_password = "",
struct crypt_settings {
pool_t pool;
+ bool fs_crypt_read_plain_fallback;
+
const char *crypt_global_public_key;
ARRAY_TYPE(const_string) crypt_global_private_keys;
const char *crypt_write_algorithm;
unsigned int crypt_write_version;
- bool crypt_plain_fallback;
/* for user-specific keys: */
ARRAY_TYPE(const_string) crypt_user_key_encryption_keys;
input = fs_read_stream(file->super_read,
I_MAX(FS_CRYPT_ISTREAM_MIN_BUFFER_SIZE, max_buffer_size));
- if (file->fs->set->crypt_plain_fallback) {
+ if (file->fs->set->fs_crypt_read_plain_fallback) {
struct istream *decrypted_input =
i_stream_create_decrypt_callback(input,
fs_crypt_istream_get_key, file);
const char *const test_settings[] = {
"fs_parent/fs_driver", "posix",
"fs_driver", "crypt",
- "crypt_plain_fallback", "yes",
+ "fs_crypt_read_plain_fallback", "yes",
"crypt_write_algorithm", "",
"crypt_global_private_key", "main",
"crypt_global_private_key/main/crypt_private_key", PRIVATE_KEY_PEM,
const char *const test_settings2[] = {
"fs_parent/fs_driver", "posix",
"fs_driver", "crypt",
- "crypt_plain_fallback", "yes",
+ "fs_crypt_read_plain_fallback", "yes",
"crypt_write_algorithm", "",
"crypt_global_public_key", PUBLIC_KEY_PEM,
"crypt_global_private_key", "main",