projects
/
apps
/
madmutt.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
simplify block_try function.
[apps/madmutt.git]
/
crypt.c
diff --git
a/crypt.c
b/crypt.c
index
e5019ec
..
c0c64ad
100644
(file)
--- a/
crypt.c
+++ b/
crypt.c
@@
-16,19
+16,21
@@
# include "config.h"
#endif
# include "config.h"
#endif
+#include <lib-lib/str.h>
+#include <lib-lib/file.h>
+#include <lib-lib/ascii.h>
#include <lib-lib/mem.h>
#include <lib-lib/mem.h>
+#include <lib-lib/macros.h>
+
+#include <lib-mime/mime.h>
#include "mutt.h"
#include "mutt.h"
-#include "ascii.h"
#include "handler.h"
#include "mutt_curses.h"
#include "handler.h"
#include "mutt_curses.h"
-#include "mime.h"
#include "copy.h"
#include "mutt_crypt.h"
#include "pgp.h"
#include "copy.h"
#include "mutt_crypt.h"
#include "pgp.h"
-#include "lib/intl.h"
-#include "lib/str.h"
#include <sys/wait.h>
#include <string.h>
#include <sys/wait.h>
#include <string.h>
@@
-389,7
+391,7
@@
int mutt_is_application_smime (BODY * m)
/* no .p7c, .p10 support yet. */
/* no .p7c, .p10 support yet. */
- len =
str_len
(t) - 4;
+ len =
m_strlen
(t) - 4;
if (len > 0 && *(t + len) == '.') {
len++;
if (!ascii_strcasecmp ((t + len), "p7m"))
if (len > 0 && *(t + len) == '.') {
len++;
if (!ascii_strcasecmp ((t + len), "p7m"))
@@
-531,7
+533,7
@@
void convert_to_7bit (BODY * a)
convert_to_7bit (a->parts);
}
else if (a->type == TYPEMESSAGE &&
convert_to_7bit (a->parts);
}
else if (a->type == TYPEMESSAGE &&
-
str_casecmp
(a->subtype, "delivery-status")) {
+
m_strcasecmp
(a->subtype, "delivery-status")) {
if (a->encoding != ENC7BIT)
mutt_message_to_7bit (a, NULL);
}
if (a->encoding != ENC7BIT)
mutt_message_to_7bit (a, NULL);
}
@@
-554,7
+556,7
@@
void crypt_extract_keys_from_messages (HEADER * h)
{
int i;
char tempfname[_POSIX_PATH_MAX], *mbox;
{
int i;
char tempfname[_POSIX_PATH_MAX], *mbox;
-
ADDRESS
*tmp = NULL;
+
address_t
*tmp = NULL;
FILE *fpout;
if (!WithCrypto)
FILE *fpout;
if (!WithCrypto)
@@
-749,7
+751,7
@@
int mutt_signed_handler (BODY * a, STATE * s)
if ((protocol_minor = strchr (protocol, '/')))
protocol_minor++;
if ((protocol_minor = strchr (protocol, '/')))
protocol_minor++;
-
strfcpy (major, protocol, sizeof (major)
);
+
m_strcpy(major, sizeof(major), protocol
);
if ((t = strchr (major, '/')))
*t = '\0';
if ((t = strchr (major, '/')))
*t = '\0';
@@
-759,7
+761,7
@@
int mutt_signed_handler (BODY * a, STATE * s)
/* consistency check */
if (!(a && a->next && a->next->type == protocol_major &&
/* consistency check */
if (!(a && a->next && a->next->type == protocol_major &&
- !
str_casecmp
(a->next->subtype, protocol_minor))) {
+ !
m_strcasecmp
(a->next->subtype, protocol_minor))) {
state_attach_puts (_("[-- Error: "
"Inconsistent multipart/signed structure! --]\n\n"),
s);
state_attach_puts (_("[-- Error: "
"Inconsistent multipart/signed structure! --]\n\n"),
s);
@@
-769,13
+771,13
@@
int mutt_signed_handler (BODY * a, STATE * s)
if ((WithCrypto & APPLICATION_PGP)
&& protocol_major == TYPEAPPLICATION
if ((WithCrypto & APPLICATION_PGP)
&& protocol_major == TYPEAPPLICATION
- && !
str_casecmp
(protocol_minor, "pgp-signature"));
+ && !
m_strcasecmp
(protocol_minor, "pgp-signature"));
else if ((WithCrypto & APPLICATION_SMIME)
&& protocol_major == TYPEAPPLICATION
else if ((WithCrypto & APPLICATION_SMIME)
&& protocol_major == TYPEAPPLICATION
- && !(
str_casecmp
(protocol_minor, "x-pkcs7-signature")
- &&
str_casecmp
(protocol_minor, "pkcs7-signature")));
+ && !(
m_strcasecmp
(protocol_minor, "x-pkcs7-signature")
+ &&
m_strcasecmp
(protocol_minor, "pkcs7-signature")));
else if (protocol_major == TYPEMULTIPART
else if (protocol_major == TYPEMULTIPART
- && !
str_casecmp
(protocol_minor, "mixed"));
+ && !
m_strcasecmp
(protocol_minor, "mixed"));
else {
state_printf (s, _("[-- Error: "
"Unknown multipart/signed protocol %s! --]\n\n"),
else {
state_printf (s, _("[-- Error: "
"Unknown multipart/signed protocol %s! --]\n\n"),
@@
-793,7
+795,7
@@
int mutt_signed_handler (BODY * a, STATE * s)
for (i = 0; i < sigcnt; i++) {
if ((WithCrypto & APPLICATION_PGP)
&& signatures[i]->type == TYPEAPPLICATION
for (i = 0; i < sigcnt; i++) {
if ((WithCrypto & APPLICATION_PGP)
&& signatures[i]->type == TYPEAPPLICATION
- && !
str_casecmp
(signatures[i]->subtype, "pgp-signature")) {
+ && !
m_strcasecmp
(signatures[i]->subtype, "pgp-signature")) {
if (crypt_pgp_verify_one (signatures[i], s, tempfile) != 0)
goodsig = 0;
if (crypt_pgp_verify_one (signatures[i], s, tempfile) != 0)
goodsig = 0;
@@
-803,8
+805,8
@@
int mutt_signed_handler (BODY * a, STATE * s)
if ((WithCrypto & APPLICATION_SMIME)
&& signatures[i]->type == TYPEAPPLICATION
&&
if ((WithCrypto & APPLICATION_SMIME)
&& signatures[i]->type == TYPEAPPLICATION
&&
- (!
str_casecmp
(signatures[i]->subtype, "x-pkcs7-signature")
- || !
str_casecmp
(signatures[i]->subtype,
+ (!
m_strcasecmp
(signatures[i]->subtype, "x-pkcs7-signature")
+ || !
m_strcasecmp
(signatures[i]->subtype,
"pkcs7-signature"))) {
if (crypt_smime_verify_one (signatures[i], s, tempfile) != 0)
goodsig = 0;
"pkcs7-signature"))) {
if (crypt_smime_verify_one (signatures[i], s, tempfile) != 0)
goodsig = 0;