View | Details | Raw Unified | Return to bug 257603 | Differences between
and this patch

Collapse All | Expand All

(-)b/security/suricata/Makefile (-2 / +1 lines)
Lines 1-6 Link Here
1
PORTNAME=	suricata
1
PORTNAME=	suricata
2
DISTVERSION=	6.0.2
2
DISTVERSION=	6.0.3
3
PORTREVISION=	3
4
CATEGORIES=	security
3
CATEGORIES=	security
5
MASTER_SITES=	https://www.openinfosecfoundation.org/download/
4
MASTER_SITES=	https://www.openinfosecfoundation.org/download/
6
5
(-)b/security/suricata/distinfo (-3 / +3 lines)
Lines 1-3 Link Here
1
TIMESTAMP = 1616753087
1
TIMESTAMP = 1628041281
2
SHA256 (suricata-6.0.2.tar.gz) = 5e4647a07cb31b5d6d0049972a45375c137de908a964a44e2d6d231fa3ad4b52
2
SHA256 (suricata-6.0.3.tar.gz) = daf134bb2d7c980035e9ae60f7aaf313323a809340009f26e48110ccde81f602
3
SIZE (suricata-6.0.2.tar.gz) = 30514801
3
SIZE (suricata-6.0.3.tar.gz) = 32421197
(-)a/security/suricata/files/patch-rust_vendor_lexical-core_src_atof_algorithm_bhcomp.rs (-11 lines)
Removed Link Here
1
--- rust/vendor/lexical-core/src/atof/algorithm/bhcomp.rs.orig	2021-06-19 12:41:29 UTC
2
+++ rust/vendor/lexical-core/src/atof/algorithm/bhcomp.rs
3
@@ -59,7 +59,7 @@ pub(super) fn parse_mantissa<'a, Data>(data: Data, rad
4
     let small_powers = Bigint::small_powers(radix);
5
     let count = data.mantissa_digits();
6
     let bits = count / integral_binary_factor(radix).as_usize();
7
-    let bytes = bits / Limb::BITS;
8
+    let bytes = bits / <Limb as Integer>::BITS;
9
 
10
     // Main loop
11
     let step = small_powers.len() - 2;
(-)a/security/suricata/files/patch-rust_vendor_lexical-core_src_atof_algorithm_bigcomp.rs (-39 lines)
Removed Link Here
1
error[E0308]: mismatched types
2
   --> src/atof/algorithm/bigcomp.rs:242:55
3
    |
4
242 |     let nlz = den.leading_zeros().wrapping_sub(wlz) & (u32::BITS - 1);
5
    |                                                       ^^^^^^^^^^^^^^^ expected `usize`, found `u32`
6
7
error[E0277]: no implementation for `usize & u32`
8
9
https://github.com/Alexhuszagh/rust-lexical/commit/05f2cf96b080a81e2bee1f30ae389dc4f9cb6d00
10
11
--- rust/vendor/lexical-core/src/atof/algorithm/bigcomp.rs.orig	2021-03-01 16:15:39 UTC
12
+++ rust/vendor/lexical-core/src/atof/algorithm/bigcomp.rs
13
@@ -154,7 +154,7 @@ pub(super) fn make_ratio<F: Float>(radix: u32, sci_exp
14
     // Scale the denominator so it has the number of bits
15
     // in the radix as the number of leading zeros.
16
     let wlz = integral_binary_factor(radix).as_usize();
17
-    let nlz = den.leading_zeros().wrapping_sub(wlz) & (u32::BITS - 1);
18
+    let nlz = den.leading_zeros().wrapping_sub(wlz) & (<u32 as Integer>::BITS - 1);
19
     small::ishl_bits(den.data_mut(), nlz);
20
     den.exp -= nlz.as_i32();
21
 
22
@@ -172,7 +172,7 @@ pub(super) fn make_ratio<F: Float>(radix: u32, sci_exp
23
         // denominator will be normalized.
24
         // We need to add one to the quotient,since we're calculating the
25
         // ceiling of the divmod.
26
-        let (q, r) = shift.ceil_divmod(Limb::BITS);
27
+        let (q, r) = shift.ceil_divmod(<Limb as Integer>::BITS);
28
         // Since we're using a power from the denominator to the
29
         // numerator, we to invert r, not add u32::BITS.
30
         let r = -r;
31
@@ -180,7 +180,7 @@ pub(super) fn make_ratio<F: Float>(radix: u32, sci_exp
32
         num.exp -= r;
33
         if !q.is_zero() {
34
             den.pad_zero_digits(q);
35
-            den.exp -= Limb::BITS.as_i32() * q.as_i32();
36
+            den.exp -= <Limb as Integer>::BITS.as_i32() * q.as_i32();
37
         }
38
     }
39
 
(-)a/security/suricata/files/patch-rust_vendor_lexical-core_src_atof_algorithm_math.rs (-211 lines)
Removed Link Here
1
--- rust/vendor/lexical-core/src/atof/algorithm/math.rs.orig	2021-03-01 16:15:39 UTC
2
+++ rust/vendor/lexical-core/src/atof/algorithm/math.rs
3
@@ -956,7 +956,7 @@ pub fn mul(x: Limb, y: Limb, carry: Limb)
4
     // the following is always true:
5
     // `Wide::max_value() - (Narrow::max_value() * Narrow::max_value()) >= Narrow::max_value()`
6
     let z: Wide = as_wide(x) * as_wide(y) + as_wide(carry);
7
-    (as_limb(z), as_limb(z >> Limb::BITS))
8
+    (as_limb(z), as_limb(z >> <Limb as Integer>::BITS))
9
 }}
10
 
11
 /// Multiply two small integers (with carry) (and return if overflow happens).
12
@@ -979,7 +979,7 @@ pub fn div(x: Limb, y: Limb, rem: Limb)
13
     -> (Limb, Limb)
14
 {
15
     // Cannot overflow, as long as wide is 2x as wide.
16
-    let x = as_wide(x) | (as_wide(rem) << Limb::BITS);
17
+    let x = as_wide(x) | (as_wide(rem) << <Limb as Integer>::BITS);
18
     let y = as_wide(y);
19
     (as_limb(x / y), as_limb(x % y))
20
 }}
21
@@ -1046,7 +1046,7 @@ perftools_inline!{
22
 pub fn trailing_zeros(x: &[Limb]) -> usize {
23
     // Get the index of the last non-zero value
24
     let index = trailing_zero_limbs(x);
25
-    let mut count = index.saturating_mul(Limb::BITS);
26
+    let mut count = index.saturating_mul(<Limb as Integer>::BITS);
27
     if let Some(value) = x.get(index) {
28
         count = count.saturating_add(value.trailing_zeros().as_usize());
29
     }
30
@@ -1061,7 +1061,7 @@ pub fn bit_length(x: &[Limb]) -> usize {
31
     // Avoid overflowing, calculate via total number of bits
32
     // minus leading zero bits.
33
     let nlz = leading_zeros(x);
34
-    Limb::BITS.checked_mul(x.len())
35
+    <Limb as Integer>::BITS.checked_mul(x.len())
36
         .map(|v| v - nlz)
37
         .unwrap_or(usize::max_value())
38
 }}
39
@@ -1080,14 +1080,14 @@ pub fn limb_length(x: &[Limb]) -> usize {
40
 ///
41
 /// Returns the truncated bits.
42
 ///
43
-/// Assumes `n < Limb::BITS`, IE, internally shifting bits.
44
+/// Assumes `n < <Limb as Integer>::BITS`, IE, internally shifting bits.
45
 perftools_inline!{
46
 pub fn ishr_bits<T>(x: &mut T, n: usize)
47
     -> Limb
48
     where T: CloneableVecLike<Limb>
49
 {
50
-    // Need to shift by the number of `bits % Limb::BITS`.
51
-    let bits = Limb::BITS;
52
+    // Need to shift by the number of `bits % <Limb as Integer>::BITS`.
53
+    let bits = <Limb as Integer>::BITS;
54
     debug_assert!(n < bits && n != 0);
55
 
56
     // Internally, for each item, we shift left by n, and add the previous
57
@@ -1134,9 +1134,9 @@ pub fn ishr<T>(x: &mut T, n: usize)
58
     -> bool
59
     where T: CloneableVecLike<Limb>
60
 {
61
-    let bits = Limb::BITS;
62
-    // Need to pad with zeros for the number of `bits / Limb::BITS`,
63
-    // and shift-left with carry for `bits % Limb::BITS`.
64
+    let bits = <Limb as Integer>::BITS;
65
+    // Need to pad with zeros for the number of `bits / <Limb as Integer>::BITS`,
66
+    // and shift-left with carry for `bits % <Limb as Integer>::BITS`.
67
     let rem = n % bits;
68
     let div = n / bits;
69
     let is_zero = match div.is_zero() {
70
@@ -1187,13 +1187,13 @@ pub fn shr<T>(x: &[Limb], n: usize)
71
 
72
 /// Shift-left bits inside a buffer.
73
 ///
74
-/// Assumes `n < Limb::BITS`, IE, internally shifting bits.
75
+/// Assumes `n < <Limb as Integer>::BITS`, IE, internally shifting bits.
76
 perftools_inline!{
77
 pub fn ishl_bits<T>(x: &mut T, n: usize)
78
     where T: CloneableVecLike<Limb>
79
 {
80
-    // Need to shift by the number of `bits % Limb::BITS)`.
81
-    let bits = Limb::BITS;
82
+    // Need to shift by the number of `bits % <Limb as Integer>::BITS)`.
83
+    let bits = <Limb as Integer>::BITS;
84
     debug_assert!(n < bits);
85
     if n.is_zero() {
86
         return;
87
@@ -1223,7 +1223,7 @@ pub fn ishl_bits<T>(x: &mut T, n: usize)
88
 
89
 /// Shift-left bits inside a buffer.
90
 ///
91
-/// Assumes `n < Limb::BITS`, IE, internally shifting bits.
92
+/// Assumes `n < <Limb as Integer>::BITS`, IE, internally shifting bits.
93
 perftools_inline!{
94
 pub fn shl_bits<T>(x: &[Limb], n: usize)
95
     -> T
96
@@ -1253,9 +1253,9 @@ perftools_inline!{
97
 pub fn ishl<T>(x: &mut T, n: usize)
98
     where T: CloneableVecLike<Limb>
99
 {
100
-    let bits = Limb::BITS;
101
-    // Need to pad with zeros for the number of `bits / Limb::BITS`,
102
-    // and shift-left with carry for `bits % Limb::BITS`.
103
+    let bits = <Limb as Integer>::BITS;
104
+    // Need to pad with zeros for the number of `bits / <Limb as Integer>::BITS`,
105
+    // and shift-left with carry for `bits % <Limb as Integer>::BITS`.
106
     let rem = n % bits;
107
     let div = n / bits;
108
     ishl_bits(x, rem);
109
@@ -1912,7 +1912,7 @@ pub fn mul<T>(x: &[Limb], y: &[Limb])
110
 // DIVISION
111
 
112
 /// Constants for algorithm D.
113
-const ALGORITHM_D_B: Wide = 1 << Limb::BITS;
114
+const ALGORITHM_D_B: Wide = 1 << <Limb as Integer>::BITS;
115
 const ALGORITHM_D_M: Wide = ALGORITHM_D_B - 1;
116
 
117
 /// Calculate qhat (an estimate for the quotient).
118
@@ -1932,7 +1932,7 @@ fn calculate_qhat(x: &[Limb], y: &[Limb], j: usize)
119
     //  rhat = (x[j+n]*B + x[j+n-1]) - qhat*y[n-1];
120
     let x_jn = as_wide(x[j+n]);
121
     let x_jn1 = as_wide(x[j+n-1]);
122
-    let num = (x_jn << Limb::BITS) + x_jn1;
123
+    let num = (x_jn << <Limb as Integer>::BITS) + x_jn1;
124
     let den = as_wide(y[n-1]);
125
     let mut qhat = num / den;
126
     let mut rhat = num - qhat * den;
127
@@ -1949,7 +1949,7 @@ fn calculate_qhat(x: &[Limb], y: &[Limb], j: usize)
128
     let y_n2 = as_wide(y[n-2]);
129
     let y_n1 = as_wide(y[n-1]);
130
     // This only happens when the leading bit of qhat is set.
131
-    while qhat >= ALGORITHM_D_B || qhat * y_n2 > (rhat << Limb::BITS) + x_jn2 {
132
+    while qhat >= ALGORITHM_D_B || qhat * y_n2 > (rhat << <Limb as Integer>::BITS) + x_jn2 {
133
         qhat -= 1;
134
         rhat += y_n1;
135
         if rhat >= ALGORITHM_D_B {
136
@@ -1989,7 +1989,7 @@ fn multiply_and_subtract<T>(x: &mut T, y: &T, qhat: Wi
137
         let p = qhat * y_i;
138
         t = x_ij.wrapping_sub(k).wrapping_sub(as_signed_wide(p & ALGORITHM_D_M));
139
         x[i+j] = as_limb(t);
140
-        k = as_signed_wide(p >> Limb::BITS) - (t >> Limb::BITS);
141
+        k = as_signed_wide(p >> <Limb as Integer>::BITS) - (t >> <Limb as Integer>::BITS);
142
     }
143
     t = as_signed_wide(x[j+n]) - k;
144
     x[j+n] = as_limb(t);
145
@@ -2045,7 +2045,7 @@ fn add_back<T>(x: &mut T, y: &T, mut t: SignedWide, j:
146
         for i in 0..n {
147
             t = as_signed_wide(as_wide(x[i+j]) + as_wide(y[i])) + k;
148
             x[i+j] = as_limb(t);
149
-            k = t >> Limb::BITS;
150
+            k = t >> <Limb as Integer>::BITS;
151
         }
152
         let x_jn = as_signed_wide(x[j+n]) + k;
153
         x[j+n] = as_limb(x_jn);
154
@@ -2068,7 +2068,7 @@ fn calculate_remainder<T>(x: &[Limb], y: &[Limb], s: u
155
     let n = y.len();
156
     let mut r = T::default();
157
     r.reserve_exact(n);
158
-    let rs = Limb::BITS - s;
159
+    let rs = <Limb as Integer>::BITS - s;
160
     for i in 0..n-1 {
161
         let xi = as_wide(x[i]) >> s;
162
         let xi1 = as_wide(x[i+1]) << rs;
163
@@ -2205,9 +2205,9 @@ pub fn quorem<T>(x: &mut T, y: &T)
164
         let mut carry: Wide = 0;
165
         for j in 0..m {
166
             let p = as_wide(y[j]) * as_wide(q) + carry;
167
-            carry = p >> Limb::BITS;
168
+            carry = p >> <Limb as Integer>::BITS;
169
             let t = as_wide(x[j]).wrapping_sub(p & mask).wrapping_sub(borrow);
170
-            borrow = (t >> Limb::BITS) & 1;
171
+            borrow = (t >> <Limb as Integer>::BITS) & 1;
172
             x[j] = as_limb(t);
173
         }
174
         small::normalize(x);
175
@@ -2220,9 +2220,9 @@ pub fn quorem<T>(x: &mut T, y: &T)
176
         let mut carry: Wide = 0;
177
         for j in 0..m {
178
             let p = as_wide(y[j]) + carry;
179
-            carry = p >> Limb::BITS;
180
+            carry = p >> <Limb as Integer>::BITS;
181
             let t = as_wide(x[j]).wrapping_sub(p & mask).wrapping_sub(borrow);
182
-            borrow = (t >> Limb::BITS) & 1;
183
+            borrow = (t >> <Limb as Integer>::BITS) & 1;
184
             x[j] = as_limb(t);
185
         }
186
         small::normalize(x);
187
@@ -3137,18 +3137,18 @@ mod tests {
188
     fn leading_zeros_test() {
189
         assert_eq!(Bigint::new().leading_zeros(), 0);
190
 
191
-        assert_eq!(Bigint::from_u16(0xFF).leading_zeros(), Limb::BITS-8);
192
-        assert_eq!(Bigint::from_u32(0xFF).leading_zeros(), Limb::BITS-8);
193
+        assert_eq!(Bigint::from_u16(0xFF).leading_zeros(), <Limb as Integer>::BITS-8);
194
+        assert_eq!(Bigint::from_u32(0xFF).leading_zeros(), <Limb as Integer>::BITS-8);
195
         assert_eq!(Bigint::from_u64(0xFF00000000).leading_zeros(), 24);
196
         assert_eq!(Bigint::from_u128(0xFF000000000000000000000000).leading_zeros(), 24);
197
 
198
-        assert_eq!(Bigint::from_u16(0xF).leading_zeros(), Limb::BITS-4);
199
-        assert_eq!(Bigint::from_u32(0xF).leading_zeros(), Limb::BITS-4);
200
+        assert_eq!(Bigint::from_u16(0xF).leading_zeros(), <Limb as Integer>::BITS-4);
201
+        assert_eq!(Bigint::from_u32(0xF).leading_zeros(), <Limb as Integer>::BITS-4);
202
         assert_eq!(Bigint::from_u64(0xF00000000).leading_zeros(), 28);
203
         assert_eq!(Bigint::from_u128(0xF000000000000000000000000).leading_zeros(), 28);
204
 
205
-        assert_eq!(Bigint::from_u16(0xF0).leading_zeros(), Limb::BITS-8);
206
-        assert_eq!(Bigint::from_u32(0xF0).leading_zeros(), Limb::BITS-8);
207
+        assert_eq!(Bigint::from_u16(0xF0).leading_zeros(), <Limb as Integer>::BITS-8);
208
+        assert_eq!(Bigint::from_u32(0xF0).leading_zeros(), <Limb as Integer>::BITS-8);
209
         assert_eq!(Bigint::from_u64(0xF000000000).leading_zeros(), 24);
210
         assert_eq!(Bigint::from_u128(0xF0000000000000000000000000).leading_zeros(), 24);
211
     }
(-)a/security/suricata/files/patch-src_suricata-common.h (-11 lines)
Removed Link Here
1
--- src/suricata-common.h.orig	2021-03-01 16:13:22 UTC
2
+++ src/suricata-common.h
3
@@ -36,6 +36,8 @@
4
 #define _GNU_SOURCE
5
 #define __USE_GNU
6
 
7
+#include "queue.h"
8
+
9
 #if HAVE_CONFIG_H
10
 #include <autoconf.h>
11
 #endif
(-)b/security/suricata/pkg-plist (-1 / +2 lines)
Lines 20-25 include/htp/htp_utf8_decoder.h Link Here
20
include/htp/htp_version.h
20
include/htp/htp_version.h
21
include/htp/lzma/7zTypes.h
21
include/htp/lzma/7zTypes.h
22
include/htp/lzma/LzmaDec.h
22
include/htp/lzma/LzmaDec.h
23
include/suricata-plugin.h
23
lib/libhtp.a
24
lib/libhtp.a
24
lib/libhtp.so
25
lib/libhtp.so
25
lib/libhtp.so.2
26
lib/libhtp.so.2
Lines 135-141 man/man1/suricata.1.gz Link Here
135
%%PYTHON%%%%PYTHON_SITELIBDIR%%/suricata/update/util.pyc
136
%%PYTHON%%%%PYTHON_SITELIBDIR%%/suricata/update/util.pyc
136
%%PYTHON%%%%PYTHON_SITELIBDIR%%/suricata/update/version.py
137
%%PYTHON%%%%PYTHON_SITELIBDIR%%/suricata/update/version.py
137
%%PYTHON%%%%PYTHON_SITELIBDIR%%/suricata/update/version.pyc
138
%%PYTHON%%%%PYTHON_SITELIBDIR%%/suricata/update/version.pyc
138
%%PYTHON%%%%PYTHON_SITELIBDIR%%/suricata_update-1.2.1-py%%PYTHON_VER%%.egg-info
139
%%PYTHON%%%%PYTHON_SITELIBDIR%%/suricata_update-1.2.2-py%%PYTHON_VER%%.egg-info
139
%%PYTHON%%%%PYTHON_SITELIBDIR%%/suricatasc/__init__.py
140
%%PYTHON%%%%PYTHON_SITELIBDIR%%/suricatasc/__init__.py
140
%%PYTHON%%%%PYTHON_SITELIBDIR%%/suricatasc/__init__.pyc
141
%%PYTHON%%%%PYTHON_SITELIBDIR%%/suricatasc/__init__.pyc
141
%%DATADIR%%/rules/app-layer-events.rules
142
%%DATADIR%%/rules/app-layer-events.rules

Return to bug 257603