mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-15 10:30:25 -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
|
||||
(plist-get cdata :cipher-keysize))
|
||||
(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)))
|
||||
|
||||
|
|
@ -1203,14 +1204,16 @@ FILE is the file from which we obtained this token."
|
|||
(gnutls-available-p))
|
||||
(let ((cdata (car (last (gnutls-ciphers))))
|
||||
(bits (split-string data "-")))
|
||||
(auth-source--unpad
|
||||
(car
|
||||
(gnutls-symmetric-decrypt
|
||||
(pop cdata)
|
||||
(auth-source--pad auth-source--session-nonce
|
||||
(plist-get cdata :cipher-keysize))
|
||||
(base64-decode-string (cadr bits))
|
||||
(base64-decode-string (car bits))))))
|
||||
(decode-coding-string
|
||||
(auth-source--unpad
|
||||
(car
|
||||
(gnutls-symmetric-decrypt
|
||||
(pop cdata)
|
||||
(auth-source--pad auth-source--session-nonce
|
||||
(plist-get cdata :cipher-keysize))
|
||||
(base64-decode-string (cadr bits))
|
||||
(base64-decode-string (car bits)))))
|
||||
'utf-8))
|
||||
(apply #'string (mapcar #'1+ data))))
|
||||
|
||||
(cl-defun auth-source-netrc-search (&rest spec
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue