From f6b21f9a43763c43e81304394a42d2559dc33b27 Mon Sep 17 00:00:00 2001 From: Helmut Merz Date: Sun, 18 Aug 2024 19:28:03 +0200 Subject: [PATCH] auth: base64-encode password hashes (digests) --- lib/auth/auth.lisp | 9 ++++++--- lib/auth/scopes-auth.asd | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/auth/auth.lisp b/lib/auth/auth.lisp index 14173ce..0b9a4e9 100644 --- a/lib/auth/auth.lisp +++ b/lib/auth/auth.lisp @@ -5,7 +5,8 @@ (:local-nicknames (:config :scopes/config) (:core :scopes/core) (:shape :scopes/shape) - (:util :scopes/util)) + (:util :scopes/util) + (:b64 :qbase64)) (:export #:config #:setup #:simple-credentials #:login)) @@ -71,5 +72,7 @@ ;;;; auxiliary functions (defun digest (pw) - (ironclad:digest-sequence - :sha3/256 (flexi-streams:string-to-octets pw :external-format :utf8))) + (b64:encode-bytes + (ironclad:digest-sequence + :sha3/256 (flexi-streams:string-to-octets pw :external-format :utf8)) + :scheme :uri)) diff --git a/lib/auth/scopes-auth.asd b/lib/auth/scopes-auth.asd index 932ec1f..d6bdbfb 100644 --- a/lib/auth/scopes-auth.asd +++ b/lib/auth/scopes-auth.asd @@ -7,7 +7,7 @@ :homepage "https://www.cyberconcepts.org" :description "Authentication services" :depends-on (:scopes - :flexi-streams :ironclad) + :flexi-streams :ironclad :qbase64) :components ((:file "auth")) :long-description "scopes framework: authentication services." ;;#.(uiop:read-file-string