wingss.c 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570
  1. #ifndef NO_GSSAPI
  2. #include "putty.h"
  3. #define SECURITY_WIN32
  4. #include <security.h>
  5. #include "pgssapi.h"
  6. #include "sshgss.h"
  7. #include "sshgssc.h"
  8. #include "misc.h"
  9. /* Windows code to set up the GSSAPI library list. */
  10. const int ngsslibs = 3;
  11. const char *const gsslibnames[3] = {
  12. "MIT Kerberos GSSAPI32.DLL",
  13. "Microsoft SSPI SECUR32.DLL",
  14. "User-specified GSSAPI DLL",
  15. };
  16. const struct keyvalwhere gsslibkeywords[] = {
  17. { "gssapi32", 0, -1, -1 },
  18. { "sspi", 1, -1, -1 },
  19. { "custom", 2, -1, -1 },
  20. };
  21. DECL_WINDOWS_FUNCTION(static, SECURITY_STATUS,
  22. AcquireCredentialsHandleA,
  23. (SEC_CHAR *, SEC_CHAR *, ULONG, PLUID,
  24. PVOID, SEC_GET_KEY_FN, PVOID, PCredHandle, PTimeStamp));
  25. DECL_WINDOWS_FUNCTION(static, SECURITY_STATUS,
  26. InitializeSecurityContextA,
  27. (PCredHandle, PCtxtHandle, SEC_CHAR *, ULONG, ULONG,
  28. ULONG, PSecBufferDesc, ULONG, PCtxtHandle,
  29. PSecBufferDesc, PULONG, PTimeStamp));
  30. DECL_WINDOWS_FUNCTION(static, SECURITY_STATUS,
  31. FreeContextBuffer,
  32. (PVOID));
  33. DECL_WINDOWS_FUNCTION(static, SECURITY_STATUS,
  34. FreeCredentialsHandle,
  35. (PCredHandle));
  36. DECL_WINDOWS_FUNCTION(static, SECURITY_STATUS,
  37. DeleteSecurityContext,
  38. (PCtxtHandle));
  39. DECL_WINDOWS_FUNCTION(static, SECURITY_STATUS,
  40. QueryContextAttributesA,
  41. (PCtxtHandle, ULONG, PVOID));
  42. DECL_WINDOWS_FUNCTION(static, SECURITY_STATUS,
  43. MakeSignature,
  44. (PCtxtHandle, ULONG, PSecBufferDesc, ULONG));
  45. DECL_WINDOWS_FUNCTION(static, DLL_DIRECTORY_COOKIE,
  46. AddDllDirectory,
  47. (PCWSTR));
  48. typedef struct winSsh_gss_ctx {
  49. unsigned long maj_stat;
  50. unsigned long min_stat;
  51. CredHandle cred_handle;
  52. CtxtHandle context;
  53. PCtxtHandle context_handle;
  54. TimeStamp expiry;
  55. } winSsh_gss_ctx;
  56. #ifdef MPEXT
  57. static
  58. #endif
  59. const Ssh_gss_buf gss_mech_krb5={9,"\x2A\x86\x48\x86\xF7\x12\x01\x02\x02"};
  60. const char *gsslogmsg = NULL;
  61. static void ssh_sspi_bind_fns(struct ssh_gss_library *lib);
  62. struct ssh_gss_liblist *ssh_gss_setup(Conf *conf)
  63. {
  64. HMODULE module;
  65. HKEY regkey;
  66. struct ssh_gss_liblist *list = snew(struct ssh_gss_liblist);
  67. char *path;
  68. static HMODULE kernel32_module;
  69. if (!kernel32_module) {
  70. kernel32_module = load_system32_dll("kernel32.dll");
  71. }
  72. #if (defined _MSC_VER && _MSC_VER < 1900) || defined MPEXT
  73. /* Omit the type-check because older MSVCs don't have this function */
  74. GET_WINDOWS_FUNCTION_NO_TYPECHECK(kernel32_module, AddDllDirectory);
  75. #else
  76. GET_WINDOWS_FUNCTION(kernel32_module, AddDllDirectory);
  77. #endif
  78. list->libraries = snewn(3, struct ssh_gss_library);
  79. list->nlibraries = 0;
  80. /* MIT Kerberos GSSAPI implementation */
  81. /* TODO: For 64-bit builds, check for gssapi64.dll */
  82. module = NULL;
  83. if (RegOpenKey(HKEY_LOCAL_MACHINE, "SOFTWARE\\MIT\\Kerberos", &regkey)
  84. == ERROR_SUCCESS) {
  85. DWORD type, size;
  86. LONG ret;
  87. char *buffer;
  88. /* Find out the string length */
  89. ret = RegQueryValueEx(regkey, "InstallDir", NULL, &type, NULL, &size);
  90. if (ret == ERROR_SUCCESS && type == REG_SZ) {
  91. buffer = snewn(size + 20, char);
  92. ret = RegQueryValueEx(regkey, "InstallDir", NULL,
  93. &type, (LPBYTE)buffer, &size);
  94. if (ret == ERROR_SUCCESS && type == REG_SZ) {
  95. strcat (buffer, "\\bin");
  96. if(p_AddDllDirectory) {
  97. /* Add MIT Kerberos' path to the DLL search path,
  98. * it loads its own DLLs further down the road */
  99. wchar_t *dllPath =
  100. dup_mb_to_wc(DEFAULT_CODEPAGE, 0, buffer);
  101. p_AddDllDirectory(dllPath);
  102. sfree(dllPath);
  103. }
  104. strcat (buffer, "\\gssapi32.dll");
  105. module = LoadLibraryEx (buffer, NULL,
  106. LOAD_LIBRARY_SEARCH_SYSTEM32 |
  107. LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR |
  108. LOAD_LIBRARY_SEARCH_USER_DIRS);
  109. }
  110. sfree(buffer);
  111. }
  112. RegCloseKey(regkey);
  113. }
  114. if (module) {
  115. struct ssh_gss_library *lib =
  116. &list->libraries[list->nlibraries++];
  117. lib->id = 0;
  118. lib->gsslogmsg = "Using GSSAPI from GSSAPI32.DLL";
  119. lib->handle = (void *)module;
  120. #define BIND_GSS_FN(name) \
  121. lib->u.gssapi.name = (t_gss_##name) GetProcAddress(module, "gss_" #name)
  122. BIND_GSS_FN(delete_sec_context);
  123. BIND_GSS_FN(display_status);
  124. BIND_GSS_FN(get_mic);
  125. BIND_GSS_FN(import_name);
  126. BIND_GSS_FN(init_sec_context);
  127. BIND_GSS_FN(release_buffer);
  128. BIND_GSS_FN(release_cred);
  129. BIND_GSS_FN(release_name);
  130. #undef BIND_GSS_FN
  131. ssh_gssapi_bind_fns(lib);
  132. }
  133. /* Microsoft SSPI Implementation */
  134. module = load_system32_dll("secur32.dll");
  135. if (module) {
  136. struct ssh_gss_library *lib =
  137. &list->libraries[list->nlibraries++];
  138. lib->id = 1;
  139. lib->gsslogmsg = "Using SSPI from SECUR32.DLL";
  140. lib->handle = (void *)module;
  141. #pragma option push -w-cpt
  142. GET_WINDOWS_FUNCTION(module, AcquireCredentialsHandleA);
  143. #pragma option pop
  144. GET_WINDOWS_FUNCTION(module, InitializeSecurityContextA);
  145. GET_WINDOWS_FUNCTION(module, FreeContextBuffer);
  146. GET_WINDOWS_FUNCTION(module, FreeCredentialsHandle);
  147. GET_WINDOWS_FUNCTION(module, DeleteSecurityContext);
  148. GET_WINDOWS_FUNCTION(module, QueryContextAttributesA);
  149. GET_WINDOWS_FUNCTION(module, MakeSignature);
  150. ssh_sspi_bind_fns(lib);
  151. }
  152. /*
  153. * Custom GSSAPI DLL.
  154. */
  155. module = NULL;
  156. path = conf_get_filename(conf, CONF_ssh_gss_custom)->path;
  157. if (*path) {
  158. if(p_AddDllDirectory) {
  159. /* Add the custom directory as well in case it chainloads
  160. * some other DLLs (e.g a non-installed MIT Kerberos
  161. * instance) */
  162. int pathlen = strlen(path);
  163. while (pathlen > 0 && path[pathlen-1] != ':' &&
  164. path[pathlen-1] != '\\')
  165. pathlen--;
  166. if (pathlen > 0 && path[pathlen-1] != '\\')
  167. pathlen--;
  168. if (pathlen > 0) {
  169. char *dirpath = dupprintf("%.*s", pathlen, path);
  170. wchar_t *dllPath = dup_mb_to_wc(DEFAULT_CODEPAGE, 0, dirpath);
  171. p_AddDllDirectory(dllPath);
  172. sfree(dllPath);
  173. sfree(dirpath);
  174. }
  175. }
  176. module = LoadLibraryEx(path, NULL,
  177. LOAD_LIBRARY_SEARCH_SYSTEM32 |
  178. LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR |
  179. LOAD_LIBRARY_SEARCH_USER_DIRS);
  180. }
  181. if (module) {
  182. struct ssh_gss_library *lib =
  183. &list->libraries[list->nlibraries++];
  184. lib->id = 2;
  185. lib->gsslogmsg = dupprintf("Using GSSAPI from user-specified"
  186. " library '%s'", path);
  187. lib->handle = (void *)module;
  188. #define BIND_GSS_FN(name) \
  189. lib->u.gssapi.name = (t_gss_##name) GetProcAddress(module, "gss_" #name)
  190. BIND_GSS_FN(delete_sec_context);
  191. BIND_GSS_FN(display_status);
  192. BIND_GSS_FN(get_mic);
  193. BIND_GSS_FN(import_name);
  194. BIND_GSS_FN(init_sec_context);
  195. BIND_GSS_FN(release_buffer);
  196. BIND_GSS_FN(release_cred);
  197. BIND_GSS_FN(release_name);
  198. #undef BIND_GSS_FN
  199. ssh_gssapi_bind_fns(lib);
  200. }
  201. return list;
  202. }
  203. void ssh_gss_cleanup(struct ssh_gss_liblist *list)
  204. {
  205. int i;
  206. /*
  207. * LoadLibrary and FreeLibrary are defined to employ reference
  208. * counting in the case where the same library is repeatedly
  209. * loaded, so even in a multiple-sessions-per-process context
  210. * (not that we currently expect ever to have such a thing on
  211. * Windows) it's safe to naively FreeLibrary everything here
  212. * without worrying about destroying it under the feet of
  213. * another SSH instance still using it.
  214. */
  215. for (i = 0; i < list->nlibraries; i++) {
  216. FreeLibrary((HMODULE)list->libraries[i].handle);
  217. if (list->libraries[i].id == 2) {
  218. /* The 'custom' id involves a dynamically allocated message.
  219. * Note that we must cast away the 'const' to free it. */
  220. sfree((char *)list->libraries[i].gsslogmsg);
  221. }
  222. }
  223. sfree(list->libraries);
  224. sfree(list);
  225. }
  226. static Ssh_gss_stat ssh_sspi_indicate_mech(struct ssh_gss_library *lib,
  227. Ssh_gss_buf *mech)
  228. {
  229. *mech = gss_mech_krb5;
  230. return SSH_GSS_OK;
  231. }
  232. static Ssh_gss_stat ssh_sspi_import_name(struct ssh_gss_library *lib,
  233. char *host, Ssh_gss_name *srv_name)
  234. {
  235. char *pStr;
  236. /* Check hostname */
  237. if (host == NULL) return SSH_GSS_FAILURE;
  238. /* copy it into form host/FQDN */
  239. pStr = dupcat("host/", host, NULL);
  240. *srv_name = (Ssh_gss_name) pStr;
  241. return SSH_GSS_OK;
  242. }
  243. static Ssh_gss_stat ssh_sspi_acquire_cred(struct ssh_gss_library *lib,
  244. Ssh_gss_ctx *ctx)
  245. {
  246. winSsh_gss_ctx *winctx = snew(winSsh_gss_ctx);
  247. memset(winctx, 0, sizeof(winSsh_gss_ctx));
  248. /* prepare our "wrapper" structure */
  249. winctx->maj_stat = winctx->min_stat = SEC_E_OK;
  250. winctx->context_handle = NULL;
  251. /* Specifying no principal name here means use the credentials of
  252. the current logged-in user */
  253. winctx->maj_stat = p_AcquireCredentialsHandleA(NULL,
  254. "Kerberos",
  255. SECPKG_CRED_OUTBOUND,
  256. NULL,
  257. NULL,
  258. NULL,
  259. NULL,
  260. &winctx->cred_handle,
  261. &winctx->expiry);
  262. if (winctx->maj_stat != SEC_E_OK) return SSH_GSS_FAILURE;
  263. *ctx = (Ssh_gss_ctx) winctx;
  264. return SSH_GSS_OK;
  265. }
  266. #ifdef MPEXT
  267. static SecBuffer ssh_gss_init_sec_buffer(unsigned long buffersize,
  268. unsigned long buffertype, void * buffer)
  269. {
  270. SecBuffer result;
  271. result.cbBuffer = buffersize;
  272. result.BufferType = buffertype;
  273. result.pvBuffer = buffer;
  274. return result;
  275. }
  276. static SecBufferDesc ssh_gss_init_sec_buffer_desc(unsigned long version,
  277. unsigned long bufferscount, PSecBuffer buffers)
  278. {
  279. SecBufferDesc result;
  280. result.ulVersion = version;
  281. result.cBuffers = bufferscount;
  282. result.pBuffers = buffers;
  283. return result;
  284. }
  285. #define MPEXT_INIT_SEC_BUFFER(BUFFERSIZE, BUFFERTYPE, BUFFER) \
  286. ssh_gss_init_sec_buffer(BUFFERSIZE, BUFFERTYPE, BUFFER)
  287. #define MPEXT_INIT_SEC_BUFFERDESC(VERSION, BUFFERSCOUNT, BUFFERS) \
  288. ssh_gss_init_sec_buffer_desc(VERSION, BUFFERSCOUNT, BUFFERS)
  289. #else
  290. #define MPEXT_INIT_SEC_BUFFER(BUFFERSIZE, BUFFERTYPE, BUFFER) \
  291. {BUFFERSIZE, BUFFERTYPE, BUFFER}
  292. #define MPEXT_INIT_SEC_BUFFERDESC(VERSION, BUFFERSCOUNT, BUFFERS) \
  293. {VERSION, BUFFERSCOUNT, BUFFERS}
  294. #endif
  295. static Ssh_gss_stat ssh_sspi_init_sec_context(struct ssh_gss_library *lib,
  296. Ssh_gss_ctx *ctx,
  297. Ssh_gss_name srv_name,
  298. int to_deleg,
  299. Ssh_gss_buf *recv_tok,
  300. Ssh_gss_buf *send_tok)
  301. {
  302. winSsh_gss_ctx *winctx = (winSsh_gss_ctx *) *ctx;
  303. SecBuffer wsend_tok = MPEXT_INIT_SEC_BUFFER(send_tok->length,SECBUFFER_TOKEN,send_tok->value);
  304. SecBuffer wrecv_tok = MPEXT_INIT_SEC_BUFFER(recv_tok->length,SECBUFFER_TOKEN,recv_tok->value);
  305. SecBufferDesc output_desc= MPEXT_INIT_SEC_BUFFERDESC(SECBUFFER_VERSION,1,&wsend_tok);
  306. SecBufferDesc input_desc = MPEXT_INIT_SEC_BUFFERDESC(SECBUFFER_VERSION,1,&wrecv_tok);
  307. unsigned long flags=ISC_REQ_MUTUAL_AUTH|ISC_REQ_REPLAY_DETECT|
  308. ISC_REQ_CONFIDENTIALITY|ISC_REQ_ALLOCATE_MEMORY;
  309. unsigned long ret_flags=0;
  310. /* check if we have to delegate ... */
  311. if (to_deleg) flags |= ISC_REQ_DELEGATE;
  312. winctx->maj_stat = p_InitializeSecurityContextA(&winctx->cred_handle,
  313. winctx->context_handle,
  314. (char*) srv_name,
  315. flags,
  316. 0, /* reserved */
  317. SECURITY_NATIVE_DREP,
  318. &input_desc,
  319. 0, /* reserved */
  320. &winctx->context,
  321. &output_desc,
  322. &ret_flags,
  323. &winctx->expiry);
  324. /* prepare for the next round */
  325. winctx->context_handle = &winctx->context;
  326. send_tok->value = wsend_tok.pvBuffer;
  327. send_tok->length = wsend_tok.cbBuffer;
  328. /* check & return our status */
  329. if (winctx->maj_stat==SEC_E_OK) return SSH_GSS_S_COMPLETE;
  330. if (winctx->maj_stat==SEC_I_CONTINUE_NEEDED) return SSH_GSS_S_CONTINUE_NEEDED;
  331. return SSH_GSS_FAILURE;
  332. }
  333. static Ssh_gss_stat ssh_sspi_free_tok(struct ssh_gss_library *lib,
  334. Ssh_gss_buf *send_tok)
  335. {
  336. /* check input */
  337. if (send_tok == NULL) return SSH_GSS_FAILURE;
  338. /* free Windows buffer */
  339. p_FreeContextBuffer(send_tok->value);
  340. SSH_GSS_CLEAR_BUF(send_tok);
  341. return SSH_GSS_OK;
  342. }
  343. static Ssh_gss_stat ssh_sspi_release_cred(struct ssh_gss_library *lib,
  344. Ssh_gss_ctx *ctx)
  345. {
  346. winSsh_gss_ctx *winctx= (winSsh_gss_ctx *) *ctx;
  347. /* check input */
  348. if (winctx == NULL) return SSH_GSS_FAILURE;
  349. /* free Windows data */
  350. p_FreeCredentialsHandle(&winctx->cred_handle);
  351. #ifdef MPEXT
  352. if (winctx->context_handle != NULL)
  353. #endif
  354. p_DeleteSecurityContext(&winctx->context);
  355. /* delete our "wrapper" structure */
  356. sfree(winctx);
  357. *ctx = (Ssh_gss_ctx) NULL;
  358. return SSH_GSS_OK;
  359. }
  360. static Ssh_gss_stat ssh_sspi_release_name(struct ssh_gss_library *lib,
  361. Ssh_gss_name *srv_name)
  362. {
  363. char *pStr= (char *) *srv_name;
  364. if (pStr == NULL) return SSH_GSS_FAILURE;
  365. sfree(pStr);
  366. *srv_name = (Ssh_gss_name) NULL;
  367. return SSH_GSS_OK;
  368. }
  369. static Ssh_gss_stat ssh_sspi_display_status(struct ssh_gss_library *lib,
  370. Ssh_gss_ctx ctx, Ssh_gss_buf *buf)
  371. {
  372. winSsh_gss_ctx *winctx = (winSsh_gss_ctx *) ctx;
  373. const char *msg;
  374. if (winctx == NULL) return SSH_GSS_FAILURE;
  375. /* decode the error code */
  376. switch (winctx->maj_stat) {
  377. case SEC_E_OK: msg="SSPI status OK"; break;
  378. case SEC_E_INVALID_HANDLE: msg="The handle passed to the function"
  379. " is invalid.";
  380. break;
  381. case SEC_E_TARGET_UNKNOWN: msg="The target was not recognized."; break;
  382. case SEC_E_LOGON_DENIED: msg="The logon failed."; break;
  383. case SEC_E_INTERNAL_ERROR: msg="The Local Security Authority cannot"
  384. " be contacted.";
  385. break;
  386. case SEC_E_NO_CREDENTIALS: msg="No credentials are available in the"
  387. " security package.";
  388. break;
  389. case SEC_E_NO_AUTHENTICATING_AUTHORITY:
  390. msg="No authority could be contacted for authentication."
  391. "The domain name of the authenticating party could be wrong,"
  392. " the domain could be unreachable, or there might have been"
  393. " a trust relationship failure.";
  394. break;
  395. case SEC_E_INSUFFICIENT_MEMORY:
  396. msg="One or more of the SecBufferDesc structures passed as"
  397. " an OUT parameter has a buffer that is too small.";
  398. break;
  399. case SEC_E_INVALID_TOKEN:
  400. msg="The error is due to a malformed input token, such as a"
  401. " token corrupted in transit, a token"
  402. " of incorrect size, or a token passed into the wrong"
  403. " security package. Passing a token to"
  404. " the wrong package can happen if client and server did not"
  405. " negotiate the proper security package.";
  406. break;
  407. default:
  408. msg = "Internal SSPI error";
  409. break;
  410. }
  411. buf->value = dupstr(msg);
  412. buf->length = strlen(buf->value);
  413. return SSH_GSS_OK;
  414. }
  415. static Ssh_gss_stat ssh_sspi_get_mic(struct ssh_gss_library *lib,
  416. Ssh_gss_ctx ctx, Ssh_gss_buf *buf,
  417. Ssh_gss_buf *hash)
  418. {
  419. winSsh_gss_ctx *winctx= (winSsh_gss_ctx *) ctx;
  420. SecPkgContext_Sizes ContextSizes;
  421. SecBufferDesc InputBufferDescriptor;
  422. SecBuffer InputSecurityToken[2];
  423. if (winctx == NULL) return SSH_GSS_FAILURE;
  424. winctx->maj_stat = 0;
  425. memset(&ContextSizes, 0, sizeof(ContextSizes));
  426. winctx->maj_stat = p_QueryContextAttributesA(&winctx->context,
  427. SECPKG_ATTR_SIZES,
  428. &ContextSizes);
  429. if (winctx->maj_stat != SEC_E_OK ||
  430. ContextSizes.cbMaxSignature == 0)
  431. return winctx->maj_stat;
  432. InputBufferDescriptor.cBuffers = 2;
  433. InputBufferDescriptor.pBuffers = InputSecurityToken;
  434. InputBufferDescriptor.ulVersion = SECBUFFER_VERSION;
  435. InputSecurityToken[0].BufferType = SECBUFFER_DATA;
  436. InputSecurityToken[0].cbBuffer = buf->length;
  437. InputSecurityToken[0].pvBuffer = buf->value;
  438. InputSecurityToken[1].BufferType = SECBUFFER_TOKEN;
  439. InputSecurityToken[1].cbBuffer = ContextSizes.cbMaxSignature;
  440. InputSecurityToken[1].pvBuffer = snewn(ContextSizes.cbMaxSignature, char);
  441. winctx->maj_stat = p_MakeSignature(&winctx->context,
  442. 0,
  443. &InputBufferDescriptor,
  444. 0);
  445. if (winctx->maj_stat == SEC_E_OK) {
  446. hash->length = InputSecurityToken[1].cbBuffer;
  447. hash->value = InputSecurityToken[1].pvBuffer;
  448. }
  449. return winctx->maj_stat;
  450. }
  451. static Ssh_gss_stat ssh_sspi_free_mic(struct ssh_gss_library *lib,
  452. Ssh_gss_buf *hash)
  453. {
  454. sfree(hash->value);
  455. return SSH_GSS_OK;
  456. }
  457. static void ssh_sspi_bind_fns(struct ssh_gss_library *lib)
  458. {
  459. lib->indicate_mech = ssh_sspi_indicate_mech;
  460. lib->import_name = ssh_sspi_import_name;
  461. lib->release_name = ssh_sspi_release_name;
  462. lib->init_sec_context = ssh_sspi_init_sec_context;
  463. lib->free_tok = ssh_sspi_free_tok;
  464. lib->acquire_cred = ssh_sspi_acquire_cred;
  465. lib->release_cred = ssh_sspi_release_cred;
  466. lib->get_mic = ssh_sspi_get_mic;
  467. lib->free_mic = ssh_sspi_free_mic;
  468. lib->display_status = ssh_sspi_display_status;
  469. }
  470. #else
  471. /* Dummy function so this source file defines something if NO_GSSAPI
  472. is defined. */
  473. void ssh_gss_init(void)
  474. {
  475. }
  476. #endif