Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
platform
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
micah
platform
Commits
ad9415a5
Commit
ad9415a5
authored
Oct 4, 2016
by
elijah
Browse files
Options
Downloads
Patches
Plain Diff
[bug] fix Tor hidden service key generation
parent
b13cbe47
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/leap_cli/macros/keys.rb
+4
-4
4 additions, 4 deletions
lib/leap_cli/macros/keys.rb
provider_base/services/tor.json
+1
-1
1 addition, 1 deletion
provider_base/services/tor.json
with
5 additions
and
5 deletions
lib/leap_cli/macros/keys.rb
+
4
−
4
View file @
ad9415a5
...
@@ -29,7 +29,7 @@ module LeapCli
...
@@ -29,7 +29,7 @@ module LeapCli
# generating key if it is missing
# generating key if it is missing
#
#
def
tor_public_key_path
(
path_name
,
key_type
)
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
end
#
#
...
@@ -37,7 +37,7 @@ module LeapCli
...
@@ -37,7 +37,7 @@ module LeapCli
# generating key if it is missing
# generating key if it is missing
#
#
def
tor_private_key_path
(
path_name
,
key_type
)
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
end
#
#
...
@@ -55,7 +55,7 @@ module LeapCli
...
@@ -55,7 +55,7 @@ module LeapCli
require
'base32'
require
'base32'
require
'base64'
require
'base64'
require
'openssl'
require
'openssl'
path
=
Path
.
find_file
([
path_name
,
self
.
name
])
path
=
Path
.
named_path
([
path_name
,
self
.
name
])
if
path
&&
File
.
exist?
(
path
)
if
path
&&
File
.
exist?
(
path
)
public_key_str
=
File
.
readlines
(
path
).
grep
(
/^[^-]/
).
join
public_key_str
=
File
.
readlines
(
path
).
grep
(
/^[^-]/
).
join
public_key
=
Base64
.
decode64
(
public_key_str
)
public_key
=
Base64
.
decode64
(
public_key_str
)
...
@@ -63,7 +63,7 @@ module LeapCli
...
@@ -63,7 +63,7 @@ module LeapCli
sha1sum
=
Digest
::
SHA1
.
new
.
digest
(
public_key
)
sha1sum
=
Digest
::
SHA1
.
new
.
digest
(
public_key
)
Base32
.
encode
(
sha1sum
.
slice
(
0
,
10
)).
downcase
Base32
.
encode
(
sha1sum
.
slice
(
0
,
10
)).
downcase
else
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
end
end
...
...
This diff is collapsed.
Click to expand it.
provider_base/services/tor.json
+
1
−
1
View file @
ad9415a5
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
"key_type"
:
"RSA"
,
"key_type"
:
"RSA"
,
"public_key"
:
"= tor_public_key_path(:node_tor_pub_key, tor.hidden_service.key_type) if tor.hidden_service.active"
,
"public_key"
:
"= tor_public_key_path(:node_tor_pub_key, tor.hidden_service.key_type) if tor.hidden_service.active"
,
"private_key"
:
"= tor_private_key_path(:node_tor_priv_key, tor.hidden_service.key_type) if tor.hidden_service.active"
,
"private_key"
:
"= tor_private_key_path(:node_tor_priv_key, tor.hidden_service.key_type) if tor.hidden_service.active"
,
"address"
:
"= onion_address(:node_tor_pub_key)
if tor.hidden_service.active
"
"address"
:
"=
> tor.hidden_service.active &&
onion_address(:node_tor_pub_key)"
}
}
}
}
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment