mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-01-06 03:40:56 -08:00
Make auth-source work with non-ASCII passwords again
* lisp/auth-source.el (auth-source--obfuscate): Convert the string to bytes before obfuscating. (auth-source--deobfuscate): Convert back into a string (bug#37758).
This commit is contained in:
parent
ddc9837bf4
commit
dcc710916e
1 changed files with 12 additions and 9 deletions
|
|
@ -1184,7 +1184,8 @@ FILE is the file from which we obtained this token."
|
||||||
(auth-source--pad auth-source--session-nonce
|
(auth-source--pad auth-source--session-nonce
|
||||||
(plist-get cdata :cipher-keysize))
|
(plist-get cdata :cipher-keysize))
|
||||||
(list 'iv-auto (plist-get cdata :cipher-ivsize))
|
(list 'iv-auto (plist-get cdata :cipher-ivsize))
|
||||||
(auth-source--pad string (plist-get cdata :cipher-blocksize)))
|
(auth-source--pad (encode-coding-string string 'utf-8)
|
||||||
|
(plist-get cdata :cipher-blocksize)))
|
||||||
"-"))
|
"-"))
|
||||||
(mapcar #'1- string)))
|
(mapcar #'1- string)))
|
||||||
|
|
||||||
|
|
@ -1203,14 +1204,16 @@ FILE is the file from which we obtained this token."
|
||||||
(gnutls-available-p))
|
(gnutls-available-p))
|
||||||
(let ((cdata (car (last (gnutls-ciphers))))
|
(let ((cdata (car (last (gnutls-ciphers))))
|
||||||
(bits (split-string data "-")))
|
(bits (split-string data "-")))
|
||||||
(auth-source--unpad
|
(decode-coding-string
|
||||||
(car
|
(auth-source--unpad
|
||||||
(gnutls-symmetric-decrypt
|
(car
|
||||||
(pop cdata)
|
(gnutls-symmetric-decrypt
|
||||||
(auth-source--pad auth-source--session-nonce
|
(pop cdata)
|
||||||
(plist-get cdata :cipher-keysize))
|
(auth-source--pad auth-source--session-nonce
|
||||||
(base64-decode-string (cadr bits))
|
(plist-get cdata :cipher-keysize))
|
||||||
(base64-decode-string (car bits))))))
|
(base64-decode-string (cadr bits))
|
||||||
|
(base64-decode-string (car bits)))))
|
||||||
|
'utf-8))
|
||||||
(apply #'string (mapcar #'1+ data))))
|
(apply #'string (mapcar #'1+ data))))
|
||||||
|
|
||||||
(cl-defun auth-source-netrc-search (&rest spec
|
(cl-defun auth-source-netrc-search (&rest spec
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue