libddwaf 1.5.1.0.0-arm64-darwin → 1.6.2.0.0-arm64-darwin

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: d753815cac6c230540e2151594fde2aba6edcbc8b29f70ac6126e2258064d4fc
4
- data.tar.gz: d75d28707e292d9f374a1c9209474b2b051a917cb2a08836813ac5594aca2050
3
+ metadata.gz: d6d5bdc85251c24106014d72ad6507431f1b262a9a5e2d15e6b4a59a5b7b1df1
4
+ data.tar.gz: cb156bf930d70d1b4b1b30f9c7633febccf143cc36358606cb766674c83e0a19
5
5
  SHA512:
6
- metadata.gz: c72b639026ea1686d23c58146296bbbb9b88a4adb8a229af1d82d53ef74eace3d3969e0fa46206e3bd73ddabcfe224119f86f0c360ca2470a3e0fa874106453a
7
- data.tar.gz: 46f507d84f237a23fcd6d7587fb2ac5fb8948a14123648275bdf45bf69f228da08fcf9e77f4ad8726b40928059f8e1eaa910d9ac2bf1f345b94c840b75c199f5
6
+ metadata.gz: b2e6a95fae63462d043a81b2e194ab3b8789b4ef5ed4b6705cfdff29c3b0401bf47127f820e2cac9d1975475680db16bb4b26dc5d20e4d298b91a2ad81dff9e0
7
+ data.tar.gz: c1d4d747ab936ff1aa4bb951056910dc8b20cfc8449c13959a22bc7a93403ff2e323738dae05ee134c6aeb95bf805adc8cfdd42c0e1959044d50897b5345935c
data/CHANGELOG.md CHANGED
@@ -1,3 +1,13 @@
1
+ # 2023-02-03 v1.6.2.0.0
2
+
3
+ - Update to libddwaf 1.6.2
4
+ - Add specs for the getter functions
5
+
6
+ # 2023-02-01 v1.5.1.0.1
7
+
8
+ - Fix incorrect size in input string limit
9
+ - Fix object freeing on `update_rule_data` and `toggle_rules`
10
+
1
11
  # 2022-10-04 v1.5.1.0.0
2
12
 
3
13
  - Update to libddwaf 1.5.1
@@ -2,7 +2,7 @@ module Datadog
2
2
  module AppSec
3
3
  module WAF
4
4
  module VERSION
5
- BASE_STRING = '1.5.1'
5
+ BASE_STRING = '1.6.2'
6
6
  STRING = "#{BASE_STRING}.0.0"
7
7
  MINIMUM_RUBY_VERSION = '2.1'
8
8
  end
@@ -182,6 +182,7 @@ module Datadog
182
182
  attach_function :ddwaf_object_get_unsigned, [:ddwaf_object], :uint64
183
183
  attach_function :ddwaf_object_get_signed, [:ddwaf_object], :int64
184
184
  attach_function :ddwaf_object_get_index, [:ddwaf_object, :size_t], :ddwaf_object
185
+ attach_function :ddwaf_object_get_bool, [:ddwaf_object], :bool
185
186
 
186
187
  ## freeers
187
188
 
@@ -203,8 +204,8 @@ module Datadog
203
204
  end
204
205
 
205
206
  class Obfuscator < ::FFI::Struct
206
- layout :key_regex, :pointer, # :charptr
207
- :value_regex, :pointer # :charptr
207
+ layout :key_regex, :pointer, # should be :charptr
208
+ :value_regex, :pointer # should be :charptr
208
209
  end
209
210
 
210
211
  layout :limits, Limits,
@@ -539,15 +540,21 @@ module Datadog
539
540
  end
540
541
 
541
542
  def update_rule_data(data)
542
- res = Datadog::AppSec::WAF::LibDDWAF.ddwaf_update_rule_data(@handle_obj, Datadog::AppSec::WAF.ruby_to_object(data, coerce: false))
543
+ data_obj = Datadog::AppSec::WAF.ruby_to_object(data, coerce: false)
544
+ res = Datadog::AppSec::WAF::LibDDWAF.ddwaf_update_rule_data(@handle_obj, data_obj)
543
545
 
544
546
  RESULT_CODE[res]
547
+ ensure
548
+ Datadog::AppSec::WAF::LibDDWAF.ddwaf_object_free(data_obj) if data_obj
545
549
  end
546
550
 
547
551
  def toggle_rules(map)
548
- res = Datadog::AppSec::WAF::LibDDWAF.ddwaf_toggle_rules(@handle_obj, Datadog::AppSec::WAF.ruby_to_object(map, coerce: false))
552
+ map_obj = Datadog::AppSec::WAF.ruby_to_object(map, coerce: false)
553
+ res = Datadog::AppSec::WAF::LibDDWAF.ddwaf_toggle_rules(@handle_obj, map_obj)
549
554
 
550
555
  RESULT_CODE[res]
556
+ ensure
557
+ Datadog::AppSec::WAF::LibDDWAF.ddwaf_object_free(map_obj) if map_obj
551
558
  end
552
559
 
553
560
  private
@@ -627,7 +634,7 @@ module Datadog
627
634
 
628
635
  max_container_size = LibDDWAF::DDWAF_MAX_CONTAINER_SIZE
629
636
  max_container_depth = LibDDWAF::DDWAF_MAX_CONTAINER_DEPTH
630
- max_string_length = LibDDWAF::DDWAF_MAX_CONTAINER_SIZE
637
+ max_string_length = LibDDWAF::DDWAF_MAX_STRING_LENGTH
631
638
 
632
639
  input_obj = Datadog::AppSec::WAF.ruby_to_object(input,
633
640
  max_container_size: max_container_size,
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: libddwaf
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.1.0.0
4
+ version: 1.6.2.0.0
5
5
  platform: arm64-darwin
6
6
  authors:
7
7
  - Datadog, Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-10-04 00:00:00.000000000 Z
11
+ date: 2023-02-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ffi
@@ -42,7 +42,7 @@ files:
42
42
  - lib/datadog/appsec/waf.rb
43
43
  - lib/datadog/appsec/waf/version.rb
44
44
  - lib/libddwaf.rb
45
- - vendor/libddwaf/libddwaf-1.5.1-darwin-arm64/lib/libddwaf.dylib
45
+ - vendor/libddwaf/libddwaf-1.6.2-darwin-arm64/lib/libddwaf.dylib
46
46
  homepage: https://github.com/DataDog/libddwaf-rb
47
47
  licenses:
48
48
  - BSD-3-Clause
@@ -63,7 +63,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
63
63
  - !ruby/object:Gem::Version
64
64
  version: 2.0.0
65
65
  requirements: []
66
- rubygems_version: 3.3.22
66
+ rubygems_version: 3.4.6
67
67
  signing_key:
68
68
  specification_version: 4
69
69
  summary: Datadog WAF