summaryrefslogtreecommitdiff
path: root/sshconnect2.c
diff options
context:
space:
mode:
Diffstat (limited to 'sshconnect2.c')
-rw-r--r--sshconnect2.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/sshconnect2.c b/sshconnect2.c
index e58d078c4..8b2e633c0 100644
--- a/sshconnect2.c
+++ b/sshconnect2.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: sshconnect2.c,v 1.160 2006/08/03 03:34:42 deraadt Exp $ */ 1/* $OpenBSD: sshconnect2.c,v 1.161 2006/08/18 13:54:54 djm Exp $ */
2/* 2/*
3 * Copyright (c) 2000 Markus Friedl. All rights reserved. 3 * Copyright (c) 2000 Markus Friedl. All rights reserved.
4 * 4 *
@@ -508,25 +508,18 @@ userauth_gssapi(Authctxt *authctxt)
508 508
509 /* Check to see if the mechanism is usable before we offer it */ 509 /* Check to see if the mechanism is usable before we offer it */
510 while (mech < gss_supported->count && !ok) { 510 while (mech < gss_supported->count && !ok) {
511 if (gssctxt)
512 ssh_gssapi_delete_ctx(&gssctxt);
513 ssh_gssapi_build_ctx(&gssctxt);
514 ssh_gssapi_set_oid(gssctxt, &gss_supported->elements[mech]);
515
516 /* My DER encoding requires length<128 */ 511 /* My DER encoding requires length<128 */
517 if (gss_supported->elements[mech].length < 128 && 512 if (gss_supported->elements[mech].length < 128 &&
518 !GSS_ERROR(ssh_gssapi_import_name(gssctxt, 513 ssh_gssapi_check_mechanism(&gssctxt,
519 authctxt->host))) { 514 &gss_supported->elements[mech], authctxt->host)) {
520 ok = 1; /* Mechanism works */ 515 ok = 1; /* Mechanism works */
521 } else { 516 } else {
522 mech++; 517 mech++;
523 } 518 }
524 } 519 }
525 520
526 if (!ok) { 521 if (!ok)
527 ssh_gssapi_delete_ctx(&gssctxt);
528 return 0; 522 return 0;
529 }
530 523
531 authctxt->methoddata=(void *)gssctxt; 524 authctxt->methoddata=(void *)gssctxt;
532 525