Closed sitnikovv closed 2 years ago
Does the same thing happen if you lock the entries again before encoding it?
Hmm ... If the entries before the encode are locked, no data corruption occurs. Thank you, I understood my mistake, but you can't find anything like this in the description (404 on examples) :) Is it possible to issue an error during encode if protected entries are not locked? Or forcibly lock before encode and unlock after it (if previously protected entries were unlocked)? To prevent others from making the same mistake as me.
Yes, it should be possible.
Actually something like that is happening now already, as the internal XML structure is not always sorted the same way depending on which Keepass implemention was used to create the files. That would appear to break your file as well.
If the struct would keep state on whether it was already unlocked or not, it would probably be able to cover your case.
Thank you
The example file and the code you provided did not work for me btw
Regardless, it probably makes sense to have auto locking on encoding for cases where it is not yet locked. Otherwise the passwords will be stored unlocked and next time it will scramble the content when it is unlocked again - which is the same thing that happens if you call unlock twice
password corrupted
if you run code on version 3.1.0 - all ok, data not corrupted