doy / rbw

unofficial bitwarden cli
https://git.tozt.net/rbw
Other
573 stars 82 forks source link

fix `rbw code: totp secret was not valid base32` #189

Closed illfygli closed 4 days ago

illfygli commented 1 week ago

After a recent update, most of my TOTP secrets stopped working, with the message:

rbw code: totp secret was not valid base32

I found that it's because they must be uppercase now.

This patch makes the secret uppercase, before decoding, which resolves the issue for me.

adamthiede commented 1 week ago

I encountered this issue as well and this has fixed it, thank you. How did you figure this out?

illfygli commented 1 week ago

@adamthiede I cloned the repo, so I could look around with better tools. It looked like the TOTP code only accepted uppercase letters, so I tried uppercasing a broken TOTP, and that fixed it, so I made the code do that.

I tried to find out why/when it broke, but I don't really know Rust, and it seemed like a simple-enough fix, so I put up the PR and let those who do know it be the judge. :)

rjc commented 4 days ago

I've also encountered it and, after not being able to find it under issues, I reported it yesterday - #191 ;^)

I hadn't tried the patch yet but, it seems like it only fixes one of the issues mentioned in there, so I'll leave it open until the padding issue is also fixed.

Thanks!