]> granicus.if.org Git - mutt/commitdiff
Don't try to decrypt autocrypt messages if the option is off.
authorKevin McCarthy <kevin@8t8.us>
Sun, 4 Aug 2019 14:55:26 +0000 (07:55 -0700)
committerKevin McCarthy <kevin@8t8.us>
Sun, 4 Aug 2019 14:55:26 +0000 (07:55 -0700)
cryptglue.c

index b154e8dc4c3f98554b9e9eab21a121463e5791f4..ec4d05138ea5ce44187246206d58a78799b16dc1 100644 (file)
@@ -164,13 +164,16 @@ int crypt_pgp_decrypt_mime (FILE *a, FILE **b, BODY *c, BODY **d)
 #ifdef USE_AUTOCRYPT
   int result;
 
-  set_option (OPTAUTOCRYPTGPGME);
-  result = pgp_gpgme_decrypt_mime (a, b, c, d);
-  unset_option (OPTAUTOCRYPTGPGME);
-  if (result == 0)
+  if (option (OPTAUTOCRYPT))
   {
-    c->is_autocrypt = 1;
-    return result;
+    set_option (OPTAUTOCRYPTGPGME);
+    result = pgp_gpgme_decrypt_mime (a, b, c, d);
+    unset_option (OPTAUTOCRYPTGPGME);
+    if (result == 0)
+    {
+      c->is_autocrypt = 1;
+      return result;
+    }
   }
 #endif
 
@@ -195,13 +198,16 @@ int crypt_pgp_encrypted_handler (BODY *a, STATE *s)
 #ifdef USE_AUTOCRYPT
   int result;
 
-  set_option (OPTAUTOCRYPTGPGME);
-  result = pgp_gpgme_encrypted_handler (a, s);
-  unset_option (OPTAUTOCRYPTGPGME);
-  if (result == 0)
+  if (option (OPTAUTOCRYPT))
   {
-    a->is_autocrypt = 1;
-    return result;
+    set_option (OPTAUTOCRYPTGPGME);
+    result = pgp_gpgme_encrypted_handler (a, s);
+    unset_option (OPTAUTOCRYPTGPGME);
+    if (result == 0)
+    {
+      a->is_autocrypt = 1;
+      return result;
+    }
   }
 #endif