+Wed Jun 17 16:35:37 1998 Tom Yu <tlyu@mit.edu>
+
+ * cnv_tkt_skey.c (krb524_convert_tkt_skey): Handle null address
+ fields; actually use saddr (the address from the UDP header) to
+ generate the ticket address rather than just checking against it.
+
+ * conv_creds.c (krb524_convert_creds_plain): Punt address checks.
+
1998-05-06 Theodore Ts'o <tytso@rsts-11.mit.edu>
* k524init.c (main): POSIX states that getopt returns -1
krb5_enc_tkt_part *v5etkt;
int ret, lifetime, deltatime;
krb5_timestamp server_time;
- krb5_address **caddr, *good_addr = 0;
+ struct sockaddr_in *sinp = (struct sockaddr_in *)saddr;
+ krb5_address kaddr;
v5tkt->enc_part2 = NULL;
if ((ret = krb5_decrypt_tkt_part(context, v5_skey, v5tkt))) {
return KRB5KRB_AP_ERR_TKT_NYV;
}
- for (caddr = v5etkt->caddrs; *caddr; caddr++) {
- if (v5etkt->caddrs[0]->addrtype == ADDRTYPE_INET) {
- if (! memcmp((*caddr)->contents, &saddr->sin_addr,
- sizeof(saddr->sin_addr))) {
- good_addr = *caddr;
- break;
- }
- else if (! good_addr) {
- good_addr = *caddr;
- }
- }
- }
-
- if (! good_addr) {
- if (krb524_debug)
- fprintf(stderr, "Invalid v5creds address information.\n");
- krb5_free_enc_tkt_part(context, v5etkt);
- v5tkt->enc_part2 = NULL;
- return KRB524_BADADDR;
+ kaddr.addrtype = ADDRTYPE_INET;
+ kaddr.length = sizeof(sinp->sin_addr);
+ kaddr.contents = (krb5_octet *)&sinp->sin_addr;
+
+ if (!krb5_address_search(context, &kaddr, v5etkt->caddrs)) {
+ if (krb524_debug)
+ fprintf(stderr, "Invalid v5creds address information.\n");
+ krb5_free_enc_tkt_part(context, v5etkt);
+ v5tkt->enc_part2 = NULL;
+ return KRB524_BADADDR;
}
-
+
if (krb524_debug)
printf("startime = %ld, authtime = %ld, lifetime = %ld\n",
(long) v5etkt->times.starttime,
pname,
pinst,
prealm,
- *((unsigned long *)good_addr->contents),
+ *((unsigned long *)kaddr.contents),
(char *) v5etkt->session->contents,
lifetime,
/* issue_data */
krb5_creds *v5creds;
CREDENTIALS *v4creds;
{
+#if 0
krb5_ui_4 addr;
+#endif
int ret;
krb5_timestamp lifetime;
((lifetime > 0xff) ? 0xff : lifetime);
v4creds->issue_date = v5creds->times.starttime;
+#if 0
/* XXX perhaps we should use the addr of the client host if */
/* v5creds contains more than one addr. Q: Does V4 support */
/* non-INET addresses? */
} else
memcpy((char *) &addr, v5creds->addresses[0]->contents,
sizeof(addr));
-
+#endif
return 0;
}