Skip Menu |
 

Download (untitled) / with headers
text/plain 3.8KiB
From kenh@cmf.nrl.navy.mil Fri Oct 24 17:19:41 1997
Received: from MIT.EDU (PACIFIC-CARRIER-ANNEX.MIT.EDU [18.69.0.28]) by rt-11.MIT.EDU (8.7.5/8.7.3) with SMTP id RAA23525 for <bugs@RT-11.MIT.EDU>; Fri, 24 Oct 1997 17:19:40 -0400
Received: from ginger.cmf.nrl.navy.mil by MIT.EDU with SMTP
id AA04730; Fri, 24 Oct 97 17:19:36 EDT
Received: from elvis.cmf.nrl.navy.mil (kenh@elvis.cmf.nrl.navy.mil [134.207.10.38])
by ginger.cmf.nrl.navy.mil (8.8.5/8.8.5) with ESMTP id RAA25774
for <krb5-bugs@mit.edu>; Fri, 24 Oct 1997 17:19:02 -0400 (EDT)
Received: (from kenh@localhost)
by elvis.cmf.nrl.navy.mil (8.8.5/8.8.5) id RAA01026;
Fri, 24 Oct 1997 17:18:48 -0400 (EDT)
Message-Id: <199710242118.RAA01026@elvis.cmf.nrl.navy.mil>
Date: Fri, 24 Oct 1997 17:18:48 -0400 (EDT)
From: Ken Hornstein <kenh@cmf.nrl.navy.mil>
Reply-To: kenh@cmf.nrl.navy.mil
To: krb5-bugs@MIT.EDU
Subject: The Win32 code doesn't work if your local machine is multihomed
X-Send-Pr-Version: 3.99

Show quoted text
>Number: 484
>Category: krb5-libs
>Synopsis: krb5_crypto_os_localaddr() doesn't support multihomed Win32 machines
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: krb5-unassigned
>State: open
>Class: sw-bug
>Submitter-Id: unknown
>Arrival-Date: Fri Oct 24 17:20:00 EDT 1997
>Last-Modified:
>Originator: Ken Hornstein
>Organization:
Navel Research Lab

Show quoted text
>Release: krb5-current
>Environment:

System: Windows 95
Architecture: win32

Show quoted text
>Description:

The calls to krb5_crypto_os_localaddr() that do the magic for Win32 machines
don't handle multihomed machines. So, depending on the address list you get
back, you might not be able to use Kerberos.
Show quoted text
>How-To-Repeat:

Try Kerberos on a multihomed NT box.
Show quoted text
>Fix:

--- lib/crypto/os/c_localaddr.c.orig Fri Oct 24 14:34:02 1997
+++ lib/crypto/os/c_localaddr.c Fri Oct 24 16:45:02 1997
@@ -294,11 +294,7 @@
krb5_crypto_os_localaddr (krb5_address ***addr) {
char host[64]; /* Name of local machine */
struct hostent *hostrec;
- int err;
-
- *addr = calloc (2, sizeof (krb5_address *));
- if (*addr == NULL)
- return ENOMEM;
+ int err, i;

#ifdef HAVE_MACSOCK_H
hostrec = getmyipaddr();
@@ -323,26 +319,45 @@
}
#endif /* HAVE_MACSOCK_H */

