ronin-support 1.0.3 → 1.0.5

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: 3f47bb5e6e9e8b720f2b2e66cfd1eb49bcb4562e5ed0025a3ed491ee7e39f106
4
- data.tar.gz: a68c5f263d3d7caf40f789354e51a977ada25c52cb7a93f58c4c10208c40da67
3
+ metadata.gz: a34adac08397fc6bc4164f60be481e5f945eda3d18fcf5f93c0145fcc6a624ea
4
+ data.tar.gz: a6199b50de111e4140ee8159a0537b557e1e0e481f51ca04e362222a13572338
5
5
  SHA512:
6
- metadata.gz: 302af7c9324ba08daff8107236734c211b10f969723f55cac2843ec52a5e367357c1b3c06d4138215553960a994ae4c3338e3a4302105979fedb1dac51b2cc20
7
- data.tar.gz: 542b8b0d1caab51fce5fedf516b3b849c2a673492995916db6a43b3522090cd8bb1acc1b3200741832153e874522fcd60eae76f74e2aa90bb76d57dafb6daa1e
6
+ metadata.gz: 3b998a3b8fdfb358d1416d77c8f1107ef708f97ab635b6e1d5cd3d24804f958f4ea23e670cdf0c6dd718e358fccfda3fc2609432563c27e1f68d4f0c785bc426
7
+ data.tar.gz: b1d94229203e0485999d89a6521bd5ec43aa1356d347ae90f09e6ef85255b704a5e2de2bfcedd02a6b91596942a3673b796b8f70d760f883110f033f86545557
@@ -12,11 +12,12 @@ jobs:
12
12
  - '3.0'
13
13
  - '3.1'
14
14
  - '3.2'
15
+ - '3.3'
15
16
  # - jruby
16
17
  # - truffleruby
17
18
  name: Ruby ${{ matrix.ruby }}
18
19
  steps:
19
- - uses: actions/checkout@v2
20
+ - uses: actions/checkout@v4
20
21
  - name: Set up Ruby
21
22
  uses: ruby/setup-ruby@v1
22
23
  with:
@@ -31,7 +32,7 @@ jobs:
31
32
  rubocop:
32
33
  runs-on: ubuntu-latest
33
34
  steps:
34
- - uses: actions/checkout@v2
35
+ - uses: actions/checkout@v4
35
36
  - name: Set up Ruby
36
37
  uses: ruby/setup-ruby@v1
37
38
  with:
