New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ipaldap: handle binary encoding option transparently #298
ipaldap: handle binary encoding option transparently #298
Conversation
Per RFC 4523, particular attribute syntaxes require use of the ';binary' attribute option. Attributes using these syntaxes include 'userCertificate' and 'cACertificate'. Our handling of this requirement is inconsistent with no library support (i.e. it was up to individual plugin authors to "do the right thing". Also, because 389 DS currently does not always use this encoding option (which is a defect), whether you need to read the 'userCertificate' or 'userCertificate;binary' attribute - or both - is often unclear. But technically, these both refer to the same attribute, because the 'binary' option does not specify an attribute subtype. This commit implements proper handling of the binary encoding option within ipaldap. Plugin code should now always use an attribute description *without* the binary encoding option, and allow ipaldap to automatically add it when sending attribute to the server, and strip it when reading attributes in search results. A follow-up commit will remove explicit use of the binary encoding option from code that uses ipaldap. Part of: https://fedorahosted.org/freeipa/ticket/6529
ipaldap now handles the binary encoding option automatically for those attribute types that require it. Avoid explicit use of this option in code that uses ipaldap. Fixes: https://fedorahosted.org/freeipa/ticket/6529
|
The binary transfer option is currently handled in code of the affected commands. The next layer below is Also note that the real bug in 389 DS is that it defines the attribute types to use octet string syntax, rather than the certificate syntax as defined in RFC 4523. It actually behaves correctly, not enforcing the binary transfer option on attribute types with octet string syntax. |
|
@jcholast I disagree. If This would also avoid inconsistent handling of relevant attributes between different plugins, which is the situation we currently have. But apart from the inconsisency (which is a nusiance) we have a bigger problem - in several plugins we specifically try to read
389DS does not behave correctly; it's treatment of |
No, it should respect whatever is defined on the server, otherwise it's not a generic LDAP client. If the server does something wrong, it has to be fixed there, on the server. The goal of
Nowhere in the RFCs is it mandated that a compliant client cannot request the attributes without the option, nor that it must not accept the attributes without the option in server responses. If this was true, it would have to be fixed in OpenLDAP libs anyway, not in
The part where you implicitly add the binary transfer option to attribute names (although not mandated on clients by any RFC) without knowing how the attribute types are defined on the server (although mandated only on attribute types with the certificate syntax by RFC 4523) .
This is because of historical reasons (the original implementation of
We can easily fix the plugins to read from
Not enforcing |
|
OK, let's just fix all the plugins / other routines that deal with the relevant attributes to explicitly read both |
This patchset addresses
https://fedorahosted.org/freeipa/ticket/6529. I'm publishing it for
discussion and review but it should not be hastily merged because
there are compatibility implications for older server versions
(discussed in https://fedorahosted.org/freeipa/ticket/6530).
Per RFC 4523, particular attribute syntaxes require use of the
';binary' attribute option. Attributes using these syntaxes include
'userCertificate' and 'cACertificate'. Our handling of this requirement is
inconsistent with no library support (i.e. it was up to individual plugin
authors to "do the right thing".
Also, because 389 DS currently does not always use this encoding option
(which is a defect), whether you need to read the
'userCertificate' or 'userCertificate;binary' attribute - or both - is
often unclear. But technically, these both refer to the same attribute,
because the 'binary' option does not specify an attribute subtype.
This commit implements proper handling of the binary encoding option within
ipaldap. Plugin code should now always use an attribute description
without the binary encoding option, and allow ipaldap to automatically
add it when sending attribute to the server, and strip it when reading
attributes in search results.