X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=crypt.c;h=fbe984a9157fcb365dea663e1561d6c8f124e53c;hp=d8339fe5f3b8328608b99462d4d928066dde0b8f;hb=105e395f06e15f2c3878d856bc278dd2cf971794;hpb=c3e57678c8be193fc137854020f3a90887be97c9 diff --git a/crypt.c b/crypt.c index d8339fe..fbe984a 100644 --- a/crypt.c +++ b/crypt.c @@ -23,6 +23,10 @@ #include "mutt_crypt.h" #include "pgp.h" +#include "lib/mem.h" +#include "lib/intl.h" +#include "lib/str.h" + #include #include #include @@ -382,7 +386,7 @@ int mutt_is_application_smime (BODY * m) /* no .p7c, .p10 support yet. */ - len = mutt_strlen (t) - 4; + len = safe_strlen (t) - 4; if (len > 0 && *(t + len) == '.') { len++; if (!ascii_strcasecmp ((t + len), "p7m")) @@ -524,7 +528,7 @@ void convert_to_7bit (BODY * a) convert_to_7bit (a->parts); } else if (a->type == TYPEMESSAGE && - mutt_strcasecmp (a->subtype, "delivery-status")) { + safe_strcasecmp (a->subtype, "delivery-status")) { if (a->encoding != ENC7BIT) mutt_message_to_7bit (a, NULL); } @@ -751,7 +755,7 @@ void mutt_signed_handler (BODY * a, STATE * s) /* consistency check */ if (!(a && a->next && a->next->type == protocol_major && - !mutt_strcasecmp (a->next->subtype, protocol_minor))) { + !safe_strcasecmp (a->next->subtype, protocol_minor))) { state_attach_puts (_("[-- Error: " "Inconsistent multipart/signed structure! --]\n\n"), s); @@ -762,13 +766,13 @@ void mutt_signed_handler (BODY * a, STATE * s) if ((WithCrypto & APPLICATION_PGP) && protocol_major == TYPEAPPLICATION - && !mutt_strcasecmp (protocol_minor, "pgp-signature")); + && !safe_strcasecmp (protocol_minor, "pgp-signature")); else if ((WithCrypto & APPLICATION_SMIME) && protocol_major == TYPEAPPLICATION - && !(mutt_strcasecmp (protocol_minor, "x-pkcs7-signature") - && mutt_strcasecmp (protocol_minor, "pkcs7-signature"))); + && !(safe_strcasecmp (protocol_minor, "x-pkcs7-signature") + && safe_strcasecmp (protocol_minor, "pkcs7-signature"))); else if (protocol_major == TYPEMULTIPART - && !mutt_strcasecmp (protocol_minor, "mixed")); + && !safe_strcasecmp (protocol_minor, "mixed")); else { state_printf (s, _("[-- Error: " "Unknown multipart/signed protocol %s! --]\n\n"), @@ -787,7 +791,7 @@ void mutt_signed_handler (BODY * a, STATE * s) for (i = 0; i < sigcnt; i++) { if ((WithCrypto & APPLICATION_PGP) && signatures[i]->type == TYPEAPPLICATION - && !mutt_strcasecmp (signatures[i]->subtype, "pgp-signature")) { + && !safe_strcasecmp (signatures[i]->subtype, "pgp-signature")) { if (crypt_pgp_verify_one (signatures[i], s, tempfile) != 0) goodsig = 0; @@ -797,8 +801,8 @@ void mutt_signed_handler (BODY * a, STATE * s) if ((WithCrypto & APPLICATION_SMIME) && signatures[i]->type == TYPEAPPLICATION && - (!mutt_strcasecmp (signatures[i]->subtype, "x-pkcs7-signature") - || !mutt_strcasecmp (signatures[i]->subtype, + (!safe_strcasecmp (signatures[i]->subtype, "x-pkcs7-signature") + || !safe_strcasecmp (signatures[i]->subtype, "pkcs7-signature"))) { if (crypt_smime_verify_one (signatures[i], s, tempfile) != 0) goodsig = 0;