simple_nts_client 0.0.1 → 0.0.2
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/.rubocop.yml +1 -1
- data/Gemfile +2 -2
- data/README.md +2 -2
- data/lib/nts/ntske/client.rb +1 -1
- data/lib/nts/ntske/message/aead_algorithm_negotiation.rb +1 -1
- data/lib/nts/ntske/message/cookie.rb +1 -1
- data/lib/nts/ntske/message/end_of_message.rb +1 -1
- data/lib/nts/ntske/message/error_record.rb +2 -1
- data/lib/nts/ntske/message/nts_next_protocol_negotiation.rb +1 -1
- data/lib/nts/ntske/message/ntsv4_port_negotiation.rb +1 -1
- data/lib/nts/ntske/message/ntsv4_server_negotiation.rb +1 -1
- data/lib/nts/ntske/message/warning_record.rb +1 -1
- data/lib/nts/ntske/message.rb +3 -3
- data/lib/nts/sntp/extension/nts_authenticator.rb +1 -1
- data/lib/nts/sntp/extension/nts_cookie.rb +1 -1
- data/lib/nts/sntp/extension/unique_identifier.rb +1 -1
- data/lib/nts/sntp/extension.rb +2 -2
- data/lib/nts/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3452e99b47263c3c1c876411bf05e7518736acb03c9d28bb09f25eea3207235a
|
4
|
+
data.tar.gz: 25ea815f69d92210381423b47695c2b435c964ee6d557ba099cbcdc11f532b03
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 891fc8209f24ceda4ab400d4d4d45266f2dafe02b6b092fb9e4c98ee640d8f86620cbed92810f1aab58a783533b22bd6086717c557efca085f77298abd35df6a
|
7
|
+
data.tar.gz: 70942fefc46c43ced0b0c883681359142cf62ef367670a10d8256b9a702c16e46c6908c0cf1c8fd843f398a71523755a98cb72f77cea73391b0486e875d6951e
|
data/.rubocop.yml
CHANGED
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# simple_nts_client
|
2
2
|
|
3
|
-
[](https://badge.fury.io/rb/simple_nts_client)
|
3
|
+
[](https://badge.fury.io/rb/simple_nts_client)
|
4
4
|
[](https://travis-ci.org/thekuwayama/simple_nts_client)
|
5
5
|
[](https://codeclimate.com/github/thekuwayama/simple_nts_client/maintainability)
|
6
6
|
|
@@ -8,7 +8,7 @@ simple\_nts\_client is CLI that is simple NTS(Network Time Security) Client impl
|
|
8
8
|
This CLI prints the now timestamp got with NTS.
|
9
9
|
Current implementation is based on:
|
10
10
|
|
11
|
-
* [draft-ietf-ntp-using-nts-for-ntp-
|
11
|
+
* [draft-ietf-ntp-using-nts-for-ntp-22](https://tools.ietf.org/html/draft-ietf-ntp-using-nts-for-ntp-22)
|
12
12
|
|
13
13
|
|
14
14
|
## Installation
|
data/lib/nts/ntske/client.rb
CHANGED
@@ -78,7 +78,7 @@ module Nts
|
|
78
78
|
raise Exception if cookies.empty?
|
79
79
|
|
80
80
|
# AEAD algorithm => C2S, S2C key
|
81
|
-
# https://tools.ietf.org/html/draft-ietf-ntp-using-nts-for-ntp-
|
81
|
+
# https://tools.ietf.org/html/draft-ietf-ntp-using-nts-for-ntp-22#section-5.1
|
82
82
|
alg = res.find { |m| m.is_a?(AeadAlgorithmNegotiation) }&.algorithms
|
83
83
|
&.first
|
84
84
|
raise Exception if alg.nil?
|
@@ -8,7 +8,7 @@ module Nts
|
|
8
8
|
AEAD_AES_SIV_CMAC_256 = "\x00\x0F"
|
9
9
|
end
|
10
10
|
|
11
|
-
# https://tools.ietf.org/html/draft-ietf-ntp-using-nts-for-ntp-
|
11
|
+
# https://tools.ietf.org/html/draft-ietf-ntp-using-nts-for-ntp-22#section-4.1.5
|
12
12
|
class AeadAlgorithmNegotiation < Record
|
13
13
|
attr_reader :algorithms
|
14
14
|
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
module Nts
|
4
4
|
module Ntske
|
5
|
-
# https://tools.ietf.org/html/draft-ietf-ntp-using-nts-for-ntp-
|
5
|
+
# https://tools.ietf.org/html/draft-ietf-ntp-using-nts-for-ntp-22#section-4.1.1
|
6
6
|
class EndOfMessage < Record
|
7
7
|
def initialize
|
8
8
|
super(true, RecordType::END_OF_MESSAGE)
|
@@ -2,10 +2,11 @@
|
|
2
2
|
|
3
3
|
module Nts
|
4
4
|
module Ntske
|
5
|
-
# https://tools.ietf.org/html/draft-ietf-ntp-using-nts-for-ntp-
|
5
|
+
# https://tools.ietf.org/html/draft-ietf-ntp-using-nts-for-ntp-22#section-4.1.3
|
6
6
|
module ErrorCode
|
7
7
|
UNRECOGNIZED_CRITICAL_RECORD = "\x00\x00"
|
8
8
|
BAD_REQUEST = "\x00\x01"
|
9
|
+
INTERNAL_SERVER_ERROR = "\x00\x02"
|
9
10
|
end
|
10
11
|
|
11
12
|
class ErrorRecord < Record
|
@@ -3,7 +3,7 @@
|
|
3
3
|
|
4
4
|
module Nts
|
5
5
|
module Ntske
|
6
|
-
# https://tools.ietf.org/html/draft-ietf-ntp-using-nts-for-ntp-
|
6
|
+
# https://tools.ietf.org/html/draft-ietf-ntp-using-nts-for-ntp-22#section-4.1.2
|
7
7
|
class NtsNextProtocolNegotiation < Record
|
8
8
|
attr_reader :next_protocol
|
9
9
|
|
data/lib/nts/ntske/message.rb
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
module Nts
|
4
4
|
module Ntske
|
5
|
-
# https://tools.ietf.org/html/draft-ietf-ntp-using-nts-for-ntp-
|
5
|
+
# https://tools.ietf.org/html/draft-ietf-ntp-using-nts-for-ntp-22#section-7.6
|
6
6
|
module RecordType
|
7
7
|
END_OF_MESSAGE = 0
|
8
8
|
NTS_NEXT_PROTOCOL_NEGOTIATION = 1
|
@@ -14,7 +14,7 @@ module Nts
|
|
14
14
|
NTPV4_PORT_NEGOTIATION = 7
|
15
15
|
end
|
16
16
|
|
17
|
-
# https://tools.ietf.org/html/draft-ietf-ntp-using-nts-for-ntp-
|
17
|
+
# https://tools.ietf.org/html/draft-ietf-ntp-using-nts-for-ntp-22#section-4
|
18
18
|
class Record
|
19
19
|
# @param c [Boolean]
|
20
20
|
# @param type [Integer] less than 32768(15 bits)
|
@@ -32,7 +32,7 @@ module Nts
|
|
32
32
|
end
|
33
33
|
end
|
34
34
|
|
35
|
-
Dir[File.dirname(__FILE__) + '/message/*.rb'].each { |f| require f }
|
35
|
+
Dir[File.dirname(__FILE__) + '/message/*.rb'].sort.each { |f| require f }
|
36
36
|
|
37
37
|
module Nts
|
38
38
|
module Ntske
|
@@ -3,7 +3,7 @@
|
|
3
3
|
module Nts
|
4
4
|
module Sntp
|
5
5
|
module Extension
|
6
|
-
# https://tools.ietf.org/html/draft-ietf-ntp-using-nts-for-ntp-
|
6
|
+
# https://tools.ietf.org/html/draft-ietf-ntp-using-nts-for-ntp-22#section-5.6
|
7
7
|
class NtsAuthenticator
|
8
8
|
include Extension
|
9
9
|
attr_reader :nonce, :ciphertext, :padding_length
|
@@ -3,7 +3,7 @@
|
|
3
3
|
module Nts
|
4
4
|
module Sntp
|
5
5
|
module Extension
|
6
|
-
# https://tools.ietf.org/html/draft-ietf-ntp-using-nts-for-ntp-
|
6
|
+
# https://tools.ietf.org/html/draft-ietf-ntp-using-nts-for-ntp-22#section-5.3
|
7
7
|
class UniqueIdentifier
|
8
8
|
include Extension
|
9
9
|
attr_reader :id
|
data/lib/nts/sntp/extension.rb
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
module Nts
|
4
4
|
module Sntp
|
5
|
-
# https://tools.ietf.org/html/draft-ietf-ntp-using-nts-for-ntp-
|
5
|
+
# https://tools.ietf.org/html/draft-ietf-ntp-using-nts-for-ntp-22#section-7.5
|
6
6
|
module ExtensionFieldType
|
7
7
|
UNIQUE_IDENTIFIER = 260
|
8
8
|
NTS_COOKIE = 516
|
@@ -35,4 +35,4 @@ module Nts
|
|
35
35
|
end
|
36
36
|
end
|
37
37
|
|
38
|
-
Dir[File.dirname(__FILE__) + '/extension/*.rb'].each { |f| require f }
|
38
|
+
Dir[File.dirname(__FILE__) + '/extension/*.rb'].sort.each { |f| require f }
|
data/lib/nts/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: simple_nts_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- thekuwayama
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-03-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -124,7 +124,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
124
124
|
- !ruby/object:Gem::Version
|
125
125
|
version: '0'
|
126
126
|
requirements: []
|
127
|
-
rubygems_version: 3.
|
127
|
+
rubygems_version: 3.1.2
|
128
128
|
signing_key:
|
129
129
|
specification_version: 4
|
130
130
|
summary: Simple NTS(Network Time Security) Client
|