annotate lisp/w3/socks.el @ 16:0293115a14e9 r19-15b91

Import from CVS: tag r19-15b91
author cvs
date Mon, 13 Aug 2007 08:49:20 +0200
parents 9ee227acff29
children 15872534500d
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
14
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
1 ;;; socks.el --- A Socks v5 Client for Emacs
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
2 ;; Author: wmperry
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
3 ;; Created: 1997/01/10 00:13:05
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
4 ;; Version: 1.3
14
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
5 ;; Keywords: comm, firewalls
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
6
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
7 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
8 ;;; Copyright (c) 1996, 1997 by William M. Perry (wmperry@cs.indiana.edu)
14
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
9 ;;;
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
10 ;;; This file is not part of GNU Emacs, but the same permissions apply.
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
11 ;;;
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
12 ;;; GNU Emacs is free software; you can redistribute it and/or modify
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
13 ;;; it under the terms of the GNU General Public License as published by
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
14 ;;; the Free Software Foundation; either version 2, or (at your option)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
15 ;;; any later version.
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
16 ;;;
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
17 ;;; GNU Emacs is distributed in the hope that it will be useful,
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
18 ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
19 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
20 ;;; GNU General Public License for more details.
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
21 ;;;
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
22 ;;; You should have received a copy of the GNU General Public License
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
23 ;;; along with GNU Emacs; see the file COPYING. If not, write to
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
24 ;;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
25 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
26 ;;;
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
27 ;;; This is an implementation of the SOCKS v5 protocol as defined in
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
28 ;;; RFC 1928.
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
29 ;;;
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
30 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
31 (require 'cl)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
32
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
33 (defconst socks-version 5)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
34 (defvar socks-debug nil)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
35
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
36 ;; Common socks v5 commands
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
37 (defconst socks-connect-command 1)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
38 (defconst socks-bind-command 2)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
39 (defconst socks-udp-associate-command 3)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
40
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
41 ;; Miscellaneous other socks constants
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
42 (defconst socks-authentication-null 0)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
43 (defconst socks-authentication-failure 255)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
44
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
45 ;; Response codes
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
46 (defconst socks-response-success 0)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
47 (defconst socks-response-general-failure 1)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
48 (defconst socks-response-access-denied 2)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
49 (defconst socks-response-network-unreachable 3)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
50 (defconst socks-response-host-unreachable 4)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
51 (defconst socks-response-connection-refused 5)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
52 (defconst socks-response-ttl-expired 6)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
53 (defconst socks-response-cmd-not-supported 7)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
54 (defconst socks-response-address-not-supported 8)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
55
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
56 (defvar socks-errors
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
57 '("Succeeded"
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
58 "General SOCKS server failure"
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
59 "Connection not allowed by ruleset"
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
60 "Network unreachable"
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
61 "Host unreachable"
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
62 "Connection refused"
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
63 "Time-to-live expired"
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
64 "Command not supported"
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
65 "Address type not supported"))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
66
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
67 ;; The socks v5 address types
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
68 (defconst socks-address-type-v4 1)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
69 (defconst socks-address-type-name 3)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
70 (defconst socks-address-type-v6 4)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
71
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
72 ;; Base variables
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
73 (defvar socks-host (or (getenv "SOCKS5_SERVER") "socks"))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
74 (defvar socks-port (or (getenv "SOCKS5_PORT") 1080))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
75 (defvar socks-timeout 5)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
76 (defvar socks-connections (make-hash-table :size 13))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
77
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
78 ;; Miscellaneous stuff for authentication
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
79 (defvar socks-authentication-methods nil)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
80 (defvar socks-username (user-login-name))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
81 (defvar socks-password nil)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
82
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
83 (defun socks-register-authentication-method (id desc callback)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
84 (let ((old (assq id socks-authentication-methods)))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
85 (if old
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
86 (setcdr old (cons desc callback))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
87 (setq socks-authentication-methods
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
88 (cons (cons id (cons desc callback))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
89 socks-authentication-methods)))))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
90
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
91 (defun socks-unregister-authentication-method (id)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
92 (let ((old (assq id socks-authentication-methods)))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
93 (if old
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
94 (setq socks-authentication-methods
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
95 (delq old socks-authentication-methods)))))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
96
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
97 (socks-register-authentication-method 0 "No authentication" 'identity)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
98
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
99 (defun socks-build-auth-list ()
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
100 (let ((num 0)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
101 (retval ""))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
102 (mapcar
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
103 (function
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
104 (lambda (x)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
105 (if (fboundp (cdr (cdr x)))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
106 (setq retval (format "%s%c" retval (car x))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
107 num (1+ num)))))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
108 socks-authentication-methods)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
109 (format "%c%s" num retval)))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
110
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
111 (defconst socks-state-waiting-for-auth 0)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
112 (defconst socks-state-submethod-negotiation 1)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
113 (defconst socks-state-authenticated 2)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
114 (defconst socks-state-waiting 3)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
115 (defconst socks-state-connected 4)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
116
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
117 (defmacro socks-wait-for-state-change (proc htable cur-state)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
118 (`
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
119 (while (and (= (cl-gethash 'state (, htable)) (, cur-state))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
120 (memq (process-status (, proc)) '(run open)))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
121 (accept-process-output (, proc) socks-timeout))))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
122
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
123 (defun socks-filter (proc string)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
124 (let ((info (cl-gethash proc socks-connections))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
125 state desired-len)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
126 (or info (error "socks-filter called on non-SOCKS connection %S" proc))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
127 (setq state (cl-gethash 'state info))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
128 (cond
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
129 ((= state socks-state-waiting-for-auth)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
130 (cl-puthash 'scratch (concat string (cl-gethash 'scratch info)) info)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
131 (setq string (cl-gethash 'scratch info))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
132 (if (< (length string) 2)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
133 nil ; We need to spin some more
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
134 (cl-puthash 'authtype (aref string 1) info)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
135 (cl-puthash 'scratch (substring string 2 nil) info)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
136 (cl-puthash 'state socks-state-submethod-negotiation info)))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
137 ((= state socks-state-submethod-negotiation)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
138 )
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
139 ((= state socks-state-authenticated)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
140 )
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
141 ((= state socks-state-waiting)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
142 (cl-puthash 'scratch (concat string (cl-gethash 'scratch info)) info)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
143 (setq string (cl-gethash 'scratch info))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
144 (if (< (length string) 4)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
145 nil
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
146 (setq desired-len
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
147 (+ 6 ; Standard socks header
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
148 (cond
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
149 ((= (aref string 3) socks-address-type-v4) 4)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
150 ((= (aref string 3) socks-address-type-v6) 16)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
151 ((= (aref string 3) socks-address-type-name)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
152 (if (< (length string) 5)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
153 255
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
154 (+ 1 (aref string 4)))))))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
155 (if (< (length string) desired-len)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
156 nil ; Need to spin some more
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
157 (cl-puthash 'state socks-state-connected info)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
158 (cl-puthash 'reply (aref string 1) info)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
159 (cl-puthash 'response string info))))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
160 ((= state socks-state-connected)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
161 )
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
162 )
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
163 )
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
164 )
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
165
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
166 (defun socks-open-connection (&optional host port)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
167 (interactive)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
168 (setq host (or host socks-host)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
169 port (or port socks-port))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
170 (save-excursion
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
171 (let ((proc (socks-original-open-network-stream "socks"
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
172 nil
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
173 host port))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
174 (info (make-hash-table :size 13))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
175 (authtype nil))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
176
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
177 ;; Initialize process and info about the process
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
178 (set-process-filter proc 'socks-filter)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
179 (process-kill-without-query proc)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
180 (cl-puthash proc info socks-connections)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
181 (cl-puthash 'state socks-state-waiting-for-auth info)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
182 (cl-puthash 'authtype socks-authentication-failure info)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
183
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
184 ;; Send what we think we can handle for authentication types
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
185 (process-send-string proc (format "%c%s" socks-version
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
186 (socks-build-auth-list)))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
187
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
188 ;; Basically just do a select() until we change states.
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
189 (socks-wait-for-state-change proc info socks-state-waiting-for-auth)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
190 (setq authtype (cl-gethash 'authtype info))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
191 (cond
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
192 ((= authtype socks-authentication-null)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
193 (and socks-debug (message "No authentication necessary")))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
194 ((= authtype socks-authentication-failure)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
195 (error "No acceptable authentication methods found."))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
196 (t
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
197 (let* ((auth-type (char-int (cl-gethash 'authtype info)))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
198 (auth-handler (assoc auth-type socks-authentication-methods))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
199 (auth-func (and auth-handler (cdr (cdr auth-handler))))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
200 (auth-desc (and auth-handler (car (cdr auth-handler)))))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
201 (set-process-filter proc nil)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
202 (if (and auth-func (fboundp auth-func)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
203 (funcall auth-func proc))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
204 (message "Successfully authenticated using: %s" auth-desc)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
205 (delete-process proc)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
206 (error "Failed to use auth method: %s (%d)"
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
207 (or auth-desc "Unknown") auth-type))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
208 )
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
209 )
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
210 )
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
211 (cl-puthash 'state socks-state-authenticated info)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
212 (set-process-filter proc 'socks-filter)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
213 proc)))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
214
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
215 (defun socks-send-command (proc command atype address port)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
216 (let ((addr (case atype
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
217 (socks-address-type-v4 address)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
218 (socks-address-type-v6 address)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
219 (t
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
220 (format "%c%s" (length address) address))))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
221 (info (cl-gethash proc socks-connections)))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
222 (or info (error "socks-send-command called on non-SOCKS connection %S"
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
223 proc))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
224 (cl-puthash 'state socks-state-waiting info)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
225 (process-send-string proc
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
226 (format
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
227 "%c%c%c%c%s%c%c"
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
228 socks-version ; version
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
229 command ; command
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
230 0 ; reserved
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
231 atype ; address type
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
232 addr ; address
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
233 (lsh port -8) ; port, high byte
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
234 (- port (lsh (lsh port -8) 8)) ; port, low byte
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
235 ))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
236 (socks-wait-for-state-change proc info socks-state-waiting)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
237 (if (= (cl-gethash 'reply info) socks-response-success)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
238 nil ; Sweet sweet success!
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
239 (delete-process proc)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
240 (error "%s" (nth (cl-gethash 'reply info) socks-errors)))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
241 proc))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
242
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
243
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
244 ;; Replacement functions for open-network-stream, etc.
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
245 (defvar socks-noproxy nil
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
246 "*List of regexps matching hosts that we should not socksify connections to")
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
247
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
248 (defun socks-find-route (host service)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
249 (let ((route (cons socks-host socks-port))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
250 (noproxy socks-noproxy))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
251 (while noproxy
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
252 (if (string-match (car noproxy) host)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
253 (setq route nil
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
254 noproxy nil))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
255 (setq noproxy (cdr noproxy)))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
256 route))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
257
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
258 (if (fboundp 'socks-original-open-network-stream)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
259 nil ; Do nothing, we've been here already
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
260 (fset 'socks-original-open-network-stream
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
261 (symbol-function 'open-network-stream))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
262 (fset 'open-network-stream 'socks-open-network-stream))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
263
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
264 (defvar socks-services-file "/etc/services")
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
265 (defvar socks-tcp-services (make-hash-table :size 13 :test 'equal))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
266 (defvar socks-udp-services (make-hash-table :size 13 :test 'equal))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
267
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
268 (defun socks-parse-services ()
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
269 (if (not (and (file-exists-p socks-services-file)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
270 (file-readable-p socks-services-file)))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
271 (error "Could not find services file: %s" socks-services-file))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
272 (save-excursion
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
273 (clrhash socks-tcp-services)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
274 (clrhash socks-udp-services)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
275 (set-buffer (get-buffer-create " *socks-tmp*"))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
276 (erase-buffer)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
277 (insert-file-contents socks-services-file)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
278 ;; Nuke comments
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
279 (goto-char (point-min))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
280 (while (re-search-forward "#.*" nil t)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
281 (replace-match ""))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
282 ;; Nuke empty lines
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
283 (goto-char (point-min))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
284 (while (re-search-forward "^[ \t\n]+" nil t)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
285 (replace-match ""))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
286 ;; Now find all the lines
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
287 (goto-char (point-min))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
288 (let (name port type)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
289 (while (re-search-forward "^\\([^ \t]+\\)[ \t]+\\([0-9]+\\)/\\([a-z]+\\)"
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
290 nil t)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
291 (setq name (downcase (match-string 1))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
292 port (string-to-int (match-string 2))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
293 type (downcase (match-string 3)))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
294 (cl-puthash name port (if (equal type "udp")
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
295 socks-udp-services
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
296 socks-tcp-services))))))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
297
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
298 (defun socks-find-services-entry (service &optional udp)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
299 "Return the port # associated with SERVICE"
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
300 (if (= (hash-table-count socks-tcp-services) 0)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
301 (socks-parse-services))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
302 (cl-gethash (downcase service)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
303 (if udp socks-udp-services socks-tcp-services)))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
304
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
305 (defun socks-open-network-stream (name buffer host service)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
306 (let* ((route (socks-find-route host service))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
307 proc info)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
308 (if (not route)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
309 (socks-original-open-network-stream name buffer host service)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
310 (setq proc (socks-open-connection (car route) (cdr route))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
311 info (cl-gethash proc socks-connections))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
312 (socks-send-command proc socks-connect-command
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
313 socks-address-type-name
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
314 host
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
315 (if (stringp service)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
316 (socks-find-services-entry service)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
317 service))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
318 (cl-puthash 'buffer buffer info)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
319 (cl-puthash 'host host info)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
320 (cl-puthash 'service host info)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
321 (set-process-filter proc nil)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
322 (set-process-buffer proc (if buffer (get-buffer-create buffer)))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
323 proc)))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
324
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
325 ;; Authentication modules go here
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
326
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
327 ;; Basic username/password authentication, ala RFC 1929
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
328 ;; To enable username/password authentication, uncomment the following
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
329 ;; lines:
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
330 ;;
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
331 ;; (socks-register-authentication-method 2 "Username/Password"
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
332 ;; 'socks-username/password-auth)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
333
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
334 (defconst socks-username/password-auth-version 1)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
335
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
336 (if (not (fboundp 'char-int))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
337 (fset 'char-int 'identity))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
338
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
339 (defun socks-username/password-auth-filter (proc str)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
340 (let ((info (cl-gethash proc socks-connections))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
341 state desired-len)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
342 (or info (error "socks-filter called on non-SOCKS connection %S" proc))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
343 (setq state (cl-gethash 'state info))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
344 (cl-puthash 'scratch (concat (cl-gethash 'scratch info) str) info)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
345 (if (< (length (cl-gethash 'scratch info)) 2)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
346 nil
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
347 (cl-puthash 'password-auth-status (char-int
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
348 (aref (cl-gethash 'scratch info) 1))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
349 info)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
350 (cl-puthash 'state socks-state-authenticated info))))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
351
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
352 (defun socks-username/password-auth (proc)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
353 (if (not socks-password)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
354 (setq socks-password (read-passwd
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
355 (format "Password for %s@%s: "
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
356 socks-username socks-host))))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
357 (let* ((info (cl-gethash proc socks-connections))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
358 (state (cl-gethash 'state info)))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
359 (cl-puthash 'scratch "" info)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
360 (set-process-filter proc 'socks-username/password-auth-filter)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
361 (process-send-string proc
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
362 (format "%c%c%s%c%s"
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
363 socks-username/password-auth-version
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
364 (length socks-username)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
365 socks-username
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
366 (length socks-password)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
367 socks-password))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
368 (socks-wait-for-state-change proc info state)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
369 (= (cl-gethash 'password-auth-status info) 0)))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
370
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
371
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
372 ;; More advanced GSS/API stuff, not yet implemented - volunteers?
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
373 ;; (socks-register-authentication-method 1 "GSS/API" 'socks-gssapi-auth)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
374
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
375 (defun socks-gssapi-auth (proc)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
376 nil)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
377
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
378
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
379 ;; CHAP stuff
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
380 ;; (socks-register-authentication-method 3 "CHAP" 'socks-chap-auth)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
381 (defun socks-chap-auth (proc)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
382 nil)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
383
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
384 (provide 'socks)