Closed xxxserxxx closed 3 years ago
Hey @xxxserxxx,
when I am looking at the raw data of the example you provided, then the keystroke sequence field you are trying to access is actually empty
Here an excerpt from the XML of the KDBX example file you provided:
<AutoType>
<Enabled>True</Enabled>
<DataTransferObfuscation>0</DataTransferObfuscation>
<DefaultSequence>{USERNAME}{TAB}{PASSWORD}{TAB}{TOTP}</DefaultSequence>
<Association>
<Window>twmn</Window>
<KeystrokeSequence/>
</Association>
</AutoType>
If you did not add any specific keystroke sequence, then I assume you are trying to access the data held in DefaultSequence
?
That was actually missing and I added that just now in v3.2.1
Yes, I think that was it. I was expecting to see the custom key sequence for the entry; I didn't consider the custom sequence for the window association.
Does DefaultSequence
contain the "use custom key sequence" set on the entry if it's set? If so, that'd do it.
If you only edit the default, it will just replace the value in DefaultSequence
<AutoType>
<Enabled>True</Enabled>
<DataTransferObfuscation>0</DataTransferObfuscation>
<DefaultSequence>{USERNAME}{TAB}{PASSWORD}{TAB}{TOTP}{ENTER}</DefaultSequence>
<Association>
<Window>twmn</Window>
<KeystrokeSequence></KeystrokeSequence>
</Association>
</AutoType>
You have to specifically go in and set a specific sequence for the window:
<AutoType>
<Enabled>True</Enabled>
<DataTransferObfuscation>0</DataTransferObfuscation>
<DefaultSequence>{USERNAME}{TAB}{PASSWORD}{TAB}{TOTP}{ENTER}</DefaultSequence>
<Association>
<Window>twmn</Window>
<KeystrokeSequence>{USERNAME}{TAB}{PASSWORD}{TAB}{TOTP}{ENTER}</KeystrokeSequence>
</Association>
</AutoType>
Kind of makes sense actually, that in the context of the association, it has to be set to for the specific window association.
See Testdata.kdbx.zip for an example where it is set.
Generally, to me it would appear that you should check the window association first and if it is empty, check for the default.
This makes sense. Because of DefaultSequence
I can close this ticket.
One other question though: the keepass format allows for multiple associations, correct? Like in the screenshot, it's "Associations". Shouldn't Entry.AutoType.Association
be an array?
You are right, it should be a slice and not a struct.
The XML does not really reveal much of that when there is only 1 Association by default.
Fixed in v3.2.2
Very cool, thank you.
Entry.AutoType.Association.KeystrokeSequence
appears to always be empty, regardless of what it's set to in the database.Here's a test DB with a custom sequence set:
Testdata.kdbx.zip
Unzip the attachment first; here's code to dump out the contents (a single entry), including the
KeystrokeSequence
:The Window association is correct, but the keystroke sequence is empty.