- (*addr)[0] = calloc (1, sizeof(krb5_address));
- if ((*addr)[0] == NULL) {
- free (*addr);
- return ENOMEM;
- }
- (*addr)[0]->magic = KV5M_ADDRESS;
- (*addr)[0]->addrtype = hostrec->h_addrtype;
- (*addr)[0]->length = hostrec->h_length;
- (*addr)[0]->contents = (unsigned char *)malloc((*addr)[0]->length);
- if (!(*addr)[0]->contents) {
- free((*addr)[0]);
- free(*addr);
+ /*
+ * Count the elements in the host address list
+ */
+
+ for (i = 0; hostrec->h_addr_list[i]; i++);
+
+ *addr = calloc ((i+1), sizeof (krb5_address *));
+ if (*addr == NULL)
return ENOMEM;
- } else {
- memcpy ((*addr)[0]->contents,
- hostrec->h_addr,
- (*addr)[0]->length);
+
+ for (i = 0; hostrec->h_addr_list[i]; i++) {
+ (*addr)[i] = calloc (1, sizeof(krb5_address));
+
+ if ((*addr)[i] == NULL)
+ goto nomem;
+
+ (*addr)[i]->magic = KV5M_ADDRESS;
+ (*addr)[i]->addrtype = hostrec->h_addrtype;
+ (*addr)[i]->length = hostrec->h_length;
+ (*addr)[i]->contents = (unsigned char *)malloc((*addr)[i]->length);
+
+ if (!(*addr)[i]->contents) {
+ goto nomem;
+ } else {
+ memcpy ((*addr)[i]->contents, hostrec->h_addr_list[i],
+ (*addr)[i]->length);
+ }
}
- /* FIXME, deal with the case where gethostent returns multiple addrs */

return(0);
+
+nomem:
+
+ for (i = 0; (*addr)[i]; i++) {
+ if ((*addr)[i]->contents)
+ free((*addr)[i]->contents);
+ free((*addr)[i]);
+ }
+ free(*addr);
+ return ENOMEM;
}
#endif
Show quoted text
>Audit-Trail:
>Unformatted:
Download (untitled) / with headers
text/plain 4.7KiB
From brezak@apollo.hp.com Tue Jul 22 13:49:24 1997
Received: from MIT.EDU (SOUTH-STATION-ANNEX.MIT.EDU [18.72.1.2]) by rt-11.MIT.EDU (8.7.5/8.7.3) with SMTP id NAA25837 for <bugs@RT-11.MIT.EDU>; Tue, 22 Jul 1997 13:49:19 -0400
Received: from relay.hp.com by MIT.EDU with SMTP
id AA20140; Tue, 22 Jul 97 13:49:12 EDT
Received: from it_750.ch.apollo.hp.com (it_750.ch.apollo.hp.com [15.22.48.2])
by relay.hp.com (8.8.5/8.8.5) with ESMTP id KAA02510
for <krb5-bugs@mit.edu>; Tue, 22 Jul 1997 10:49:11 -0700 (PDT)
Received: from tisbury.ch.apollo.hp.com by it_750.ch.apollo.hp.com
id AA096903749; Tue, 22 Jul 1997 13:49:09 -0400
Message-Id: <3.0.2.32.19970722134906.00c4de4c@pop-e3.ch.apollo.hp.com>
Date: Tue, 22 Jul 1997 13:49:06 -0400
From: John Brezak <brezak@apollo.hp.com>
To: krb5-bugs@MIT.EDU
Subject: krb5-nt-alhpa2 fix for multiple local addrs

Show quoted text
>Number: 447
>Category: krb5-libs
>Synopsis: krb5-nt-alpha2 fix for multiple local addrs
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: dalmeida
>State: open
>Class: sw-bug
>Submitter-Id: unknown
>Arrival-Date: Tue Jul 22 13:50:00 EDT 1997
>Last-Modified: Fri Sep 14 10:39:00 EDT 2001
>Originator: John Brezak <brezak@apollo.hp.com>
>Organization:
>Release:
>Environment:
>Description:
--=====================_869608146==_
Content-Type: text/plain; charset="us-ascii"

Here is fix for win32 to use all local addresses for the initial TGT request.


--=====================_869608146==_
Content-Type: text/plain; charset="us-ascii"
Content-Disposition: attachment; filename="c_localaddr.c.diff"

