mail-gpg 0.4.1 → 0.4.2

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
  SHA256:
3
- metadata.gz: 48024e5411ba53abbdadf7a3cde7b6cbb86acaa3c81a44dacbf77cd6e5fb7021
4
- data.tar.gz: 9dba324ef49fda99768f398ff9b4799c34c661f35bd1943eecc33f906479ac5e
3
+ metadata.gz: b7e6ef944bc641fa51f189b379859528044939a7eeca16d44cdeab8f46fdbc0c
4
+ data.tar.gz: aaa67237e62a803b4d369f81a70d71511e55b175c4ba95714137d6a0aa649cfe
5
5
  SHA512:
6
- metadata.gz: db9a05bf279e61fc450b5b222ebf61a0e85797da432887ad6adda5e03e9d1cea1ccb73919ab2736df731a32a54559b2106eb651a982c4be438603c0f61602ebb
7
- data.tar.gz: e39c89fa18eba088d462e7b79ab3c5168495520f9cc32ec580ceaa75ba440be720fe6abc7c713c18afa85858253d2024d5af577aa0ed5567fa61189689e681f8
6
+ metadata.gz: 3c5224711ba09fe1b59cfb6076fe4c8c09838e0915411411fe044b5b04d76949bb74eb81e8e9a0242c8996a5be6c380c43d2662942fe58714c1d838c71ecf756
7
+ data.tar.gz: 25e41d97a17fc966d4839f96b7c827432c1e7f60905d9675238633660efa5a930c4ff9028c91c84ab8db66f0884601fb0ff5fc8b760c194ceae37fab261f09e8
data/History.txt CHANGED
@@ -1,3 +1,8 @@
1
+ == 0.4.2 2019-09-02
2
+
3
+ * do not die on invalid content-transfer encodings when checking if a message
4
+ is inline-signed or encrypted
5
+
1
6
  == 0.4.1 2019-07-08
2
7
 
3
8
  * do not modify argument hash #61
data/lib/mail/gpg.rb CHANGED
@@ -17,10 +17,13 @@ require 'mail/gpg/inline_signed_message'
17
17
 
18
18
  module Mail
19
19
  module Gpg
20
+ BEGIN_PGP_MESSAGE_MARKER = /^-----BEGIN PGP MESSAGE-----/
21
+ BEGIN_PGP_SIGNED_MESSAGE_MARKER = /^-----BEGIN PGP SIGNED MESSAGE-----/
22
+
20
23
  # options are:
21
24
  # :sign: sign message using the sender's private key
22
25
  # :sign_as: sign using this key (give the corresponding email address or key fingerprint)
23
- # :passphrase: passphrase for the signing key
26
+ # :password: passphrase for the signing key
24
27
  # :keys: A hash mapping recipient email addresses to public keys or public
25
28
  # key ids. Imports any keys given here that are not already part of the
26
29
  # local keychain before sending the mail.
@@ -198,10 +201,10 @@ module Mail
198
201
  # check if inline PGP (i.e. if any parts of the mail includes
199
202
  # the PGP MESSAGE marker)
200
203
  def self.encrypted_inline?(mail)
201
- return true if mail.body.include?('-----BEGIN PGP MESSAGE-----')
204
+ return true if mail.body.to_s =~ BEGIN_PGP_MESSAGE_MARKER rescue nil
202
205
  if mail.multipart?
203
206
  mail.parts.each do |part|
204
- return true if part.body.include?('-----BEGIN PGP MESSAGE-----')
207
+ return true if part.body.to_s =~ BEGIN_PGP_MESSAGE_MARKER rescue nil
205
208
  return true if part.has_content_type? &&
206
209
  /application\/(?:octet-stream|pgp-encrypted)/ =~ part.mime_type &&
207
210
  /.*\.(?:pgp|gpg|asc)$/ =~ part.content_type_parameters[:name] &&
@@ -223,10 +226,10 @@ module Mail
223
226
  # check if inline PGP (i.e. if any parts of the mail includes
224
227
  # the PGP SIGNED marker)
225
228
  def self.signed_inline?(mail)
226
- return true if mail.body.to_s =~ /^-----BEGIN PGP SIGNED MESSAGE-----/
229
+ return true if mail.body.to_s =~ BEGIN_PGP_SIGNED_MESSAGE_MARKER rescue nil
227
230
  if mail.multipart?
228
231
  mail.parts.each do |part|
229
- return true if part.body.to_s =~ /^-----BEGIN PGP SIGNED MESSAGE-----/
232
+ return true if part.body.to_s =~ BEGIN_PGP_SIGNED_MESSAGE_MARKER rescue nil
230
233
  end
231
234
  end
232
235
  false
@@ -1,5 +1,5 @@
1
1
  module Mail
2
2
  module Gpg
3
- VERSION = "0.4.1"
3
+ VERSION = "0.4.2"
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.4.1
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jens Kraemer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-07-08 00:00:00.000000000 Z
11
+ date: 2019-09-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mail