simple_nts_client 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 652264467fb142946c50c1c01e3c5d44fdb68e8dee855246e52bed1dea34752f
4
- data.tar.gz: cd08bca836f061cb2df2f6ed936af9f0b159cb9f1db9a69feddf552ca3883b2e
3
+ metadata.gz: 1600dacea6a8cf46babf3ee8af7dd787bbc98e3cde9466da08bac31344eb0451
4
+ data.tar.gz: cb9fadc6aa0aae82532eb1649eab158becbd5ee32ceb49c0a3f26d7b19340b5e
5
5
  SHA512:
6
- metadata.gz: f34f766f6769a3a0f71ca679d045b0ed6d9ad953b82eeefa5b245c794b6bc8567f6e26facf67a4a7719a179b19ed6fac6648cb8bfe4d6e0cfda1828b025eb706
7
- data.tar.gz: f1bf6f0e3c1b613fddbbf7e20eccb799e52451f9eae59305ad0874a2cf8785669fe24fc6c1538de82b7b967206e035101ba4d67bc3f9e77be4666738078a5d00
6
+ metadata.gz: d6d978023acdffba26264b42e5aed38c469ca0f439ccb3abac670e919c52f7c01119110fdadb6831d82dc5783f80b508f50666ac6bc629007f4ebdc572739832
7
+ data.tar.gz: 24dbd67070a021488b399cb00d47fcd4d5b002f7dc797babb12ec52444dd3bc46de0ff9519f34c376e5375de4c88e140e57cc48f00b2b8ce1f0413bf788e16d7
data/README.md CHANGED
@@ -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-28](https://tools.ietf.org/html/draft-ietf-ntp-using-nts-for-ntp-28)
11
+ * [RFC 8915](https://tools.ietf.org/html/rfc8915)
12
12
 
13
13
 
14
14
  ## Installation
@@ -26,7 +26,7 @@ $ gem install simple_nts_client
26
26
  $ simple_nts_client --help
27
27
  Usage: simple_nts_client [options]
28
28
  -s, --server VALUE NTS-KE server name (default time.cloudflare.com)
29
- -p, --port VALUE NTS-KE port number (default 1234)
29
+ -p, --port VALUE NTS-KE port number (default 4460)
30
30
  -v, --verbose verbose mode (default false)
31
31
  ```
32
32
 
@@ -34,14 +34,14 @@ You can run it the following:
34
34
 
35
35
  ```bash
36
36
  $ simple_nts_client
37
- 2019-07-20 06:00:00 +0900
37
+ 2020-10-30 20:00:00 +0900
38
38
  ```
39
39
 
40
40
  If you need to access other NTS-KE server or port, you can run it the following:
41
41
 
42
42
  ```bash
43
43
  $ simple_nts_client --server YOURSERVER --port YOURPORT
44
- 2019-07-20 06:00:00 +0900
44
+ 2020-10-30 20:00:00 +0900
45
45
  ```
46
46
 
47
47
 
@@ -11,7 +11,7 @@ module Nts
11
11
  # default value
12
12
  opts = {
13
13
  server: 'time.cloudflare.com',
14
- port: 1234,
14
+ port: 4460,
15
15
  verbose: false
16
16
  }
17
17
 
@@ -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-28#section-5.1
81
+ # https://tools.ietf.org/html/rfc8915#section-5.1
82
82
  alg = res.find { |m| m.is_a?(AeadAlgorithmNegotiation) }&.algorithms
83
83
  &.first
84
84
  raise Exception if alg.nil?
@@ -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-28#section-7.6
5
+ # https://tools.ietf.org/html/rfc8915#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-28#section-4
17
+ # https://tools.ietf.org/html/rfc8915#section-4
18
18
  class Record
19
19
  # @param c [Boolean]
20
20
  # @param type [Integer] less than 32768(15 bits)
@@ -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-28#section-4.1.5
11
+ # https://tools.ietf.org/html/rfc8915#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-28#section-4.1.6
5
+ # https://tools.ietf.org/html/rfc8915#section-4.1.6
6
6
  class Cookie < Record
7
7
  attr_reader :cookie
8
8
 
@@ -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-28#section-4.1.1
5
+ # https://tools.ietf.org/html/rfc8915#section-4.1.1
6
6
  class EndOfMessage < Record
7
7
  def initialize
8
8
  super(true, RecordType::END_OF_MESSAGE)
@@ -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-28#section-4.1.3
5
+ # https://tools.ietf.org/html/rfc8915#section-4.1.3
6
6
  module ErrorCode
7
7
  UNRECOGNIZED_CRITICAL_RECORD = "\x00\x00"
8
8
  BAD_REQUEST = "\x00\x01"
@@ -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-28#section-4.1.2
6
+ # https://tools.ietf.org/html/rfc8915#section-4.1.2
7
7
  class NtsNextProtocolNegotiation < Record
8
8
  attr_reader :next_protocol
9
9
 
@@ -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-28#section-4.1.8
5
+ # https://tools.ietf.org/html/rfc8915#section-4.1.8
6
6
  class Ntsv4PortNegotiation < Record
7
7
  attr_reader :port
8
8
 
@@ -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-28#section-4.1.7
5
+ # https://tools.ietf.org/html/rfc8915#section-4.1.7
6
6
  class Ntsv4ServerNegotiation < Record
7
7
  attr_reader :server
8
8
 
@@ -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-28#section-4.1.4
5
+ # https://tools.ietf.org/html/rfc8915#section-4.1.4
6
6
  class WarningRecord < Record
7
7
  attr_reader :warning_code
8
8
 
@@ -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-28#section-7.5
5
+ # https://tools.ietf.org/html/rfc8915#section-7.5
6
6
  module ExtensionFieldType
7
7
  UNIQUE_IDENTIFIER = 260
8
8
  NTS_COOKIE = 516
@@ -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-28#section-5.6
6
+ # https://tools.ietf.org/html/rfc8915#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-28#section-5.4
6
+ # https://tools.ietf.org/html/rfc8915#section-5.4
7
7
  class NtsCookie
8
8
  include Extension
9
9
  attr_reader :cookie
@@ -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-28#section-5.3
6
+ # https://tools.ietf.org/html/rfc8915#section-5.3
7
7
  class UniqueIdentifier
8
8
  include Extension
9
9
  attr_reader :id
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Nts
4
- VERSION = '0.0.3'
4
+ VERSION = '0.0.4'
5
5
  end
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.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - thekuwayama
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-07-23 00:00:00.000000000 Z
11
+ date: 2020-10-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler