18 Commits

Author SHA1 Message Date
nelson%bolyard.com
ed1126d939 Bug 485690: LDAP SSL connections with clientauth sometimes use wrong credentials
r=Mark Smith


git-svn-id: svn://10.0.0.236/trunk@257854 18797224-902f-48f8-a5cc-f745e15eee43
2009-07-29 21:43:27 +00:00
anton.bobrov%sun.com
1e79648fe9 Bug 355244 merging Sun and Mozilla libssldap
git-svn-id: svn://10.0.0.236/trunk@213412 18797224-902f-48f8-a5cc-f745e15eee43
2006-10-10 13:37:35 +00:00
richm%stanfordalumni.org
f1ced83b02 Bug: 348926
Description: Memleak: ldap_start_tls_s should free oidptr and dataptr
Fix Description: Just omit oidptr and dataptr and pass NULL for those arguments to ldap_extended_operation_s().
Bug: 348927
Description: Memleak: ldaptls_complete should free hostlist
Fix Description: Instead of returning directly from early error conditions, just goto the error handling code, and let that code free hostlist and do the other cleanup.  I had to make sure all relevant variables were initialized to NULL in order for cleanup to work properly.


git-svn-id: svn://10.0.0.236/trunk@207762 18797224-902f-48f8-a5cc-f745e15eee43
2006-08-17 19:21:03 +00:00
richm%stanfordalumni.org
8b7e2cbc94 Bug: 347033
Description: The client must call ldapssl_enable_clientauth before the first operation.  This means before ldap_start_tls_s in the case of startTLS.  However, the certname and keypassword (if any) are stored in the connection context.  ldapssl_enable_clientauth will now allocate and store this connection context if it doesn't already exist, then set the certname and keypassword.


git-svn-id: svn://10.0.0.236/trunk@206564 18797224-902f-48f8-a5cc-f745e15eee43
2006-08-04 14:05:38 +00:00
richm%stanfordalumni.org
86c3ab791d Bug: 201483
Fix Description: Replaced PK11_FindCertFromNickname() with CERT_FindUserCertByUsage(), using a cert usage of SSL Client.  This should only find certs that are used for SSL Clients, which is the type of cert we want in this context (as opposed to e.g. an email signing cert).  The LDAPSSLSessionInfo* ssip is passed now as the context argument.  Moved calling PK11_SetPasswordFunc before CERT_FindUserCertByUsage() in case CERT_FindUserCertByUsage() needs it for some reason.


git-svn-id: svn://10.0.0.236/trunk@206431 18797224-902f-48f8-a5cc-f745e15eee43
2006-08-02 20:00:42 +00:00
richm%stanfordalumni.org
9f0ab5ffa2 bug 323374
Mem and resource leaks in ldapsinit.c
1) I'm pretty sure the reference to socket should be fd instead.  I don't know
why it compiled with socket in there . . . note to self: read compiler warnings
. . .
2) The cert returned by SSL_PeerCertificate is "dup"ed, so we need to call
CERT_DestroyCertificate to release it otherwise we'll leak references.
3) The hostname returned by SSL_RevealURL is strduped and must be freed.
Reviewed by Mark and Pete (Thanks!)


git-svn-id: svn://10.0.0.236/trunk@187706 18797224-902f-48f8-a5cc-f745e15eee43
2006-01-17 14:53:57 +00:00
mcs%pearlcrescent.com
7d734689e8 Additional fix for 141754 - Enhancement: Should support startTls:
Remove extra semicolon which causes an error on some non-gcc compilers.


git-svn-id: svn://10.0.0.236/trunk@162072 18797224-902f-48f8-a5cc-f745e15eee43
2004-09-10 13:03:03 +00:00
mcs%pearlcrescent.com
b8044053ec Fix bug # 141754 - Enhancement: Should support startTLS.
LDAP command line tools now accept 2 new options:
    -ZZ  (issue a startTLS request)
    -ZZZ (like -ZZ but require a successful response).
 API extensions:
  ldap_ssl.h: LDAP_EXOP_START_TLS macro (OID of start TLS extended op.).
  libssldap:  Added ldap_start_tls_s() function.
  libprldap:  Added prldap_is_installed() and prldap_import_connection().
  libldap:    Added new LDAP_X_OPT_SOCKETARG option for ldap_get_option()
                and ldap_set_option() (get/set the socketarg associated
                with the main LDAP TCP connection).
  liblber:    Added new LBER_SOCKBUF_OPT_SOCK_ARG option for
                 ber_sockbuf_set_option() and ber_sockbuf_get_option()
                 (get/set the socketarg associated with a Sockbuf).
Also, some refactoring was done in libssldap to simplify the code.


git-svn-id: svn://10.0.0.236/trunk@161997 18797224-902f-48f8-a5cc-f745e15eee43
2004-09-09 18:50:05 +00:00
mcs%netscape.com
17a1191dbb Additional fix for bug # 205419 - Relicense LDAP C SDK (directory/c-sdk).
Replace NPL/GPL/LGPL licenses with MPL/GPL/LGPL.


