bcb4e51a409d94ae670de96afb8483a4f7855294Stephan Bosch/* Copyright (c) 2015-2018 Dovecot authors, see the included COPYING file */
4c78d9e646c4a1158d7167806937c02d86cdfc25Aki Tuomiint fs_crypt_load_keys(struct crypt_fs *fs, const char **error_r)
4c78d9e646c4a1158d7167806937c02d86cdfc25Aki Tuomi struct mailbox_list *list = mailbox_list_fs_get_list(&fs->fs);
4c78d9e646c4a1158d7167806937c02d86cdfc25Aki Tuomi if (fs->public_key_path != NULL || fs->private_key_path != NULL) {
4c78d9e646c4a1158d7167806937c02d86cdfc25Aki Tuomi /* overrides using settings */
4c78d9e646c4a1158d7167806937c02d86cdfc25Aki Tuomi if (fs_crypt_load_keys_from_path(fs, error_r) < 0)
4c78d9e646c4a1158d7167806937c02d86cdfc25Aki Tuomi *error_r = "fs-mail-crypt can be used only via lib-storage";
4c78d9e646c4a1158d7167806937c02d86cdfc25Aki Tuomi if (mail_crypt_global_keys_load(mailbox_list_get_namespace(list)->user,
4c78d9e646c4a1158d7167806937c02d86cdfc25Aki Tuomi *error_r = t_strdup_printf("%s: %s", fs->set_prefix, error);