OpenBSD CVS

CVS log for src/usr.bin/ldap/Attic/ber.c


[BACK] Up to [local] / src / usr.bin / ldap

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.23, Sat May 11 17:46:02 2019 UTC (5 years ago) by rob
Branch: MAIN
CVS Tags: HEAD
Changes since 1.22: +1 -1 lines
FILE REMOVED

The BER API is currently used by ldap, ldapd, ldapctl, ypldap, snmpd, and
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@

Revision 1.22 / (download) - annotate - [select for diffs], Sat Apr 27 14:58:14 2019 UTC (5 years ago) by rob
Branch: MAIN
Changes since 1.21: +4 -3 lines
Diff to previous 1.21 (colored)

Only apply sign extension when less than eight bytes have been consumed. This
fixes a problem when handling large negative integers.

ok claudio@

Revision 1.21 / (download) - annotate - [select for diffs], Tue Nov 27 12:04:57 2018 UTC (5 years, 5 months ago) by martijn
Branch: MAIN
CVS Tags: OPENBSD_6_5_BASE, OPENBSD_6_5
Changes since 1.20: +23 -1 lines
Diff to previous 1.20 (colored)

LDAP returns values as OCTET STRINGs, which can be LDAPStrings, but isn't
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@

Revision 1.20 / (download) - annotate - [select for diffs], Tue Nov 20 07:20:21 2018 UTC (5 years, 5 months ago) by martijn
Branch: MAIN
Changes since 1.19: +3 -1 lines
Diff to previous 1.19 (colored)

Fix when ber_free_elements is called with a NULL-value.
Found via snmpctl snmp walk 127.0.0.1 oid 1

OK claudio@

Revision 1.19 / (download) - annotate - [select for diffs], Sun Aug 12 22:04:09 2018 UTC (5 years, 9 months ago) by rob
Branch: MAIN
CVS Tags: OPENBSD_6_4_BASE, OPENBSD_6_4
Changes since 1.18: +2 -2 lines
Diff to previous 1.18 (colored)

Change ber_write_elements() to return ssize_t instead of int.

ok claudio@

Revision 1.18 / (download) - annotate - [select for diffs], Fri Aug 3 01:51:28 2018 UTC (5 years, 9 months ago) by rob
Branch: MAIN
Changes since 1.17: +11 -2 lines
Diff to previous 1.17 (colored)

Place a limit on the number of elements in a ber sequence/set. This prevents
possible stack overflow due to recursion in ber_free_elements().

ok claudio@

Revision 1.17 / (download) - annotate - [select for diffs], Tue Jul 31 19:38:09 2018 UTC (5 years, 9 months ago) by rob
Branch: MAIN
Changes since 1.16: +63 -63 lines
Diff to previous 1.16 (colored)

Relocate some public functions above the internal functions comment.

ok claudio@

Revision 1.16 / (download) - annotate - [select for diffs], Tue Jul 31 11:37:18 2018 UTC (5 years, 9 months ago) by rob
Branch: MAIN
Changes since 1.15: +2 -2 lines
Diff to previous 1.15 (colored)

Fix some debugging output now that ber type and encoding are unsigned int.

ok claudio@

Revision 1.15 / (download) - annotate - [select for diffs], Tue Jul 31 11:02:01 2018 UTC (5 years, 9 months ago) by claudio
Branch: MAIN
Changes since 1.14: +16 -16 lines
Diff to previous 1.14 (colored)

Make ber type and encoding a unsigned int instead of unsigned long.
This way the size is the same on all archs and 32bit should be good enough.
OK rob@

Revision 1.14 / (download) - annotate - [select for diffs], Fri Jul 13 08:50:38 2018 UTC (5 years, 10 months ago) by rob
Branch: MAIN
Changes since 1.13: +5 -5 lines
Diff to previous 1.13 (colored)

Fix some comments referencing sockets which are not used by the ber api. The
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

Revision 1.13 / (download) - annotate - [select for diffs], Fri Jul 13 08:30:10 2018 UTC (5 years, 10 months ago) by rob
Branch: MAIN
Changes since 1.12: +5 -6 lines
Diff to previous 1.12 (colored)

Fix loop condition in ber.c. Discussed with claudio.

ok claudio@, jca@

