• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

ACLH A D08-Jul-20051.2 KiB4627

FORMATH A D25-Apr-20084.3 KiB9982

GETTING.STARTEDH A D25-Apr-20082.4 KiB7151

MakefileH A D03-May-20227.9 KiB218179

READMEH A D25-Apr-20083.2 KiB7158

README.securityH A D19-Mar-2017440 139

RFCsH A D15-Apr-2002232 75

THANKSH A D19-Mar-2017675 2112

TODOH A D25-Apr-20081.9 KiB5741

acl.cH A D19-Mar-201712.4 KiB512429

acl.hH A D07-Dec-200596 107

aclsH A D19-Mar-2017406 1312

addindex.cH A D19-Mar-20179.8 KiB371342

alloca.hH A D03-May-20220 10

asn1.hH A D19-Mar-20179.7 KiB235114

asn1dump.cH A D15-Apr-2014375 2521

asn1oid.cH A D27-Sep-20115.7 KiB10187

auth.cH A D19-Mar-20171.1 KiB4442

auth.hH A D14-May-2002152 84

bindrequest.cH A D14-Jan-2002253 1311

bstr.hH A D25-Apr-2008404 138

bstr_diff.cH A D05-Feb-2004520 2724

bstr_diff2.cH A D25-Apr-2008502 3128

bstrfirst.cH A D08-Jul-2002117 75

bstrlen.cH A D25-Apr-2008169 97

bstrstart.cH A D25-Apr-2008110 75

dumpacls.cH A D19-Mar-20173.6 KiB123120

dumpidx.cH A D19-Mar-20173.6 KiB128122

fmt_asn1OID.cH A D28-Apr-2011469 1715

fmt_asn1bitstring.cH A D28-Apr-2011613 2017

fmt_asn1generic.cH A D07-May-20154.5 KiB158150

fmt_asn1int.cH A D25-Apr-2008387 129

fmt_asn1intpayload.cH A D25-Apr-2008369 2119

fmt_asn1length.cH A D25-Apr-2008527 2621

fmt_asn1sint.cH A D25-Apr-2008387 129

fmt_asn1sintpayload.cH A D25-Apr-2008424 2320

fmt_asn1string.cH A D25-Apr-2008312 119

fmt_asn1tag.cH A D19-Mar-2017426 1611

fmt_asn1tagint.cH A D28-Apr-2011307 1816

fmt_asn1transparent.cH A D25-Apr-2008287 118

fmt_ldapadl.cH A D19-Mar-2017694 3329

fmt_ldapava.cH A D19-Mar-2017222 108

fmt_ldapbindrequest.cH A D19-Mar-2017575 2118

fmt_ldapdeleterequest.cH A D19-Mar-2017179 97

fmt_ldapmessage.cH A D19-Mar-2017389 1311

fmt_ldappal.cH A D19-Mar-2017525 2418

fmt_ldapresult.cH A D19-Mar-2017604 2119

fmt_ldapsearchfilter.cH A D19-Mar-20172 KiB7252

fmt_ldapsearchfilterstring.cH A D19-Mar-20171.6 KiB7068

fmt_ldapsearchrequest.cH A D19-Mar-2017661 2220

fmt_ldapsearchresultentry.cH A D19-Mar-2017333 1210

fmt_ldapstring.cH A D19-Mar-2017126 64

fmt_tls_alert.cH A D07-May-2015169 118

fmt_tls_alert_pkt.cH A D07-May-2015235 1210

fmt_tls_clienthello.cH A D07-May-20151.7 KiB5248

fmt_tls_handshake_cert.cH A D08-May-2015312 1412

fmt_tls_handshake_certs_header.cH A D08-May-2015826 2919

fmt_tls_packet.cH A D07-May-2015280 1412

fmt_tls_serverhello.cH A D07-May-20155.3 KiB164119

fmt_tls_serverhellodone.cH A D08-May-2015168 97

free_ldapadl.cH A D16-Jul-2002186 118

free_ldappal.cH A D16-Jul-2002207 129

free_ldapsearchfilter.cH A D19-Mar-2017434 2321

free_ldapsearchresultentry.cH A D01-Apr-2005110 64

freeava.cH A D14-Jan-2002184 119

freefilter.cH A D14-Jan-2002325 1715

freepal.cH A D14-Jan-2002302 1614

