Skip to content

Commit

Permalink
disdf
Browse files Browse the repository at this point in the history
  • Loading branch information
skalee committed Sep 4, 2018
1 parent 73db940 commit cb4e303
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 10 deletions.
2 changes: 1 addition & 1 deletion lib/enmail/helpers/rfc1847.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 0 additions & 4 deletions lib/enmail/helpers/rfc3156.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
7 changes: 2 additions & 5 deletions spec/unit/helpers/rfc1847_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit cb4e303

Please sign in to comment.