socks_gssapi.c 20 KB

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