* kdc_preauth.c (get_etype_info): Initialize length of
authorEzra Peisach <epeisach@mit.edu>
Tue, 17 Oct 2000 23:03:59 +0000 (23:03 +0000)
committerEzra Peisach <epeisach@mit.edu>
Tue, 17 Oct 2000 23:03:59 +0000 (23:03 +0000)
etype_info_entry to KRB5_ETYPE_NO_SALT. Before copying salt into
etype_info_entry, test that salt length (from get_salt_from_key())
is not SALT_TYPE_NO_LENGTH.

* kdc_util.c (get_salt_from_key): Initialize salt type to
SALT_TYPE_NO_LENGTH (instead of -1).

* network.c (process_packet): Cast length in sendto() call to int.

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

src/kdc/ChangeLog
src/kdc/kdc_preauth.c
src/kdc/kdc_util.c
src/kdc/network.c

index 70a7fd17ca8647374269f28a48ec979dc1d0d7d8..942da4062b8aa34f88a5b659bf3a573a337788a2 100644 (file)
@@ -1,3 +1,15 @@
+2000-10-17  Ezra Peisach  <epeisach@mit.edu>
+
+       * kdc_preauth.c (get_etype_info): Initialize length of
+       etype_info_entry to KRB5_ETYPE_NO_SALT. Before copying salt into
+       etype_info_entry, test that salt length (from get_salt_from_key())
+       is not SALT_TYPE_NO_LENGTH.
+
+       * kdc_util.c (get_salt_from_key): Initialize salt type to
+       SALT_TYPE_NO_LENGTH (instead of -1).
+
+       * network.c (process_packet): Cast length in sendto() call to int. 
+
 2000-10-06  Tom Yu  <tlyu@mit.edu>
 
        * kerberos_v4.c (kerb_get_principal): Modify to take a pointer to
index 41152f2f64ea4fd0b612c84dc35c7403e126fc79..759a480c618efc125eda059a04a9e7997992121e 100644 (file)
@@ -549,13 +549,13 @@ get_etype_info(context, request, client, server, pa_data)
            entry[i+1] = 0;
            entry[i]->magic = KV5M_ETYPE_INFO_ENTRY;
            entry[i]->etype = db_etype;
-           entry[i]->length = -1;
+           entry[i]->length = KRB5_ETYPE_NO_SALT;
            entry[i]->salt = 0;
            retval = get_salt_from_key(context, request->client,
                                       client_key, &salt);
            if (retval)
                goto cleanup;
-           if (salt.length >= 0) {
+           if (salt.length >= 0 && salt.length != SALT_TYPE_NO_LENGTH) {
                entry[i]->length = salt.length;
                entry[i]->salt = salt.data;
                salt.data = 0;
index e2c73a0f8ff1e50cdbf80459553eb9222e0b8cb8..3660ff552870cf843bc7851d9d07a24851abe063 100644 (file)
@@ -1476,7 +1476,7 @@ get_salt_from_key(context, client, client_key, salt)
     krb5_data *                        realm;
     
     salt->data = 0;
-    salt->length = -1;
+    salt->length = SALT_TYPE_NO_LENGTH;
     
     if (client_key->key_data_ver == 1)
        return 0;
index a91fc95b89a4b7d57c2a6c085083d9f2c5d6dacd..1f4cc1dc385ccca39e34fb8f538f8bf2053dbef9 100644 (file)
@@ -468,7 +468,7 @@ void process_packet(port_fd, prog, portnum)
        com_err(prog, retval, "while dispatching");
        return;
     }
-    cc = sendto(port_fd, response->data, response->length, 0,
+    cc = sendto(port_fd, response->data, (int) response->length, 0,
                (struct sockaddr *)&saddr, saddr_len);
     if (cc == -1) {
        char addrbuf[46];