summaryrefslogtreecommitdiff
path: root/src/mod_auth.c
Commit message (Collapse)AuthorAgeFilesLines
...
* [config] more specific checks for array listsGlenn Strauss2017-03-081-4/+10
| | | | | | | | | | | | | More specific checks on contents of array lists. Each module using lists now does better checking on the types of values in the list (strings, integers, arrays/lists) This helps prevent misconfiguration of things like cgi.assign, fastcgi.server, and scgi.server, where source code might be served as static files if parenthesis are misplaced. x-ref: https://redmine.lighttpd.net/boards/2/topics/6571
* [mod_auth] support LDAP groups for HTTP auth (fixes #1817)Glenn Strauss2017-01-311-0/+2
| | | | | | x-ref: "LDAP-Group support for HTTP-Authentication" https://redmine.lighttpd.net/issues/1817
* [mod_auth] enable optional authz if extern authn (fixes #2481)Glenn Strauss2017-01-311-0/+12
| | | | | | | | | | | | | Set auth.extern-authn = "enable" to check REMOTE_USER (if set) against require rules, and proceed if allowed. If REMOTE_USER is not present, or the require rules do not match, then check configured auth scheme. REMOTE_USER might be set by another module, e.g. mod_openssl client cert verification and REMOTE_USER configured with ssl.verifyclient.username) x-ref: "[mod_auth] allow SSL clientcert authenticated users to bypass AUTH" https://redmine.lighttpd.net/issues/2481
* [core] remove srv->entropy[]Glenn Strauss2016-12-091-7/+0
| | | | | unlikely to provide any real additional benefit as long as PRNG has been appropriately initialized with random data
* [core] rename li_rand() to li_rand_pseudo_bytes()Glenn Strauss2016-12-051-1/+1
| | | | | to be more explicit that the result is pseudo-random data and not cryptographically random.
* silence warnings from clang ccc-analyzerGlenn Strauss2016-10-161-1/+1
|
* [core] rand.[ch] to use better RNGs when availableGlenn Strauss2016-10-151-2/+3
| | | | | | | | prefer RAND_pseudo_bytes() (openssl), arc4random() or jrand48(), if available, over rand() These are not necessarily cryptographically secure, but should be better than rand()
* [mod_auth] fix printing of IP in error traceGlenn Strauss2016-10-041-3/+3
|
* [mod_auth] HTTP Basic auth backends also do authz (#1817)Glenn Strauss2016-09-281-6/+2
| | | | | | | | | | HTTP Basic auth backends now do both authn and authz in order to allow provide a means to extend backends to optionally support group authz x-ref: "LDAP-Group support for HTTP-Authentication" https://redmine.lighttpd.net/issues/1817
* fix errors detected by Coverity ScanGlenn Strauss2016-09-231-0/+2
| | | | | | fix potential NULL pointer dereference in mod_deflate.c remove logically dead code in connection-glue.c add coverity annotations to see if some issues will be reclassified
* [mod_auth] structured data, register auth schemesGlenn Strauss2016-09-221-550/+418
| | | | | | - parse auth.* directives into structured data during config processing - register auth schemes (basic, digest, extern, ...) for extensibility - remove auth.debug directive
* [mod_auth] extensible interface for auth backendsGlenn Strauss2016-08-201-288/+186
| | | | | | | | | | | | | | create new, extensible interface for (additional) auth backends attempt to handle HANDLER_WAIT_FOR_EVENT returned by auth backends to allow for async auth backends (e.g. to mysql database) separate auth backends from mod_auth and http_auth mod_authn_file.c htdigest, htpasswd, plain auth backends mod_authn_ldap.c ldap auth backend add http_auth.c to common_sources for auth backend registration (mod_authn_file could be three separate modules, but no need for now)
* [mod_auth] refactor out auth backend codeGlenn Strauss2016-08-181-87/+31
| | | | | separate routines for each auth backend in http_auth.c, move ldap backend init from mod_auth.c to http_auth.c
* [mod_auth] refactor out auth backend codeGlenn Strauss2016-08-181-4/+487
| | | | | move basic and digest code into mod_auth.c, and leave auth backend code in http_auth.c
* [mod_auth] fix Digest auth to be better than Basic (fixes #1844)Glenn Strauss2016-07-161-1/+6
| | | | | | | | | | | | | Make Digest authentication more compliant with RFC. Excerpt from https://www.rfc-editor.org/rfc/rfc7616.txt Section 5.13: The bottom line is that any compliant implementation will be relatively weak by cryptographic standards, but any compliant implementation will be far superior to Basic Authentication. x-ref: "Serious security problem in Digest Authentication" https://redmine.lighttpd.net/issues/1844
* fix errors detected by Coverity ScanGlenn Strauss2016-06-231-0/+3
| | | | | | | buffer.c:itostr() undefined behavior taking modulus of negative number additional minor code changes made to quiet other coverity warnings (false positives)
* [mod_auth] send charset="UTF-8" in WWW-Authenticate (fixes #1468)Glenn Strauss2016-04-121-2/+2
| | | | | | | | | | | | | https://tools.ietf.org/html/rfc7616 and https://tools.ietf.org/html/rfc7617 (September 2015) update Digest and Basic auth to allow server to recommend charset which should be used by client. http://stackoverflow.com/questions/702629/utf-8-characters-mangled-in-http-basic-auth-username x-ref: "LDAP UTF-8 encoding" https://redmine.lighttpd.net/issues/1468
* pass buf size to li_tohex()Glenn Strauss2016-04-011-1/+1
| | | | | | | | | also change passing of fixed-sized arrays: need to pass pointer to array as otherwise size does not get enforced From: Glenn Strauss <gstrauss@gluelogic.com> git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@3135 152afb58-edef-0310-8abb-c4023f1b3aa9
* consistent inclusion of config.h at top of files (fixes #2073)Glenn Strauss2016-03-191-0/+2
| | | | | | From: Glenn Strauss <gstrauss@gluelogic.com> git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@3113 152afb58-edef-0310-8abb-c4023f1b3aa9
* [config] check config option scope; warn if server option is given in ↵Stefan Bühler2015-11-071-4/+3
| | | | | | | | conditional From: Stefan Bühler <stbuehler@web.de> git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@3049 152afb58-edef-0310-8abb-c4023f1b3aa9
* minor spelling fixesStefan Bühler2015-06-211-1/+1
| | | | | | From: Stefan Bühler <stbuehler@web.de> git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2991 152afb58-edef-0310-8abb-c4023f1b3aa9
* fix segfaults in many plugins if they failed configurationStefan Bühler2015-05-141-1/+1
| | | | | | From: Stefan Bühler <stbuehler@web.de> git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2988 152afb58-edef-0310-8abb-c4023f1b3aa9
* Use buffer API to read and modify "used" memberStefan Bühler2015-02-081-10/+10
| | | | | | | | | | | | | | | | | | | | | | | - a lot of code tried to handle manually adding terminating zeroes and keeping track of the correct "used" count. Replaced all "external" usages with simple wrapper functions: * buffer_string_is_empty (used <= 1), buffer_is_empty (used == 0); prefer buffer_string_is_empty * buffer_string_set_length * buffer_string_length * CONST_BUF_LEN() macro - removed "static" buffer hacks (buffers pointing to constant/stack memory instead of malloc()ed data) - buffer_append_strftime(): refactor buffer+strftime uses - li_tohex(): no need for a buffer for binary-to-hex conversion: the output data length is easy to predict - remove "-Winline" from extra warnings: the "inline" keyword just supresses the warning about unused but defined (static) functions; don't care whether it actually gets inlined or not. From: Stefan Bühler <stbuehler@web.de> git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2979 152afb58-edef-0310-8abb-c4023f1b3aa9
* fix buffer, chunk and http_chunk APIStefan Bühler2015-02-081-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * remove unused structs and functions (buffer_array, read_buffer) * change return type from int to void for many functions, as the return value (indicating error/success) was never checked, and the function would only fail on programming errors and not on invalid input; changed functions to use force_assert instead of returning an error. * all "len" parameters now are the real size of the memory to be read. the length of strings is given always without the terminating 0. * the "buffer" struct still counts the terminating 0 in ->used, provide buffer_string_length() to get the length of a string in a buffer. unset config "strings" have used == 0, which is used in some places to distinguish unset values from "" (empty string) values. * most buffer usages should now use it as string container. * optimise some buffer copying by "moving" data to other buffers * use (u)intmax_t for generic int-to-string functions * remove unused enum values: UNUSED_CHUNK, ENCODING_UNSET * converted BUFFER_APPEND_SLASH to inline function (no macro feature needed) * refactor: create chunkqueue_steal: moving (partial) chunks into another queue * http_chunk: added separate function to terminate chunked body instead of magic handling in http_chunk_append_mem(). http_chunk_append_* now handle empty chunks, and never terminate the chunked body. From: Stefan Bühler <stbuehler@web.de> git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2975 152afb58-edef-0310-8abb-c4023f1b3aa9
* fix/silence bugs reported by ccc-analyzer (clang)Stefan Bühler2013-11-131-1/+1
| | | | | | | | | | | | | | | | | | | | | These should all be non critical: * memory leaks on startup in error cases (which lead to immediate shutdowns anyway) * http_auth/ldap: passing uninitialized "ret" to ldap_err2string * sizeof(T) not matching the target pointer in malloc/calloc calls; those cases were either: * T being the wrong pointer type - shouldn't matter as long as all pointers have same size * T being larger than the type needed * mod_accesslog: direct use after free in cleanup (server shutdown); could crash before "clean" shutdown * some false positives (mod_compress, mod_expire) * assert(srv->config_context->used > 0); - this is always the case, as there is always a global config block From: Stefan Bühler <stbuehler@web.de> git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2920 152afb58-edef-0310-8abb-c4023f1b3aa9
* [auth] new method "extern" to use already present REMOTE_USER (from magnet, ↵Stefan Bühler2013-08-301-11/+25
| | | | | | | | | | | | ssl, ...) (fixes #2436) can be combined with ssl: ssl.verifyclient.username = "SSL_CLIENT_S_DN_UID" auth.require = ("/" => ( "require" => "valid-user", "method" => "extern") ) From: Stefan Bühler <stbuehler@web.de> git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2894 152afb58-edef-0310-8abb-c4023f1b3aa9
* [mod_auth] some cleanup, only search for matching auth.require path onceStefan Bühler2013-08-301-2/+2
| | | | | | From: Stefan Bühler <stbuehler@web.de> git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2893 152afb58-edef-0310-8abb-c4023f1b3aa9
* [auth] put REMOTE_USER into cgi environment, making it accessible to lua via ↵Stefan Bühler2013-08-301-7/+14
| | | | | | | | lighty.req_env (fixes #2495) From: Stefan Bühler <stbuehler@web.de> git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2892 152afb58-edef-0310-8abb-c4023f1b3aa9
* [auth] Add "AUTH_TYPE" environment (for *cgi), remove fastcgi specific ↵Stefan Bühler2012-04-191-0/+14
| | | | | | workaround, add fastcgi test case (fixes #889) git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2833 152afb58-edef-0310-8abb-c4023f1b3aa9
* Fix header inclusion order, always include "config.h" before any system headerStefan Bühler2009-10-111-5/+5
| | | | git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2624 152afb58-edef-0310-8abb-c4023f1b3aa9
* Fix issues found with clang analyzerStefan Bühler2009-07-211-2/+2
| | | | git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2594 152afb58-edef-0310-8abb-c4023f1b3aa9
* Fix code comments in mod_auth.c (fixes #1909, thx cdumke)Stefan Bühler2009-04-111-13/+13
| | | | git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2469 152afb58-edef-0310-8abb-c4023f1b3aa9
* Added some extra warning options in cmake and fix the resulting warnings ↵Stefan Bühler2009-03-071-0/+1
| | | | | | (unused/static functions) git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2414 152afb58-edef-0310-8abb-c4023f1b3aa9
* Now really fix mod auth ldap (#1066)Stefan Bühler2008-09-301-3/+6
| | | | git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2318 152afb58-edef-0310-8abb-c4023f1b3aa9
* fix auth.backend.ldap.bind-dn/pw problems (thx ruskie)Stefan Bühler2008-09-191-0/+4
| | | | | | | - missing PATCH for them in mod_auth_patch_connection git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2304 152afb58-edef-0310-8abb-c4023f1b3aa9
* fix splitting of auth-ldap filterStefan Bühler2008-09-171-21/+23
| | | | git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2302 152afb58-edef-0310-8abb-c4023f1b3aa9
* Fixed conditional patching of ldap filter (#1564)Stefan Bühler2008-08-041-2/+4
| | | | git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2280 152afb58-edef-0310-8abb-c4023f1b3aa9
* Insert many con->mode checks; they should prevent two modules to handle the ↵Stefan Bühler2008-08-011-0/+2
| | | | | | same request if they shouldn't (#631) git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2271 152afb58-edef-0310-8abb-c4023f1b3aa9
* Replace buffer_{append,copy}_string with the _len variant where possible ↵Stefan Bühler2008-07-301-8/+8
| | | | | | | | | (#1732, thx crypt) Replace BUFFER_{APPEND,COPY}_STRING_CONST with _len(b, CONST_STRL_LEN(x)) git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2250 152afb58-edef-0310-8abb-c4023f1b3aa9
* Fixed many warnings (compare (un)signed, unused vars, and initialize with zero)Stefan Bühler2008-04-291-56/+57
| | | | git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2160 152afb58-edef-0310-8abb-c4023f1b3aa9
* fixed case-sensitive match of auth-method (fixes #1456)Jan Kneschke2007-11-231-2/+2
| | | | git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2026 152afb58-edef-0310-8abb-c4023f1b3aa9
* removed early checks if the userfiles exist (fixes #1188)Jan Kneschke2007-08-171-39/+0
| | | | | | | - it is enough if the files exist when we really need them git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@1938 152afb58-edef-0310-8abb-c4023f1b3aa9
* r1553@h2o: darix | 2007-01-14 10:37:14 +0100Marcus Rückert2007-01-141-5/+10
| | | | | | | | - allow empty passwords with ldap. patch by Jöerg Sonnenberger git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@1516 152afb58-edef-0310-8abb-c4023f1b3aa9
* - white space cleanup part 2 this time 1.4 ;)Marcus Rückert2006-10-041-124/+124
| | | | | | i hope it helps with merging stuff back to 1.5 git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@1371 152afb58-edef-0310-8abb-c4023f1b3aa9
* changed name of shadowed variableJan Kneschke2006-09-231-5/+5
| | | | git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.11-ssl-fixes@1336 152afb58-edef-0310-8abb-c4023f1b3aa9
* improved error-msg for configuration errorsJan Kneschke2006-02-151-9/+27
| | | | git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-merge-1.4.x@1001 152afb58-edef-0310-8abb-c4023f1b3aa9
* renamed server.force-lower-case-files to server.force-lowercase-filenamsJan Kneschke2006-01-111-5/+17
| | | | | | | - use case-insensitive matches for mod_auth too if the FS is lower-case git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-merge-1.4.x@939 152afb58-edef-0310-8abb-c4023f1b3aa9
* made cafile optional for starttls as encryption might be enough for a startJan Kneschke2005-11-151-14/+10
| | | | git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-merge-1.4.x@847 152afb58-edef-0310-8abb-c4023f1b3aa9
* added auto-reconnect to ldap (fixes #294), patch from joerg@netbsd.orgJan Kneschke2005-11-071-8/+21
| | | | git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-merge-1.4.x@818 152afb58-edef-0310-8abb-c4023f1b3aa9
* don't crach in error message for auth.require->methodmOo2005-09-051-1/+1
| | | | git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-merge-1.4.x@687 152afb58-edef-0310-8abb-c4023f1b3aa9