~sircmpwn/himitsu-devel

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
1

[PATCH himitsu-totp] hitotp: convert secret to uppercase before use

Details
Message ID
<20231205193421.3384-2-cowingtonpost@gmail.com>
DKIM signature
missing
Download raw message
Patch: +3 -2
This prevents hitotp from crashing when it's given a lowercase secret.
---
 cmd/hitotp/main.ha | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/cmd/hitotp/main.ha b/cmd/hitotp/main.ha
index f3a5198..2a21368 100644
--- a/cmd/hitotp/main.ha
+++ b/cmd/hitotp/main.ha
@@ -1,3 +1,4 @@
use ascii;
use dirs;
use encoding::base32;
use fmt;
@@ -86,7 +87,7 @@ fn do_totp(q: *query::query) (str, uint) = {
		case "label" =>
			label = pair.value;
		case "secret" =>
			key = base32::decodestr(&base32::std_encoding, pair.value)!;
			key = base32::decodestr(&base32::std_encoding, ascii::strupper(pair.value))!;
		case =>
			void;
		};
@@ -162,7 +163,7 @@ export fn main() void = {
			if (len(label) != 0) {
				fmt::printf("{}: ", label)!;
			};
			fmt::printfln("{:06}", code)!;
			fmt::printfln("{:6}", code)!;
		};
	};
};
-- 
2.43.0
Details
Message ID
<CXJQXGNO243U.31UD63VY68J6K@strohwolke.at>
In-Reply-To
<20231205193421.3384-2-cowingtonpost@gmail.com> (view parent)
DKIM signature
missing
Download raw message
Pushed with mentioned fixes. Thanks!
Reply to thread Export thread (mbox)