summaryrefslogtreecommitdiff
path: root/usr.bin/ldap
AgeCommit message (Collapse)Author
2022-03-31'e' is no longer an optional element for ober_scanf_elements.Martijn van Duren
This caused the last attribute to be dropped. Reported by Allan Streib (astreib <at> fastmail <dot> fm) Reminded by Raf Czlonka (rczlonka <at> gmail <dot> com) OK tb@ claudio@
2021-09-02rather than using sys/param.h, define a local replacement MINIMUM() insteadTheo de Raadt
of MIN(), as done elsewhere
2021-02-10some spacing/grammar fixes from dave voutila;Jason McIntyre
2019-10-24The ber_* namespace is used by liblber since time immemorial,Theo Buehler
so move our BER API to the unused ober_* prefix to avoid some breakage in ports. Problem diagnosed by jmatthew with ber_free() in samba, but there are many others as pointed out by sthen. tests & ok rob ok sthen (who had an almost identical diff for libutil) "go head hit it" deraadt
2019-09-10During libutil/ber.c r1.12 I made sure that every element that's requestedMartijn van Duren
by ber_scanf_elements must exist. aldap.c apparently abused the old behaviour by always trying to retrieve the referral element, which according to RFC4511 section 4.1.9 is optional. This diff only requests the referral element if we get a referral response. OK rob@
2019-05-11The BER API is currently used by ldap, ldapd, ldapctl, ypldap, snmpd, androb
snmpctl. Separate copies of ber.[ch] have existed and been maintained in sync in ldap, ldapd, ypldap and snmpd. This commit moves the BER API into /usr/lib/libutil. All current consumers already link libutil. ldapd and snmpd regress passes, and release builds. With help from tb@ and guenther@. ok deraadt@, tb@
2019-04-27Only apply sign extension when less than eight bytes have been consumed. Thisrob
fixes a problem when handling large negative integers. ok claudio@
2019-01-26avoid double free, instead flowing through a free(NULL)Theo de Raadt
from Ville Valkonen
2019-01-17rm a few more $Id which cannot be usefulTed Unangst
2018-11-29update for libtls default cert changes.Ted Unangst
bonus: this exposed a few missing const qualifiers.
2018-11-27LDAP returns values as OCTET STRINGs, which can be LDAPStrings, but isn'tMartijn van Duren
always the case. This caused some malformed output when querying databases returning data containing NUL-bytes. Fix this by also returning the actual size. With this diff we should produce basically identical output to openldap's ldapsearch. Lots of back and forths with claudio@ OK claudio@
2018-06-13Import ldap(1), a simple ldap search client.Reyk Floeter
We have an ldapd(8) server and ypldap in base, so it makes sense to have a simple LDAP client without depending on the OpenLDAP package. This tool can be used in an ssh(1) AuthorizedKeysCommand script. With feedback from many including millert@ schwarze@ gilles@ dlg@ jsing@ OK deraadt@
2018-11-20Fix when ber_free_elements is called with a NULL-value.Martijn van Duren
Found via snmpctl snmp walk 127.0.0.1 oid 1 OK claudio@
2018-11-07RFC2849 requires us to have 2 colons after the value-spec.Martijn van Duren
OK claudio@
2018-11-06Use TLS_CA_CERT_FILE instead of a separate define.Joel Sing
ok beck@ bluhm@ tb@
2018-11-06Fix base64 outlen calculation.Martijn van Duren
OK claudio@
2018-11-06Implement SAFE-INIT-CHAR.Martijn van Duren
OK claudio@
2018-10-23*** empty log message ***Martijn van Duren
2018-10-23Fix off by one when wrapping long LDIF lines.Martijn van Duren
OK reyk@
2018-08-12Change ber_write_elements() to return ssize_t instead of int.rob
ok claudio@
2018-08-03Place a limit on the number of elements in a ber sequence/set. This preventsrob
possible stack overflow due to recursion in ber_free_elements(). ok claudio@
2018-08-01Remove midsentence period.rob
2018-07-31Relocate some public functions above the internal functions comment.rob
ok claudio@
2018-07-31Fix some debugging output now that ber type and encoding are unsigned int.rob
ok claudio@
2018-07-31Make ber type and encoding a unsigned int instead of unsigned long.Claudio Jeker
This way the size is the same on all archs and 32bit should be good enough. OK rob@
2018-07-13Fix some comments referencing sockets which are not used by the ber api. Therob
api uses read and write buffers (byte streams) that are utilized by calling applications which may or may not use sockets. ok claudio@ buffer byte streams that applications then use for
2018-07-13Fix loop condition in ber.c. Discussed with claudio.rob
ok claudio@, jca@
2018-07-09Simplify ber_read()Jeremie Courreges-Anglas
After the removal of fd-based read/writes I could have trimmed the code further. - no socket-based reads so ber_read() doesn't need to loop until it gets the desired amount of data - return either the requested amount of data or -1/ECANCELED, the caller shouldn't have to handle partial reads itself - inline ber_readbuf() into ber_read() ok rob@ claudio@ tb@
2018-07-04More whitespace.rob
2018-07-04Cleanup some whitespace.rob
2018-07-04Relocate the update of br_offs from ber_read() to ber_readbuf() so ber_getc()rob
can call ber_readbuf() in all cases. This resolves a problem previously encountered with SNMPv3 authentication, simplifies the code, and completes a full synchronization of all ber instances. Proposed by claudio@. Problematic use case in snmpd tested by sthen@ and me. ldap(s) appear happy as well. looks good to claudio@
2018-07-04minor tweaks to improve readability;Jason McIntyre
ok rob reyk
2018-07-04Add HISTORY to ldap.1rob
Ok reyk@
2018-07-03Synchronize ber changes from the snmpd instance to ldap, ldapd, and ypldap.rob
See usr.sbin/snmpd/ber.c revision 1.24 commit log for a summary of these changes (e.g. SNMPv2 traps, User-based Security Model, callback for USM HMAC calculations). There is one final ber piece to copy from the snmpd instance related to ber_getc() which will be done in a separate diff. "looks good to me" deraadt@
2018-07-03- instead of trying to show a 100% accurate synopsis for -H, simplify itJason McIntyre
and add some explanatory text: originally from a diff proposed by matthew martin, with an adjusted text by him - while here, sync synopsis and usage(), and some other minor tweaks
2018-07-01s/constructive/constructed in DPRINTF output.rob
2018-06-29Consistent use of copyright notices.rob
Ok reyk@
2018-06-29Synchronize ber.c and ber.h across ldap, ldapd, and ypldap, and reduce diffrob
with snmpd. More tweaks to come once things are fully synchronized. Feedback from claudio and Robert Klein. Ok claudio@
2018-06-13Import ldap(1), a simple ldap search client.Reyk Floeter
We have an ldapd(8) server and ypldap in base, so it makes sense to have a simple LDAP client without depending on the OpenLDAP package. This tool can be used in an ssh(1) AuthorizedKeysCommand script. With feedback from many including millert@ schwarze@ gilles@ dlg@ jsing@ OK deraadt@
2018-06-27Synchronize some comments.rob
2018-06-27Consistent use of calloc in ber.c.rob
Ok claudio@, "looks right" gsoares@
2018-06-27Synchronize correct processing of BER_TYPE_EOC. Fixes support for empty LDAProb
passwords. A similar fix was applied to snmpd in 2010 (rev 1.23). Pointers from Reyk. Ok claudio@
2018-06-13Import ldap(1), a simple ldap search client.Reyk Floeter
We have an ldapd(8) server and ypldap in base, so it makes sense to have a simple LDAP client without depending on the OpenLDAP package. This tool can be used in an ssh(1) AuthorizedKeysCommand script. With feedback from many including millert@ schwarze@ gilles@ dlg@ jsing@ OK deraadt@
2018-06-26Allow to read the password from a file with -yReyk Floeter
Pointed out by Tim Chase OK rob@ gsoares@ jmc@
2018-06-13Import ldap(1), a simple ldap search client.Reyk Floeter
We have an ldapd(8) server and ypldap in base, so it makes sense to have a simple LDAP client without depending on the OpenLDAP package. This tool can be used in an ssh(1) AuthorizedKeysCommand script. With feedback from many including millert@ schwarze@ gilles@ dlg@ jsing@ OK deraadt@
2018-06-21Fix DEBUG messageReyk Floeter
2018-06-13Import ldap(1), a simple ldap search client.Reyk Floeter
We have an ldapd(8) server and ypldap in base, so it makes sense to have a simple LDAP client without depending on the OpenLDAP package. This tool can be used in an ssh(1) AuthorizedKeysCommand script. With feedback from many including millert@ schwarze@ gilles@ dlg@ jsing@ OK deraadt@
2018-06-17"filter" is optional; from matthew martinJason McIntyre
2018-06-13fix some formatting which groff was complaining about;Jason McIntyre
ok reyk
2018-06-13various tweaks;Jason McIntyre