reyes 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ZjZiNjMyZjAyMzg2ZmViYWVkYTkwMWYzZjk4YzJmOWMwYzBhODBmOA==
4
+ ZTM1YmZiYjM5MzMyNWQ4N2MyZGFiZGQyMmFmNjBlYzA5ZWY0ZTUxOA==
5
5
  data.tar.gz: !binary |-
6
- NTljMWY5NGY5MGFjYWI1YTIyN2JhOGExOGFmZTcyYTIzNmQ2YTZjNA==
6
+ NDk5ZmZlNTExMThjZDk3NDc0YTc3MWJiNzRkMTRkMDQ3YTk0NTczZA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- Yjc2Nzg4YzczNDhlZDZiMjdkZmVhM2ZlN2ViMzY4OTU0Mzk3NmZmZmEwNjJm
10
- MTUwMDQ2OWVjOTJjYjI1NjliZmRmZTFkMDg0NTU3YTRjZTcxODA0MDA5YjMz
11
- MDBiNTBhOWEzNjI1YTA5NjcwNGE1OWNiNDYzNGFjZmM3NjdiZjM=
9
+ MzhiNzk5NTI2NDE3MGE4Y2ZkMTY2ZDRhZDNjMDY5ZGYxZDAzMzFlMGRiNmJj
10
+ ZDEzZmU5ZDhkMjk5MTdlNDc3NDhjYmYxMWQzMmQ5ZGJkNDc2ZTUzMzJiYmE4
11
+ MGRmYjZhYmU2MmIzYWE2MGJjYzNhZWVkYTc5ZmUyZjExNTU5ZTY=
12
12
  data.tar.gz: !binary |-
13
- OGMwMmI5MThjNmUwNWJlZDFkNTBiNGUyYTc3MjA1NzYxOWM2ZTcwOWI1MzQ2
14
- NTRiZGNkODE5OGI5ZmIxMTM0NzA4MDc4ZDdkNWEzYzYwMDc3YmExOWM5NTUw
15
- NGRmMmUxNTFlOWNhYzYzMjYzN2I3ZmM4OWFjY2U4M2VkM2JlYjI=
13
+ NmM0NjJiMmNjY2JhMWQwZmNhYmMzZTRkZDlmNjcwMjAzNDQ0NDlkMzQwMDJm
14
+ MTMzMGI1MDY5MzkyYThmNWNhMDlmNmJmNzBhOTNlMzFlOGI5NTM4MTQ5NjZk
15
+ MzM0NTQ2MzMzM2QyOGFmNzI1Yzk1NzgzYjAyYTVjNDRhZWZmYjU=
@@ -27,7 +27,7 @@ module Reyes
27
27
  #
28
28
  # @return [String] the stripped cleartext data
29
29
  #
30
- def verify!(data)
30
+ def verify!(data, retries=1)
31
31
  log.info("Verifying #{data.length} bytes against key #{key_id}")
32
32
 
33
33
  gpg_cmd = %w{gpg --batch --decrypt --status-fd 2} + keyring_args + ['-']
@@ -42,7 +42,18 @@ module Reyes
42
42
  raise VerificationFailed.new("Bad key match") unless $1 == $2
43
43
  raise VerificationFailed.new("Bad Key ID") unless $1 == key_id
44
44
  else
45
- raise VerificationFailed.new("Pattern does not match")
45
+ # There's a weird and very rare race condition where the stderr
46
+ # output returned by Subprocess can be truncated.
47
+ # Retry in this case.
48
+ if err.split("\n").length < 4 && retries > 0
49
+ log.error("Looks like we hit hit GPG/Subprocess race condition")
50
+ log.error("GPG stderr:")
51
+ log.error(err.inspect)
52
+ log.error("Retrying...")
53
+ return verify!(data, retries - 1)
54
+ else
55
+ raise VerificationFailed.new("Pattern does not match")
56
+ end
46
57
  end
47
58
  rescue VerificationFailed => exc
48
59
  log.error("GPG verification failed: #{exc.message}")
@@ -73,7 +84,11 @@ module Reyes
73
84
  log.error("GPG stderr:")
74
85
  log.error(err)
75
86
  log.error("GPG stdout:")
76
- log.error(out)
87
+ if out.length > 80
88
+ log.error(out[0..80] + '...')
89
+ else
90
+ log.error(out)
91
+ end
77
92
 
78
93
  write_tmp_file("input data", data) unless data.empty?
79
94
  end
@@ -1,3 +1,3 @@
1
1
  module Reyes
2
- VERSION = '0.2.1' unless defined?(self::VERSION)
2
+ VERSION = '0.2.2' unless defined?(self::VERSION)
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: reyes
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andy Brody
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-02-24 00:00:00.000000000 Z
12
+ date: 2015-02-25 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: aws-sdk