socks_gssapi.c 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551
  1. /***************************************************************************
  2. * _ _ ____ _
  3. * Project ___| | | | _ \| |
  4. * / __| | | | |_) | |
  5. * | (__| |_| | _ <| |___
  6. * \___|\___/|_| \_\_____|
  7. *
  8. * Copyright (C) 2009, Markus Moeller, <markus_moeller@compuserve.com>
  9. *
  10. * This software is licensed as described in the file COPYING, which
  11. * you should have received as part of this distribution. The terms
  12. * are also available at http://curl.haxx.se/docs/copyright.html.
  13. *
  14. * You may opt to use, copy, modify, merge, publish, distribute and/or sell
  15. * copies of the Software, and permit persons to whom the Software is
  16. * furnished to do so, under the terms of the COPYING file.
  17. *
  18. * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
  19. * KIND, either express or implied.
  20. *
  21. * $Id$
  22. ***************************************************************************/
  23. #include "setup.h"
  24. #ifndef CURL_DISABLE_PROXY
  25. #ifdef HAVE_GSSAPI
  26. #ifdef HAVE_OLD_GSSMIT
  27. #define GSS_C_NT_HOSTBASED_SERVICE gss_nt_service_name
  28. #endif
  29. #ifndef gss_nt_service_name
  30. #define gss_nt_service_name GSS_C_NT_HOSTBASED_SERVICE
  31. #endif
  32. #include <string.h>
  33. #ifdef NEED_MALLOC_H
  34. #include <malloc.h>
  35. #endif
  36. #ifdef HAVE_STDLIB_H
  37. #include <stdlib.h>
  38. #endif
  39. #include "urldata.h"
  40. #include "sendf.h"
  41. #include "connect.h"
  42. #include "timeval.h"
  43. #include "socks.h"
  44. static gss_ctx_id_t gss_context = GSS_C_NO_CONTEXT;
  45. #define _MPRINTF_REPLACE /* use our functions only */
  46. #include <curl/mprintf.h>
  47. /* The last #include file should be: */
  48. #include "memdebug.h"
  49. /*
  50. * Helper gssapi error functions.
  51. */
  52. static int check_gss_err(struct SessionHandle *data,
  53. OM_uint32 major_status,
  54. OM_uint32 minor_status,
  55. const char* function)
  56. {
  57. if(GSS_ERROR(major_status)) {
  58. OM_uint32 maj_stat,min_stat;
  59. OM_uint32 msg_ctx = 0;
  60. gss_buffer_desc status_string;
  61. char buf[1024];
  62. size_t len;
  63. len = 0;
  64. msg_ctx = 0;
  65. while(!msg_ctx) {
  66. /* convert major status code (GSS-API error) to text */
  67. maj_stat = gss_display_status(&min_stat, major_status,
  68. GSS_C_GSS_CODE,
  69. GSS_C_NULL_OID,
  70. &msg_ctx, &status_string);
  71. if(maj_stat == GSS_S_COMPLETE) {
  72. if(sizeof(buf) > len + status_string.length + 1) {
  73. strcpy(buf+len, (char*) status_string.value);
  74. len += status_string.length;
  75. }
  76. gss_release_buffer(&min_stat, &status_string);
  77. break;
  78. }
  79. gss_release_buffer(&min_stat, &status_string);
  80. }
  81. if(sizeof(buf) > len + 3) {
  82. strcpy(buf+len, ".\n");
  83. len += 2;
  84. }
  85. msg_ctx = 0;
  86. while(!msg_ctx) {
  87. /* convert minor status code (underlying routine error) to text */
  88. maj_stat = gss_display_status(&min_stat, minor_status,
  89. GSS_C_MECH_CODE,
  90. GSS_C_NULL_OID,
  91. &msg_ctx, &status_string);
  92. if(maj_stat == GSS_S_COMPLETE) {
  93. if(sizeof(buf) > len + status_string.length) {
  94. strcpy(buf+len, (char*) status_string.value);
  95. len += status_string.length;
  96. }
  97. gss_release_buffer(&min_stat, &status_string);
  98. break;
  99. }
  100. gss_release_buffer(&min_stat, &status_string);
  101. }
  102. failf(data, "GSSAPI error: %s failed:\n%s\n", function, buf);
  103. return(1);
  104. }
  105. return(0);
  106. }
  107. CURLcode Curl_SOCKS5_gssapi_negotiate(int sockindex,
  108. struct connectdata *conn)
  109. {
  110. struct SessionHandle *data = conn->data;
  111. curl_socket_t sock = conn->sock[sockindex];
  112. CURLcode code;
  113. ssize_t actualread;
  114. ssize_t written;
  115. int result;
  116. long timeout;
  117. OM_uint32 gss_major_status, gss_minor_status, gss_status;
  118. OM_uint32 gss_ret_flags;
  119. int gss_conf_state, gss_enc;
  120. gss_buffer_desc service = GSS_C_EMPTY_BUFFER;
  121. gss_buffer_desc gss_send_token = GSS_C_EMPTY_BUFFER;
  122. gss_buffer_desc gss_recv_token = GSS_C_EMPTY_BUFFER;
  123. gss_buffer_desc gss_w_token = GSS_C_EMPTY_BUFFER;
  124. gss_buffer_desc* gss_token = GSS_C_NO_BUFFER;
  125. gss_name_t server = GSS_C_NO_NAME;
  126. gss_name_t gss_client_name = GSS_C_NO_NAME;
  127. u_short us_length;
  128. char *user=NULL;
  129. unsigned char socksreq[4]; /* room for gssapi exchange header only */
  130. char *serviceptr = data->set.str[STRING_SOCKS5_GSSAPI_SERVICE];
  131. /* get timeout */
  132. timeout = Curl_timeleft(conn, NULL, TRUE);
  133. /* GSSAPI request looks like
  134. * +----+------+-----+----------------+
  135. * |VER | MTYP | LEN | TOKEN |
  136. * +----+------+----------------------+
  137. * | 1 | 1 | 2 | up to 2^16 - 1 |
  138. * +----+------+-----+----------------+
  139. */
  140. /* prepare service name */
  141. if (strchr(serviceptr,'/')) {
  142. service.value = malloc(strlen(serviceptr));
  143. if(!service.value)
  144. return CURLE_OUT_OF_MEMORY;
  145. service.length = strlen(serviceptr);
  146. memcpy(service.value, serviceptr, service.length);
  147. gss_major_status = gss_import_name(&gss_minor_status, &service,
  148. (gss_OID) GSS_C_NULL_OID, &server);
  149. }
  150. else {
  151. service.value = malloc(strlen(serviceptr) +strlen(conn->proxy.name)+2);
  152. if(!service.value)
  153. return CURLE_OUT_OF_MEMORY;
  154. service.length = strlen(serviceptr) +strlen(conn->proxy.name)+1;
  155. snprintf(service.value, service.length+1, "%s@%s",
  156. serviceptr, conn->proxy.name);
  157. gss_major_status = gss_import_name(&gss_minor_status, &service,
  158. gss_nt_service_name, &server);
  159. }
  160. gss_release_buffer(&gss_status, &service); /* clear allocated memory */
  161. if(check_gss_err(data,gss_major_status,
  162. gss_minor_status,"gss_import_name()")) {
  163. failf(data, "Failed to create service name.");
  164. gss_release_name(&gss_status, &server);
  165. return CURLE_COULDNT_CONNECT;
  166. }
  167. /* As long as we need to keep sending some context info, and there's no */
  168. /* errors, keep sending it... */
  169. for(;;) {
  170. gss_major_status = gss_init_sec_context(&gss_minor_status,
  171. GSS_C_NO_CREDENTIAL,
  172. &gss_context, server,
  173. GSS_C_NULL_OID,
  174. GSS_C_MUTUAL_FLAG |
  175. GSS_C_REPLAY_FLAG,
  176. 0,
  177. NULL,
  178. gss_token,
  179. NULL,
  180. &gss_send_token,
  181. &gss_ret_flags,
  182. NULL);
  183. if(gss_token != GSS_C_NO_BUFFER)
  184. gss_release_buffer(&gss_status, &gss_recv_token);
  185. if(check_gss_err(data,gss_major_status,
  186. gss_minor_status,"gss_init_sec_context")) {
  187. gss_release_name(&gss_status, &server);
  188. gss_release_buffer(&gss_status, &gss_recv_token);
  189. gss_release_buffer(&gss_status, &gss_send_token);
  190. gss_delete_sec_context(&gss_status, &gss_context, NULL);
  191. failf(data, "Failed to initial GSSAPI token.");
  192. return CURLE_COULDNT_CONNECT;
  193. }
  194. if(gss_send_token.length != 0) {
  195. socksreq[0] = 1; /* gssapi subnegotiation version */
  196. socksreq[1] = 1; /* authentication message type */
  197. us_length = htons((short)gss_send_token.length);
  198. memcpy(socksreq+2,&us_length,sizeof(short));
  199. code = Curl_write_plain(conn, sock, (char *)socksreq, 4, &written);
  200. if((code != CURLE_OK) || (4 != written)) {
  201. failf(data, "Failed to send GSSAPI authentication request.");
  202. gss_release_name(&gss_status, &server);
  203. gss_release_buffer(&gss_status, &gss_recv_token);
  204. gss_release_buffer(&gss_status, &gss_send_token);
  205. gss_delete_sec_context(&gss_status, &gss_context, NULL);
  206. return CURLE_COULDNT_CONNECT;
  207. }
  208. code = Curl_write_plain(conn, sock, (char *)gss_send_token.value,
  209. gss_send_token.length, &written);
  210. if((code != CURLE_OK) || ((ssize_t)gss_send_token.length != written)) {
  211. failf(data, "Failed to send GSSAPI authentication token.");
  212. gss_release_name(&gss_status, &server);
  213. gss_release_buffer(&gss_status, &gss_recv_token);
  214. gss_release_buffer(&gss_status, &gss_send_token);
  215. gss_delete_sec_context(&gss_status, &gss_context, NULL);
  216. return CURLE_COULDNT_CONNECT;
  217. }
  218. }
  219. gss_release_buffer(&gss_status, &gss_send_token);
  220. gss_release_buffer(&gss_status, &gss_recv_token);
  221. if(gss_major_status != GSS_S_CONTINUE_NEEDED) break;
  222. /* analyse response */
  223. /* GSSAPI response looks like
  224. * +----+------+-----+----------------+
  225. * |VER | MTYP | LEN | TOKEN |
  226. * +----+------+----------------------+
  227. * | 1 | 1 | 2 | up to 2^16 - 1 |
  228. * +----+------+-----+----------------+
  229. */
  230. result=Curl_blockread_all(conn, sock, (char *)socksreq, 4,
  231. &actualread, timeout);
  232. if(result != CURLE_OK || actualread != 4) {
  233. failf(data, "Failed to receive GSSAPI authentication response.");
  234. gss_release_name(&gss_status, &server);
  235. gss_delete_sec_context(&gss_status, &gss_context, NULL);
  236. return CURLE_COULDNT_CONNECT;
  237. }
  238. /* ignore the first (VER) byte */
  239. if(socksreq[1] == 255) { /* status / message type */
  240. failf(data, "User was rejected by the SOCKS5 server (%d %d).",
  241. socksreq[0], socksreq[1]);
  242. gss_release_name(&gss_status, &server);
  243. gss_delete_sec_context(&gss_status, &gss_context, NULL);
  244. return CURLE_COULDNT_CONNECT;
  245. }
  246. if(socksreq[1] != 1) { /* status / messgae type */
  247. failf(data, "Invalid GSSAPI authentication response type (%d %d).",
  248. socksreq[0], socksreq[1]);
  249. gss_release_name(&gss_status, &server);
  250. gss_delete_sec_context(&gss_status, &gss_context, NULL);
  251. return CURLE_COULDNT_CONNECT;
  252. }
  253. memcpy(&us_length, socksreq+2, sizeof(short));
  254. us_length = ntohs(us_length);
  255. gss_recv_token.length=us_length;
  256. gss_recv_token.value=malloc(us_length);
  257. if(!gss_recv_token.value) {
  258. failf(data,
  259. "Could not allocate memory for GSSAPI authentication "
  260. "response token.");
  261. gss_release_name(&gss_status, &server);
  262. gss_delete_sec_context(&gss_status, &gss_context, NULL);
  263. return CURLE_OUT_OF_MEMORY;
  264. }
  265. result=Curl_blockread_all(conn, sock, (char *)gss_recv_token.value,
  266. gss_recv_token.length,
  267. &actualread, timeout);
  268. if(result != CURLE_OK || actualread != us_length) {
  269. failf(data, "Failed to receive GSSAPI authentication token.");
  270. gss_release_name(&gss_status, &server);
  271. gss_release_buffer(&gss_status, &gss_recv_token);
  272. gss_delete_sec_context(&gss_status, &gss_context, NULL);
  273. return CURLE_COULDNT_CONNECT;
  274. }
  275. gss_token = &gss_recv_token;
  276. }
  277. gss_release_name(&gss_status, &server);
  278. /* Everything is good so far, user was authenticated! */
  279. gss_major_status = gss_inquire_context (&gss_minor_status, gss_context,
  280. &gss_client_name, NULL, NULL, NULL,
  281. NULL, NULL, NULL);
  282. if(check_gss_err(data,gss_major_status,
  283. gss_minor_status,"gss_inquire_context")) {
  284. gss_delete_sec_context(&gss_status, &gss_context, NULL);
  285. gss_release_name(&gss_status, &gss_client_name);
  286. failf(data, "Failed to determine user name.");
  287. return CURLE_COULDNT_CONNECT;
  288. }
  289. gss_major_status = gss_display_name(&gss_minor_status, gss_client_name,
  290. &gss_send_token, NULL);
  291. if(check_gss_err(data,gss_major_status,
  292. gss_minor_status,"gss_display_name")) {
  293. gss_delete_sec_context(&gss_status, &gss_context, NULL);
  294. gss_release_name(&gss_status, &gss_client_name);
  295. gss_release_buffer(&gss_status, &gss_send_token);
  296. failf(data, "Failed to determine user name.");
  297. return CURLE_COULDNT_CONNECT;
  298. }
  299. user=malloc(gss_send_token.length+1);
  300. if(!user) {
  301. gss_delete_sec_context(&gss_status, &gss_context, NULL);
  302. gss_release_name(&gss_status, &gss_client_name);
  303. gss_release_buffer(&gss_status, &gss_send_token);
  304. return CURLE_OUT_OF_MEMORY;
  305. }
  306. memcpy(user, gss_send_token.value, gss_send_token.length);
  307. user[gss_send_token.length] = '\0';
  308. gss_release_name(&gss_status, &gss_client_name);
  309. gss_release_buffer(&gss_status, &gss_send_token);
  310. infof(data, "SOCKS5 server authencticated user %s with gssapi.\n",user);
  311. free(user);
  312. user=NULL;
  313. /* Do encryption */
  314. socksreq[0] = 1; /* gssapi subnegotiation version */
  315. socksreq[1] = 2; /* encryption message type */
  316. gss_enc = 0; /* no data protection */
  317. /* do confidentiality protection if supported */
  318. if(gss_ret_flags & GSS_C_CONF_FLAG)
  319. gss_enc = 2;
  320. /* else do integrity protection */
  321. else if(gss_ret_flags & GSS_C_INTEG_FLAG)
  322. gss_enc = 1;
  323. infof(data, "SOCKS5 server supports gssapi %s data protection.\n",
  324. (gss_enc==0)?"no":((gss_enc==1)?"integrity":"confidentiality"));
  325. /* force for the moment to no data protection */
  326. gss_enc = 0;
  327. /*
  328. * Sending the encryption type in clear seems wrong. It should be
  329. * protected with gss_seal()/gss_wrap(). See RFC1961 extract below
  330. * The NEC reference implementations on which this is based is
  331. * therefore at fault
  332. *
  333. * +------+------+------+.......................+
  334. * + ver | mtyp | len | token |
  335. * +------+------+------+.......................+
  336. * + 0x01 | 0x02 | 0x02 | up to 2^16 - 1 octets |
  337. * +------+------+------+.......................+
  338. *
  339. * Where:
  340. *
  341. * - "ver" is the protocol version number, here 1 to represent the
  342. * first version of the SOCKS/GSS-API protocol
  343. *
  344. * - "mtyp" is the message type, here 2 to represent a protection
  345. * -level negotiation message
  346. *
  347. * - "len" is the length of the "token" field in octets
  348. *
  349. * - "token" is the GSS-API encapsulated protection level
  350. *
  351. * The token is produced by encapsulating an octet containing the
  352. * required protection level using gss_seal()/gss_wrap() with conf_req
  353. * set to FALSE. The token is verified using gss_unseal()/
  354. * gss_unwrap().
  355. *
  356. */
  357. if(data->set.socks5_gssapi_nec) {
  358. us_length = htons((short)1);
  359. memcpy(socksreq+2,&us_length,sizeof(short));
  360. }
  361. else {
  362. gss_send_token.length = 1;
  363. gss_send_token.value = malloc(1);
  364. if(!gss_send_token.value) {
  365. gss_delete_sec_context(&gss_status, &gss_context, NULL);
  366. return CURLE_OUT_OF_MEMORY;
  367. }
  368. memcpy(gss_send_token.value, &gss_enc, 1);
  369. gss_major_status = gss_wrap(&gss_minor_status, gss_context, 0,
  370. GSS_C_QOP_DEFAULT, &gss_send_token,
  371. &gss_conf_state, &gss_w_token);
  372. if(check_gss_err(data,gss_major_status,gss_minor_status,"gss_wrap")) {
  373. gss_release_buffer(&gss_status, &gss_send_token);
  374. gss_release_buffer(&gss_status, &gss_w_token);
  375. gss_delete_sec_context(&gss_status, &gss_context, NULL);
  376. failf(data, "Failed to wrap GSSAPI encryption value into token.");
  377. return CURLE_COULDNT_CONNECT;
  378. }
  379. gss_release_buffer(&gss_status, &gss_send_token);
  380. us_length = htons((short)gss_w_token.length);
  381. memcpy(socksreq+2,&us_length,sizeof(short));
  382. }
  383. code = Curl_write_plain(conn, sock, (char *)socksreq, 4, &written);
  384. if((code != CURLE_OK) || (4 != written)) {
  385. failf(data, "Failed to send GSSAPI encryption request.");
  386. gss_release_buffer(&gss_status, &gss_w_token);
  387. gss_delete_sec_context(&gss_status, &gss_context, NULL);
  388. return CURLE_COULDNT_CONNECT;
  389. }
  390. if(data->set.socks5_gssapi_nec) {
  391. memcpy(socksreq, &gss_enc, 1);
  392. code = Curl_write_plain(conn, sock, socksreq, 1, &written);
  393. if((code != CURLE_OK) || ( 1 != written)) {
  394. failf(data, "Failed to send GSSAPI encryption type.");
  395. gss_delete_sec_context(&gss_status, &gss_context, NULL);
  396. return CURLE_COULDNT_CONNECT;
  397. }
  398. } else {
  399. code = Curl_write_plain(conn, sock, (char *)gss_w_token.value,
  400. gss_w_token.length, &written);
  401. if((code != CURLE_OK) || ((ssize_t)gss_w_token.length != written)) {
  402. failf(data, "Failed to send GSSAPI encryption type.");
  403. gss_release_buffer(&gss_status, &gss_w_token);
  404. gss_delete_sec_context(&gss_status, &gss_context, NULL);
  405. return CURLE_COULDNT_CONNECT;
  406. }
  407. gss_release_buffer(&gss_status, &gss_w_token);
  408. }
  409. result=Curl_blockread_all(conn, sock, (char *)socksreq, 4,
  410. &actualread, timeout);
  411. if(result != CURLE_OK || actualread != 4) {
  412. failf(data, "Failed to receive GSSAPI encryption response.");
  413. gss_delete_sec_context(&gss_status, &gss_context, NULL);
  414. return CURLE_COULDNT_CONNECT;
  415. }
  416. /* ignore the first (VER) byte */
  417. if(socksreq[1] == 255) { /* status / message type */
  418. failf(data, "User was rejected by the SOCKS5 server (%d %d).",
  419. socksreq[0], socksreq[1]);
  420. gss_delete_sec_context(&gss_status, &gss_context, NULL);
  421. return CURLE_COULDNT_CONNECT;
  422. }
  423. if(socksreq[1] != 2) { /* status / messgae type */
  424. failf(data, "Invalid GSSAPI encryption response type (%d %d).",
  425. socksreq[0], socksreq[1]);
  426. gss_delete_sec_context(&gss_status, &gss_context, NULL);
  427. return CURLE_COULDNT_CONNECT;
  428. }
  429. memcpy(&us_length, socksreq+2, sizeof(short));
  430. us_length = ntohs(us_length);
  431. gss_recv_token.length= us_length;
  432. gss_recv_token.value=malloc(gss_recv_token.length);
  433. if(!gss_recv_token.value) {
  434. gss_delete_sec_context(&gss_status, &gss_context, NULL);
  435. return CURLE_OUT_OF_MEMORY;
  436. }
  437. result=Curl_blockread_all(conn, sock, (char *)gss_recv_token.value,
  438. gss_recv_token.length,
  439. &actualread, timeout);
  440. if(result != CURLE_OK || actualread != us_length) {
  441. failf(data, "Failed to receive GSSAPI encryptrion type.");
  442. gss_release_buffer(&gss_status, &gss_recv_token);
  443. gss_delete_sec_context(&gss_status, &gss_context, NULL);
  444. return CURLE_COULDNT_CONNECT;
  445. }
  446. if(!data->set.socks5_gssapi_nec) {
  447. gss_major_status = gss_unwrap(&gss_minor_status, gss_context,
  448. &gss_recv_token, &gss_w_token,
  449. 0, GSS_C_QOP_DEFAULT);
  450. if(check_gss_err(data,gss_major_status,gss_minor_status,"gss_unwrap")) {
  451. gss_release_buffer(&gss_status, &gss_recv_token);
  452. gss_release_buffer(&gss_status, &gss_w_token);
  453. gss_delete_sec_context(&gss_status, &gss_context, NULL);
  454. failf(data, "Failed to unwrap GSSAPI encryption value into token.");
  455. return CURLE_COULDNT_CONNECT;
  456. }
  457. gss_release_buffer(&gss_status, &gss_recv_token);
  458. if(gss_w_token.length != 1) {
  459. failf(data, "Invalid GSSAPI encryption response length (%d).",
  460. gss_w_token.length);
  461. gss_release_buffer(&gss_status, &gss_w_token);
  462. gss_delete_sec_context(&gss_status, &gss_context, NULL);
  463. return CURLE_COULDNT_CONNECT;
  464. }
  465. memcpy(socksreq,gss_w_token.value,gss_w_token.length);
  466. gss_release_buffer(&gss_status, &gss_w_token);
  467. }
  468. else {
  469. if(gss_recv_token.length != 1) {
  470. failf(data, "Invalid GSSAPI encryption response length (%d).",
  471. gss_recv_token.length);
  472. gss_release_buffer(&gss_status, &gss_recv_token);
  473. gss_delete_sec_context(&gss_status, &gss_context, NULL);
  474. return CURLE_COULDNT_CONNECT;
  475. }
  476. memcpy(socksreq,gss_recv_token.value,gss_recv_token.length);
  477. gss_release_buffer(&gss_status, &gss_recv_token);
  478. }
  479. infof(data, "SOCKS5 access with%s protection granted.\n",
  480. (socksreq[0]==0)?"out gssapi data":
  481. ((socksreq[0]==1)?" gssapi integrity":" gssapi confidentiality"));
  482. conn->socks5_gssapi_enctype = socksreq[0];
  483. if(socksreq[0] == 0)
  484. gss_delete_sec_context(&gss_status, &gss_context, NULL);
  485. return CURLE_OK;
  486. }
  487. #endif
  488. #endif /* CURL_DISABLE_PROXY */