paolostivanin / OTPClient

Highly secure and easy to use OTP client written in C/GTK3 that supports both TOTP and HOTP
GNU General Public License v3.0
472 stars 46 forks source link

DB corrupted and unexpected symbols error after trying to import token with russian letters in Issuer field #301

Closed x00FB closed 1 year ago

x00FB commented 1 year ago

Scenario 1: Create backup file in andOTP with some of the tokens containing russian letters in the Issuer field Example line: Госуслуги Try to import this andOTP DB into OTPClient Expected: DB is imported, tokens are valid Actual: error msg about corrupted DB is shown, no tokens imported

Scenario 2: Show QR Code inside andOTP for the same token with russian letters in the Issuer field Try to scan this code using OTPClient Expected: token is imported into the current DB successfully Actual: error msg about unexpected symbols is shown and the current DB becomes corrupted

Workaround: rename the Issuer in andOTP so it does not contain russian letters

Hadn't done any screenshots, unfortunately.

Env: ubuntu 20.04 amd64, OTPClient built from source, andOTP 0.9.0.1-play

paolostivanin commented 1 year ago

thanks for reporting this, I'll look into it!

paolostivanin commented 1 year ago

I've narrowed down where the issue is. Now working on a fix!

paolostivanin commented 1 year ago

@x00FB can you please confirm that THIS branch fixes your issue? Thanks!

x00FB commented 1 year ago

@x00FB can you please confirm that THIS branch fixes your issue? Thanks!

Sure, I'll try to check it out today. Thank you!

x00FB commented 1 year ago

@paolostivanin confirm, works fine! Thank you for your efforts!

anoraktrend commented 1 year ago

this branch works, had a similar issue, tested the branch build and it didn't corrupt. once you merge that branch to main it should be ok to close this issue with a mention in the faq.

nasrally commented 1 year ago

I've tested release 3.1.9 and I have a question: is there a way to unbork my db? Apparently the autogenerated backup is also destroyed. I suppose the database is encrypted, so, is it possible to manually decrypt/encrypt it and fix it in a hex editor or something?

paolostivanin commented 1 year ago

I could try to put something together. The db should still be salvageable. Don't know how much it will take me though. My free time is very limited these days