RFC5751 favours the use of application/pkcs7-mime and
application/pkcs7-signature.
This change is pretty safe, since the GPGME code has been doing so for
a long time already.
Update the documentation to refer to the newer mime types.
Thanks to Ralf Hildebrandt for reporting the issue, and the reference
to RFC 5751.
Thanks to Arnt Gulbrandsen for the original patch in his branch. I
recreated it and added the documentation updates on top.
---
contrib/smime.rc | 2 +-
doc/Muttrc.head | 4 ++--
doc/manual.xml.head | 4 ++--
doc/smime-notes.txt | 2 +-
init.h | 6 +++---
smime.c | 6 +++---
6 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/contrib/smime.rc b/contrib/smime.rc
index dfcd13ea..ea2df0ce 100644
--- a/contrib/smime.rc
+++ b/contrib/smime.rc
@@ -99,7 +99,7 @@ set smime_decrypt_command="openssl cms -decrypt -passin stdin
-inform DER -in %f
# Verify a signature of type multipart/signed
set smime_verify_command="openssl smime -verify -inform DER -in %s %C -content
%f"
-# Verify a signature of type application/x-pkcs7-mime
+# Verify a signature of type application/pkcs7-mime
set smime_verify_opaque_command="\
openssl smime -verify -inform DER -in %s %C || \
openssl smime -verify -inform DER -in %s -noverify 2>/dev/null"
diff --git a/doc/Muttrc.head b/doc/Muttrc.head
index 0d2b2f52..542d9d0a 100644
--- a/doc/Muttrc.head
+++ b/doc/Muttrc.head
@@ -75,13 +75,13 @@ mime_lookup application/octet-stream
## text/x-vcard and application/pgp parts. (PGP parts are already known
## to mutt, and can be searched for with ~g, ~G, and ~k.)
##
-## I've added x-pkcs7 to this, since it functions (for S/MIME)
+## I've added pkcs7 to this, since it functions (for S/MIME)
## analogously to PGP signature attachments. S/MIME isn't supported
## in a stock mutt build, but we can still treat it specially here.
##
attachments +A */.*
attachments -A text/x-vcard application/pgp.*
-attachments -A application/x-pkcs7-.*
+attachments -A application/pkcs7-.*
## Discount all MIME parts with an "inline" disposition, unless they're
## text/plain. (Why inline a text/plain part unless it's external to the
diff --git a/doc/manual.xml.head b/doc/manual.xml.head
index 641ade5b..f37b81c2 100644
--- a/doc/manual.xml.head
+++ b/doc/manual.xml.head
@@ -9300,14 +9300,14 @@ commented out define the default configuration of the
lists.
# text/x-vcard and application/pgp parts. (PGP parts are already known
# to mutt, and can be searched for with ~g, ~G, and ~k.)
#
-# I've added x-pkcs7 to this, since it functions (for S/MIME)
+# I've added pkcs7 to this, since it functions (for S/MIME)
# analogously to PGP signature attachments. S/MIME isn't supported
# in a stock mutt build, but we can still treat it specially here.
#
</emphasis>
attachments +A */.*
attachments -A text/x-vcard application/pgp.*
-attachments -A application/x-pkcs7-.*
+attachments -A application/pkcs7-.*
<emphasis role="comment">
# Discount all MIME parts with an "inline" disposition, unless they're
diff --git a/doc/smime-notes.txt b/doc/smime-notes.txt
index 15ab8492..25ead497 100644
--- a/doc/smime-notes.txt
+++ b/doc/smime-notes.txt
@@ -94,5 +94,5 @@ to get a valid certificate outside of mutt. (See above)
A certificate can be viewed by adding the following to your ~/.mailcap:
-application/x-pkcs7-signature;openssl pkcs7 -in %s -inform der -noout \
+application/pkcs7-signature;openssl pkcs7 -in %s -inform der -noout \
-print_certs -text | less; needsterminal
diff --git a/init.h b/init.h
index 0c512f71..af684866 100644
--- a/init.h
+++ b/init.h
@@ -3904,7 +3904,7 @@ struct option_t MuttVars[] = {
/*
** .pp
** This format string specifies a command which is used to decrypt
- ** \fCapplication/x-pkcs7-mime\fP attachments.
+ ** \fCapplication/pkcs7-mime\fP attachments.
** .pp
** The OpenSSL command formats have their own set of \fCprintf(3)\fP-like
sequences
** similar to PGP's:
@@ -4091,7 +4091,7 @@ struct option_t MuttVars[] = {
/*
** .pp
** This command is used to created S/MIME signatures of type
- ** \fCapplication/x-pkcs7-signature\fP, which can only be handled by mail
+ ** \fCapplication/pkcs7-signature\fP, which can only be handled by mail
** clients supporting the S/MIME extension.
** .pp
** This is a format string, see the $$smime_decrypt_command command for
@@ -4118,7 +4118,7 @@ struct option_t MuttVars[] = {
/*
** .pp
** This command is used to verify S/MIME signatures of type
- ** \fCapplication/x-pkcs7-mime\fP.
+ ** \fCapplication/pkcs7-mime\fP.
** .pp
** This is a format string, see the $$smime_decrypt_command command for
** possible \fCprintf(3)\fP-like sequences.
diff --git a/smime.c b/smime.c
index 5517b2af..606d2be0 100644
--- a/smime.c
+++ b/smime.c
@@ -1495,7 +1495,7 @@ BODY *smime_build_smime_entity(BODY *a, char *certlist)
t = mutt_new_body();
t->type = TYPEAPPLICATION;
- t->subtype = safe_strdup("x-pkcs7-mime");
+ t->subtype = safe_strdup("pkcs7-mime");
mutt_set_parameter("name", "smime.p7m", &t->parameter);
mutt_set_parameter("smime-type", "enveloped-data", &t->parameter);
t->encoding = ENCBASE64; /* The output of OpenSSL SHOULD be binary */
@@ -1680,7 +1680,7 @@ BODY *smime_sign_message(BODY *a )
mutt_set_parameter("micalg", micalg, &t->parameter);
FREE(&micalg);
- mutt_set_parameter("protocol", "application/x-pkcs7-signature",
+ mutt_set_parameter("protocol", "application/pkcs7-signature",
&t->parameter);
t->parts = a;
@@ -1689,7 +1689,7 @@ BODY *smime_sign_message(BODY *a )
t->parts->next = mutt_new_body();
t = t->parts->next;
t->type = TYPEAPPLICATION;
- t->subtype = safe_strdup("x-pkcs7-signature");
+ t->subtype = safe_strdup("pkcs7-signature");
t->filename = safe_strdup(mutt_b2s(signedfile));
t->d_filename = safe_strdup("smime.p7s");
t->use_disp = 1;
--
2.54.0