* kerberos_v4.c (kerberos_v4): Fix bug where krb_create_ticket()
authorTom Yu <tlyu@mit.edu>
Fri, 30 Apr 1999 04:09:15 +0000 (04:09 +0000)
committerTom Yu <tlyu@mit.edu>
Fri, 30 Apr 1999 04:09:15 +0000 (04:09 +0000)
was getting called for an APPL_REQUEST even when there was no
single-DES key, resulting in random weirdness.

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

src/kdc/ChangeLog
src/kdc/kerberos_v4.c

index 398b55e471bc72aa4bef4385d78f34d3361f94c9..f05b0d7963f1bb2988848cd6c7f9342d326592d4 100644 (file)
@@ -1,3 +1,9 @@
+Fri Apr 30 00:05:07 1999  Tom Yu  <tlyu@mit.edu>
+
+       * kerberos_v4.c (kerberos_v4): Fix bug where krb_create_ticket()
+       was getting called for an APPL_REQUEST even when there was no
+       single-DES key, resulting in random weirdness.
+
 Wed Feb 17 17:07:43 1999  Tom Yu  <tlyu@mit.edu>
 
        * do_as_req.c (process_as_req): Fix to assign kvno to
index a1efd8b3759b9165324588a45f5badfed5459d51..4dbd4252c05dce91e27111ee5a31df231c632ddb 100644 (file)
@@ -885,11 +885,22 @@ kerberos_v4(client, pkt)
            des_new_random_key(session_key);
 #endif
 
-           krb_create_ticket(tk, k_flags, ad->pname, ad->pinst,
-                             ad->prealm, client_host.s_addr,
-                             (char *) session_key, lifetime, kerb_time.tv_sec,
-                             s_name_data.name, s_name_data.instance,
-                             key);
+           if (K4KDC_ENCTYPE_OK(k5key.enctype)) {
+               krb_create_ticket(tk, k_flags, ad->pname, ad->pinst,
+                                 ad->prealm, client_host.s_addr,
+                                 (char *) session_key, lifetime,
+                                 kerb_time.tv_sec,
+                                 s_name_data.name, s_name_data.instance,
+                                 key);
+           } else {
+               krb_cr_tkt_krb5(tk, k_flags, ad->pname, ad->pinst,
+                               ad->prealm, client_host.s_addr,
+                               (char *) session_key, lifetime,
+                               kerb_time.tv_sec,
+                               s_name_data.name, s_name_data.instance,
+                               &k5key);
+           }
+           krb5_free_keyblock_contents(kdc_context, &k5key);
            memset(key, 0, sizeof(key));
            memset(key_s, 0, sizeof(key_s));