idx2ldif.cH A D19-Mar-20172.3 KiB10689

init_tls_context.cH A D07-May-2015502 2017

ldap.hH A D19-Mar-20177.2 KiB222187

ldap_match_mapped.cH A D19-Mar-20175.1 KiB201177

ldap_match_sre.cH A D28-Jun-20074.1 KiB167154

ldapclient.cH A D19-Mar-20177.1 KiB279259

ldapclient_str.cH A D19-Mar-20173.9 KiB146137

ldapdelete.cH A D19-Mar-20173.1 KiB127113

ldif.hH A D03-May-2022930 3526

ldif_parse.cH A D25-Apr-20087.7 KiB328275

matchcaseprefix.cH A D05-Feb-2004477 2116

matchcasestring.cH A D25-Apr-2008469 2216

matchprefix.cH A D08-Jul-2002471 2116

matchstring.cH A D25-Apr-2008442 2216

md5password.cH A D25-Apr-2008709 3331

mduptab.hH A D25-Apr-2008764 2010

mduptab_add.cH A D25-Apr-2008607 2422

mduptab_adds.cH A D05-Feb-2004149 86

mduptab_init.cH A D14-Feb-2004142 86

mduptab_init_reuse.cH A D14-Feb-2004122 75

mduptab_reset.cH A D20-Apr-2008141 86

mstorage.hH A D25-Apr-2008788 3414

mstorage_add.cH A D22-Nov-20092.2 KiB8670

mstorage_add_bin.cH A D22-Nov-2009678 2922

mstorage_init.cH A D04-Feb-2004109 86

mstorage_init_persistent.cH A D05-Feb-2004472 2119

mstorage_unmap.cH A D25-Apr-2008395 2321

mysql2ldif.cH A D19-Mar-20173.6 KiB150140

normalize_dn.cH A D20-Apr-2008556 2723

parse.cH A D19-Mar-20179.3 KiB316213

printasn1.cH A D07-May-20153.4 KiB128117

scan_asn1BITSTRING.cH A D28-Apr-2011947 2823

scan_asn1BOOLEAN.cH A D25-Apr-2008416 1715

scan_asn1ENUMERATED.cH A D25-Apr-2008382 1614

scan_asn1INTEGER.cH A D25-Apr-2008319 1311

scan_asn1SEQUENCE.cH A D25-Apr-2008397 1513

scan_asn1SET.cH A D25-Apr-2008387 1513

scan_asn1STRING.cH A D25-Apr-2008334 1311

scan_asn1generic.cH A D07-May-20157.5 KiB280262

scan_asn1int.cH A D25-Apr-2008380 119

scan_asn1length.cH A D19-Mar-2017990 2925

scan_asn1oid.cH A D19-Mar-2017581 2218

scan_asn1rawint.cH A D19-Mar-2017722 2218

scan_asn1rawoid.cH A D25-Feb-2017936 4233

scan_asn1string.cH A D25-Apr-2008360 1311

scan_asn1tag.cH A D19-Mar-2017587 1813

scan_asn1tagint.cH A D15-Apr-2014436 1614

scan_certificate.cH A D07-May-201511.5 KiB394330

scan_ldapaddrequest.cH A D19-Mar-20172.5 KiB9686

scan_ldapava.cH A D19-Mar-2017296 119

scan_ldapbindrequest.cH A D19-Mar-2017515 1816

scan_ldapbindresponse.cH A D19-Mar-2017679 2422

scan_ldapdeleterequest.cH A D19-Mar-2017182 108

scan_ldapmessage.cH A D19-Mar-2017584 2220

scan_ldapmodifyrequest.cH A D19-Mar-20172.8 KiB9286

scan_ldapresult.cH A D19-Mar-2017575 1614

scan_ldapsearchfilter.cH A D19-Mar-20173.6 KiB11181

scan_ldapsearchfilterstring.cH A D19-Mar-20172.3 KiB10199

scan_ldapsearchrequest.cH A D19-Mar-20171.7 KiB5954

scan_ldapsearchresultentry.cH A D19-Mar-20171.4 KiB4441

scan_ldapstring.cH A D19-Mar-2017143 64

strduptab.cH A D25-Apr-2008583 3128

strduptab.hH A D25-Apr-2008502 145

strstorage.cH A D25-Apr-2008549 3027

strstorage.hH A D25-Apr-2008259 71

