From: Ezra Peisach Date: Tue, 17 Oct 2000 23:03:59 +0000 (+0000) Subject: * kdc_preauth.c (get_etype_info): Initialize length of X-Git-Tag: krb5-1.3-alpha1~1816 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=28e4396f34ac3c8caa53b99dc219a8ee3eda412b;p=krb5.git * 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. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@12787 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/kdc/ChangeLog b/src/kdc/ChangeLog index 70a7fd17c..942da4062 100644 --- a/src/kdc/ChangeLog +++ b/src/kdc/ChangeLog @@ -1,3 +1,15 @@ +2000-10-17 Ezra Peisach + + * 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 * kerberos_v4.c (kerb_get_principal): Modify to take a pointer to diff --git a/src/kdc/kdc_preauth.c b/src/kdc/kdc_preauth.c index 41152f2f6..759a480c6 100644 --- a/src/kdc/kdc_preauth.c +++ b/src/kdc/kdc_preauth.c @@ -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; diff --git a/src/kdc/kdc_util.c b/src/kdc/kdc_util.c index e2c73a0f8..3660ff552 100644 --- a/src/kdc/kdc_util.c +++ b/src/kdc/kdc_util.c @@ -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; diff --git a/src/kdc/network.c b/src/kdc/network.c index a91fc95b8..1f4cc1dc3 100644 --- a/src/kdc/network.c +++ b/src/kdc/network.c @@ -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];