From 4b137bfcb86636c802a71fd9bd475f857f516179 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Phil=20H=C3=B6fer?= <phil.hoefer@suma-ev.de>
Date: Tue, 14 Nov 2023 14:21:38 +0000
Subject: [PATCH] Apply 1 suggestion(s) to 1 file(s)

---
 pass/routes/key.js | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/pass/routes/key.js b/pass/routes/key.js
index aefdf84..a29fd9e 100644
--- a/pass/routes/key.js
+++ b/pass/routes/key.js
@@ -129,7 +129,9 @@ router.post("/enter", upload.single("file"), async (req, res, next) => {
         return;
       }
     }
-
+     if(input.match(/^[0-9A-F]{32}$/i)){
+      input = [input.slice(0,8), input.slice(8,12),  input.slice(12,16),  input.slice(16,20),  input.slice(20,32)].join("-");
+    }
     if(Key.IS_VALID_UUID(input) || input.match(/^[0-9a-zA-Z]{6}$/)){
       key = await Key.GET_KEY(input).then((key) => key.get_key());
     }else{
-- 
GitLab