aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Ingebrigtsen2019-07-13 01:27:32 +0200
committerLars Ingebrigtsen2019-07-13 01:31:24 +0200
commit655fe3fe0de92ace4a97dd3c478c3683b163e132 (patch)
tree0a658657d9a9b026dd07cf699771623fb3d4efbe
parentebd3f61a569f256f926828017f500cc74e6878bc (diff)
downloademacs-655fe3fe0de92ace4a97dd3c478c3683b163e132.tar.gz
emacs-655fe3fe0de92ace4a97dd3c478c3683b163e132.zip
Fix long credentials when using auth in url.el
* lisp/url/url-auth.el (url-basic-auth): When base64-ing credentials, don't let bsae64-encode-string split the result into several lines, because servers do not understand that (bug#36619).
-rw-r--r--lisp/url/url-auth.el7
1 files changed, 4 insertions, 3 deletions
diff --git a/lisp/url/url-auth.el b/lisp/url/url-auth.el
index beed7c6cb62..b78544e3f37 100644
--- a/lisp/url/url-auth.el
+++ b/lisp/url/url-auth.el
@@ -82,7 +82,7 @@ instead of the filename inheritance method."
82 (cond 82 (cond
83 ((and user pass) 83 ((and user pass)
84 ;; Explicit http://user:pass@foo/ URL. Just return the credentials. 84 ;; Explicit http://user:pass@foo/ URL. Just return the credentials.
85 (setq retval (base64-encode-string (format "%s:%s" user pass)))) 85 (setq retval (base64-encode-string (format "%s:%s" user pass) t)))
86 ((and prompt (not byserv)) 86 ((and prompt (not byserv))
87 (setq user (or 87 (setq user (or
88 (url-do-auth-source-search server type :user) 88 (url-do-auth-source-search server type :user)
@@ -97,7 +97,8 @@ instead of the filename inheritance method."
97 (setq retval 97 (setq retval
98 (base64-encode-string 98 (base64-encode-string
99 (format "%s:%s" user 99 (format "%s:%s" user
100 (encode-coding-string pass 'utf-8)))))) 100 (encode-coding-string pass 'utf-8))
101 t))))
101 (symbol-value url-basic-auth-storage)))) 102 (symbol-value url-basic-auth-storage))))
102 (byserv 103 (byserv
103 (setq retval (cdr-safe (assoc file byserv))) 104 (setq retval (cdr-safe (assoc file byserv)))
@@ -120,7 +121,7 @@ instead of the filename inheritance method."
120 pass (or 121 pass (or
121 (url-do-auth-source-search server type :secret) 122 (url-do-auth-source-search server type :secret)
122 (read-passwd "Password: ")) 123 (read-passwd "Password: "))
123 retval (base64-encode-string (format "%s:%s" user pass)) 124 retval (base64-encode-string (format "%s:%s" user pass) t)
124 byserv (assoc server (symbol-value url-basic-auth-storage))) 125 byserv (assoc server (symbol-value url-basic-auth-storage)))
125 (setcdr byserv 126 (setcdr byserv
126 (cons (cons file retval) (cdr byserv)))))) 127 (cons (cons file retval) (cdr byserv))))))