hrr_rb_ssh-ed25519 0.4.0.pre3 → 0.4.0.pre4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/hrr_rb_ssh/algorithm/publickey/ssh_ed25519.rb +4 -4
- data/lib/hrr_rb_ssh/algorithm/publickey/ssh_ed25519/openssh_private_key.rb +2 -4
- data/lib/hrr_rb_ssh/algorithm/publickey/ssh_ed25519/openssh_private_key_content.rb +2 -4
- data/lib/hrr_rb_ssh/algorithm/publickey/ssh_ed25519/pkey.rb +2 -2
- data/lib/hrr_rb_ssh/algorithm/publickey/ssh_ed25519/public_key_blob.rb +2 -4
- data/lib/hrr_rb_ssh/algorithm/publickey/ssh_ed25519/signature.rb +2 -4
- data/lib/hrr_rb_ssh/ed25519/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: afbdb6f7187d4440881fc5570d5dca6efb97c6c81d058fd7b1d83213f9455efd
|
4
|
+
data.tar.gz: 701e7dfe37047f5e83a1b20904ef1a04444371981b4460dc5148e9e30d36de41
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cba6d7d728517b128687a745305a373901ee5f1a866f82d158ddb7383a22ad8a70098828ceac4cc23f9c9973d0b094cb17de4dc35014d7e9542896629ef4a262
|
7
|
+
data.tar.gz: e1f80be12b6e9783bc6485e782cc91f9ae50d9fa44ce43ff4914f0185bbd505029f0429805a7792e768aff3f83ca0b6c181b2deccfbe32617c922e6d94683998
|
@@ -25,7 +25,7 @@ module HrrRbSsh
|
|
25
25
|
end
|
26
26
|
|
27
27
|
def new_by_public_key_blob public_key_blob
|
28
|
-
public_key_blob_h = PublicKeyBlob.
|
28
|
+
public_key_blob_h = PublicKeyBlob.new(logger: logger).decode public_key_blob
|
29
29
|
@publickey = PKey.new logger: logger
|
30
30
|
@publickey.set_public_key(public_key_blob_h[:key])
|
31
31
|
end
|
@@ -39,7 +39,7 @@ module HrrRbSsh
|
|
39
39
|
:'public key algorithm name' => self.class::NAME,
|
40
40
|
:'key' => @publickey.public_key.key_str,
|
41
41
|
}
|
42
|
-
PublicKeyBlob.
|
42
|
+
PublicKeyBlob.new(logger: logger).encode public_key_blob_h
|
43
43
|
end
|
44
44
|
|
45
45
|
def sign signature_blob
|
@@ -47,11 +47,11 @@ module HrrRbSsh
|
|
47
47
|
:'public key algorithm name' => self.class::NAME,
|
48
48
|
:'signature blob' => @publickey.sign(signature_blob),
|
49
49
|
}
|
50
|
-
Signature.
|
50
|
+
Signature.new(logger: logger).encode signature_h
|
51
51
|
end
|
52
52
|
|
53
53
|
def verify signature, signature_blob
|
54
|
-
signature_h = Signature.
|
54
|
+
signature_h = Signature.new(logger: logger).decode signature
|
55
55
|
signature_h[:'public key algorithm name'] == self.class::NAME && @publickey.public_key.verify(signature_h[:'signature blob'], signature_blob)
|
56
56
|
end
|
57
57
|
end
|
@@ -8,10 +8,8 @@ module HrrRbSsh
|
|
8
8
|
module Algorithm
|
9
9
|
class Publickey
|
10
10
|
class SshEd25519
|
11
|
-
|
12
|
-
|
13
|
-
include Codable
|
14
|
-
end
|
11
|
+
class OpenSSHPrivateKey
|
12
|
+
include Codable
|
15
13
|
DEFINITION = [
|
16
14
|
[DataType::String, :'cipher'],
|
17
15
|
[DataType::String, :'kdfname'],
|
@@ -8,10 +8,8 @@ module HrrRbSsh
|
|
8
8
|
module Algorithm
|
9
9
|
class Publickey
|
10
10
|
class SshEd25519
|
11
|
-
|
12
|
-
|
13
|
-
include Codable
|
14
|
-
end
|
11
|
+
class OpenSSHPrivateKeyContent
|
12
|
+
include Codable
|
15
13
|
DEFINITION = [
|
16
14
|
[DataType::Uint64, :'unknown'],
|
17
15
|
[DataType::String, :'name'],
|
@@ -50,8 +50,8 @@ module HrrRbSsh
|
|
50
50
|
decoded_key_str = Base64.decode64(key_str[begin_marker.size...-end_marker.size])
|
51
51
|
raise Error unless decoded_key_str[0,14] == magic
|
52
52
|
|
53
|
-
private_key_h = OpenSSHPrivateKey.decode decoded_key_str[15..-1]
|
54
|
-
private_key_content_h = OpenSSHPrivateKeyContent.decode private_key_h[:'content']
|
53
|
+
private_key_h = OpenSSHPrivateKey.new(logger: logger).decode decoded_key_str[15..-1]
|
54
|
+
private_key_content_h = OpenSSHPrivateKeyContent.new(logger: logger).decode private_key_h[:'content']
|
55
55
|
key_pair = private_key_content_h[:'key pair']
|
56
56
|
|
57
57
|
::Ed25519::SigningKey.new(key_pair[0,32])
|
@@ -8,10 +8,8 @@ module HrrRbSsh
|
|
8
8
|
module Algorithm
|
9
9
|
class Publickey
|
10
10
|
class SshEd25519
|
11
|
-
|
12
|
-
|
13
|
-
include Codable
|
14
|
-
end
|
11
|
+
class PublicKeyBlob
|
12
|
+
include Codable
|
15
13
|
DEFINITION = [
|
16
14
|
[DataType::String, :'public key algorithm name'],
|
17
15
|
[DataType::String, :'key'],
|
@@ -8,10 +8,8 @@ module HrrRbSsh
|
|
8
8
|
module Algorithm
|
9
9
|
class Publickey
|
10
10
|
class SshEd25519
|
11
|
-
|
12
|
-
|
13
|
-
include Codable
|
14
|
-
end
|
11
|
+
class Signature
|
12
|
+
include Codable
|
15
13
|
DEFINITION = [
|
16
14
|
[DataType::String, :'public key algorithm name'],
|
17
15
|
[DataType::String, :'signature blob'],
|