From 7818abd6a89a882cabb3d2a14a572308d9e959ff Mon Sep 17 00:00:00 2001 From: elijah Date: Tue, 21 Jun 2016 17:38:00 -0700 Subject: minor ruby linting --- lib/leap_cli/macros/keys.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/leap_cli/macros/keys.rb') diff --git a/lib/leap_cli/macros/keys.rb b/lib/leap_cli/macros/keys.rb index e7a75cfb..9dd9b34f 100644 --- a/lib/leap_cli/macros/keys.rb +++ b/lib/leap_cli/macros/keys.rb @@ -56,7 +56,7 @@ module LeapCli require 'base64' require 'openssl' path = Path.find_file([path_name, self.name]) - if path && File.exists?(path) + if path && File.exist?(path) public_key_str = File.readlines(path).grep(/^[^-]/).join public_key = Base64.decode64(public_key_str) public_key = public_key.slice(22..-1) # Tor ignores the 22 byte SPKI header -- cgit v1.2.3 From ad9415a5e2885e940e99a07a9d6cdb2b1600e1bd Mon Sep 17 00:00:00 2001 From: elijah Date: Tue, 4 Oct 2016 11:06:13 -0700 Subject: [bug] fix Tor hidden service key generation --- lib/leap_cli/macros/keys.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lib/leap_cli/macros/keys.rb') diff --git a/lib/leap_cli/macros/keys.rb b/lib/leap_cli/macros/keys.rb index 9dd9b34f..9cc01fe7 100644 --- a/lib/leap_cli/macros/keys.rb +++ b/lib/leap_cli/macros/keys.rb @@ -29,7 +29,7 @@ module LeapCli # generating key if it is missing # def tor_public_key_path(path_name, key_type) - file_path(path_name) { generate_tor_key(key_type) } + remote_file_path(path_name) { generate_tor_key(key_type) } end # @@ -37,7 +37,7 @@ module LeapCli # generating key if it is missing # def tor_private_key_path(path_name, key_type) - file_path(path_name) { generate_tor_key(key_type) } + remote_file_path(path_name) { generate_tor_key(key_type) } end # @@ -55,7 +55,7 @@ module LeapCli require 'base32' require 'base64' require 'openssl' - path = Path.find_file([path_name, self.name]) + path = Path.named_path([path_name, self.name]) if path && File.exist?(path) public_key_str = File.readlines(path).grep(/^[^-]/).join public_key = Base64.decode64(public_key_str) @@ -63,7 +63,7 @@ module LeapCli sha1sum = Digest::SHA1.new.digest(public_key) Base32.encode(sha1sum.slice(0,10)).downcase else - LeapCli.log :warning, 'Tor public key file "%s" does not exist' % tor_public_key_path + LeapCli.log :warning, 'Tor public key file "%s" does not exist' % path end end -- cgit v1.2.3