Issue 1120 - Kerberos V4 SASL patches (server AND client)
Summary: Kerberos V4 SASL patches (server AND client)
Status: VERIFIED FIXED
Alias: None
Product: OpenLDAP
Classification: Unclassified
Component: contrib (show other issues)
Version: unspecified
Hardware: All All
: --- normal
Target Milestone: ---
Assignee: OpenLDAP project
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-04-18 21:17 UTC by ses@unc.edu
Modified: 2014-08-01 21:05 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description ses@unc.edu 2001-04-18 21:17:26 UTC
Full_Name: Simon Spero
Version: -current
OS: OpenBSD
URL: ftp://ftp.openldap.org/incoming/
Submission from: (NULL) (152.2.246.198)


FUrther to previous report (1106), patches now available for client and server
in 
http://www.ibilio.org/ses/kerberos/

Simon
Comment 1 Kurt Zeilenga 2001-04-23 05:46:46 UTC
moved from Incoming to Contrib
Comment 2 Kurt Zeilenga 2001-05-03 01:31:29 UTC
If I recall your patch correctly (the URL provided is bad), the
changes are not portable across all protocol/address families.

Kurt 
Comment 3 Kurt Zeilenga 2001-05-03 01:31:40 UTC
changed state Open to Suspended
Comment 4 Kurt Zeilenga 2001-05-03 01:31:50 UTC
moved from Contrib to Software Bugs
Comment 5 ses@unc.edu 2001-05-03 03:35:27 UTC
 > If I recall your patch correctly (the URL provided is bad), the
 > changes are not portable across all protocol/address families.


In my working copy I'm checking for AF_INET in the result and only 
setting
addresses if it is really a V4 address. I've got a sinking feeling this
wasn't the version I took the patches from.  That version is correct,
since IP_REMOTE and IP_LOCAL are defined to be always be IPV4 addresses.
This breaks portability if there is no IPV4 support on the machine, but 
at
the moment this is assumed in a lot of places in the code.

  [ doh- just tried to get the right patches, and lost connectivity to 
UNC.
I'll mail you the patches when telocity decides to start routing to UNC
again - sample that hadn't scrolled out of the terminal buffer:
 >               struct sockaddr_in sin;
 >               int l;
 >               l = sizeof(sin);
 >               if(getsockname(lc->lconn_sb->sb_fd,(struct 
sockaddr*)&sin,&l)==
0 &&
 >                  sin.sin_family == AF_INET) {
 >                       sasl_setprop(ctx,SASL_IP_LOCAL, (void*)&sin);
 >               } ].

There are a few correct behaviours available. The approach I'm using will
work on IPV4 connections which have the kerberos4 plugin installed, and
does nothing with IPV6 connections.

This still isn't completely correct - I need to prevent the negotiation
mechanism from offering or picking KERBEROS_V4 in SASL negotiation over a
V6 connection, since KERBEROS_V4 is only defined for IPV4, and  
KERBEROS_V4 cannot be offered unless IP_REMOTE and IP_LOCAL are set.

slap_sasl_mechs has the Connection, so this is a pretty easy fix; ought 
to check in slap_sasl_bind just in case someone decides to try 
kerberos_v4 even when it isn't offered (not that this gains them 
anything).   Client side needs to strip KERBEROS_V4 before calling 
sasl_client_start - socket is available in ldap_int_sasl_bind before 
this point so it's also a clean change.

If I could connect I would have already made this changes :-)

Do this make you feel any more comfortable?

Simon
p.s.
  With these changes in place, openldap interoperates beautifully with 
JNDI and kerberos sasl

Comment 6 ses@unc.edu 2001-05-03 04:00:54 UTC
 > If I recall your patch correctly (the URL provided is bad), the
 > changes are not portable across all protocol/address families.


In my working copy I'm checking for AF_INET in the result and only 
setting
addresses if it is really a V4 address. I've got a sinking feeling this
wasn't the version I took the patches from.  That version is correct,
since IP_REMOTE and IP_LOCAL are defined to be always be IPV4 addresses.
This breaks portability if there is no IPV4 support on the machine, but 
at
the moment this is assumed in a lot of places in the code.

  [ doh- just tried to get the right patches, and lost connectivity to 
UNC.
I'll mail you the patches when telocity decides to start routing to UNC
again - sample that hadn't scrolled out of the terminal buffer:
 >               struct sockaddr_in sin;
 >               int l;
 >               l = sizeof(sin);
 >               if(getsockname(lc->lconn_sb->sb_fd,(struct 
sockaddr*)&sin,&l)==
0 &&
 >                  sin.sin_family == AF_INET) {
 >                       sasl_setprop(ctx,SASL_IP_LOCAL, (void*)&sin);
 >               } ].

