bcb4e51a409d94ae670de96afb8483a4f7855294Stephan Bosch/* Copyright (c) 2015-2018 Dovecot authors, see the included COPYING file */
4c78d9e646c4a1158d7167806937c02d86cdfc25Aki Tuomimail_crypt_load_global_private_keys(struct mail_user *user,
4c78d9e646c4a1158d7167806937c02d86cdfc25Aki Tuomi const char **error_r)
4c78d9e646c4a1158d7167806937c02d86cdfc25Aki Tuomi unsigned int i = 1;
4c78d9e646c4a1158d7167806937c02d86cdfc25Aki Tuomi while ((key_data = mail_user_plugin_getenv(user, 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_user_plugin_getenv(user, set_pw);
4c78d9e646c4a1158d7167806937c02d86cdfc25Aki Tuomi if (mail_crypt_load_global_private_key(str_c(set_key), key_data,
4c78d9e646c4a1158d7167806937c02d86cdfc25Aki Tuomi /* skip this key */
4c78d9e646c4a1158d7167806937c02d86cdfc25Aki Tuomi "mail_crypt_load_global_private_key failed: %s",
4c78d9e646c4a1158d7167806937c02d86cdfc25Aki Tuomiint mail_crypt_global_keys_load(struct mail_user *user, const char *set_prefix,
4c78d9e646c4a1158d7167806937c02d86cdfc25Aki Tuomi const char **error_r)
4c78d9e646c4a1158d7167806937c02d86cdfc25Aki Tuomi const char *set_key = t_strconcat(set_prefix, "_public_key", NULL);
4c78d9e646c4a1158d7167806937c02d86cdfc25Aki Tuomi const char *key_data = mail_user_plugin_getenv(user, set_key);