]> andersk Git - gssapi-openssh.git/commitdiff
bug fix from Dan Kouril: return GSS_LAST_ENTRY if no matching mechanism found
authorjbasney <jbasney>
Fri, 2 Aug 2002 19:36:35 +0000 (19:36 +0000)
committerjbasney <jbasney>
Fri, 2 Aug 2002 19:36:35 +0000 (19:36 +0000)
openssh/gss-genr.c

index 511a1830c3405cfaa673f0be5d83f7469a566d92..5dbd8b50ac09935f3198426a00bf17d4fe1ba47f 100644 (file)
@@ -196,13 +196,14 @@ void ssh_gssapi_set_oid(Gssctxt *ctx, gss_OID oid) {
 enum ssh_gss_id ssh_gssapi_get_ctype(Gssctxt *ctxt) {
        enum ssh_gss_id i=0;
        
-       while(supported_mechs[i].name!=NULL &&
-               supported_mechs[i].oid.length != ctxt->oid->length &&
-               (memcmp(supported_mechs[i].oid.elements,
-                      ctxt->oid->elements,ctxt->oid->length) !=0)) {
+       while(supported_mechs[i].name!=NULL) {
+          if (supported_mechs[i].oid.length == ctxt->oid->length &&
+              (memcmp(supported_mechs[i].oid.elements,
+                      ctxt->oid->elements,ctxt->oid->length) == 0))
+              return i;
           i++;
        }
-       return(i);
+       return(GSS_LAST_ENTRY);
 }
 
 /* Set the GSS context's OID to the oid indicated by the given key exchange
This page took 0.033056 seconds and 5 git commands to generate.