aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Wiegley2008-01-29 03:52:05 +0000
committerJohn Wiegley2008-01-29 03:52:05 +0000
commite652840bf703a633979983552556434f6753397b (patch)
treeaab1670a70c863b3dbaca045b7bcdeb0d233c54b
parent548667aad86a5e07e5ac96b832dcd10c5e6eb4c6 (diff)
downloademacs-e652840bf703a633979983552556434f6753397b.tar.gz
emacs-e652840bf703a633979983552556434f6753397b.zip
2008-01-29 John Wiegley <johnw@newartisans.com>
* url-auth.el (url-digest-auth): If the 'opaque' argument is not being used, don't add it to the response text. Also, changed an if so that the interaction between the PROMPT and OVERWRITE arguments can no longer result in the user being queried twice for the same login and password information.
-rw-r--r--lisp/url/ChangeLog8
-rw-r--r--lisp/url/url-auth.el51
2 files changed, 38 insertions, 21 deletions
diff --git a/lisp/url/ChangeLog b/lisp/url/ChangeLog
index 124f3fc9974..3a70b5343a0 100644
--- a/lisp/url/ChangeLog
+++ b/lisp/url/ChangeLog
@@ -1,3 +1,11 @@
12008-01-29 John Wiegley <johnw@newartisans.com>
2
3 * url-auth.el (url-digest-auth): If the 'opaque' argument is not
4 being used, don't add it to the response text. Also, changed an
5 if so that the interaction between the PROMPT and OVERWRITE
6 arguments can no longer result in the user being queried twice for
7 the same login and password information.
8
12008-01-21 Stefan Monnier <monnier@iro.umontreal.ca> 92008-01-21 Stefan Monnier <monnier@iro.umontreal.ca>
2 10
3 * url-handlers.el (unhandled-file-name-directory): Add handler. 11 * url-handlers.el (unhandled-file-name-directory): Add handler.
diff --git a/lisp/url/url-auth.el b/lisp/url/url-auth.el
index ea96bb08129..ed1a79260ee 100644
--- a/lisp/url/url-auth.el
+++ b/lisp/url/url-auth.el
@@ -188,31 +188,40 @@ instead of hostname:portnum."
188 (string= data (substring file 0 (length data))))) 188 (string= data (substring file 0 (length data)))))
189 (setq retval (cdr (car byserv)))) 189 (setq retval (cdr (car byserv))))
190 (setq byserv (cdr byserv)))) 190 (setq byserv (cdr byserv))))
191 (if (or (and (not retval) prompt) overwrite) 191 (if overwrite
192 (progn 192 (if (and (not retval) prompt)
193 (setq user (read-string (url-auth-user-prompt url realm) 193 (setq user (read-string (url-auth-user-prompt url realm)
194 (user-real-login-name)) 194 (user-real-login-name))
195 pass (read-passwd "Password: ") 195 pass (read-passwd "Password: ")
196 retval (setq retval 196 retval (setq retval
197 (cons user 197 (cons user
198 (url-digest-auth-create-key 198 (url-digest-auth-create-key
199 user pass realm 199 user pass realm
200 (or url-request-method "GET") 200 (or url-request-method "GET")
201 url))) 201 url)))
202 byserv (assoc server url-digest-auth-storage)) 202 byserv (assoc server url-digest-auth-storage))
203 (setcdr byserv 203 (setcdr byserv
204 (cons (cons file retval) (cdr byserv)))))) 204 (cons (cons file retval) (cdr byserv))))))
205 (t (setq retval nil))) 205 (t (setq retval nil)))
206 (if retval 206 (if retval
207 (let ((nonce (or (cdr-safe (assoc "nonce" args)) "nonegiven")) 207 (if (cdr-safe (assoc "opaque" args))
208 (opaque (or (cdr-safe (assoc "opaque" args)) "nonegiven"))) 208 (let ((nonce (or (cdr-safe (assoc "nonce" args)) "nonegiven"))
209 (format 209 (opaque (cdr-safe (assoc "opaque" args))))
210 (concat "Digest username=\"%s\", realm=\"%s\"," 210 (format
211 "nonce=\"%s\", uri=\"%s\"," 211 (concat "Digest username=\"%s\", realm=\"%s\","
212 "response=\"%s\", opaque=\"%s\"") 212 "nonce=\"%s\", uri=\"%s\","
213 (nth 0 retval) realm nonce (url-filename href) 213 "response=\"%s\", opaque=\"%s\"")
214 (md5 (concat (nth 1 retval) ":" nonce ":" 214 (nth 0 retval) realm nonce (url-filename href)
215 (nth 2 retval))) opaque)))))) 215 (md5 (concat (nth 1 retval) ":" nonce ":"
216 (nth 2 retval))) opaque))
217 (let ((nonce (or (cdr-safe (assoc "nonce" args)) "nonegiven")))
218 (format
219 (concat "Digest username=\"%s\", realm=\"%s\","
220 "nonce=\"%s\", uri=\"%s\","
221 "response=\"%s\"")
222 (nth 0 retval) realm nonce (url-filename href)
223 (md5 (concat (nth 1 retval) ":" nonce ":"
224 (nth 2 retval))))))))))
216 225
217(defvar url-registered-auth-schemes nil 226(defvar url-registered-auth-schemes nil
218 "A list of the registered authorization schemes and various and sundry 227 "A list of the registered authorization schemes and various and sundry