rubeepass 0.2.2 → 0.2.3
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 +5 -1
- data/lib/rubeepass.rb +10 -9
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 006a68f0d13c9efe8eecf937d1bec8a8c2d067eb
|
4
|
+
data.tar.gz: e19d1a9a76ffd938a85feea89d3bc8211a7458c2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1b71c2f598f1e5d56575e6faca2dad81f24c790f713218b101467f3982ce3a5cc4b84f6f0815b7b4f8c40cec87b772097a07ce08d523551ed6849d26699d584b
|
7
|
+
data.tar.gz: 1f53c5905d5e620f58576789dfeea5617394f278e8196f3bb1d01b23fc48c78704a1c9367dd76a2cb8cae420dba05b83fc77d5d0629e3fdcfbe89dc1a40cc380
|
data/lib/rubeepass/entry.rb
CHANGED
@@ -75,7 +75,11 @@ class RubeePass::Entry
|
|
75
75
|
|
76
76
|
def password
|
77
77
|
return nil if (@keepass.nil?)
|
78
|
-
|
78
|
+
begin
|
79
|
+
return @keepass.protected_decryptor.get_password(@password)
|
80
|
+
rescue
|
81
|
+
return @password
|
82
|
+
end
|
79
83
|
end
|
80
84
|
|
81
85
|
def to_s
|
data/lib/rubeepass.rb
CHANGED
@@ -311,7 +311,7 @@ class RubeePass
|
|
311
311
|
end
|
312
312
|
private :parse_gzip
|
313
313
|
|
314
|
-
# Horrible attempt at parsing xml. Someday I might use a library
|
314
|
+
# Horrible attempt at parsing xml. Someday I might use a library.
|
315
315
|
def parse_xml
|
316
316
|
curr = Group.new({"Keepass" => self, "Name" => "/"})
|
317
317
|
entry_params = Hash.new
|
@@ -335,13 +335,7 @@ class RubeePass
|
|
335
335
|
next
|
336
336
|
when "</Root>"
|
337
337
|
break
|
338
|
-
when
|
339
|
-
line.gsub!(%r{</Value>$}, "")
|
340
|
-
entry_params[status] += line if (line && !line.empty?)
|
341
|
-
if (line && !line.empty?)
|
342
|
-
entry_params[status] += "\n#{line}"
|
343
|
-
end
|
344
|
-
|
338
|
+
when "</Value>"
|
345
339
|
status = nil
|
346
340
|
inside_value = false
|
347
341
|
next
|
@@ -351,6 +345,13 @@ class RubeePass
|
|
351
345
|
|
352
346
|
line = CGI::unescapeHTML(line)
|
353
347
|
line = URI::unescape(line)
|
348
|
+
if (!line.valid_encoding?)
|
349
|
+
line = line.encode(
|
350
|
+
"UTF-16be",
|
351
|
+
:invalid=>:replace,
|
352
|
+
:replace=>"?"
|
353
|
+
).encode('UTF-8')
|
354
|
+
end
|
354
355
|
|
355
356
|
# Handle values with newlines
|
356
357
|
if (inside_value && !ignore)
|
@@ -400,7 +401,7 @@ class RubeePass
|
|
400
401
|
entry_params["UUID"] = uuid
|
401
402
|
end
|
402
403
|
when %r{^<Value>.*}
|
403
|
-
line.gsub!(%r{
|
404
|
+
line.gsub!(%r{^<Value>}, "")
|
404
405
|
line = "" if (line.nil?)
|
405
406
|
entry_params[status] = line
|
406
407
|
inside_value = true
|
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: 0.2.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Miles Whittaker
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-10-
|
11
|
+
date: 2015-10-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: minitest
|