git-svn-id: svn://10.0.0.236/trunk@147988 18797224-902f-48f8-a5cc-f745e15eee43
2003-10-15 17:26:10 +00:00
mcs%netscape.com
f9cbc32e48 Fix bug # 205419 - Relicense LDAP C SDK (directory/c-sdk).
Replace existing licenses with a triple license (NPL/GPL/LGPL or
    MPL/GPL/LGPL).
  Add licenses to files that had no license.
  Remove two unused files.


git-svn-id: svn://10.0.0.236/trunk@147837 18797224-902f-48f8-a5cc-f745e15eee43
2003-10-10 15:03:52 +00:00
mcs%netscape.com
5076ab7942 Fix 126462 - Occurences of uninitialized variables being used
before being set (in directory/c-sdk).


git-svn-id: svn://10.0.0.236/trunk@140157 18797224-902f-48f8-a5cc-f745e15eee43
2003-03-24 19:59:05 +00:00
mcs%netscape.com
b9b47058f3 Fix 183385 - eliminate references to NSS key/cert/module files.
The LDAP tools code no longer has any knowledge of the NSS
	file names; the certpath2keypath() function has been deleted
	and we now simply use the certdbpath as keydbpath when it is
	provided (it makes no difference in the end). But note that
	because we need to maintain backwards compatibility, the
	libssldap code used by the ldapssl_.*_init() functions still
	knows the default name of the NSS module file (secmod.db),
	and the code also relies on the fact that the suffix for the
	key and cert files is ".db" and that the first letter in the
	main part of the name is either 'c' or 'k'.
Also fixed a bug that caused the module file name specified on
	the LDAP tools command line (-m name) to be ignored.
The ldapsearch and ldapcmp tools now exit with LDAP_NO_MEMORY
	if an LDIF fragment can't be constructed.
Also fixed some issues reported by lint:
	Return values that were ignored.
	Make more functions and global variables static.
	Add /*ARGSUSED*/ and similar lint-friendly comments.


git-svn-id: svn://10.0.0.236/trunk@139935 18797224-902f-48f8-a5cc-f745e15eee43
2003-03-21 16:00:34 +00:00
mcs%netscape.com
cc5865f4c9 Fix bug # 177771 - libssldap: keyfile password should be optional.
If a NULL keypasswd value is passed to ldapssl_enable_clientauth()
		then it is assumed that the application has already unlocked
		the key DB or has installed its own GetPassword callback.
	Also improved some error reporting.


git-svn-id: svn://10.0.0.236/trunk@134796 18797224-902f-48f8-a5cc-f745e15eee43
2002-12-04 17:11:20 +00:00
mcs%netscape.com
b7046746c2 Fix bug # 153250 - need a way to set SSL options when using libssldap.
Added two new libssldap public functions: ldapssl_set_option() and
		ldapssl_get_option().
	Also fixed a bug in ldapsinit:do_ldapssl_connect() that sometimes
		caused PR_Close() to be called twice on an SSL file descriptor
		if an error occurred (once in do_ldapssl_connect() itself and
		once in the libprldap close function that is called from
		do_ldapssl_connect()).
	Also updated the NSPR and NSS "error code to string" mapping
		tables that are used by ldapssl_err2string().
	Also fixed a bug in common.c:ldaptool_print_lderror (LDAP command
		line tools) where we did not check for SSL errors when the
		error code was "can't connect."  We were only checking on
		"server down" errors.


git-svn-id: svn://10.0.0.236/trunk@124204 18797224-902f-48f8-a5cc-f745e15eee43
2002-06-27 19:26:38 +00:00
dmose%netscape.com
4eea0e428a Fix memory leak in libssldap and an incorrect error return in libprldap (bug 137017). r=mcs@netscape.com
git-svn-id: svn://10.0.0.236/trunk@120270 18797224-902f-48f8-a5cc-f745e15eee43
2002-04-30 01:23:58 +00:00
mcs%netscape.com
0c1f40ad50 Fix bug # 132040 - LDAP tools need a "no man in the middle" option.
New libssldap public function: ldapssl_set_strength().
	New command line tool option: -3 ("no third").
Fix bug # 134035 - LDAP command line tools don't report vendor mismatch.
Improved error checks and reporting for SSL errors in tools.


git-svn-id: svn://10.0.0.236/trunk@119280 18797224-902f-48f8-a5cc-f745e15eee43
2002-04-18 18:53:19 +00:00
mcs%netscape.com
fabb0d49a2 Revise SSL layer comment
git-svn-id: svn://10.0.0.236/trunk@119271 18797224-902f-48f8-a5cc-f745e15eee43
2002-04-18 15:30:22 +00:00
dmose%netscape.com
4680f8f4d7 LDAP C SDK v5.0 merge from ldapcsdk_branch_50 (at ldapcsdk_branch_50-20020326-pre-trunk-merge-tag).
git-svn-id: svn://10.0.0.236/trunk@117510 18797224-902f-48f8-a5cc-f745e15eee43
2002-03-26 21:54:41 +00:00