symmetric-encryption 4.2.0 → 4.2.1
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 40e60b20cfaf40c1b3ad68fb05b12fd766886ac3d4527a02c8d456906e45b705
|
4
|
+
data.tar.gz: 3c87cffcfc26fe8a057619b3559c3f93ff5a3951c219eb90deb1c2054ae4495f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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)
|
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
|
18
|
-
# directory and configure
|
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
|
#
|
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.
|
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-
|
11
|
+
date: 2019-04-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: coercible
|