Author: jsuchome Date: Thu Jan 13 11:50:42 2011 New Revision: 63174 URL: http://svn.opensuse.org/viewcvs/yast?rev=63174&view=rev Log: - added support for setting TLS options - 2.20.0 Modified: trunk/ldap/VERSION trunk/ldap/package/yast2-ldap.changes trunk/ldap/src/LdapAgent.cc trunk/ldap/src/LdapAgent.h Modified: trunk/ldap/VERSION URL: http://svn.opensuse.org/viewcvs/yast/trunk/ldap/VERSION?rev=63174&r1=63173&r2=63174&view=diff ============================================================================== --- trunk/ldap/VERSION (original) +++ trunk/ldap/VERSION Thu Jan 13 11:50:42 2011 @@ -1 +1 @@ -2.17.3 +2.20.0 Modified: trunk/ldap/package/yast2-ldap.changes URL: http://svn.opensuse.org/viewcvs/yast/trunk/ldap/package/yast2-ldap.changes?rev=63174&r1=63173&r2=63174&view=diff ============================================================================== --- trunk/ldap/package/yast2-ldap.changes (original) +++ trunk/ldap/package/yast2-ldap.changes Thu Jan 13 11:50:42 2011 @@ -1,4 +1,10 @@ ------------------------------------------------------------------- +Thu Jan 13 09:33:46 CET 2011 - jsuchome@suse.cz + +- added support for setting TLS options +- 2.20.0 + +------------------------------------------------------------------- Thu Jun 18 15:07:37 CEST 2009 - mvidner@suse.cz - Using autodocs-cc.ami, which contains a fix for automake 1.11. Modified: trunk/ldap/src/LdapAgent.cc URL: http://svn.opensuse.org/viewcvs/yast/trunk/ldap/src/LdapAgent.cc?rev=63174&r1=63173&r2=63174&view=diff ============================================================================== --- trunk/ldap/src/LdapAgent.cc (original) +++ trunk/ldap/src/LdapAgent.cc Thu Jan 13 11:50:42 2011 @@ -500,6 +500,33 @@ } /** + * Adapt TLS Settings of existing LDAP connection + * args is argument map got from YCP call + * tls is string, values are "yes" and "try" + */ +void LdapAgent::set_tls_options (YCPMap args, string set_tls) +{ + string cacertfile = getValue (args, "cacertfile"); + string cacertdir = getValue (args, "cacertdir"); + + TlsOptions tls = ldap->getTlsOptions(); + if (cacertfile != "") { + tls.setOption (TlsOptions::CACERTFILE, cacertfile); + } + if (cacertdir != "") { + tls.setOption (TlsOptions::CACERTDIR, cacertdir); + } + + if (set_tls == "yes") { + tls.setOption (TlsOptions::REQUIRE_CERT, TlsOptions::DEMAND); + } + if (set_tls == "try") { + tls.setOption (TlsOptions::REQUIRE_CERT, TlsOptions::TRY); + } +} + + +/** * Dir */ YCPList LdapAgent::Dir(const YCPPath& path) @@ -1248,6 +1275,7 @@ // start TLS if proper parameter is given string tls = getValue (argmap, "use_tls"); + set_tls_options (argmap, tls); if (tls == "try" || tls == "yes") { try { @@ -1436,6 +1464,7 @@ } else if (PC(0) == "start_tls") { + set_tls_options (argmap, "yes"); try { ldap->start_tls (); } @@ -1446,6 +1475,7 @@ } return YCPBoolean(true); } + else { y2error("Wrong path '%s' in Execute().", path->toString().c_str()); } Modified: trunk/ldap/src/LdapAgent.h URL: http://svn.opensuse.org/viewcvs/yast/trunk/ldap/src/LdapAgent.h?rev=63174&r1=63173&r2=63174&view=diff ============================================================================== --- trunk/ldap/src/LdapAgent.h (original) +++ trunk/ldap/src/LdapAgent.h Thu Jan 13 11:50:42 2011 @@ -157,6 +157,11 @@ void debug_referral (LDAPReferralException e, string action); /** + * Adapt TLS Settings of existing LDAP connection + */ + void set_tls_options (YCPMap args, string tls); + + /** * creates attributes for new LDAP object and fills their values */ void generate_attr_list (LDAPAttributeList* attrs, YCPMap map); -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org