Revision 1.12 / (download) - annotate - [select for diffs], Mon Jul 9 09:21:26 2018 UTC (5 years, 10 months ago) by jca
Branch: MAIN
Changes since 1.11: +16 -36 lines
Diff to previous 1.11 (colored)

Simplify ber_read()

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@

Revision 1.11 / (download) - annotate - [select for diffs], Wed Jul 4 15:21:24 2018 UTC (5 years, 10 months ago) by rob
Branch: MAIN
Changes since 1.10: +2 -4 lines
Diff to previous 1.10 (colored)

More whitespace.

Revision 1.10 / (download) - annotate - [select for diffs], Wed Jul 4 13:31:57 2018 UTC (5 years, 10 months ago) by rob
Branch: MAIN
Changes since 1.9: +2 -2 lines
Diff to previous 1.9 (colored)

Cleanup some whitespace.

Revision 1.9 / (download) - annotate - [select for diffs], Wed Jul 4 13:04:30 2018 UTC (5 years, 10 months ago) by rob
Branch: MAIN
Changes since 1.8: +4 -8 lines
Diff to previous 1.8 (colored)

Relocate the update of br_offs from ber_read() to ber_readbuf() so ber_getc()
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@

Revision 1.8 / (download) - annotate - [select for diffs], Tue Jul 3 18:49:10 2018 UTC (5 years, 10 months ago) by rob
Branch: MAIN
Changes since 1.7: +62 -3 lines
Diff to previous 1.7 (colored)

Synchronize ber changes from the snmpd instance to ldap, ldapd, and ypldap.

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@

Revision 1.7 / (download) - annotate - [select for diffs], Sun Jul 1 20:03:48 2018 UTC (5 years, 10 months ago) by rob
Branch: MAIN
Changes since 1.6: +2 -2 lines
Diff to previous 1.6 (colored)

s/constructive/constructed in DPRINTF output.

Revision 1.6 / (download) - annotate - [select for diffs], Fri Jun 29 18:28:41 2018 UTC (5 years, 10 months ago) by rob
Branch: MAIN
Changes since 1.5: +2 -2 lines
Diff to previous 1.5 (colored)

Consistent use of copyright notices.

Ok reyk@

Revision 1.5 / (download) - annotate - [select for diffs], Fri Jun 29 15:18:03 2018 UTC (5 years, 10 months ago) by rob
Branch: MAIN
Changes since 1.4: +21 -8 lines
Diff to previous 1.4 (colored)

Synchronize ber.c and ber.h across ldap, ldapd, and ypldap, and reduce diff
with snmpd. More tweaks to come once things are fully synchronized.

Feedback from claudio and Robert Klein.

Ok claudio@

Revision 1.4 / (download) - annotate - [select for diffs], Wed Jun 27 20:38:10 2018 UTC (5 years, 10 months ago) by rob
Branch: MAIN
Changes since 1.3: +3 -3 lines
Diff to previous 1.3 (colored)

Synchronize some comments.

Revision 1.3 / (download) - annotate - [select for diffs], Wed Jun 27 20:11:27 2018 UTC (5 years, 10 months ago) by rob
Branch: MAIN
Changes since 1.2: +2 -2 lines
Diff to previous 1.2 (colored)

Consistent use of calloc in ber.c.

Ok claudio@, "looks right" gsoares@

Revision 1.2 / (download) - annotate - [select for diffs], Wed Jun 27 13:22:17 2018 UTC (5 years, 10 months ago) by rob
Branch: MAIN
Changes since 1.1: +3 -2 lines
Diff to previous 1.1 (colored)

Synchronize correct processing of BER_TYPE_EOC. Fixes support for empty LDAP
passwords. A similar fix was applied to snmpd in 2010 (rev 1.23).

Pointers from Reyk.

Ok claudio@

Revision 1.1.1.1 / (download) - annotate - [select for diffs] (vendor branch), Wed Jun 13 15:45:57 2018 UTC (5 years, 11 months ago) by reyk
Branch: reyk
CVS Tags: ldap_20180613
Changes since 1.1: +0 -0 lines
Diff to previous 1.1 (colored)

Import ldap(1), a simple ldap search client.

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@

Revision 1.1 / (download) - annotate - [select for diffs], Wed Jun 13 15:45:57 2018 UTC (5 years, 11 months ago) by reyk
Branch: MAIN

Initial revision

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.