data/ChangeLog.md CHANGED
@@ -1,3 +1,18 @@
1
+ ### 1.0.5 / 2023-12-27
2
+
3
+ * Fixed a bug in {Ronin::Support::Binary::Stream::Methods#read_string} on Ruby
4
+ 3.3.0.
5
+
6
+ ### 1.0.4 / 2023-12-15
7
+
8
+ * Fixed a bug in {Array#pack} where complex types (ex: `[[:uint32, 4], 10]`)
9
+ were not being packed correctly.
10
+ * Fixed a bug in {String#unpack} where complex types (ex: `[[:uint32, 4], 10]`)
11
+ were not being unpacked correctly.
12
+ * Fixed a bug in {Ronin::Support::Binary::CTypes::ObjectType#initialize} when
13
+ the object's type has an infinite size, such as an unbounded Array type.
14
+ * Allow using non-RSA keys in all SSL/TLS methods.
15
+
1
16
  ### 1.0.3 / 2023-09-19
2
17
 
3
18
  * {Ronin::Support::Crypto::Cert::Name#entries} now returns UTF-8 encoded
@@ -41,6 +41,11 @@ class Array
41
41
  # :mips, :mips_le, :mips64, :mips64_le, nil] :arch
42
42
  # The desired architecture to pack the data for.
43
43
  #
44
+ # @option kwargs [:linux, :macos, :windows,
45
+ # :android, :apple_ios, :bsd,
46
+ # :freebsd, :openbsd, :netbsd] :os
47
+ # The Operating System (OS) to use.
48
+ #
44
49
  # @return [String]
45
50
  # The packed Array.
46
51
  #
@@ -67,8 +72,8 @@ class Array
67
72
  if (arguments.length == 1 && arguments.first.kind_of?(String))
68
73
  pack_original(arguments.first)
69
74
  else
70
- format = Ronin::Support::Binary::Template.new(arguments,**kwargs)
71
- pack_original(format.pack_string)
75
+ template = Ronin::Support::Binary::Template.new(arguments,**kwargs)
76
+ template.pack(*self)
72
77
  end
73
78
  end
74
79
 
@@ -43,6 +43,11 @@ class String
43
43
  # :mips, :mips_le, :mips64, :mips64_le, nil] :arch
44
44
  # The desired architecture that the data was packed for.
45
45
  #
46
+ # @option kwargs [:linux, :macos, :windows,
47
+ # :android, :apple_ios, :bsd,
48
+ # :freebsd, :openbsd, :netbsd] :os
49
+ # The Operating System (OS) to use.
50
+ #
46
51
  # @return [Array]
47
52
  # The values unpacked from the String.
48
53
  #
@@ -69,8 +74,8 @@ class String
69
74
  if (arguments.length == 1 && arguments.first.kind_of?(String))
70
75
  unpack_original(arguments.first)
71
76
  else
72
- format = Ronin::Support::Binary::Template.new(arguments,**kwargs)
73
- unpack_original(format.pack_string)
77
+ template = Ronin::Support::Binary::Template.new(arguments,**kwargs)
78
+ template.unpack(self)
74
79
  end
75
80
  end
76
81
 
@@ -45,7 +45,13 @@ module Ronin
45
45
  def initialize(size)
46
46
  @size = size
47
47
 
48
- super(pack_string: "a#{@size}")
48
+ super(
49
+ pack_string: if size.finite?
50
+ "a#{@size}"
51
+ else
52
+ 'a*'
53
+ end
54
+ )
49
55
  end
50
56
 
51
57
  end
@@ -44,7 +44,7 @@ module Ronin
44
44
  typedef :long, :__blkcnt_t
45
45
  typedef :long, :__blksize_t
46
46
  typedef :long, :blksize_t
47
- typedef types::POINTER, :__caddr_t
47
+ typedef :pointer, :__caddr_t
48
48
  typedef :int, :__clockid_t
49
49
  typedef :int, :clockid_t
50
50
  typedef :long, :__clock_t
@@ -170,7 +170,7 @@ module Ronin
170
170
  typedef :uint, :nlink_t
171
171
  typedef :long_long, :__off64_t
172
172
  typedef :long_long, :off_t
173
- typedef types::POINTER, :__qaddr_t
173
+ typedef :pointer, :__qaddr_t
174
174
  typedef :long_long, :__quad_t
175
175
  typedef :long_long, :quad_t
176
176
  typedef :ulong_long, :__rlim64_t
@@ -111,7 +111,11 @@ module Ronin
111
111
  # @api public
112
112
  #
113
113
  def read_string(length=nil)
114
- new_string = String.new('', encoding: external_encoding)
114
+ new_string = if (encoding = external_encoding)
115
+ String.new('', encoding: encoding)
116
+ else
117
+ String.new('')
118
+ end
115
119
 
116
120
  if length
117
121
  length.times do
@@ -132,11 +132,16 @@ module Ronin
132
132
  # :arm64, :arm64_le, :arm64_be] :arch
133
133
  # The desired architecture for the values within the template.
134
134
  #
135
+ # @option kwargs [:linux, :macos, :windows,
136
+ # :android, :apple_ios, :bsd,
137
+ # :freebsd, :openbsd, :netbsd] :os
138
+ # The Operating System (OS) to use.
139
+ #
135
140
  # @raise [ArgumentError]
136
141
  # A given type is not known.
137
142
  #
138
143
  # @example
139
- # template = Template.new([:uint32, [:char, 100]])
144
+ # template = Template.new([:uint32, [:char, 10]])
140
145
  # template.pack(0x123456, ['A', 'B', 'C'])
141
146
  # # => "CBA\x00XYZ\x00\x00\x00\x00\x00\x00\x00"
142
147
  # template.unpack("CBA\x00XYZ\x00\x00\x00\x00\x00\x00\x00")
@@ -164,9 +169,39 @@ module Ronin
164
169
  end
165
170
  end
166
171
 
172
+ #
173
+ # Alias for `Template.new`.
174
+ #
175
+ # @param [::Array<Symbol, (Symbol, Integer)>] fields
176
+ # The C-types which the packer will use.
177
+ #
178
+ # @param [Hash{Symbol => Object}] kwargs
179
+ # Additional keyword arguments.
180
+ #
181
+ # @option kwargs [:little, :big, :net, nil] :endian
182
+ # The desired endianness of the values within the template.
183
+ #
184
+ # @option kwargs [:x86, :x86_64,
185
+ # :ppc, :ppc64,
186
+ # :mips, :mips_le, :mips_be,
187
+ # :mips64, :mips64_le, :mips64_be,
188
+ # :arm, :arm_le, :arm_be,
189
+ # :arm64, :arm64_le, :arm64_be] :arch
190
+ # The desired architecture for the values within the template.
191
+ #
192
+ # @option kwargs [:linux, :macos, :windows,
193
+ # :android, :apple_ios, :bsd,
194
+ # :freebsd, :openbsd, :netbsd] :os
195
+ # The Operating System (OS) to use.
196
+ #
197
+ # @return [Template]
198
+ # The new template object.
199
+ #
200
+ # @raise [ArgumentError]
201
+ # A given type is not known.
167
202
  #
168
203
  # @example
169
- # template = Template.new[:uint32, [:char, 10]]
204
+ # template = Template[:uint32, [:char, 10]]
170
205
  # template.pack(0x123456, ['A', 'B', 'C'])
171
206
  # # => "CBA\x00XYZ\x00\x00\x00\x00\x00\x00\x00"
172
207
  # template.unpack("CBA\x00XYZ\x00\x00\x00\x00\x00\x00\x00")
@@ -78,7 +78,7 @@ class Integer
78
78
  # The `format:` or `case:` keyword argument is invalid.
79
79
  #
80
80
  # @example
81
- # 0x41.html_enocde
81
+ # 0x41.html_encode
82
82
  # # => "&#65;"
83
83
  #
84
84
  # @example Zero-padding:
@@ -182,7 +182,7 @@ module Ronin
182
182
  # The HTTP method to use for the request.
183
183
  #
184
184
  # @param [URI::HTTP, Addressable::URI, String] url
185
- # Optional URL to create the HTTP request for.
185
+ # The URL to create the HTTP request for.
186
186
  #
187
187
  # @!macro request_kwargs
188
188
  # @!macro connect_kwargs
@@ -215,7 +215,7 @@ module Ronin
215
215
  # The HTTP method to use for the request.
216
216
  #
217
217
  # @param [URI::HTTP, Addressable::URI, String] url
218
- # Optional URL to create the HTTP request for.
218
+ # The URL to create the HTTP request for.
219
219
  #
220
220
  # @!macro request_kwargs
221
221
  # @!macro connect_kwargs
@@ -240,7 +240,7 @@ module Ronin
240
240
  # The HTTP method to use for the request.
241
241
  #
242
242
  # @param [URI::HTTP, Addressable::URI, String] url
243
- # Optional URL to create the HTTP request for.
243
+ # The URL to create the HTTP request for.
244
244
  #
245
245
  # @!macro request_kwargs
246
246
  # @!macro connect_kwargs
@@ -263,7 +263,7 @@ module Ronin
263
263
  # The HTTP method to use for the request.
264
264
  #
265
265
  # @param [URI::HTTP, Addressable::URI, String] url
266
- # Optional URL to create the HTTP request for.
266
+ # The URL to create the HTTP request for.
267
267
  #
268
268
  # @!macro request_kwargs
269
269
  # @!macro connect_kwargs
@@ -285,7 +285,7 @@ module Ronin
285
285
  # Sends an HTTP request and returns the `Server` header.
286
286
  #
287
287
  # @param [URI::HTTP, Addressable::URI, String] url
288
- # Optional URL to create the HTTP request for.
288
+ # The URL to create the HTTP request for.
289
289
  #
290
290
  # @!macro connect_kwargs
291
291
  # @!macro request_kwargs
@@ -307,7 +307,7 @@ module Ronin
307
307
  # Sends an HTTP request and returns the `X-Powered-By` header.
308
308
  #
309
309
  # @param [URI::HTTP, Addressable::URI, String] url
310
- # Optional URL to create the HTTP request for.
310
+ # The URL to create the HTTP request for.
311
311
  #
312
312
  # @!macro request_kwargs
313
313
  # @!macro connect_kwargs
@@ -332,7 +332,7 @@ module Ronin
332
332
  # The HTTP method to use for the request.
333
333
  #
334
334
  # @param [URI::HTTP, Addressable::URI, String] url
335
- # Optional URL to create the HTTP request for.
335
+ # The URL to create the HTTP request for.
336
336
  #
337
337
  # @!macro request_kwargs
338
338
  # @!macro connect_kwargs
@@ -354,7 +354,7 @@ module Ronin
354
354
  # Performs a `COPY` request for the given URI.
355
355
  #
356
356
  # @param [URI::HTTP, Addressable::URI, String] url
357
- # Optional URL to create the HTTP request for.
357
+ # The URL to create the HTTP request for.
358
358
  #
359
359
  # @!macro request_kwargs
360
360
  # @!macro connect_kwargs
@@ -372,15 +372,15 @@ module Ronin
372
372
  #
373
373
  # @api public
374
374
  #
375
- def http_copy(url, ssl: nil, **kwargs)
376
- Network::HTTP.copy(url, ssl: ssl, **kwargs)
375
+ def http_copy(url, ssl: nil, **kwargs,&block)
376
+ Network::HTTP.copy(url, ssl: ssl, **kwargs,&block)
377
377
  end
378
378
 
379
379
  #
380
380
  # Performs a `DELETE` request for the given URI.
381
381
  #
382
382
  # @param [URI::HTTP, Addressable::URI, String] url
383
- # Optional URL to create the HTTP request for.
383
+ # The URL to create the HTTP request for.
384
384
  #
385
385
  # @!macro request_kwargs
386
386
  # @!macro connect_kwargs
@@ -406,7 +406,7 @@ module Ronin
406
406
  # Performs a `GET` request for the given URI.
407
407
  #
408
408
  # @param [URI::HTTP, Addressable::URI, String] url
409
- # Optional URL to create the HTTP request for.
409
+ # The URL to create the HTTP request for.
410
410
  #
411
411
  # @!macro request_kwargs
412
412
  # @!macro connect_kwargs
@@ -433,7 +433,7 @@ module Ronin
433
433
  # headers.
434
434
  #
435
435
  # @param [URI::HTTP, Addressable::URI, String] url
436
- # Optional URL to create the HTTP request for.
436
+ # The URL to create the HTTP request for.
437
437
  #
438
438
  # @!macro request_kwargs
439
439
  # @!macro connect_kwargs
@@ -456,7 +456,7 @@ module Ronin
456
456
  # header(s).
457
457
  #
458
458
  # @param [URI::HTTP, Addressable::URI, String] url
459
- # Optional URL to create the HTTP request for.
459
+ # The URL to create the HTTP request for.
460
460
  #
461
461
  # @!macro request_kwargs
462
462
  # @!macro connect_kwargs
@@ -477,7 +477,7 @@ module Ronin
477
477
  # body.
478
478
  #
479
479
  # @param [URI::HTTP, Addressable::URI, String] url
480
- # Optional URL to create the HTTP request for.
480
+ # The URL to create the HTTP request for.
481
481
  #
482
482
  # @!macro request_kwargs
483
483
  # @!macro connect_kwargs
@@ -497,7 +497,7 @@ module Ronin
497
497
  # Performs a `HEAD` request for the given URI.
498
498
  #
499
499
  # @param [URI::HTTP, Addressable::URI, String] url
500
- # Optional URL to create the HTTP request for.
500
+ # The URL to create the HTTP request for.
501
501
  #
502
502
  # @!macro request_kwargs
503
503
  # @!macro connect_kwargs
@@ -523,7 +523,7 @@ module Ronin
523
523
  # Performs a `LOCK` request for the given URI.
524
524
  #
525
525
  # @param [URI::HTTP, Addressable::URI, String] url
526
- # Optional URL to create the HTTP request for.
526
+ # The URL to create the HTTP request for.
527
527
  #
528
528
  # @!macro request_kwargs
529
529
  # @!macro connect_kwargs
@@ -549,7 +549,7 @@ module Ronin
549
549
  # Performs a `MKCOL` request for the given URI.
550
550
  #
551
551
  # @param [URI::HTTP, Addressable::URI, String] url
552
- # Optional URL to create the HTTP request for.
552
+ # The URL to create the HTTP request for.
553
553
  #
554
554
  # @!macro request_kwargs
555
555
  # @!macro connect_kwargs
@@ -575,7 +575,7 @@ module Ronin
575
575
  # Performs a `MOVE` request for the given URI.
576
576
  #
577
577
  # @param [URI::HTTP, Addressable::URI, String] url
578
- # Optional URL to create the HTTP request for.
578
+ # The URL to create the HTTP request for.
579
579
  #
580
580
  # @!macro request_kwargs
581
581
  # @!macro connect_kwargs
@@ -601,7 +601,7 @@ module Ronin
601
601
  # Performs a `OPTIONS` request for the given URI.
602
602
  #
603
603
  # @param [URI::HTTP, Addressable::URI, String] url
604
- # Optional URL to create the HTTP request for.
604
+ # The URL to create the HTTP request for.
605
605
  #
606
606
  # @!macro request_kwargs
607
607
  # @!macro connect_kwargs
@@ -628,17 +628,11 @@ module Ronin
628
628
  # `Allow` response header.
629
629
  #
630
630
  # @param [URI::HTTP, Addressable::URI, String] url
631
- # Optional URL to create the HTTP request for.
631
+ # The URL to create the HTTP request for.
632
632
  #
633
633
  # @!macro request_kwargs
634
634
  # @!macro connect_kwargs
635
635
  #
636
- # @yield [response]
637
- # If a block is given it will be passed the received HTTP response.
638
- #
639
- # @yieldparam [Net::HTTPRresponse] response
640
- # The received HTTP response object.
641
- #
642
636
  # @return [Array<Symbol>]
643
637
  # The allowed HTTP request methods for the given URL.
644
638
  #
@@ -646,15 +640,15 @@ module Ronin
646
640
  #
647
641
  # @api public
648
642
  #
649
- def http_allowed_methods(url, ssl: nil, **kwargs,&block)
650
- Network::HTTP.allowed_methods(url, ssl: ssl, **kwargs,&block)
643
+ def http_allowed_methods(url, ssl: nil, **kwargs)
644
+ Network::HTTP.allowed_methods(url, ssl: ssl, **kwargs)
651
645
  end
652
646
 
653
647
  #
654
648
  # Performs a `PATCH` request for the given URI.
655
649
  #
656
650
  # @param [URI::HTTP, Addressable::URI, String] url
657
- # Optional URL to create the HTTP request for.
651
+ # The URL to create the HTTP request for.
658
652
  #
659
653
  # @!macro request_kwargs
660
654
  # @!macro connect_kwargs
@@ -682,7 +676,7 @@ module Ronin
682
676
  # Performs a `POST` request for the given URI.
683
677
  #
684
678
  # @param [URI::HTTP, Addressable::URI, String] url
685
- # Optional URL to create the HTTP request for.
679
+ # The URL to create the HTTP request for.
686
680
  #
687
681
  # @!macro request_kwargs
688
682
  # @!macro connect_kwargs
@@ -709,7 +703,7 @@ module Ronin
709
703
  # headers.
710
704
  #
711
705
  # @param [URI::HTTP, Addressable::URI, String] url
712
- # Optional URL to create the HTTP request for.
706
+ # The URL to create the HTTP request for.
713
707
  #
714
708
  # @!macro request_kwargs
715
709
  # @!macro connect_kwargs
@@ -732,7 +726,7 @@ module Ronin
732
726
  # response body.
733
727
  #
734
728
  # @param [URI::HTTP, Addressable::URI, String] url
735
- # Optional URL to create the HTTP request for.
729
+ # The URL to create the HTTP request for.
736
730
  #
737
731
  # @!macro request_kwargs
738
732
  # @!macro connect_kwargs
@@ -752,7 +746,7 @@ module Ronin
752
746
  # Performs a `PROPFIND` request for the given URI.
753
747
  #
754
748
  # @param [URI::HTTP, Addressable::URI, String] url
755
- # Optional URL to create the HTTP request for.
749
+ # The URL to create the HTTP request for.
756
750
  #
757
751
  # @!macro request_kwargs
758
752
  # @!macro connect_kwargs
@@ -780,7 +774,7 @@ module Ronin
780
774
  # Performs a `PROPPATCH` request for the given URI.
781
775
  #
782
776
  # @param [URI::HTTP, Addressable::URI, String] url
783
- # Optional URL to create the HTTP request for.
777
+ # The URL to create the HTTP request for.
784
778
  #
785
779
  # @!macro request_kwargs
786
780
  # @!macro connect_kwargs
@@ -808,7 +802,7 @@ module Ronin
808
802
  # Performs a `PUT` request for the given URI.
809
803
  #
810
804
  # @param [URI::HTTP, Addressable::URI, String] url
811
- # Optional URL to create the HTTP request for.
805
+ # The URL to create the HTTP request for.
812
806
  #
813
807
  # @!macro request_kwargs
814
808
  # @!macro connect_kwargs
@@ -836,7 +830,7 @@ module Ronin
836
830
  # Performs a `TRACE` request for the given URI.
837
831
  #
838
832
  # @param [URI::HTTP, Addressable::URI, String] url
839
- # Optional URL to create the HTTP request for.
833
+ # The URL to create the HTTP request for.
840
834
  #
841
835
  # @!macro request_kwargs
842
836
  # @!macro connect_kwargs
@@ -862,7 +856,7 @@ module Ronin
862
856
  # Performs a `UNLOCK` request for the given URI.
863
857
  #
864
858
  # @param [URI::HTTP, Addressable::URI, String] url
865
- # Optional URL to create the HTTP request for.
859
+ # The URL to create the HTTP request for.
866
860
  #
867
861
  # @!macro request_kwargs
868
862
  # @!macro connect_kwargs
@@ -108,7 +108,7 @@ module Ronin
108
108
  # Path to the CA certificate file or directory.
109
109
  #
110
110
  # @return [OpenSSL::SSL::SSLSocket]
111
- # the new SSL Socket.
111
+ # The new SSL Socket.
112
112
  #
113
113
  # @api public
114
114
  #
@@ -246,7 +246,7 @@ module Ronin
246
246
  # The new SSL Socket.
247
247
  #
248
248
  # @return [OpenSSL::SSL::SSLSocket, nil]
249
- # the new SSL Socket. If a block is given, then `nil` will be
249
+ # The new SSL Socket. If a block is given, then `nil` will be
250
250
  # returned.
251
251
  #
252
252
  # @example
@@ -573,7 +573,7 @@ module Ronin
573
573
  # Path to the CA certificate file or directory.
574
574
  #
575
575
  # @return [OpenSSL::SSL::SSLSocket]
576
- # the new SSL Socket.
576
+ # The new SSL Socket.
577
577
  #
578
578
  # @api public
579
579
  #
@@ -16,7 +16,8 @@
16
16
  # along with ronin-support. If not, see <https://www.gnu.org/licenses/>.
17
17
  #
18
18
 
19
- require 'ronin/support/network/ssl/openssl'
19
+ require 'ronin/support/crypto/openssl'
20
+ require 'ronin/support/crypto/key'
20
21
  require 'ronin/support/network/ssl/local_key'
21
22
  require 'ronin/support/network/ssl/local_cert'
22
23
  require 'ronin/support/network/ssl/proxy'
@@ -148,7 +149,7 @@ module Ronin
148
149
  context.verify_mode = VERIFY[verify]
149
150
 
150
151
  if (key_file || key) && (cert_file || cert)
151
- context.key = if key_file then Crypto::Key::RSA.load_file(key_file)
152
+ context.key = if key_file then Crypto::Key.load_file(key_file)
152
153
  else key
153
154
  end
154
155
 
@@ -107,7 +107,7 @@ module Ronin
107
107
  # Path to the CA certificate file or directory.
108
108
  #
109
109
  # @return [OpenSSL::SSL::SSLSocket]
110
- # the new SSL Socket.
110
+ # The new SSL Socket.
111
111
  #
112
112
  # @api public
113
113
  #
@@ -233,7 +233,7 @@ module Ronin
233
233
  # The new SSL Socket.
234
234
  #
235
235
  # @return [OpenSSL::SSL::SSLSocket, nil]
236
- # the new SSL Socket. If a block is given, then `nil` will be
236
+ # The new SSL Socket. If a block is given, then `nil` will be
237
237
  # returned.
238
238
  #
239
239
  # @example
@@ -519,7 +519,7 @@ module Ronin
519
519
  # * `:client_once`
520
520
  #
521
521
  # @return [OpenSSL::SSL::SSLSocket]
522
- # the new SSL Socket.
522
+ # The new SSL Socket.
523
523
  #
524
524
  # @api public
525
525
  #
@@ -51,7 +51,7 @@ module Ronin
51
51
  length = string.length.to_f
52
52
  entropy = 0.0
53
53
 
54
- char_counts.each do |char,count|
54
+ char_counts.each_value do |count|
55
55
  freq = count / length
56
56
  entropy -= freq * Math.log(freq,base)
57
57
  end
@@ -19,6 +19,6 @@
19
19
  module Ronin
20
20
  module Support
21
21
  # ronin-support version
22
- VERSION = '1.0.3'
22
+ VERSION = '1.0.5'
23
23
  end
24
24
  end
data/lib/ronin/support.rb CHANGED
@@ -28,6 +28,20 @@ require 'ronin/support/text'
28
28
  require 'ronin/support/version'
29
29
 
30
30
  module Ronin
31
+ #
32
+ # Top-level namespace for `ronin-support`.
33
+ #
34
+ # ## Example
35
+ #
36
+ # require 'ronin/support'
37
+ # include Ronin::Support
38
+ #
39
+ # "hello world".base64_encode
40
+ # # => "aGVsbG8gd29ybGQ=\n"
41
+ #
42
+ # http_get 'https://example.com/'
43
+ # # => #<Net::HTTPOK 200 OK readbody=true>
44
+ #
31
45
  module Support
32
46
  include Mixin
33
47
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ronin-support
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Postmodern
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-09-19 00:00:00.000000000 Z
11
+ date: 2023-12-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: chars
@@ -470,7 +470,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
470
470
  - !ruby/object:Gem::Version
471
471
  version: '0'
472
472
  requirements: []
473
- rubygems_version: 3.3.26
473
+ rubygems_version: 3.5.3
474
474
  signing_key:
475
475
  specification_version: 4
476
476
  summary: A support library for ronin-rb.