I faced with the issue when tried to use some svg file as keyfile. I got the error
File "/home/or/works/opensource/pykeepass/pykeepass/kdbx_parsing/common.py", line 130, in compute_key_composite
version = version_element.text
AttributeError: 'NoneType' object has no attribute 'text'
keyfile example to reproduce the error:
<xml />
The reason is that pykeepass doesn't check if xml is valid XML keyfile and handle any xml file as XML keyfile trying to read expected fields.
As I understand, the correct approach would be treat xml files, that doesn't have expected schema as plain text.
And there is another error. If the xml file has Meta/Version, that doesn't start from 1.0 or 2.0 - it will raise another error:
File "/home/or/works/opensource/pykeepass/pykeepass/kdbx_parsing/common.py", line 169, in compute_key_composite
return hashlib.sha256(password_composite + keyfile_composite).digest()
UnboundLocalError: cannot access local variable 'keyfile_composite' where it is not associated with a value
I faced with the issue when tried to use some
svg
file as keyfile. I got the errorkeyfile example to reproduce the error:
The reason is that
pykeepass
doesn't check if xml is validXML keyfile
and handle any xml file asXML keyfile
trying to read expected fields.by
XML keyfile
I mean one of supported keyfile formatsAs I understand, the correct approach would be treat xml files, that doesn't have expected schema as plain text.
And there is another error. If the xml file has
Meta/Version
, that doesn't start from 1.0 or 2.0 - it will raise another error:keyfile example to reproduce the error: