From 02cd738d8f2319db9515997c30befd50ab2f40cf Mon Sep 17 00:00:00 2001 From: Javi Fontan Date: Fri, 22 Feb 2013 16:59:46 +0100 Subject: [PATCH] feature #1741: escape dn in X509CloudAuth.rb --- src/cloud/common/CloudAuth/X509CloudAuth.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/cloud/common/CloudAuth/X509CloudAuth.rb b/src/cloud/common/CloudAuth/X509CloudAuth.rb index e2f51873eb..cdae1f3893 100644 --- a/src/cloud/common/CloudAuth/X509CloudAuth.rb +++ b/src/cloud/common/CloudAuth/X509CloudAuth.rb @@ -14,6 +14,8 @@ # limitations under the License. # #--------------------------------------------------------------------------- # +require 'opennebula/x509_auth' + module X509CloudAuth def do_auth(env, params={}) # For https, the web service should be set to include the user cert in the environment. @@ -32,7 +34,8 @@ module X509CloudAuth end # Password should be DN with whitespace removed. - username = get_username(cert.subject.to_s.delete("\s")) + username = get_username( + OpenNebula::X509Auth.escape_dn(cert.subject.to_s)) return username if username