symmetric-encryption 4.2.0 → 4.2.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
  SHA256:
3
- metadata.gz: 9a62a8497a82ccb4701f2301bc351ab8e054569a3cdc02a0e0f2e14cc9866776
4
- data.tar.gz: f8867d2e9ced1fd3f7adb081a851481cb3abc11f067d67104324bce539911e26
3
+ metadata.gz: 40e60b20cfaf40c1b3ad68fb05b12fd766886ac3d4527a02c8d456906e45b705
4
+ data.tar.gz: 3c87cffcfc26fe8a057619b3559c3f93ff5a3951c219eb90deb1c2054ae4495f
5
5
  SHA512:
6
- metadata.gz: b8feb0c726ca19c1a956c24b1ec74c11786e07dc1d5131741697b23c0ff9a4b692a3b24853040b73e1418321a761d7f0687f51f620332c7480be73f5b23935fb
7
- data.tar.gz: 26fb41fd4d2dc609eb21c382399ed1656798071eedcef94f127e4f4054f7c46f268b94c344ed73cf4ea51583dcbff08deb602df02c04b3dfd5e8fb6a3ea0b73d
6
+ metadata.gz: 479105df621736ea8ccaddc73129f4c6d9ebad8a6918a793044d9d3329f547e3a7cbd404719bcbd9918a5cedb0c18694f22173201e799ab70d3a8032a7a90ac6
7
+ data.tar.gz: dd8fd1b290bc1e2e55311234e8a06660dbc6f0849382189bc9408432caa519f973a1cbb7835eb97805136699eaf357772531cb7dfe6dbe2a62c33b4600c141f5
@@ -51,7 +51,7 @@ module SymmetricEncryption
51
51
  "Symmetric Encryption key file: '#{file_name}' not found") unless ::File.exists?(file_name)
52
52
  raise(SymmetricEncryption::ConfigError,
53
53
  "Symmetric Encryption key file '#{file_name}' has the wrong "\
54
- "permissions: #{::File.stat(file_name).mode.to_s(8)}. Expected 100600.") unless correct_permissions?
54
+ "permissions: #{::File.stat(file_name).mode.to_s(8)}. Expected 100600 or 100400.") unless correct_permissions?
55
55
 
56
56
  data = read_from_file(file_name)
57
57
  key_encrypting_key ? key_encrypting_key.decrypt(data) : data
@@ -66,12 +66,12 @@ module SymmetricEncryption
66
66
  private
67
67
 
68
68
  # Returns true if the file is owned by the user running this code and it
69
- # has the correct mode - readable and writable by its owner and no one
69
+ # has the correct mode - readable and writable by its owner and no one
70
70
  # else, much like the keys one has in ~/.ssh
71
71
  def correct_permissions?
72
72
  stat = ::File.stat(file_name)
73
-
74
- stat.owned? && stat.mode.to_s(8) == '100600'
73
+
74
+ stat.owned? && %w(100600 100400).include?(stat.mode.to_s(8))
75
75
  end
76
76
  end
77
77
  end
@@ -14,8 +14,8 @@ module SymmetricEncryption #:nodoc:
14
14
  # end
15
15
  config.symmetric_encryption = ::SymmetricEncryption
16
16
 
17
- # Initialize Symmetry. This will look for a symmetry.yml in the config
18
- # directory and configure Symmetry appropriately.
17
+ # Initialize Symmetric Encryption. This will look for a symmetric-encryption.yml in the config
18
+ # directory and configure Symmetric Encryption appropriately.
19
19
  #
20
20
  # @example symmetric-encryption.yml
21
21
  #
@@ -1,3 +1,3 @@
1
1
  module SymmetricEncryption
2
- VERSION = '4.2.0'.freeze
2
+ VERSION = '4.2.1'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: symmetric-encryption
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.2.0
4
+ version: 4.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Reid Morrison
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-02-21 00:00:00.000000000 Z
11
+ date: 2019-04-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: coercible