t.cH A D21-Feb-200214.9 KiB558466

t1.cH A D25-Apr-20083.2 KiB145130

t10.cH A D12-May-20111.6 KiB7364

t2.cH A D19-Mar-20176.4 KiB230220

tinyldap.cH A D03-May-202271.6 KiB2,6272,171

tinytls.hH A D07-May-20155.6 KiB167106

tls_accept.cH A D08-May-20152.1 KiB8669

tls_cipherprio.cH A D07-May-2015281 1411

tls_connect.cH A D08-May-20153.8 KiB126107

tls_doread.cH A D25-Feb-20173.4 KiB12292

tls_dowrite.cH A D08-May-2015858 3123

x.cH A D25-Feb-20172.1 KiB5750

README

1Please read ldap.h and asn1.h for an overview of the API.
2
3Example code using the high level API is in tinyldap and ldapclient.
4This will be encapsulated some more eventually.
5
6ldapclient is the client test application.  It connects to localhost,
7makes a BindRequest and dumps the BindResponse in human readable form.
8
9tinyldap is the server test application.  It can understand BindRequest,
10some simple forms of SearchRequest, and it can even answer simple
11queries.
12
13tinyldap now supports an external database representation with indexes.
14Use "parse" to create the file "data" from an LDIF file called
15"exp.ldif" (I can't give you my test data, sorry).  Then use "addindex"
16to add indexes if you like.  To make an index case insentive (and the
17corresponding attribute, too), pass an "i" in third command line
18argument to addindex (e.g.  "./addindex data sn i").  addindex also
19supports a second index type, where the offset table also contains the
20record number (will save run time, but the index is twice as large).  To
21enable it, pass a "f" in the third command line argument.  So, to have a
22fast case-insensitive index, use "if" or "fi" as third argument to
23addindex.
24
25Use "dumpidx" to have the contents of data displayed on screen.
26tinyldap has been modified to use data instead of the in-memory linked
27list.
28
29Do _not_ add an index for objectClass!  It will not work!
30
31parse will now normalize dn before writing it to the index.  That means
32that the attribute names in dn are lowercased, ';' is converted to ','
33and spaces after ';' or ',' are removed.
34
35tinyldap support authentication.  It does not have any real effect yet,
36as tinyldap does not support ACLs, but it can be used to use LDAP for
37password checking.  To use this, you must add an index for "dn".  Most
38programs check by an attribute called "uid", so you should have that as
39well, and put the password into an attribute called "userPassword".  By
40convention, the attribute "homeDirectory" contains $HOME for that user.
41tinyldap support three kinds of passwords here:
42
43  - straight MD5
44    I think I took this scheme from OpenLDAP.  It's just the straight
45    MD5 without salt but expressed as base64 not hex (as md5sum outputs
46    it).  Example:
47    userPassword: {MD5}CY9rzUYh03PK3k6DJie09g==
48    You can use "md5password" (part of the tinyldap distribution) to
49    calculate these passwords.
50
51  - crypt(3)
52    This means you can simply copy the password from /etc/shadow.
53    If your libc supports MD5 passwords in crypt (diet libc does, glibc
54    does, all the free BSDs do; you can know them by the "$1$" at the
55    start), this is actually more secure than the straight MD5 above.
56    However, the ldif and data files are then not portable to tinyldap
57    running on another OS without MD5 support in crypt.  Same goes for
58    blowfish or other obscure algorithms your crypt(3) may or may not
59    support.  Example:
60    userPassword: a4FGJQkF1FYY2
61
62  - plain text password
63    You can also simply put the password in plain text in the ldif.
64    userPassword: test
65    This is NOT advisable, because tinyldap does not support ACLs yet!
66    That means everyone can read everyone's passwords.  The MD5 above
67    provides at least moderate protection.
68
69This code has been tested against pam_ldap and an ldap checkpassword I
70wrote for a customer.
71

README.security

1tinyldap trusts the binary data file on disk.
2There are numerous ways to make tinyldap crash or loop endlessly if an
3attacker can hex edit the data file.
4
5Other than that, tinyldap does not trust anyone :-)
6
7tinyldap can (and should) be run as non-root, via tcpserver, in a chroot
8jail.
9
10If you worry about memory consumption, set resource limits before
11running tinyldap, e.g. with softlimit from daemontools or limit/ulimit
12in your shell.
13