bcb4e51a409d94ae670de96afb8483a4f7855294Stephan Bosch/* Copyright (c) 2015-2018 Dovecot authors, see the included COPYING file */
4c78d9e646c4a1158d7167806937c02d86cdfc25Aki Tuomistatic const struct fs_crypt_settings *
4c78d9e646c4a1158d7167806937c02d86cdfc25Aki Tuomi static const struct setting_parser_info *set_roots[] = {
4c78d9e646c4a1158d7167806937c02d86cdfc25Aki Tuomi if (master_service_settings_read(master_service, &input,
4c78d9e646c4a1158d7167806937c02d86cdfc25Aki Tuomi i_fatal("Error reading configuration: %s", error);
4c78d9e646c4a1158d7167806937c02d86cdfc25Aki Tuomi return master_service_settings_get_others(master_service)[0];
4c78d9e646c4a1158d7167806937c02d86cdfc25Aki Tuomiconst char *mail_crypt_plugin_getenv(const struct fs_crypt_settings *set,
4c78d9e646c4a1158d7167806937c02d86cdfc25Aki Tuomi const char *name)
4c78d9e646c4a1158d7167806937c02d86cdfc25Aki Tuomimail_crypt_load_global_private_keys(const struct fs_crypt_settings *set,
4c78d9e646c4a1158d7167806937c02d86cdfc25Aki Tuomi const char **error_r)
4c78d9e646c4a1158d7167806937c02d86cdfc25Aki Tuomi unsigned int i = 1;
4c78d9e646c4a1158d7167806937c02d86cdfc25Aki Tuomi while ((key_data = mail_crypt_plugin_getenv(set, str_c(set_key))) != NULL) {
4c78d9e646c4a1158d7167806937c02d86cdfc25Aki Tuomi const char *set_pw = t_strconcat(str_c(set_key), "_password", NULL);
4c78d9e646c4a1158d7167806937c02d86cdfc25Aki Tuomi const char *password = mail_crypt_plugin_getenv(set, set_pw);
4c78d9e646c4a1158d7167806937c02d86cdfc25Aki Tuomi if (mail_crypt_load_global_private_key(str_c(set_key), key_data,
4c78d9e646c4a1158d7167806937c02d86cdfc25Aki Tuomiint mail_crypt_global_keys_load_pluginenv(const char *set_prefix,
4c78d9e646c4a1158d7167806937c02d86cdfc25Aki Tuomi const char **error_r)
4c78d9e646c4a1158d7167806937c02d86cdfc25Aki Tuomi const struct fs_crypt_settings *set = fs_crypt_load_settings();
4c78d9e646c4a1158d7167806937c02d86cdfc25Aki Tuomi const char *set_key = t_strconcat(set_prefix, "_public_key", NULL);
4c78d9e646c4a1158d7167806937c02d86cdfc25Aki Tuomi const char *key_data = mail_crypt_plugin_getenv(set, set_key);
4c78d9e646c4a1158d7167806937c02d86cdfc25Aki Tuomi if (mail_crypt_load_global_public_key(set_key, key_data,
4c78d9e646c4a1158d7167806937c02d86cdfc25Aki Tuomi if (ret == 0 &&