*** c_localaddr.c~ Wed Jun 12 06:15:12 1996
--- c_localaddr.c Tue Jul 22 02:34:46 1997
***************
*** 249,255 ****
krb5_crypto_os_localaddr (krb5_address ***addr) {
char host[64]; /* Name of local machine */
struct hostent *hostrec;
! int err;

*addr = calloc (2, sizeof (krb5_address *));
if (*addr == NULL)
--- 249,256 ----
krb5_crypto_os_localaddr (krb5_address ***addr) {
char host[64]; /* Name of local machine */
struct hostent *hostrec;
! int err, j;
! int count = 1;

*addr = calloc (2, sizeof (krb5_address *));
if (*addr == NULL)
***************
*** 270,294 ****
}
#endif /* HAVE_MACSOCK_H */

! (*addr)[0] = calloc (1, sizeof(krb5_address));
! if ((*addr)[0] == NULL) {
free (*addr);
return ENOMEM;
}
! (*addr)[0]->magic = KV5M_ADDRESS;
! (*addr)[0]->addrtype = hostrec->h_addrtype;
! (*addr)[0]->length = hostrec->h_length;
! (*addr)[0]->contents = (unsigned char *)malloc((*addr)[0]->length);
! if (!(*addr)[0]->contents) {
! free((*addr)[0]);
free(*addr);
return ENOMEM;
} else {
! memcpy ((*addr)[0]->contents,
! hostrec->h_addr,
(*addr)[0]->length);
}
! /* FIXME, deal with the case where gethostent returns multiple addrs */

return(0);
}
--- 271,309 ----
}
#endif /* HAVE_MACSOCK_H */

! /*printf("hostname=\"%s\"\n", host);*/
!
! for (j = 0; hostrec->h_addr_list[j]; j++) {
!
! /*printf("\t[%d > %d] ", j, count);*/
!
! if (j >= count) {
! *addr = realloc (*addr, (++count+1) * sizeof (krb5_address *));
! if (*addr == NULL)
! return ENOMEM;
! (*addr)[count] = NULL;
! }
!
! (*addr)[j] = calloc (1, sizeof(krb5_address));
! if ((*addr)[j] == NULL) {
free (*addr);
return ENOMEM;
}
! (*addr)[j]->magic = KV5M_ADDRESS;
! (*addr)[j]->addrtype = hostrec->h_addrtype;
! (*addr)[j]->length = hostrec->h_length;
! (*addr)[j]->contents = (unsigned char *)malloc((*addr)[j]->length);
! if (!(*addr)[j]->contents) {
! free((*addr)[j]);
free(*addr);
return ENOMEM;
} else {
! memcpy ((*addr)[j]->contents,
! hostrec->h_addr_list[j],
(*addr)[0]->length);
}
! /*printf("%s\n", inet_ntoa(*(struct in_addr *)((*addr)[j]->contents)));*/
! }

return(0);
}

--=====================_869608146==_
Content-Type: text/plain; charset="us-ascii"



=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
John Brezak Internet: brezak@ch.hp.com
Hewlett Packard/Apollo Phone: (508) 436-4915
300 Apollo Drive Fax: (508) 436-5140
Chelmsford, Massachusetts, USA

--=====================_869608146==_--

Show quoted text
>How-To-Repeat:
>Fix:
>Audit-Trail:

Responsible-Changed-From-To: gnats-admin->dalmeida
Responsible-Changed-By: raeburn
Responsible-Changed-When: Tue Jul 6 20:12:33 1999
Responsible-Changed-Why:

Windows patch from John Brezak, to get all addresses of the local
machine. Looks like some attention is needed for cleaning up in the
ENOMEM case.

Show quoted text
>Unformatted:
Subject: krb5-nt-alpha2 fix for multiple local addrs
c_localaddr.c gone; current localaddr.c win32 support does copy all
addresses; fixed by dalmeida for 1.1 and pre-1.2 trunk
Subject: krb5_crypto_os_localaddr() doesn't support multihomed Win32 machines
fixed by dalmeida for 1.1; see also ticket 447