patch from Luke - fix enctype-nego enctype list setup
authorKen Raeburn <raeburn@mit.edu>
Sat, 17 Jan 2009 00:04:49 +0000 (00:04 +0000)
committerKen Raeburn <raeburn@mit.edu>
Sat, 17 Jan 2009 00:04:49 +0000 (00:04 +0000)
ticket: 6336

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21760 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/krb5/krb/mk_req_ext.c

index 4a9d03551f42582fea62e245003450e2c5d87aad..0d24017ee7bebcb615062e7e038248eedb81608b 100644 (file)
@@ -343,23 +343,15 @@ make_etype_list(krb5_context context,
     for (etypes.length = 0;
         etypes.etypes[etypes.length] != ENCTYPE_NULL;
         etypes.length++)
-       ;
-
-    /*
-     * RFC 4537:
-     *
-     *   If the enctype of the ticket session key is included in the enctype
-     *   list sent by the client, it SHOULD be the last on the list;
-     */
-    for (i = 0; i < etypes.length; i++) {
-       if (etypes.etypes[i] == tkt_enctype) {
-           krb5_enctype etype;
-
-           etype = etypes.etypes[etypes.length - 1];
-           etypes.etypes[etypes.length - 1] = tkt_enctype;
-           etypes.etypes[i] = etype;
+    {
+       /*
+        * RFC 4537:
+        *
+        *   If the enctype of the ticket session key is included in the enctype
+        *   list sent by the client, it SHOULD be the last on the list;
+        */
+       if (etypes.length && etypes.etypes[etypes.length - 1] == tkt_enctype)
            break;
-       }
     }
 
     code = encode_krb5_etype_list(&etypes, &enc_etype_list);