totp

Simple cli tool for storing TOTP secrets and generating tokens
git clone https://git.inz.fi/totp/
Log | Files | Refs | Submodules

commit 9ff6f1b75fdd5361a97a48be1a31f701abb99e14
parent fe3ac5b82b7a8a7630afdedfe354df37e837c71b
Author: Santtu Lakkala <inz@inz.fi>
Date:   Thu,  1 Dec 2022 08:36:42 +0200

Allow lower-case base32 in keys

Diffstat:
Mutil.c | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/util.c b/util.c @@ -136,7 +136,7 @@ size_t debase32(char *buffer, size_t len) size_t b = 0; for (rp = (uint8_t *)buffer; (char *)rp - buffer < (ptrdiff_t)len && *rp && *rp != '='; rp++) { - uint8_t c = *rp >= 'A' ? *rp - 'A' : *rp - '2' + 26; + uint8_t c = *rp >= 'a' ? *rp - 'a' : *rp >= 'A' ? *rp - 'A' : *rp - '2' + 26; v = v << 5 | c; b += 5; if (b >= 8) {