rubeepass 1.1.0 → 1.1.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 +4 -4
- data/lib/rubeepass/entry.rb +36 -29
- data/lib/rubeepass/protected_decryptor.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5945c73082ac80abb126641064d1adc6ff1b08d1
|
4
|
+
data.tar.gz: 387b03a273731daf0330dbdc2419494c22c66b46
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b5d068702f0b3d5bbe09ec040434f6c52a947c995b1d62fa2580f894497b9184c1b842467c05c4297345b164078e19d298b69273af90133e8f71a608af692539
|
7
|
+
data.tar.gz: 714026548c9412fa21ea26f97dca37462a94d596041d432b4424757b351843372aa9617ce8ac18373593013142e76010d441b984eb45bc290c406ed9bf515ef5
|
data/lib/rubeepass/entry.rb
CHANGED
@@ -22,6 +22,36 @@ class RubeePass::Entry
|
|
22
22
|
return (self.title.downcase <=> other.title.downcase)
|
23
23
|
end
|
24
24
|
|
25
|
+
def additional_attributes
|
26
|
+
return attributes.select do |key, value|
|
27
|
+
key.match(/^(Notes|Password|Title|URL|UserName)$/).nil?
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
def attribute(attr)
|
32
|
+
return nil if (@keepass.nil?)
|
33
|
+
return "" if (!has_attribute?(attr))
|
34
|
+
|
35
|
+
begin
|
36
|
+
return @keepass.protected_decryptor.decrypt(
|
37
|
+
@attributes[attr]
|
38
|
+
)
|
39
|
+
rescue
|
40
|
+
return @attributes[attr]
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
def attributes
|
45
|
+
return nil if (@keepass.nil?)
|
46
|
+
|
47
|
+
attrs = Hash.new
|
48
|
+
@attributes.each do |key, value|
|
49
|
+
attrs[key] = attribute(key)
|
50
|
+
end
|
51
|
+
|
52
|
+
return attrs
|
53
|
+
end
|
54
|
+
|
25
55
|
def details(level = 0, show_passwd = false)
|
26
56
|
lvl = Array.new(level, " ").join
|
27
57
|
|
@@ -75,8 +105,9 @@ class RubeePass::Entry
|
|
75
105
|
end
|
76
106
|
|
77
107
|
def self.handle_protected(keepass, base64)
|
78
|
-
data = nil
|
79
108
|
return nil if (base64.nil?)
|
109
|
+
|
110
|
+
data = nil
|
80
111
|
begin
|
81
112
|
data = base64.unpack("m*")[0]
|
82
113
|
if (data.length != data.bytesize)
|
@@ -90,6 +121,10 @@ class RubeePass::Entry
|
|
90
121
|
return keepass.protected_decryptor.add_to_stream(data)
|
91
122
|
end
|
92
123
|
|
124
|
+
def has_attribute?(attr)
|
125
|
+
return !@attributes[attr].nil?
|
126
|
+
end
|
127
|
+
|
93
128
|
def hilight_password(passwd)
|
94
129
|
return passwd if (!RubeePass.hilight?)
|
95
130
|
return passwd.light_red
|
@@ -154,34 +189,6 @@ class RubeePass::Entry
|
|
154
189
|
end
|
155
190
|
end
|
156
191
|
|
157
|
-
def has_attribute?(attr)
|
158
|
-
!@attributes[attr].nil?
|
159
|
-
end
|
160
|
-
|
161
|
-
def attribute(attr)
|
162
|
-
return nil if (@keepass.nil?)
|
163
|
-
return "" unless (has_attribute?(attr))
|
164
|
-
|
165
|
-
begin
|
166
|
-
return @keepass.protected_decryptor.get_password(
|
167
|
-
@attributes[attr]
|
168
|
-
)
|
169
|
-
rescue
|
170
|
-
return @attributes[attr]
|
171
|
-
end
|
172
|
-
end
|
173
|
-
|
174
|
-
def attributes
|
175
|
-
return nil if (@keepass.nil?)
|
176
|
-
|
177
|
-
attributes = {}
|
178
|
-
@attributes.each do |key, value|
|
179
|
-
attributes[key] = attribute(key)
|
180
|
-
end
|
181
|
-
|
182
|
-
return attributes
|
183
|
-
end
|
184
|
-
|
185
192
|
def to_s
|
186
193
|
return details
|
187
194
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubeepass
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Miles Whittaker
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-04-
|
11
|
+
date: 2017-04-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: minitest
|
@@ -221,7 +221,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
221
221
|
version: '0'
|
222
222
|
requirements: []
|
223
223
|
rubyforge_project:
|
224
|
-
rubygems_version: 2.
|
224
|
+
rubygems_version: 2.6.8
|
225
225
|
signing_key:
|
226
226
|
specification_version: 4
|
227
227
|
summary: Ruby KeePass 2.x implementation
|