Lines Matching refs:fs
15 #include "fs-api-private.h"
18 struct fs fs;
31 struct crypt_fs *fs;
41 extern const struct fs FS_CLASS_CRYPT;
44 int fs_crypt_load_keys(struct crypt_fs *fs, const char **error_r);
46 static struct fs *fs_crypt_alloc(void)
48 struct crypt_fs *fs;
50 fs = i_new(struct crypt_fs, 1);
51 fs->fs = FS_CLASS_CRYPT;
53 return &fs->fs;
57 fs_crypt_init(struct fs *_fs, const char *args, const
60 struct crypt_fs *fs = (struct crypt_fs *)_fs;
69 [private_key_path=<s>:[password=<s>:]]<parent fs> */
112 fs->enc_algo = i_strdup(enc_algo);
113 fs->set_prefix = i_strdup(set_prefix);
114 fs->public_key_path = i_strdup_empty(public_key_path);
115 fs->private_key_path = i_strdup_empty(private_key_path);
116 fs->password = i_strdup_empty(password);
120 static void fs_crypt_deinit(struct fs *_fs)
122 struct crypt_fs *fs = (struct crypt_fs *)_fs;
124 mail_crypt_global_keys_free(&fs->keys);
127 i_free(fs->enc_algo);
128 i_free(fs->set_prefix);
129 i_free(fs->public_key_path);
130 i_free(fs->private_key_path);
131 i_free(fs->password);
132 i_free(fs);
145 struct crypt_fs *fs = (struct crypt_fs *)_file->fs;
149 file->fs = fs;
212 fs_crypt_load_keys_from_path(struct crypt_fs *fs, const char **error_r)
216 mail_crypt_global_keys_init(&fs->keys);
217 if (fs->public_key_path != NULL) {
219 fs->public_key_path,
223 key_data, &fs->keys,
230 if (fs->private_key_path != NULL) {
232 fs->private_key_path,
237 fs->password, &fs->keys,
254 if (fs_crypt_load_keys(file->fs, error_r) < 0)
257 *priv_key_r = mail_crypt_global_key_find(&file->fs->keys, pubkey_digest);
289 if (fs_crypt_load_keys(file->fs, &error) < 0) {
295 if (file->fs->keys.public_key == NULL) {
296 if (_file->fs->set.debug)
306 if (strstr(file->fs->enc_algo, "gcm") != NULL ||
307 strstr(file->fs->enc_algo, "ccm") != NULL) {
314 iostream_temp_create_named(_file->fs->temp_path_prefix,
318 file->fs->enc_algo, file->fs->keys.public_key,