simple_nts_client 0.0.1 → 0.0.2

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: fc37d0334da875bdc71e5089fc001e0ce29772ab238db3ca93f750f25579d417
4
- data.tar.gz: c432c7f707cdbe678df8181881900525d39fa6e502190924fb3b6025ad5ca63e
3
+ metadata.gz: 3452e99b47263c3c1c876411bf05e7518736acb03c9d28bb09f25eea3207235a
4
+ data.tar.gz: 25ea815f69d92210381423b47695c2b435c964ee6d557ba099cbcdc11f532b03
5
5
  SHA512:
6
- metadata.gz: 054d1484e8d6c17b1da9f183edd9c18c79fe83b86747555774a551b6791460a67c9c6aff5dff5ef5b9bda1a47e8613e58ceec5dd2ae3848253dc8718973bcbb2
7
- data.tar.gz: ee2d152f81b731ab6e9213acb11b8e7af43366cb6565a3369000efbb8f8d005f2f46dbdde95708fa3c1b7e26917a94cc79eafb62834cbaab9042535645ef3503
6
+ metadata.gz: 891fc8209f24ceda4ab400d4d4d45266f2dafe02b6b092fb9e4c98ee640d8f86620cbed92810f1aab58a783533b22bd6086717c557efca085f77298abd35df6a
7
+ data.tar.gz: 70942fefc46c43ced0b0c883681359142cf62ef367670a10d8256b9a702c16e46c6908c0cf1c8fd843f398a71523755a98cb72f77cea73391b0486e875d6951e
data/.rubocop.yml CHANGED
@@ -16,7 +16,7 @@ Metrics/AbcSize:
16
16
  Metrics/MethodLength:
17
17
  Max: 30
18
18
 
19
- Naming/UncommunicativeMethodParamName:
19
+ Naming/MethodParameterName:
20
20
  MinNameLength: 1
21
21
 
22
22
  Metrics/BlockLength:
data/Gemfile CHANGED
@@ -9,6 +9,6 @@ gem 'tttls1.3', '>= 0.2.7'
9
9
  group :test do
10
10
  gem 'pry'
11
11
  gem 'pry-byebug'
12
- gem 'rspec', '3.8.0'
13
- gem 'rubocop', '0.68.1'
12
+ gem 'rspec', '3.9.0'
13
+ gem 'rubocop', '0.79.0'
14
14
  end
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # simple_nts_client
2
2
 
3
- [![Gem Version](https://badge.fury.io/simple_nts_client.svg)](https://badge.fury.io/rb/simple_nts_client)
3
+ [![Gem Version](https://badge.fury.io/rb/simple_nts_client.svg)](https://badge.fury.io/rb/simple_nts_client)
4
4
  [![Build Status](https://travis-ci.org/thekuwayama/simple_nts_client.svg?branch=master)](https://travis-ci.org/thekuwayama/simple_nts_client)
5
5
  [![Maintainability](https://api.codeclimate.com/v1/badges/7b34a4868f1e297af084/maintainability)](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-20](https://tools.ietf.org/html/draft-ietf-ntp-using-nts-for-ntp-20)
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
@@ -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-20#section-5.1
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-20#section-4.1.5
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-20#section-4.1.6
5
+ # https://tools.ietf.org/html/draft-ietf-ntp-using-nts-for-ntp-22#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-20#section-4.1.1
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-20#section-4.1.3
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-20#section-4.1.2
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
 
@@ -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-20#section-4.1.8
5
+ # https://tools.ietf.org/html/draft-ietf-ntp-using-nts-for-ntp-22#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-20#section-4.1.7
5
+ # https://tools.ietf.org/html/draft-ietf-ntp-using-nts-for-ntp-22#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-20#section-4.1.4
5
+ # https://tools.ietf.org/html/draft-ietf-ntp-using-nts-for-ntp-22#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 Ntske
5
- # https://tools.ietf.org/html/draft-ietf-ntp-using-nts-for-ntp-20#section-7.6
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-20#section-4
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-20#section-5.6
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-20#section-5.4
6
+ # https://tools.ietf.org/html/draft-ietf-ntp-using-nts-for-ntp-22#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-20#section-5.3
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
@@ -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-20#section-7.5
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Nts
4
- VERSION = '0.0.1'
4
+ VERSION = '0.0.2'
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.1
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: 2019-09-26 00:00:00.000000000 Z
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.0.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