diff --git a/lib/enmail/helpers/rfc1847.rb b/lib/enmail/helpers/rfc1847.rb index 9bdc345..94b1996 100644 --- a/lib/enmail/helpers/rfc1847.rb +++ b/lib/enmail/helpers/rfc1847.rb @@ -85,7 +85,7 @@ def build_signature_part(signature) part end - def multipart_signed_content_type(protocol: sign_protocol, micalg: message_integrity_algorithm) + def multipart_signed_content_type(protocol: sign_protocol, micalg:) %[multipart/signed; protocol="#{protocol}"; micalg="#{micalg}"] end diff --git a/lib/enmail/helpers/rfc3156.rb b/lib/enmail/helpers/rfc3156.rb index ab2c039..6917ab7 100644 --- a/lib/enmail/helpers/rfc3156.rb +++ b/lib/enmail/helpers/rfc3156.rb @@ -51,10 +51,6 @@ def encryption_protocol "application/pgp-encrypted" end - def message_integrity_algorithm - "pgp-sha1" - end - # As defined in RFC 3156 def encryption_control_information "Version: 1" diff --git a/spec/unit/helpers/rfc1847_spec.rb b/spec/unit/helpers/rfc1847_spec.rb index 64f5a13..f904abb 100644 --- a/spec/unit/helpers/rfc1847_spec.rb +++ b/spec/unit/helpers/rfc1847_spec.rb @@ -273,12 +273,9 @@ expect(retval_segments[1..-1]).to include(micalg_def) end - it "defaults micalg argument to value returned by " + - "#message_integrity_algorithm" do + it "requires micalg argument" do args.delete :micalg - retval_segments = subject.call(args).split(/\s*;\s*/) - micalg_def = %[micalg="#{adapter.message_integrity_algorithm}"] - expect(retval_segments[1..-1]).to include(micalg_def) + expect { subject.call(args) }.to raise_error(ArgumentError) end it "tells about PGP protocol given as argument" do