From 8d82e3072f54cfcae1a8cdeab8aed6cb241a6a73 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Ren=C3=A9=20Clerc?= Date: Thu, 10 Oct 2002 09:50:03 +0000 Subject: [PATCH] Make sure that crypt_reply replies with the same type, despite a possible S/MIME default. --- send.c | 39 ++++++++++++++++++++++++++------------- 1 file changed, 26 insertions(+), 13 deletions(-) diff --git a/send.c b/send.c index 85186b56..0f7ed7d6 100644 --- a/send.c +++ b/send.c @@ -1248,28 +1248,41 @@ ci_send_message (int flags, /* send mode */ msg->security |= SIGN; if (option (OPTCRYPTREPLYSIGNENCRYPTED) && cur && cur->security & ENCRYPT) msg->security |= SIGN; - -#ifdef HAVE_PGP - if (msg->security) - msg->security |= APPLICATION_PGP; /* default is PGP */ -#endif + } + if (msg->security && cur) + { #ifdef HAVE_SMIME - if (msg->security && ((cur && cur->security & APPLICATION_SMIME) || - option (OPTSMIMEISDEFAULT))) - { + if (cur->security & APPLICATION_SMIME || option (OPTSMIMEISDEFAULT)) + msg->security |= APPLICATION_SMIME; +#endif #ifdef HAVE_PGP - /* if not both.. */ - msg->security ^= APPLICATION_PGP; + if (cur->security & APPLICATION_PGP) + { +#ifdef HAVE_SMIME + if (option (OPTSMIMEISDEFAULT)) + msg->security ^= APPLICATION_SMIME; #endif - msg->security |= APPLICATION_SMIME; + msg->security |= APPLICATION_PGP; } -#endif /* HAVE_SMIME */ +#endif /* HAVE_PGP */ + } + else if (msg->security) + { +#ifdef HAVE_PGP + msg->security |= APPLICATION_PGP; +#ifdef HAVE_SMIME + if (option (OPTSMIMEISDEFAULT)) + { + msg->security |= APPLICATION_SMIME; + msg->security ^= APPLICATION_PGP; + } +#endif +#endif /* HAVE_PGP */ } #endif /* HAVE_PGP || HAVE_SMIME */ - } /* wait until now to set the real name portion of our return address so that $realname can be set in a send-hook */ -- 2.40.0