diff --git a/src/authm_mad/remotes/x509/x509_auth.rb b/src/authm_mad/remotes/x509/x509_auth.rb index d9c15c8374..a75a79a09a 100644 --- a/src/authm_mad/remotes/x509/x509_auth.rb +++ b/src/authm_mad/remotes/x509/x509_auth.rb @@ -81,7 +81,7 @@ class X509Auth # Returns the dn of the user certificate def dn - @cert_chain[0].subject.to_s + @cert_chain[0].subject.to_s.delete("\s") end # Generates a login token in the form: diff --git a/src/cli/one_helper/oneuser_helper.rb b/src/cli/one_helper/oneuser_helper.rb index f76ace7cc8..70ec8804bf 100644 --- a/src/cli/one_helper/oneuser_helper.rb +++ b/src/cli/one_helper/oneuser_helper.rb @@ -37,8 +37,10 @@ class OneUserHelper < OpenNebulaHelper::OneHelper return -1, "Can not read file: #{arg}" end else - if options[:plain] || options[:ssh] || options[:x509] - password = arg.gsub(/\s/, '') + if options[:plain] || options[:ssh] + password = arg + elsif options[:x509] + password = arg.delete("\s") else password = Digest::SHA1.hexdigest(arg) end