diff options
author | Kirill A. Korinsky <kirill@korins.ky> | 2024-03-05 14:58:12 +0100 |
---|---|---|
committer | Kirill A. Korinsky <kirill@korins.ky> | 2024-03-05 14:58:12 +0100 |
commit | ac8445c0545dc94dde397ab69e3bbdc8514ae188 (patch) | |
tree | c65726a3174aca84e042ddbac8b1dbf7af48e6a7 | |
parent | 4d15d6f17b98c97f5235d928f6e4ffb5f18307e6 (diff) |
percent-encode input password
pinentry.texi cleary states that all string expected to be UTF-8 and if
it contains special characters the string should be percent encoded.
-rw-r--r-- | util/pinentry/pinentry.lisp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/util/pinentry/pinentry.lisp b/util/pinentry/pinentry.lisp index e5b9b14..393b6a8 100644 --- a/util/pinentry/pinentry.lisp +++ b/util/pinentry/pinentry.lisp @@ -6,10 +6,12 @@ (defun main (stream) (let ((description (percent:decode (read-line stream))) (prompt (read-line stream))) - (format stream (or (stumpwm:read-one-line (stumpwm:current-screen) - (format nil "~a~%~a " description prompt) - :password t) - "")))) + (format stream + (percent:encode + (or (stumpwm:read-one-line (stumpwm:current-screen) + (format nil "~a~%~a " description prompt) + :password t) + ""))))) (handler-case (usocket:socket-server "127.0.0.1" 22222 #'main nil :in-new-thread t |