summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorFalk Alexander Seidl2018-09-04 15:25:13 +0200
committerFalk Alexander Seidl2018-09-04 15:25:13 +0200
commit3da62112665a3d51fd31b9f15d5715475f001ac8 (patch)
tree912837a9a8b0cfe1772f3b2db6c97a724cdb539f
parent260db55d2c222c9be139e478d9189c650199b6c8 (diff)
downloadaur-3da62112665a3d51fd31b9f15d5715475f001ac8.tar.gz
Add patch file
-rw-r--r--0001-Strip-out-non-ASCII-characters-on-decrypt.patch38
1 files changed, 38 insertions, 0 deletions
diff --git a/0001-Strip-out-non-ASCII-characters-on-decrypt.patch b/0001-Strip-out-non-ASCII-characters-on-decrypt.patch
new file mode 100644
index 000000000000..5f8dbd4aafdc
--- /dev/null
+++ b/0001-Strip-out-non-ASCII-characters-on-decrypt.patch
@@ -0,0 +1,38 @@
+From d1716dec6ab6a3b947f217fff13839ed72ac0d36 Mon Sep 17 00:00:00 2001
+From: Falk Alexander Seidl <fa@terminal.run>
+Date: Tue, 4 Sep 2018 14:56:54 +0200
+Subject: [PATCH] Strip out non-ASCII characters on decrypt
+
+---
+ pykeepass/kdbx_parsing/common.py | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/pykeepass/kdbx_parsing/common.py b/pykeepass/kdbx_parsing/common.py
+index 1fe4003..2d2eca7 100644
+--- a/pykeepass/kdbx_parsing/common.py
++++ b/pykeepass/kdbx_parsing/common.py
+@@ -9,6 +9,7 @@ from construct import (
+ )
+ from lxml import etree
+ import base64
++import unicodedata
+ import zlib
+ from io import BytesIO
+ from collections import OrderedDict
+@@ -153,11 +154,11 @@ class UnprotectedStream(Adapter):
+ cipher = self.get_cipher(self.protected_stream_key(con))
+ for elem in tree.xpath(self.protected_xpath):
+ if elem.text is not None:
+- elem.text = cipher.decrypt(
++ elem.text = ''.join(c for c in cipher.decrypt(
+ base64.b64decode(
+ elem.text
+ )
+- ).decode('utf-8')
++ ).decode('utf-8') if unicodedata.category(c)[0] != "C")
+ elem.attrib['Protected'] = 'False'
+ return tree
+
+--
+libgit2 0.27.2
+