keeweb / kdbxweb

Web Kdbx library
https://app.keeweb.info
MIT License
413 stars 57 forks source link

kdbxweb creates corrupted kdbx 4 database #49

Open AlBundy33 opened 1 year ago

AlBundy33 commented 1 year ago

see https://github.com/keeweb/keeweb/issues/2001 https://sourceforge.net/p/keepass/bugs/2231/ https://keepass.info/help/kb/kdbx_4.1.html#cd_lastmod

after reading the source I would assume that the issue is maybe here https://github.com/keeweb/kdbxweb/blob/4bce1b0add2e4a6f34377b7cfa7c5ce2d49b16d7/lib/format/kdbx-custom-data.ts#L36

this line calls setDate https://github.com/keeweb/kdbxweb/blob/4bce1b0add2e4a6f34377b7cfa7c5ce2d49b16d7/lib/utils/xml-utils.ts#L212 with only two arguments and therefore binary is false and the date is written as iso-string instead of base64

because the lastModificationTime is only written for dataases >= 4.1 - so it should be save to add the third parameter with true.

AlBundy33 commented 1 year ago

I was able to build keeweb with my modification, saved a database in kdbx3 und kdbx4 format and successfully opened then in keepass.

https://github.com/AlBundy33/keeweb_kdbx4_hotfix

Aetherinox commented 6 months ago

Thanks for submitting this. I was recently added onto the team; so I'm getting adjusted to the structure of the code and we've started up development on KeeWeb again.

So let me review these changes, run some tests to ensure it doesn't break anything, and I'll update you.

AlBundy33 commented 3 weeks ago

@Aetherinox any news about integration? this issue breaks compatibility to KeePass 🤔