dnsruby 1.70.0 → 1.71.0

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: 4dc686d217ec8e77f7abacc6b43390f892920c36a99f88f30f10dd55945b262b
4
- data.tar.gz: 4763e50a42d153c3921c40cdadd273259fa882007da3dbc43b2098d50d895be1
3
+ metadata.gz: 269c27f2434453482847eab90060c2de583ca876e9056b8acff0c9df23a64a84
4
+ data.tar.gz: 37c09c9a2c25f97cfd391ee8662de09b1698a44b189abe2cd75753579c87379a
5
5
  SHA512:
6
- metadata.gz: 0550b91ea605ae46381df4eb119b7457cef365f0981b90185479b5e490fede56fd72323b9c98b4e4f886bf16925fc6b268c6d0f753196d5cb6f1daaea05499e1
7
- data.tar.gz: 3a16635ca644a6d4654bdaa9d83c7c5e0bba69289ffa59e2ad69994099b03b2e15bc2eeaf521200104d860e5127a1066bb41e39f5492c8ee010438a9c81c9a93
6
+ metadata.gz: 6863374c8f220932c6aff08fce2a8afd1e38267f44f505121516580b69e4c5691a613d11b45e4227939586f6283743871834138bca06a8776a26f6b32c2141ad
7
+ data.tar.gz: e58edc0688147d6c8e6576bf6144469d52b09120da7a7d7d0c00fc962579e1c49e23962264caa448d1bb54c70559e25e4663a176d95fe5282a43dba631233035
@@ -7,7 +7,7 @@ jobs:
7
7
  runs-on: ubuntu-latest
8
8
  strategy:
9
9
  matrix:
10
- ruby: [ '2.6', '2.7', '3.0', '3.1', '3.2' ] # , 'ruby-head' ]
10
+ ruby: [ '3.1', '3.2', '3.3' ] # , 'ruby-head' ]
11
11
  name: Ruby ${{ matrix.ruby }} tests
12
12
  steps:
13
13
  - uses: actions/checkout@v2
data/RELEASE_NOTES.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Release Notes
2
2
 
3
+ ## v.1.71.0
4
+
5
+ * Fix assigning public_key in ECDSA - thanks Jiří Kubíček!
6
+
3
7
  ## v.1.70.0
4
8
 
5
9
  * OpenSSL 3 support
data/Rakefile CHANGED
@@ -27,6 +27,7 @@ def create_task(task_name, test_suite_filespec)
27
27
  end
28
28
 
29
29
  create_task(:test, 'test/ts_dnsruby.rb')
30
+ create_task(:dnskey, 'test/tc_dnskey.rb')
30
31
  create_task(:test_offline, 'test/ts_offline.rb')
31
32
  create_task(:test_online, 'test/ts_online.rb')
32
33
  create_task(:soak, 'test/tc_soak.rb')
data/dnsruby.gemspec CHANGED
@@ -38,7 +38,7 @@ DNSSEC NSEC3 support.'
38
38
  s.add_development_dependency 'rake', '>= 13.0.6'
39
39
  s.add_development_dependency 'minitest', '~> 5.18.0'
40
40
  s.add_development_dependency 'rubydns', '>= 2.0.2'
41
- s.add_development_dependency 'nio4r', '>= 2.5.8'
41
+ s.add_development_dependency 'nio4r', '>= 2.7.0'
42
42
  s.add_development_dependency 'minitest-display', '>= 0.3.1'
43
43
  s.add_development_dependency('yard', '>= 0.9')
44
44
  # s.add_development_dependency('io-event', '>=1.1.7')
@@ -392,15 +392,22 @@ module Dnsruby
392
392
  # uncompressed form of a curve point, "x | y".
393
393
  def ec_key(curve = 'prime256v1')
394
394
  group = OpenSSL::PKey::EC::Group.new(curve)
395
- pkey = OpenSSL::PKey::EC.new(group)
396
395
  # DNSSEC pub does not have first octet that determines whether it's uncompressed
397
396
  # or compressed form, but it's required by OpenSSL to parse EC point correctly
