1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-01-14 19:24:10 +03:00

feature #754: Fix bugs for server authN

This commit is contained in:
Ruben S. Montero 2011-08-26 16:34:17 +02:00
parent bbe32d8375
commit 48c0e06544
2 changed files with 4 additions and 17 deletions

View File

@ -39,8 +39,9 @@ secret = ARGV[2] # Base64 encoded secret as obtained from login_token
begin
server_auth = ServerAuth.new
dsecret = Base64::decode64(secret)
rc = server_auth.authenticate(user, pass, secret)
rc = server_auth.authenticate(user, pass, dsecret)
rescue => e
OpenNebula.error_message e.message
exit -1

View File

@ -18,18 +18,6 @@ require 'openssl'
require 'base64'
require 'fileutils'
ONE_LOCATION=ENV["ONE_LOCATION"]
if !ONE_LOCATION
RUBY_LIB_LOCATION="/usr/lib/one/ruby"
ETC_LOCATION="/etc/one/"
else
RUBY_LIB_LOCATION=ONE_LOCATION+"/lib/ruby"
ETC_LOCATION=ONE_LOCATION+"/etc/"
end
$: << RUBY_LIB_LOCATION
require 'x509_auth'
# Server authentication class. This authmethod can be used by opennebula services
@ -65,10 +53,8 @@ class ServerAuth < X509Auth
end
begin
certs = Array.new
certs[0] = File.read(@options[:host_cert])
key = File.read(@options[:host_key])
certs = [ File.read(@options[:one_cert]) ]
key = File.read(@options[:one_key])
super(:certs_pem => certs,
:key_pem => key,