There are a few correct behaviours available. The approach I'm using will
work on IPV4 connections which have the kerberos4 plugin installed, and
does nothing with IPV6 connections.

This still isn't completely correct - I need to prevent the negotiation
mechanism from offering or picking KERBEROS_V4 in SASL negotiation over a
V6 connection, since KERBEROS_V4 is only defined for IPV4, and  
KERBEROS_V4 cannot be offered unless IP_REMOTE and IP_LOCAL are set.

slap_sasl_mechs has the Connection, so this is a pretty easy fix; ought 
to check in slap_sasl_bind just in case someone decides to try 
kerberos_v4 even when it isn't offered (not that this gains them 
anything).   Client side needs to strip KERBEROS_V4 before calling 
sasl_client_start - socket is available in ldap_int_sasl_bind before 
this point so it's also a clean change.

If I could connect I would have already made this changes :-)

Do this make you feel any more comfortable?

Simon
p.s.
  With these changes in place, openldap interoperates beautifully with 
JNDI and kerberos sasl

Comment 7 Kurt Zeilenga 2001-05-03 05:28:38 UTC
At 08:53 PM 5/2/01, ses@unc.edu wrote:
>Do this make you feel any more comfortable?

My primary concern is for the code to only set the parameters
when IPv4 is used.  As far as the other issues, I assume only
those who care to use KERBEROS_IV will install the mechanisms.
As far as issue of when it should be chosen or not is actual
best done by Cyrus SASL.

BTW, I assume you are aware of the Cyrus KRB4_IGNORE_IP_ADDRESS
flag.

Kurt

Comment 8 ses@unc.edu 2001-05-03 15:02:43 UTC

"Kurt D. Zeilenga" wrote:

> At 08:53 PM 5/2/01, ses@unc.edu wrote:
> >Do this make you feel any more comfortable?
>
> My primary concern is for the code to only set the parameters when
> IPv4 is used.

> As far as the other issues, I assume only those who care to use
> KERBEROS_IV will install the mechanisms. As far as issue of when it
> should be chosen or not is actual best done by Cyrus SASL.

That is the right place, but would require the library to insist that
all properties that might be to have already been set before listmechs
is called (which is reasonable, but is different from current behaviour,
which just requires them to be set before the mechanism is used). That
might be feasible (it wouldn't break cyrus-imapd).  I'll bounce it off
the cmu folks.

> BTW, I assume you are aware of the Cyrus KRB4_IGNORE_IP_ADDRESS

This doesn't knock out all the getprops of these fields - just one of
them :-(

Simon

Comment 9 Kurt Zeilenga 2001-05-12 17:54:18 UTC
moved from Software Bugs to Software Enhancements
Comment 10 Kurt Zeilenga 2001-06-07 05:11:28 UTC
moved from Software Enhancements to Contrib
Comment 11 Kurt Zeilenga 2001-12-06 23:59:02 UTC
changed notes
Comment 12 Kurt Zeilenga 2001-12-06 23:59:17 UTC
changed state Suspended to Feedback
Comment 13 Kurt Zeilenga 2002-06-20 21:39:56 UTC
changed notes
Comment 14 Kurt Zeilenga 2002-10-12 09:23:30 UTC
changed notes
changed state Feedback to Suspended
Comment 15 Kurt Zeilenga 2002-10-19 21:05:05 UTC
changed notes
changed state Suspended to Closed
Comment 16 Kurt Zeilenga 2002-10-31 08:39:05 UTC
changed notes
changed state Closed to Suspended
Comment 17 Howard Chu 2002-11-20 20:42:43 UTC
changed notes
changed state Suspended to Closed
Comment 18 Howard Chu 2003-12-12 22:46:04 UTC
moved from Contrib to Archive.Contrib
Comment 19 OpenLDAP project 2014-08-01 21:05:13 UTC
KerberosIV SASL works in HEAD and RE21.