398
- public_key_with_prefix = "\x04" + @key.to_s
399
- pkey = OpenSSL::PKey::EC.new(group, public_key_with_prefix)
400
-
401
- pkey
402
-
397
+ dnskey_bn = OpenSSL::BN.new("\x04" + @key, 2)
398
+ key_point = OpenSSL::PKey::EC::Point.new(group, dnskey_bn)
399
+
400
+ asn1 = OpenSSL::ASN1::Sequence.new(
401
+ [
402
+ OpenSSL::ASN1::Sequence.new([
403
+ OpenSSL::ASN1::ObjectId.new("id-ecPublicKey"),
404
+ OpenSSL::ASN1::ObjectId.new(group.curve_name)
405
+ ]),
406
+ OpenSSL::ASN1::BitString.new(key_point.to_octet_string(:uncompressed))
407
+ ]
408
+ )
409
+ OpenSSL::PKey::EC.new(asn1.to_der)
403
410
  end
404
411
  end
405
412
  end
406
- end
413
+ end
@@ -234,7 +234,7 @@ module Dnsruby
234
234
  def verify_common(response)#:nodoc: all
235
235
  tsig_rr = response.tsig
236
236
 
237
- if (!tsig_rr)
237
+ if (!tsig_rr)
238
238
  response.tsigerror = RCode.FORMERR
239
239
  response.tsigstate = :Failed
240
240
  return false
@@ -1,3 +1,3 @@
1
1
  module Dnsruby
2
- VERSION = '1.70.0'
2
+ VERSION = '1.71.0'
3
3
  end
@@ -138,7 +138,7 @@ module Dnsruby
138
138
  send_message(socket, msg)
139
139
  next
140
140
  end
141
- raise ResolvError.new(rcode.string);
141
+ raise ResolvError.new(rcode.string)
142
142
  end
143
143
 
144
144
  if (response.question[0].qtype != @transfer_type)
data/test/tc_dns.rb CHANGED
@@ -25,7 +25,7 @@ class TestDNS < Minitest::Test
25
25
  end
26
26
 
27
27
  def test_ipv4_address
28
- Dnsruby::DNS.open { |dns| dns.getnames(Dnsruby::IPv4.create("221.186.184.68")) }
28
+ Dnsruby::DNS.open { |dns| dns.getnames(Dnsruby::IPv4.create("8.8.8.8")) }
29
29
  end
30
30
 
31
31
  # def test_resolv_rb_api
data/test/tc_ecdsa.rb ADDED
@@ -0,0 +1,27 @@
1
+ require_relative 'spec_helper'
2
+
3
+ Dnsruby::TheLog.level = Logger::DEBUG
4
+
5
+ class VerifierTest < Minitest::Test
6
+
7
+ def test_ecdsa
8
+ inner_resolver = Dnsruby::Resolver.new
9
+ inner_resolver.do_validation = true
10
+ inner_resolver.dnssec = true
11
+ resolver = Dnsruby::Recursor.new(inner_resolver)
12
+ resolver.dnssec = true
13
+
14
+ # Dnsruby::TheLog.level=Logger::DEBUG
15
+
16
+ name = 'carlgo11.com'
17
+ type = 'A'
18
+ klass = 'IN'
19
+
20
+ begin
21
+ answer = resolver.query(name, type, klass)
22
+ print answer
23
+ rescue Exception => e
24
+ fatal_error("query failed: #{e}")
25
+ end
26
+ end
27
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dnsruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.70.0
4
+ version: 1.71.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex Dalitz
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-04-11 00:00:00.000000000 Z
11
+ date: 2024-03-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -58,14 +58,14 @@ dependencies:
58
58
  requirements:
59
59
  - - ">="
60
60
  - !ruby/object:Gem::Version
61
- version: 2.5.8
61
+ version: 2.7.0
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - ">="
67
67
  - !ruby/object:Gem::Version
68
- version: 2.5.8
68
+ version: 2.7.0
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: minitest-display
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -254,6 +254,7 @@ files:
254
254
  - test/tc_dns.rb
255
255
  - test/tc_dnskey.rb
256
256
  - test/tc_ds.rb
257
+ - test/tc_ecdsa.rb
257
258
  - test/tc_encoding.rb
258
259
  - test/tc_escapedchars.rb
259
260
  - test/tc_gpos.rb
@@ -335,7 +336,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
335
336
  - !ruby/object:Gem::Version
336
337
  version: '0'
337
338
  requirements: []
338
- rubygems_version: 3.3.7
339
+ rubygems_version: 3.5.3
339
340
  signing_key:
340
341
  specification_version: 4
341
342
  summary: Ruby DNS(SEC) implementation