mail-gpg 0.3.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 14ba55d7e077b20728fd06b9439c9c7694bdea53
4
- data.tar.gz: 858613b6a0fea4c2c3d4485fa11c735056b0ca58
3
+ metadata.gz: 5372354dbe32dbf5c05196f257b8172582e5ffcc
4
+ data.tar.gz: 983703ee19cac1078e36c37bfde1b13906fd0ffa
5
5
  SHA512:
6
- metadata.gz: ccc8ecdcd585fd538504acb42d024d114008af0e7db5f5751824eda2bb4a6edfe65b0a95c844325ede9315470b2bda1a43937f0822331008e3fd8a2d4efec171
7
- data.tar.gz: 0c480fd57cc572c2cc4fa3495b1046513aa14a3052c05645462157052095d7434205b37e556448deec60fa80469b9be29e32cde7da5bc4a587405c9811030cff
6
+ metadata.gz: aeb9b25b2c04e4c0a71b1eea09631e399a82dbcef6b707b75a4053bca637e66dbdd1d3eabf88673c16a75b8ffd623fabdbdc1e9fe906c10b0ceee4debe452c75
7
+ data.tar.gz: 241a812c8341db86deae1bf48927e5a1c5e92491c505ab67706a9c3e83768c341207dc4d00dcc434d4fbff29252c6625ea5a55110a91a9d033bfb2a534701de6
@@ -1,3 +1,8 @@
1
+ == 0.3.1 2017-04-13
2
+
3
+ * fixes a bug with signature verification that only surfaced in environments
4
+ where ActiveSupport isn't loaded. Thanks @mashedcode for pointing this out.
5
+
1
6
  == 0.3.0 2016-12-27
2
7
 
3
8
  * [MIGHT BREAK THINGS] All mail headers will preserved now, if you want to
@@ -116,12 +116,11 @@ module Mail
116
116
 
117
117
  # decrypts PGP/MIME (RFC 3156, section 4) encrypted mail
118
118
  def self.decrypt_pgp_mime(encrypted_mail, options)
119
- # MUST containt exactly two body parts
120
- if encrypted_mail.parts.length != 2
121
- raise EncodingError, "RFC 3136 mandates exactly two body parts, found '#{encrypted_mail.parts.length}'"
119
+ if encrypted_mail.parts.length < 2
120
+ raise EncodingError, "RFC 3156 mandates exactly two body parts, found '#{encrypted_mail.parts.length}'"
122
121
  end
123
122
  if !VersionPart.isVersionPart? encrypted_mail.parts[0]
124
- raise EncodingError, "RFC 3136 first part not a valid version part '#{encrypted_mail.parts[0]}'"
123
+ raise EncodingError, "RFC 3156 first part not a valid version part '#{encrypted_mail.parts[0]}'"
125
124
  end
126
125
  decrypted = DecryptedPart.new(encrypted_mail.parts[1], options)
127
126
  Mail.new(decrypted.raw_source) do
@@ -151,7 +150,7 @@ module Mail
151
150
  def self.signature_valid_pgp_mime?(signed_mail, options)
152
151
  # MUST contain exactly two body parts
153
152
  if signed_mail.parts.length != 2
154
- raise EncodingError, "RFC 3136 mandates exactly two body parts, found '#{signed_mail.parts.length}'"
153
+ raise EncodingError, "RFC 3156 mandates exactly two body parts, found '#{signed_mail.parts.length}'"
155
154
  end
156
155
  result, verify_result = SignPart.verify_signature(signed_mail.parts[0], signed_mail.parts[1], options)
157
156
  signed_mail.verify_result = verify_result
@@ -17,7 +17,7 @@ module Mail
17
17
  # checks validity of signatures (true / false)
18
18
  def signature_valid?
19
19
  sigs = self.signatures
20
- sigs.any? && sigs.detect{|s|!s.valid?}.blank?
20
+ sigs.any? && sigs.all?{|s|s.valid?}
21
21
  end
22
22
 
23
23
  # list of all signatures from verify_result
@@ -1,5 +1,5 @@
1
1
  module Mail
2
2
  module Gpg
3
- VERSION = "0.3.0"
3
+ VERSION = "0.3.1"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mail-gpg
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jens Kraemer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-12-27 00:00:00.000000000 Z
11
+ date: 2017-04-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mail