summaryrefslogtreecommitdiffstats
path: root/ldap/servers/plugins/pwdstorage
Commit message (Collapse)AuthorAgeFilesLines
* fix compiler warnings - unused vars/funcs, invalid castsRich Megginson2010-09-011-3/+3
| | | | | | | | | This commit fixes many compiler warnings, mostly for things like unused variables, functions, goto labels. One place was using csngen_free instead of csn_free. A couple of places were using casts incorrectly, and several places needed some casts added. Tested on: RHEL5 x86_64, Fedora 14 x86_64 Reviewed by: nkinder (Thanks!)
* Update to New DN FormatNoriko Hosoi2010-04-261-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix Description: . adding slapi_dn_normalize_ext and its siblings to normalize/validate invalid DNs; deprecating slapi_dn_normalize and its siblings. (dn.c) . replacing slapi_dn_normalize with new corresponding functions. . normalizing hardcoded DNs (e.g., removing spaces around ',') . setting correct DN syntax to nsslapd-suffix, nsslapd-ldapiautodnsuffix, costemplatedn, nsslapd-changelogsuffix, nsBaseDN, nsBindDN . if nsslapd-dn-validate-strict is enabled, incoming DN is examined and rejected if it is invalid. Once approved, the DN is normalized. . fixing compiler warnings and typos. See also: http://directory.fedoraproject.org/wiki/Upgrade_to_New_DN_Format Related bugs: Bug 199923 - subtree search fails to find items under a db containing special characters Bug 567968 - subtree/user level password policy created using 389-ds-console doesn't work. Bug 570107 - The import of LDIFs with base-64 encoded DNs fails, modrdn with non-ASCII new rdn incorrect Bug 570962 - ns-inactivate.pl does not work Bug 572785 - DN syntax: old style of DN <type>="<DN>",<the_rest> is not correctly normalized Bug 573060 - DN normalizer: ESC HEX HEX is not normalized Bug 574167 - An escaped space at the end of the RDN value is not handled correctly
* cleanup build warningsRich Megginson2010-03-081-4/+3
| | | | | | This patch cleans up various build warnings found by compiling the code with -Wall on RHEL5. Reviewed by: nhosoi (Thanks!)
* Workaround bogus base64 encoded passwords that end in newlineRich Megginson2010-01-114-7/+20
| | | | | | | | | | | | | https://bugzilla.redhat.com/show_bug.cgi?id=552421 Resolves: bug 552421 Bug Description: Cannot log into admin server after upgrade (fedora-ds-admin-1.1.6 -> 389-admin-1.1.9 Reviewed by: nkinder (Thanks!) Branch: HEAD Fix Description: Some older versions of setup encoded the admin password in SHA and added a trailing newline to the userPassword attribute when adding the admin entry. This changes the SHA passsword compare routine to ignore a trailing newline character in the dbpwd. newline is not a valid base64 character. Platforms tested: RHEL5 x86_64 Flag Day: no Doc impact: no
* Implement support for versioning and release engineering procedures - ↵389-ds-base-1.2.5.a1Rich Megginson2009-11-161-13/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | version 1.2.5.a1 Instead of changing configure.ac AC_INIT for each version change, there is a new file - VERSION.sh. This file also contains support for creating version numbers for pre-releases, and pre-release strings containing git commit hashes. One of the complications is that AC_INIT does not allow you to override the version and package tarname fields. We can override them after the fact everywhere except in config.h. AC_INIT defines the following which we would like to override but cannot: PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_STRING PACKAGE_BUGREPORT Instead, we define DS_ versions of these e.g. DS_PACKAGE_VERSION etc. and make these available with AC_DEFINE(DS_PACKAGE_VERSION,...) etc. As an extra added precaution, we undefine these in Makefile.am like this: DS_DEFINES = ... \ -UPACKAGE_VERSION -UPACKAGE_TARNAME -UPACKAGE_STRING -UPACKAGE_BUGREPORT If someone tries to use PACKAGE_VERSION in C code, they will not be able to, and will have to use DS_PACKAGE_VERSION instead. All of the DS code that used PACKAGE_VERSION has been changed to use DS_PACKAGE_VERSION instead. There is a new make target - git-archive - as a convenience for creating source tarballs from git. By default, the source archive will be placed in the build directory - you can specify SRCDISTDIR=/path/to/SOURCES to use an alternate dir (e.g. make SRCDISTDIR=/path/to/rpmbuild/SOURCES git-archive to make a source tarball for rpmbuild) configure will print the branded package name and version Reviewed by: nkinder (Thanks!)
* BZ 221905 - Add SMD5 password storage support.Nathan Kinder2009-10-266-39/+272
| | | | | | | This adds SMD5 password storage support to the existing password storage plug-in. Add upgrade LDIF has been added to ensure that this new functionality will be available to servers that are upgraded from previous versions.
* Fix usage of pre-hashed salted passwordsRich Megginson2009-08-201-13/+26
| | | | | | | | | | | | | Pre-hashed passwords may not use the standard internal salt length. The old ldif base64 decode function would return the number of bytes in the decoded string - the new NSPR function does not. We can't use strlen on the decoded value since it is binary and may contain nulls. The solution is to use a function to calculate exactly how many bytes the encode string will have when decoded, taking into account padding. Since we know exactly how many bytes are decoded, and we know exactly how many bytes of that decoded value are the hash, the remainder must be the salt, however many bytes that is. I tested this code with salt lengths from 1 to 99. Reviewed by: nkinder (Thanks!)
* Change default branding to 389 - remove lite codeRich Megginson2009-08-113-15/+13
| | | | | | | | | | | | | | | | | | | The vendor, brand, and capbrand are set in configure - we should use those everywhere rather than have to run some sort of script over the code to change vendor, brand, version, etc. I've added VENDOR, BRAND, CAPBRAND to the default defines passed to the compiler, and changed the code to use these defines. And instead of the unintuitively named PRODUCTTEXT macro, we should use the already defined PRODUCT_VERSION. This allowed me to get rid of some code. The version was from a generated file called dirver.h which we don't need anymore, and we don't need the perl script dirver.pl which generated it. The vendor string was coming from the dirlite header file. So I also used this as an excuse to get rid of all references to dirlite once and for all (yay!). For the places in plain text files which are not substituted, I just used the generic name Dirsrv or Directory Server instead of having an explicit brand and/or version in there. Reviewed by: nkinder (Thanks!)
* Fix unsalted password comparisonsRich Megginson2009-07-151-1/+10
| | | | | | | | Unsalted password comparison was broken by the switch from using the ldif base64 function to using the NSPR base64 function. The old function used to return the number of bytes. The new one does not. The code was assuming there was always a salt, but this is not the case. Now, the code determines if there is a salt by comparing the calculated length (hash_len) with the actual number of bytes in the hash (shaLen). Reviewed by: nhosoi (Thanks!)
* Reduce noise reported by valgrindRich Megginson2009-07-142-28/+35
| | | | | | | | | | | | | | | | | | | valgrind is a very useful tool - however, the directory server produces a lot of false positives that have to be suppressed in order to get to the useful information. These patches attempt to reduce some of that noise. 1) aclparse - should calculate the length of the string _after_ trimming the spaces 2) something about random number generation causes some of the bits to be uninitialized, and valgrind doesn't like it - this patch doesn't eliminate the error, just reduces it 3) use initialized memory when generating hashes - also remove "magic numbers" 4) bin.c - slapi_value_get_string must not be used with unterminated (binary) values 5) we get these odd valgrind reports from deep within bdb about invalid reads and uninitialized memory - I thought perhaps because we were initializing DBT structures with = {0} which the bdb docs says is not sufficient - they recommend memset or bzero 6) There are some small memory leaks during attrcrypt initialization and in error cases 7) error message in ldif2ldbm.c was attempting to print the Slapi_DN structure rather than getting the char *dn 8) After we call NSS_Initialize, we must call the NSS shutdown functions to clean up the caches and other data structures, otherwise NSS will leak memory. This is harmless since it happens at exit, but valgrind reports hundreds of memory leaks. The solution is to make sure we go through a single exit point after NSS_Initialize. This means many places that just called exit() must instead return with a real return value. This mostly affected main.c, detach.c, and a couple of other places called during startup. 9) minor memory leaks in mapping tree initialization 10) sasl_map.c - should not call this in referral mode 11) minor memory leaks during ssl init Reviewed by: nkinder, nhosoi (Thanks!)
* OpenLDAP supportcleanupRich Megginson2009-07-077-74/+70
| | | | | | | | | | These changes allow the server to be built with OpenLDAP (2.4.17+). A brief summary of the changes: * #defines not provided by OpenLDAP were copied into slapi-plugin.h and protected with #ifndef blocks * where it made sense, I created slapi wrapper functions for things like URL and LDIF processing to abstract way the differences in the APIs * I created a new file utf8.c which contains the UTF8 functions from MozLDAP - this is only compiled when using OpenLDAP * I tried to clean up the code - use the _ext versions of LDAP functions everywhere since the older versions should be considered deprecated * I removed some unused code NOTE that this should still be considered a work in progress since it depends on functionality not yet present in a released version of OpenLDAP, for NSS crypto and for the LDIF public API.
* Bug Description: Need to address 64-bit compiler warnings - part 1Rich Megginson2008-10-081-0/+2
| | | | | | | | | | | | | | | | | | | | | Reviewed by: nhosoi (Thanks!) Fix Description: The intptr_t and uintptr_t are types which are defined as integer types that are the same size as the pointer (void *) type. On the platforms we currently support, this is the same as long and unsigned long, respectively (ILP32 and LP64). However, intptr_t and uintptr_t are more portable. These can be used to assign a value passed as a void * to get an integer value, then "cast down" to an int or PRBool, and vice versa. This seems to be a common idiom in other applications where values must be passed as void *. For the printf/scanf formats, there is a standard header called inttypes.h which defines formats to use for various 64 bit quantities, so that you don't need to figure out if you have to use %lld or %ld for a 64-bit value - you just use PRId64 which is set to the correct value. I also assumed that size_t is defined as the same size as a pointer so I used the PRIuPTR format macro for size_t. I removed many unused variables and some unused functions. I put parentheses around assignments in conditional expressions to tell the compiler not to complain about them. I cleaned up some #defines that were defined more than once. I commented out some unused goto labels. Some of our header files shared among several source files define static variables. I made it so that those variables are not defined unless a macro is set in the source file. This avoids a lot of unused variable warnings. I added some return values to functions that were declared as returning a value but did not return a value. In all of these cases no one was checking the return value anyway. I put explicit parentheses around cases like this: expr || expr && expr - the && has greater precedence than the ||. The compiler complains because it wants you to make sure you mean expr || (expr && expr), not (expr || expr) && expr. I cleaned up several places where the compiler was complaining about possible use of uninitialized variables. There are still a lot of these cases remaining. There are a lot of warnings like this: lib/ldaputil/certmap.c:1279: warning: dereferencing type-punned pointer will break strict-aliasing rules These are due to our use of void ** to pass in addresses of addresses of structures. Many of these are calls to slapi_ch_free, but many are not - they are cases where we do not know what the type is going to be and may have to cast and modify the structure or pointer. I started replacing the calls to slapi_ch_free with slapi_ch_free_string, but there are many many more that need to be fixed. The dblayer code also contains a fix for https://bugzilla.redhat.com/show_bug.cgi?id=463991 - instead of checking for dbenv->foo_handle to see if a db "feature" is enabled, instead check the flags passed to open the dbenv. This works for bdb 4.2 through bdb 4.7 and probably other releases as well. Platforms tested: RHEL5 x86_64, Fedora 8 i386 Flag Day: no Doc impact: no
* Resolves: #188320Noriko Hosoi2007-10-181-4/+4
| | | | Summary: HP-UX: warnings reported by the HP-UX compiler
* Resolves: #237040Noriko Hosoi2007-04-191-150/+0
| | | | Summary: Remove obsolete makefiles
* Resolves: 217796Nathan Kinder2006-12-051-1/+12
| | | | Summary: Fix inconsistent clear password storage and ensure that SASL authentication uses passwords properly.
* Resolves: #214533Noriko Hosoi2006-11-1011-0/+55
| | | | | | | | | | Summary: configure needs to support --with-fhs (Comment #6) Changes: Added the following include next to the end of the copyright block. + +#ifdef HAVE_CONFIG_H +# include <config.h> +#endif +
* Resolves: #214728Noriko Hosoi2006-11-101-1/+0
| | | | | Summary: Cleaning up obsolete macros in the build Changes: eliminated macro NSPR20 (Comment #9)
* Resolves: #214728Noriko Hosoi2006-11-103-64/+0
| | | | | Summary: Cleaning up obsolete macros in the build Changes: eliminated macro NET_SSL (Comment #5)
* Resolves: #210947Noriko Hosoi2006-10-251-1/+1
| | | | | Summary: parameterizing the hardcoded paths (phase 3. installed binaries, change log, setup) Comment #23
* Bug(s) fixed: 199321Rich Megginson2006-10-091-1/+4
| | | | | | | | | Bug Description: incorrect base64 encoding of SHA passwords crashes server Reviewed by: nkinder (Thanks!) Fix Description: Check the return value of ldif_base64_decode to see if it is less than zero first before the other comparisons. This is the error condition, so we can just return an error. Additionally, the other comparisons with the unsigned should be ok since we know that the hash_len is a positive number. Platforms tested: FC5 Flag Day: no Doc impact: no
* Bug: 205456Rich Megginson2006-09-061-1/+1
| | | | | | Description: Enable DS Core build/install on HP-UX Fix Description: remove some bogus adminutil and nsdshttpd stuff from the plugin makefiles Reviewed by: nhosoi (Thanks!)
* Bug(s) fixed: 172005Rich Megginson2005-10-291-1/+1
| | | | | | | | | | | | | Bug Description: Change ldapserver version to 1.0 Reviewed by: Noriko (Thanks!) Fix Description: This also fixes some lingering build issues involving perldap, which is no longer a separate setup package, but just gets included into DS in a similar manner to nspr, nss, etc. Platforms tested: RHEL4 Flag Day: no Doc impact: no QA impact: should be covered by regular nightly and manual testing New Tests integrated into TET: none
* 168322 - Check size of hash needed before base64 encoding password hashesNathan Kinder2005-09-141-2/+2
|
* 167441 - Added SHA2 hashed password storage support.Nathan Kinder2005-09-064-77/+444
|
* Bug 160008Rich Megginson2005-06-144-1/+162
| | | | | | | Coding done by David Irving, Fred Brittain, and Aaron Gagnon Reviewed by Rich Megginson - minor changes to md5_pwd.c Tested on RHEL3 with FDS post-7.1 Does not include the OpenLDAP migration script - that will be handled separately
* 155460 - Remove crypt password storage from windows buildNathan Kinder2005-04-204-4/+13
|
* Fixed licensing typoNathan Kinder2005-04-1913-13/+39
|
* 155068 - Added license to source filesNathan Kinder2005-04-1513-0/+390
|
* [Bug 146919] Directory Server rebrandingNoriko Hosoi2005-03-251-1/+1
| | | | | | | | | | 1) Brandx -> Fedora 2) Pick up new internal component set (Admin SDK, Setup SDK, Admin Server) 3) Use JRE from the Admin Server package 4) Docs a) Componentize Docs b) Rebrand Docs c) Drop packaging Administration Guide in the external version
* clean up sprintf usage and many other flawfinder issues; clean up compiler ↵Rich Megginson2005-03-052-6/+2
| | | | warnings on Linux; remove pam_passthru from DS 7.1
* 149951 - Updated source code copyrightsNathan Kinder2005-02-2813-26/+26
|
* [146919] De-brand the Directory Server as "brandx"Noriko Hosoi2005-02-021-1/+1
|
* remove references to ldapserver from makefiles; use BUILD_ROOT instead of ↵Rich Megginson2005-01-281-2/+2
| | | | MCOM_ROOT and NSROOT; BUILD_ROOT is now the ldapserver directory rather than its parent
* Moving NSCP Directory Server from DirectoryBranch to TRUNK, initial drop. ↵ldapserver7xcvsadm2005-01-2113-0/+1702
(foxworth)