summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKirill A. Korinsky <kirill@korins.ky>2024-03-05 14:58:12 +0100
committerKirill A. Korinsky <kirill@korins.ky>2024-03-05 14:58:12 +0100
commitac8445c0545dc94dde397ab69e3bbdc8514ae188 (patch)
treec65726a3174aca84e042ddbac8b1dbf7af48e6a7
parent4d15d6f17b98c97f5235d928f6e4ffb5f18307e6 (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.lisp10
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