|
1 |
| -From fca73313b77d2c8ea32db8b21858745500c334ec Mon Sep 17 00:00:00 2001 |
2 |
| -From: Jan-Michael Brummer <[email protected]> |
3 |
| -Date: Tue, 26 Mar 2024 10:27:48 +0100 |
4 |
| -Subject: [PATCH] Fix composite key computation for BytesIO |
| 1 | +From a5fa7e06c5dd73f41d124e7697d14ce7c9d1eb43 Mon Sep 17 00:00:00 2001 |
| 2 | + |
| 3 | +Date: Tue, 9 Apr 2024 14:46:07 -0500 |
| 4 | +Subject: [PATCH] bump version |
5 | 5 |
|
6 |
| -In case a keyfile as BytesIO has been read before, the |
7 |
| -next read will be empty. We need to ensure that we |
8 |
| -are reading the data from the beginning. |
9 |
| - |
10 |
| -Add seek to start to fix it. |
11 | 6 | ---
|
12 |
| - pykeepass/kdbx_parsing/common.py | 9 ++++++++- |
13 |
| - 1 file changed, 8 insertions(+), 1 deletion(-) |
| 7 | + requirements.txt | 9 +++++++++ |
| 8 | + 1 file changed, 9 insertions(+) |
| 9 | + create mode 100644 requirements.txt |
14 | 10 |
|
15 |
| -diff --git a/pykeepass/kdbx_parsing/common.py b/pykeepass/kdbx_parsing/common.py |
16 |
| -index 3973f61..1865bb4 100644 |
17 |
| ---- a/pykeepass/kdbx_parsing/common.py |
18 |
| -+++ b/pykeepass/kdbx_parsing/common.py |
19 |
| -@@ -13,6 +13,7 @@ import unicodedata |
20 |
| - import zlib |
21 |
| - import re |
22 |
| - import codecs |
23 |
| -+import io |
24 |
| - from io import BytesIO |
25 |
| - from collections import OrderedDict |
26 |
| - import logging |
27 |
| -@@ -116,7 +117,13 @@ def compute_key_composite(password=None, keyfile=None): |
28 |
| - password_composite = b'' |
29 |
| - # hash the keyfile |
30 |
| - if keyfile: |
31 |
| -- if hasattr(keyfile, "read"): |
32 |
| -+ if ( |
33 |
| -+ isinstance(keyfile, io.BufferedIOBase) |
34 |
| -+ or isinstance(keyfile, io.TextIOBase) |
35 |
| -+ or isinstance(keyfile, io.RawIOBase) |
36 |
| -+ ): |
37 |
| -+ if keyfile.seekable(): |
38 |
| -+ keyfile.seek(0) |
39 |
| - keyfile_bytes = keyfile.read() |
40 |
| - else: |
41 |
| - with open(keyfile, 'rb') as f: |
| 11 | +diff --git a/requirements.txt b/requirements.txt |
| 12 | +new file mode 100644 |
| 13 | +index 0000000..5cd6bd7 |
| 14 | +--- /dev/null |
| 15 | ++++ b/requirements.txt |
| 16 | +@@ -0,0 +1,9 @@ |
| 17 | ++argon2-cffi==23.1.0 |
| 18 | ++argon2-cffi-bindings==21.2.0 |
| 19 | ++cffi==1.16.0 |
| 20 | ++construct==2.10.70 |
| 21 | ++lxml==5.2.1 |
| 22 | ++pycparser==2.22 |
| 23 | ++pycryptodomex==3.20.0 |
| 24 | ++pykeepass @ file:///home/evan/resources/pykeepass |
| 25 | ++pyotp==2.9.0 |
42 | 26 | --
|
43 | 27 | 2.44.0
|
44 | 28 |
|
0 commit comments