summaryrefslogtreecommitdiffstats
path: root/autocrypt
diff options
context:
space:
mode:
authorKevin McCarthy <kevin@8t8.us>2019-07-27 15:34:51 -0700
committerKevin McCarthy <kevin@8t8.us>2019-08-03 14:08:09 -0700
commite5463f577620969a19181b78b541373ced9662f6 (patch)
tree812be4ff7d7cbfaef15416a7b251caacb3b31576 /autocrypt
parenta7a5abe480ef23562537c9a8f59c0a8b3cd1e3cd (diff)
Add account->enabled checks.
Add to ui recommendation, keylist generator, and autocrypt header writing routines.
Diffstat (limited to 'autocrypt')
-rw-r--r--autocrypt/autocrypt.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/autocrypt/autocrypt.c b/autocrypt/autocrypt.c
index 1b0dd2af..73584650 100644
--- a/autocrypt/autocrypt.c
+++ b/autocrypt/autocrypt.c
@@ -499,6 +499,9 @@ autocrypt_rec_t mutt_autocrypt_ui_recommendation (HEADER *hdr, char **keylist)
if (mutt_autocrypt_db_account_get (hdr->env->from, &account) <= 0)
goto cleanup;
+ if (!account->enabled)
+ goto cleanup;
+
keylist_buf = mutt_buffer_pool_get ();
mutt_buffer_addstr (keylist_buf, account->keyid);
@@ -593,6 +596,8 @@ int mutt_autocrypt_set_sign_as_default_key (HEADER *hdr)
goto cleanup;
if (!account->keyid)
goto cleanup;
+ if (!account->enabled)
+ goto cleanup;
mutt_str_replace (&AutocryptSignAs, account->keyid);
mutt_str_replace (&AutocryptDefaultKey, account->keyid);
@@ -646,6 +651,8 @@ int mutt_autocrypt_write_autocrypt_header (ENVELOPE *env, FILE *fp)
goto cleanup;
if (!account->keydata)
goto cleanup;
+ if (!account->enabled)
+ goto cleanup;
fputs ("Autocrypt: ", fp);
write_autocrypt_header_line (fp, account->email_addr, account->prefer_encrypt,