Lines 1-6
Link Here
|
1 |
Obtained from: https://github.com/Jan-E/php-radius/commit/d2d10e1781dbae70c39112a98ef14602bf99a221 |
1 |
--- pecl-compat/src/zend_resource.h |
2 |
|
|
|
3 |
--- pecl-compat/src/zend_resource.h.orig 2016-02-15 15:11:50 UTC |
4 |
+++ pecl-compat/src/zend_resource.h |
2 |
+++ pecl-compat/src/zend_resource.h |
5 |
@@ -54,7 +54,7 @@ |
3 |
@@ -54,7 +54,7 @@ |
6 |
* |
4 |
* |
Lines 11-17
Obtained from: https://github.com/Jan-E/php-radius/commit/d2d10e1781dbae70c39112
Link Here
|
11 |
|
9 |
|
12 |
/** |
10 |
/** |
13 |
* Fetches the resource. |
11 |
* Fetches the resource. |
14 |
@@ -68,7 +68,7 @@ static void compat_zend_delete_resource(const zval *zv |
12 |
@@ -68,7 +68,7 @@ static void compat_zend_delete_resource(const zval *zv TSRMLS_DC); |
15 |
* @return A void pointer to the resource, which needs to be typecast, or NULL |
13 |
* @return A void pointer to the resource, which needs to be typecast, or NULL |
16 |
* on error. |
14 |
* on error. |
17 |
*/ |
15 |
*/ |
Lines 20-26
Obtained from: https://github.com/Jan-E/php-radius/commit/d2d10e1781dbae70c39112
Link Here
|
20 |
|
18 |
|
21 |
/** |
19 |
/** |
22 |
* Registers a new resource. |
20 |
* Registers a new resource. |
23 |
@@ -77,12 +77,12 @@ static void *compat_zend_fetch_resource(zval *zv, cons |
21 |
@@ -77,12 +77,12 @@ static void *compat_zend_fetch_resource(zval *zv, const char *rsrc_type_name, in |
24 |
* @param ptr A void pointer to the resource. |
22 |
* @param ptr A void pointer to the resource. |
25 |
* @param rsrc_type The resource type ID. |
23 |
* @param rsrc_type The resource type ID. |
26 |
*/ |
24 |
*/ |
Lines 35-41
Obtained from: https://github.com/Jan-E/php-radius/commit/d2d10e1781dbae70c39112
Link Here
|
35 |
{ |
33 |
{ |
36 |
if (IS_RESOURCE != Z_TYPE_P(zv)) { |
34 |
if (IS_RESOURCE != Z_TYPE_P(zv)) { |
37 |
return; |
35 |
return; |
38 |
@@ -91,7 +91,7 @@ static void compat_zend_delete_resource(const zval *zv |
36 |
@@ -91,7 +91,7 @@ static void compat_zend_delete_resource(const zval *zv TSRMLS_DC) |
39 |
zend_list_close(Z_RES_P(zv)); |
37 |
zend_list_close(Z_RES_P(zv)); |
40 |
} |
38 |
} |
41 |
|
39 |
|
Lines 44-50
Obtained from: https://github.com/Jan-E/php-radius/commit/d2d10e1781dbae70c39112
Link Here
|
44 |
{ |
42 |
{ |
45 |
if (IS_RESOURCE != Z_TYPE_P(zv)) { |
43 |
if (IS_RESOURCE != Z_TYPE_P(zv)) { |
46 |
return NULL; |
44 |
return NULL; |
47 |
@@ -100,7 +100,7 @@ static void *compat_zend_fetch_resource(zval *zv, cons |
45 |
@@ -100,7 +100,7 @@ static void *compat_zend_fetch_resource(zval *zv, const char *rsrc_type_name, in |
48 |
return zend_fetch_resource(Z_RES_P(zv), rsrc_type_name, rsrc_type); |
46 |
return zend_fetch_resource(Z_RES_P(zv), rsrc_type_name, rsrc_type); |
49 |
} |
47 |
} |
50 |
|
48 |
|
Lines 53-59
Obtained from: https://github.com/Jan-E/php-radius/commit/d2d10e1781dbae70c39112
Link Here
|
53 |
{ |
51 |
{ |
54 |
ZVAL_RES(zv, zend_register_resource(ptr, rsrc_type)); |
52 |
ZVAL_RES(zv, zend_register_resource(ptr, rsrc_type)); |
55 |
} |
53 |
} |
56 |
@@ -111,7 +111,7 @@ static void compat_zend_register_resource(zval *zv, vo |
54 |
@@ -111,7 +111,7 @@ static void compat_zend_register_resource(zval *zv, void *ptr, int rsrc_type TSR |
57 |
/* Used for destructors. */ |
55 |
/* Used for destructors. */ |
58 |
typedef zend_rsrc_list_entry zend_resource; |
56 |
typedef zend_rsrc_list_entry zend_resource; |
59 |
|
57 |
|
Lines 62-68
Obtained from: https://github.com/Jan-E/php-radius/commit/d2d10e1781dbae70c39112
Link Here
|
62 |
{ |
60 |
{ |
63 |
if (IS_RESOURCE != Z_TYPE_P(zv)) { |
61 |
if (IS_RESOURCE != Z_TYPE_P(zv)) { |
64 |
return; |
62 |
return; |
65 |
@@ -120,16 +120,16 @@ static void compat_zend_delete_resource(const zval *zv |
63 |
@@ -120,16 +120,16 @@ static void compat_zend_delete_resource(const zval *zv TSRMLS_DC) |
66 |
zend_list_delete(Z_LVAL_P(zv)); |
64 |
zend_list_delete(Z_LVAL_P(zv)); |
67 |
} |
65 |
} |
68 |
|
66 |
|
Lines 83-89
Obtained from: https://github.com/Jan-E/php-radius/commit/d2d10e1781dbae70c39112
Link Here
|
83 |
{ |
81 |
{ |
84 |
ZEND_REGISTER_RESOURCE(zv, ptr, rsrc_type); |
82 |
ZEND_REGISTER_RESOURCE(zv, ptr, rsrc_type); |
85 |
} |
83 |
} |
86 |
--- radius.c.orig 2016-02-15 15:11:50 UTC |
84 |
--- radius.c |
87 |
+++ radius.c |
85 |
+++ radius.c |
88 |
@@ -51,12 +51,12 @@ any other GPL-like (LGPL, GPL2) License. |
86 |
@@ -51,12 +51,12 @@ any other GPL-like (LGPL, GPL2) License. |
89 |
|
87 |
|
Lines 100-106
Obtained from: https://github.com/Jan-E/php-radius/commit/d2d10e1781dbae70c39112
Link Here
|
100 |
if (!radh) { \ |
98 |
if (!radh) { \ |
101 |
RETURN_FALSE; \ |
99 |
RETURN_FALSE; \ |
102 |
} |
100 |
} |
103 |
@@ -165,7 +165,7 @@ PHP_FUNCTION(radius_auth_open) |
101 |
@@ -65,6 +65,102 @@ static int _init_options(struct rad_attr_options *out, int options, int tag); |
|
|
102 |
ZEND_DECLARE_MODULE_GLOBALS(radius) |
103 |
*/ |
104 |
|
105 |
+ZEND_BEGIN_ARG_INFO_EX(arginfo_radius_auth_open, 0, 0, 0) |
106 |
+ZEND_END_ARG_INFO() |
107 |
+ |
108 |
+#define arginfo_radius_acct_open arginfo_radius_auth_open |
109 |
+ |
110 |
+ZEND_BEGIN_ARG_INFO_EX(arginfo_radius_close, 0, 0, 1) |
111 |
+ ZEND_ARG_INFO(0, "radius_handle") |
112 |
+ZEND_END_ARG_INFO() |
113 |
+ |
114 |
+#define arginfo_radius_strerror arginfo_radius_close |
115 |
+ |
116 |
+ZEND_BEGIN_ARG_INFO_EX(arginfo_radius_config, 0, 0, 2) |
117 |
+ ZEND_ARG_INFO(0, "radius_handle") |
118 |
+ ZEND_ARG_INFO(0, "file") |
119 |
+ZEND_END_ARG_INFO() |
120 |
+ |
121 |
+ZEND_BEGIN_ARG_INFO_EX(arginfo_radius_add_server, 0, 0, 6) |
122 |
+ ZEND_ARG_INFO(0, "radius_handle") |
123 |
+ ZEND_ARG_INFO(0, "hostname") |
124 |
+ ZEND_ARG_INFO(0, "port") |
125 |
+ ZEND_ARG_INFO(0, "secret") |
126 |
+ ZEND_ARG_INFO(0, "timeout") |
127 |
+ ZEND_ARG_INFO(0, "max_tries") |
128 |
+ZEND_END_ARG_INFO() |
129 |
+ |
130 |
+ZEND_BEGIN_ARG_INFO_EX(arginfo_radius_create_request, 0, 0, 2) |
131 |
+ ZEND_ARG_INFO(0, "radius_handle") |
132 |
+ ZEND_ARG_INFO(0, "type") |
133 |
+ZEND_END_ARG_INFO() |
134 |
+ |
135 |
+ZEND_BEGIN_ARG_INFO_EX(arginfo_radius_put_string, 0, 0, 3) |
136 |
+ ZEND_ARG_INFO(0, "radius_handle") |
137 |
+ ZEND_ARG_INFO(0, "type") |
138 |
+ ZEND_ARG_INFO(0, "value") |
139 |
+ ZEND_ARG_INFO(0, "options") |
140 |
+ ZEND_ARG_INFO(0, "tag") |
141 |
+ZEND_END_ARG_INFO() |
142 |
+ |
143 |
+#define arginfo_radius_put_int arginfo_radius_put_string |
144 |
+#define arginfo_radius_put_attr arginfo_radius_put_string |
145 |
+ |
146 |
+ZEND_BEGIN_ARG_INFO_EX(arginfo_radius_put_addr, 0, 0, 3) |
147 |
+ ZEND_ARG_INFO(0, "radius_handle") |
148 |
+ ZEND_ARG_INFO(0, "type") |
149 |
+ ZEND_ARG_INFO(0, "addr") |
150 |
+ ZEND_ARG_INFO(0, "options") |
151 |
+ ZEND_ARG_INFO(0, "tag") |
152 |
+ZEND_END_ARG_INFO() |
153 |
+ |
154 |
+ZEND_BEGIN_ARG_INFO_EX(arginfo_radius_put_vendor_string, 0, 0, 4) |
155 |
+ ZEND_ARG_INFO(0, "radius_handle") |
156 |
+ ZEND_ARG_INFO(0, "vendor") |
157 |
+ ZEND_ARG_INFO(0, "type") |
158 |
+ ZEND_ARG_INFO(0, "value") |
159 |
+ ZEND_ARG_INFO(0, "options") |
160 |
+ ZEND_ARG_INFO(0, "tag") |
161 |
+ZEND_END_ARG_INFO() |
162 |
+ |
163 |
+#define arginfo_radius_put_vendor_int arginfo_radius_put_vendor_string |
164 |
+#define arginfo_radius_put_vendor_attr arginfo_radius_put_vendor_string |
165 |
+ |
166 |
+ZEND_BEGIN_ARG_INFO_EX(arginfo_radius_put_vendor_addr, 0, 0, 4) |
167 |
+ ZEND_ARG_INFO(0, "radius_handle") |
168 |
+ ZEND_ARG_INFO(0, "vendor") |
169 |
+ ZEND_ARG_INFO(0, "type") |
170 |
+ ZEND_ARG_INFO(0, "addr") |
171 |
+ZEND_END_ARG_INFO() |
172 |
+ |
173 |
+#define arginfo_radius_send_request arginfo_radius_close |
174 |
+#define arginfo_radius_get_attr arginfo_radius_close |
175 |
+ |
176 |
+ZEND_BEGIN_ARG_INFO_EX(arginfo_radius_get_tagged_attr_data, 0, 0, 1) |
177 |
+ ZEND_ARG_INFO(0, "data") |
178 |
+ZEND_END_ARG_INFO() |
179 |
+ |
180 |
+#define arginfo_radius_get_tagged_attr_tag arginfo_radius_get_tagged_attr_data |
181 |
+#define arginfo_radius_get_vendor_attr arginfo_radius_get_tagged_attr_data |
182 |
+#define arginfo_radius_cvt_addr arginfo_radius_get_tagged_attr_data |
183 |
+#define arginfo_radius_cvt_int arginfo_radius_get_tagged_attr_data |
184 |
+#define arginfo_radius_cvt_string arginfo_radius_get_tagged_attr_data |
185 |
+ |
186 |
+ZEND_BEGIN_ARG_INFO_EX(arginfo_radius_salt_encrypt_attr, 0, 0, 2) |
187 |
+ ZEND_ARG_INFO(0, "radius_handle") |
188 |
+ ZEND_ARG_INFO(0, "data") |
189 |
+ZEND_END_ARG_INFO() |
190 |
+ |
191 |
+#define arginfo_radius_request_authenticator arginfo_radius_close |
192 |
+#define arginfo_radius_server_secret arginfo_radius_close |
193 |
+ |
194 |
+ZEND_BEGIN_ARG_INFO_EX(arginfo_radius_demangle, 0, 0, 2) |
195 |
+ ZEND_ARG_INFO(0, "radius_handle") |
196 |
+ ZEND_ARG_INFO(0, "mangled") |
197 |
+ZEND_END_ARG_INFO() |
198 |
+ |
199 |
+#define arginfo_radius_demangle_mppe_key arginfo_radius_demangle |
200 |
+ |
201 |
/* True global resources - no need for thread safety here */ |
202 |
static int le_radius; |
203 |
|
204 |
@@ -73,34 +169,34 @@ static int le_radius; |
205 |
* Every user visible function must have an entry in radius_functions[]. |
206 |
*/ |
207 |
zend_function_entry radius_functions[] = { |
208 |
- PHP_FE(radius_auth_open, NULL) |
209 |
- PHP_FE(radius_acct_open, NULL) |
210 |
- PHP_FE(radius_close, NULL) |
211 |
- PHP_FE(radius_strerror, NULL) |
212 |
- PHP_FE(radius_config, NULL) |
213 |
- PHP_FE(radius_add_server, NULL) |
214 |
- PHP_FE(radius_create_request, NULL) |
215 |
- PHP_FE(radius_put_string, NULL) |
216 |
- PHP_FE(radius_put_int, NULL) |
217 |
- PHP_FE(radius_put_attr, NULL) |
218 |
- PHP_FE(radius_put_addr, NULL) |
219 |
- PHP_FE(radius_put_vendor_string, NULL) |
220 |
- PHP_FE(radius_put_vendor_int, NULL) |
221 |
- PHP_FE(radius_put_vendor_attr, NULL) |
222 |
- PHP_FE(radius_put_vendor_addr, NULL) |
223 |
- PHP_FE(radius_send_request, NULL) |
224 |
- PHP_FE(radius_get_attr, NULL) |
225 |
- PHP_FE(radius_get_tagged_attr_data, NULL) |
226 |
- PHP_FE(radius_get_tagged_attr_tag, NULL) |
227 |
- PHP_FE(radius_get_vendor_attr, NULL) |
228 |
- PHP_FE(radius_cvt_addr, NULL) |
229 |
- PHP_FE(radius_cvt_int, NULL) |
230 |
- PHP_FE(radius_cvt_string, NULL) |
231 |
- PHP_FE(radius_salt_encrypt_attr, NULL) |
232 |
- PHP_FE(radius_request_authenticator, NULL) |
233 |
- PHP_FE(radius_server_secret, NULL) |
234 |
- PHP_FE(radius_demangle, NULL) |
235 |
- PHP_FE(radius_demangle_mppe_key, NULL) |
236 |
+ PHP_FE(radius_auth_open, arginfo_radius_auth_open) |
237 |
+ PHP_FE(radius_acct_open, arginfo_radius_acct_open) |
238 |
+ PHP_FE(radius_close, arginfo_radius_close) |
239 |
+ PHP_FE(radius_strerror, arginfo_radius_strerror) |
240 |
+ PHP_FE(radius_config, arginfo_radius_config) |
241 |
+ PHP_FE(radius_add_server, arginfo_radius_add_server) |
242 |
+ PHP_FE(radius_create_request, arginfo_radius_create_request) |
243 |
+ PHP_FE(radius_put_string, arginfo_radius_put_string) |
244 |
+ PHP_FE(radius_put_int, arginfo_radius_put_int) |
245 |
+ PHP_FE(radius_put_attr, arginfo_radius_put_attr) |
246 |
+ PHP_FE(radius_put_addr, arginfo_radius_put_addr) |
247 |
+ PHP_FE(radius_put_vendor_string, arginfo_radius_put_vendor_string) |
248 |
+ PHP_FE(radius_put_vendor_int, arginfo_radius_put_vendor_int) |
249 |
+ PHP_FE(radius_put_vendor_attr, arginfo_radius_put_vendor_attr) |
250 |
+ PHP_FE(radius_put_vendor_addr, arginfo_radius_put_vendor_addr) |
251 |
+ PHP_FE(radius_send_request, arginfo_radius_send_request) |
252 |
+ PHP_FE(radius_get_attr, arginfo_radius_get_attr) |
253 |
+ PHP_FE(radius_get_tagged_attr_data, arginfo_radius_get_tagged_attr_data) |
254 |
+ PHP_FE(radius_get_tagged_attr_tag, arginfo_radius_get_tagged_attr_tag) |
255 |
+ PHP_FE(radius_get_vendor_attr, arginfo_radius_get_vendor_attr) |
256 |
+ PHP_FE(radius_cvt_addr, arginfo_radius_cvt_addr) |
257 |
+ PHP_FE(radius_cvt_int, arginfo_radius_cvt_int) |
258 |
+ PHP_FE(radius_cvt_string, arginfo_radius_cvt_string) |
259 |
+ PHP_FE(radius_salt_encrypt_attr, arginfo_radius_salt_encrypt_attr) |
260 |
+ PHP_FE(radius_request_authenticator, arginfo_radius_request_authenticator) |
261 |
+ PHP_FE(radius_server_secret, arginfo_radius_server_secret) |
262 |
+ PHP_FE(radius_demangle, arginfo_radius_demangle) |
263 |
+ PHP_FE(radius_demangle_mppe_key, arginfo_radius_demangle_mppe_key) |
264 |
{NULL, NULL, NULL} /* Must be the last line in radius_functions[] */ |
265 |
}; |
266 |
/* }}} */ |
267 |
@@ -165,7 +261,7 @@ PHP_FUNCTION(radius_auth_open) |
104 |
struct rad_handle *radh = rad_auth_open(); |
268 |
struct rad_handle *radh = rad_auth_open(); |
105 |
|
269 |
|
106 |
if (radh != NULL) { |
270 |
if (radh != NULL) { |
Lines 109-115
Obtained from: https://github.com/Jan-E/php-radius/commit/d2d10e1781dbae70c39112
Link Here
|
109 |
} else { |
273 |
} else { |
110 |
RETURN_FALSE; |
274 |
RETURN_FALSE; |
111 |
} |
275 |
} |
112 |
@@ -178,7 +178,7 @@ PHP_FUNCTION(radius_acct_open) |
276 |
@@ -178,7 +274,7 @@ PHP_FUNCTION(radius_acct_open) |
113 |
struct rad_handle *radh = rad_acct_open(); |
277 |
struct rad_handle *radh = rad_acct_open(); |
114 |
|
278 |
|
115 |
if (radh != NULL) { |
279 |
if (radh != NULL) { |
Lines 118-124
Obtained from: https://github.com/Jan-E/php-radius/commit/d2d10e1781dbae70c39112
Link Here
|
118 |
} else { |
282 |
} else { |
119 |
RETURN_FALSE; |
283 |
RETURN_FALSE; |
120 |
} |
284 |
} |
121 |
@@ -191,13 +191,13 @@ PHP_FUNCTION(radius_close) |
285 |
@@ -191,13 +287,13 @@ PHP_FUNCTION(radius_close) |
122 |
struct rad_handle *radh; |
286 |
struct rad_handle *radh; |
123 |
zval *z_radh; |
287 |
zval *z_radh; |
124 |
|
288 |
|
Lines 134-140
Obtained from: https://github.com/Jan-E/php-radius/commit/d2d10e1781dbae70c39112
Link Here
|
134 |
RETURN_TRUE; |
298 |
RETURN_TRUE; |
135 |
} |
299 |
} |
136 |
/* }}} */ |
300 |
/* }}} */ |
137 |
@@ -209,7 +209,7 @@ PHP_FUNCTION(radius_strerror) |
301 |
@@ -209,7 +305,7 @@ PHP_FUNCTION(radius_strerror) |
138 |
struct rad_handle *radh; |
302 |
struct rad_handle *radh; |
139 |
zval *z_radh; |
303 |
zval *z_radh; |
140 |
|
304 |
|
Lines 143-149
Obtained from: https://github.com/Jan-E/php-radius/commit/d2d10e1781dbae70c39112
Link Here
|
143 |
return; |
307 |
return; |
144 |
} |
308 |
} |
145 |
|
309 |
|
146 |
@@ -227,7 +227,7 @@ PHP_FUNCTION(radius_config) |
310 |
@@ -227,7 +323,7 @@ PHP_FUNCTION(radius_config) |
147 |
struct rad_handle *radh; |
311 |
struct rad_handle *radh; |
148 |
zval *z_radh; |
312 |
zval *z_radh; |
149 |
|
313 |
|
Lines 152-158
Obtained from: https://github.com/Jan-E/php-radius/commit/d2d10e1781dbae70c39112
Link Here
|
152 |
return; |
316 |
return; |
153 |
} |
317 |
} |
154 |
|
318 |
|
155 |
@@ -250,7 +250,7 @@ PHP_FUNCTION(radius_add_server) |
319 |
@@ -250,7 +346,7 @@ PHP_FUNCTION(radius_add_server) |
156 |
struct rad_handle *radh; |
320 |
struct rad_handle *radh; |
157 |
zval *z_radh; |
321 |
zval *z_radh; |
158 |
|
322 |
|
Lines 161-167
Obtained from: https://github.com/Jan-E/php-radius/commit/d2d10e1781dbae70c39112
Link Here
|
161 |
&hostname, &hostname_len, |
325 |
&hostname, &hostname_len, |
162 |
&port, |
326 |
&port, |
163 |
&secret, &secret_len, |
327 |
&secret, &secret_len, |
164 |
@@ -275,7 +275,7 @@ PHP_FUNCTION(radius_create_request) |
328 |
@@ -275,7 +371,7 @@ PHP_FUNCTION(radius_create_request) |
165 |
struct rad_handle *radh; |
329 |
struct rad_handle *radh; |
166 |
zval *z_radh; |
330 |
zval *z_radh; |
167 |
|
331 |
|
Lines 170-176
Obtained from: https://github.com/Jan-E/php-radius/commit/d2d10e1781dbae70c39112
Link Here
|
170 |
return; |
334 |
return; |
171 |
} |
335 |
} |
172 |
|
336 |
|
173 |
@@ -299,7 +299,7 @@ PHP_FUNCTION(radius_put_string) |
337 |
@@ -299,7 +395,7 @@ PHP_FUNCTION(radius_put_string) |
174 |
struct rad_handle *radh; |
338 |
struct rad_handle *radh; |
175 |
zval *z_radh; |
339 |
zval *z_radh; |
176 |
|
340 |
|
Lines 179-185
Obtained from: https://github.com/Jan-E/php-radius/commit/d2d10e1781dbae70c39112
Link Here
|
179 |
== FAILURE) { |
343 |
== FAILURE) { |
180 |
return; |
344 |
return; |
181 |
} |
345 |
} |
182 |
@@ -324,7 +324,7 @@ PHP_FUNCTION(radius_put_int) |
346 |
@@ -324,7 +420,7 @@ PHP_FUNCTION(radius_put_int) |
183 |
struct rad_handle *radh; |
347 |
struct rad_handle *radh; |
184 |
zval *z_radh; |
348 |
zval *z_radh; |
185 |
|
349 |
|
Lines 188-194
Obtained from: https://github.com/Jan-E/php-radius/commit/d2d10e1781dbae70c39112
Link Here
|
188 |
== FAILURE) { |
352 |
== FAILURE) { |
189 |
return; |
353 |
return; |
190 |
} |
354 |
} |
191 |
@@ -351,7 +351,7 @@ PHP_FUNCTION(radius_put_attr) |
355 |
@@ -351,7 +447,7 @@ PHP_FUNCTION(radius_put_attr) |
192 |
struct rad_handle *radh; |
356 |
struct rad_handle *radh; |
193 |
zval *z_radh; |
357 |
zval *z_radh; |
194 |
|
358 |
|
Lines 197-203
Obtained from: https://github.com/Jan-E/php-radius/commit/d2d10e1781dbae70c39112
Link Here
|
197 |
== FAILURE) { |
361 |
== FAILURE) { |
198 |
return; |
362 |
return; |
199 |
} |
363 |
} |
200 |
@@ -380,7 +380,7 @@ PHP_FUNCTION(radius_put_addr) |
364 |
@@ -380,7 +476,7 @@ PHP_FUNCTION(radius_put_addr) |
201 |
zval *z_radh; |
365 |
zval *z_radh; |
202 |
struct in_addr intern_addr; |
366 |
struct in_addr intern_addr; |
203 |
|
367 |
|
Lines 206-212
Obtained from: https://github.com/Jan-E/php-radius/commit/d2d10e1781dbae70c39112
Link Here
|
206 |
== FAILURE) { |
370 |
== FAILURE) { |
207 |
return; |
371 |
return; |
208 |
} |
372 |
} |
209 |
@@ -412,7 +412,7 @@ PHP_FUNCTION(radius_put_vendor_string) |
373 |
@@ -412,7 +508,7 @@ PHP_FUNCTION(radius_put_vendor_string) |
210 |
struct rad_handle *radh; |
374 |
struct rad_handle *radh; |
211 |
zval *z_radh; |
375 |
zval *z_radh; |
212 |
|
376 |
|
Lines 215-221
Obtained from: https://github.com/Jan-E/php-radius/commit/d2d10e1781dbae70c39112
Link Here
|
215 |
== FAILURE) { |
379 |
== FAILURE) { |
216 |
return; |
380 |
return; |
217 |
} |
381 |
} |
218 |
@@ -437,7 +437,7 @@ PHP_FUNCTION(radius_put_vendor_int) |
382 |
@@ -437,7 +533,7 @@ PHP_FUNCTION(radius_put_vendor_int) |
219 |
struct rad_handle *radh; |
383 |
struct rad_handle *radh; |
220 |
zval *z_radh; |
384 |
zval *z_radh; |
221 |
|
385 |
|
Lines 224-230
Obtained from: https://github.com/Jan-E/php-radius/commit/d2d10e1781dbae70c39112
Link Here
|
224 |
== FAILURE) { |
388 |
== FAILURE) { |
225 |
return; |
389 |
return; |
226 |
} |
390 |
} |
227 |
@@ -464,7 +464,7 @@ PHP_FUNCTION(radius_put_vendor_attr) |
391 |
@@ -464,7 +560,7 @@ PHP_FUNCTION(radius_put_vendor_attr) |
228 |
struct rad_handle *radh; |
392 |
struct rad_handle *radh; |
229 |
zval *z_radh; |
393 |
zval *z_radh; |
230 |
|
394 |
|
Lines 233-239
Obtained from: https://github.com/Jan-E/php-radius/commit/d2d10e1781dbae70c39112
Link Here
|
233 |
&data, &len, &options, &tag) == FAILURE) { |
397 |
&data, &len, &options, &tag) == FAILURE) { |
234 |
return; |
398 |
return; |
235 |
} |
399 |
} |
236 |
@@ -492,7 +492,7 @@ PHP_FUNCTION(radius_put_vendor_addr) |
400 |
@@ -492,7 +588,7 @@ PHP_FUNCTION(radius_put_vendor_addr) |
237 |
zval *z_radh; |
401 |
zval *z_radh; |
238 |
struct in_addr intern_addr; |
402 |
struct in_addr intern_addr; |
239 |
|
403 |
|
Lines 242-248
Obtained from: https://github.com/Jan-E/php-radius/commit/d2d10e1781dbae70c39112
Link Here
|
242 |
&type, &addr, &addrlen, &options, &tag) == FAILURE) { |
406 |
&type, &addr, &addrlen, &options, &tag) == FAILURE) { |
243 |
return; |
407 |
return; |
244 |
} |
408 |
} |
245 |
@@ -521,7 +521,7 @@ PHP_FUNCTION(radius_send_request) |
409 |
@@ -521,7 +617,7 @@ PHP_FUNCTION(radius_send_request) |
246 |
zval *z_radh; |
410 |
zval *z_radh; |
247 |
int res; |
411 |
int res; |
248 |
|
412 |
|
Lines 251-257
Obtained from: https://github.com/Jan-E/php-radius/commit/d2d10e1781dbae70c39112
Link Here
|
251 |
== FAILURE) { |
415 |
== FAILURE) { |
252 |
return; |
416 |
return; |
253 |
} |
417 |
} |
254 |
@@ -546,7 +546,7 @@ PHP_FUNCTION(radius_get_attr) |
418 |
@@ -546,7 +642,7 @@ PHP_FUNCTION(radius_get_attr) |
255 |
size_t len; |
419 |
size_t len; |
256 |
zval *z_radh; |
420 |
zval *z_radh; |
257 |
|
421 |
|
Lines 260-266
Obtained from: https://github.com/Jan-E/php-radius/commit/d2d10e1781dbae70c39112
Link Here
|
260 |
return; |
424 |
return; |
261 |
} |
425 |
} |
262 |
|
426 |
|
263 |
@@ -574,7 +574,7 @@ PHP_FUNCTION(radius_get_tagged_attr_data) |
427 |
@@ -574,7 +670,7 @@ PHP_FUNCTION(radius_get_tagged_attr_data) |
264 |
const char *attr; |
428 |
const char *attr; |
265 |
COMPAT_ARG_SIZE_T len; |
429 |
COMPAT_ARG_SIZE_T len; |
266 |
|
430 |
|
Lines 269-275
Obtained from: https://github.com/Jan-E/php-radius/commit/d2d10e1781dbae70c39112
Link Here
|
269 |
return; |
433 |
return; |
270 |
} |
434 |
} |
271 |
|
435 |
|
272 |
@@ -595,7 +595,7 @@ PHP_FUNCTION(radius_get_tagged_attr_tag) |
436 |
@@ -595,7 +691,7 @@ PHP_FUNCTION(radius_get_tagged_attr_tag) |
273 |
const char *attr; |
437 |
const char *attr; |
274 |
COMPAT_ARG_SIZE_T len; |
438 |
COMPAT_ARG_SIZE_T len; |
275 |
|
439 |
|
Lines 278-284
Obtained from: https://github.com/Jan-E/php-radius/commit/d2d10e1781dbae70c39112
Link Here
|
278 |
return; |
442 |
return; |
279 |
} |
443 |
} |
280 |
|
444 |
|
281 |
@@ -617,7 +617,7 @@ PHP_FUNCTION(radius_get_vendor_attr) |
445 |
@@ -617,7 +713,7 @@ PHP_FUNCTION(radius_get_vendor_attr) |
282 |
unsigned char type; |
446 |
unsigned char type; |
283 |
size_t data_len; |
447 |
size_t data_len; |
284 |
|
448 |
|
Lines 287-293
Obtained from: https://github.com/Jan-E/php-radius/commit/d2d10e1781dbae70c39112
Link Here
|
287 |
return; |
451 |
return; |
288 |
} |
452 |
} |
289 |
|
453 |
|
290 |
@@ -642,7 +642,7 @@ PHP_FUNCTION(radius_cvt_addr) |
454 |
@@ -642,7 +738,7 @@ PHP_FUNCTION(radius_cvt_addr) |
291 |
COMPAT_ARG_SIZE_T len; |
455 |
COMPAT_ARG_SIZE_T len; |
292 |
struct in_addr addr; |
456 |
struct in_addr addr; |
293 |
|
457 |
|
Lines 296-302
Obtained from: https://github.com/Jan-E/php-radius/commit/d2d10e1781dbae70c39112
Link Here
|
296 |
return; |
460 |
return; |
297 |
} |
461 |
} |
298 |
|
462 |
|
299 |
@@ -659,7 +659,7 @@ PHP_FUNCTION(radius_cvt_int) |
463 |
@@ -659,7 +755,7 @@ PHP_FUNCTION(radius_cvt_int) |
300 |
COMPAT_ARG_SIZE_T len; |
464 |
COMPAT_ARG_SIZE_T len; |
301 |
int val; |
465 |
int val; |
302 |
|
466 |
|
Lines 305-311
Obtained from: https://github.com/Jan-E/php-radius/commit/d2d10e1781dbae70c39112
Link Here
|
305 |
== FAILURE) { |
469 |
== FAILURE) { |
306 |
return; |
470 |
return; |
307 |
} |
471 |
} |
308 |
@@ -676,7 +676,7 @@ PHP_FUNCTION(radius_cvt_string) |
472 |
@@ -676,7 +772,7 @@ PHP_FUNCTION(radius_cvt_string) |
309 |
char *val; |
473 |
char *val; |
310 |
COMPAT_ARG_SIZE_T len; |
474 |
COMPAT_ARG_SIZE_T len; |
311 |
|
475 |
|
Lines 314-320
Obtained from: https://github.com/Jan-E/php-radius/commit/d2d10e1781dbae70c39112
Link Here
|
314 |
== FAILURE) { |
478 |
== FAILURE) { |
315 |
return; |
479 |
return; |
316 |
} |
480 |
} |
317 |
@@ -698,7 +698,7 @@ PHP_FUNCTION(radius_salt_encrypt_attr) |
481 |
@@ -698,7 +794,7 @@ PHP_FUNCTION(radius_salt_encrypt_attr) |
318 |
struct rad_salted_value salted; |
482 |
struct rad_salted_value salted; |
319 |
zval *z_radh; |
483 |
zval *z_radh; |
320 |
|
484 |
|
Lines 323-329
Obtained from: https://github.com/Jan-E/php-radius/commit/d2d10e1781dbae70c39112
Link Here
|
323 |
return; |
487 |
return; |
324 |
} |
488 |
} |
325 |
|
489 |
|
326 |
@@ -724,7 +724,7 @@ PHP_FUNCTION(radius_request_authenticator) |
490 |
@@ -724,7 +820,7 @@ PHP_FUNCTION(radius_request_authenticator) |
327 |
char buf[LEN_AUTH]; |
491 |
char buf[LEN_AUTH]; |
328 |
zval *z_radh; |
492 |
zval *z_radh; |
329 |
|
493 |
|
Lines 332-338
Obtained from: https://github.com/Jan-E/php-radius/commit/d2d10e1781dbae70c39112
Link Here
|
332 |
return; |
496 |
return; |
333 |
} |
497 |
} |
334 |
|
498 |
|
335 |
@@ -746,7 +746,7 @@ PHP_FUNCTION(radius_server_secret) |
499 |
@@ -746,7 +842,7 @@ PHP_FUNCTION(radius_server_secret) |
336 |
struct rad_handle *radh; |
500 |
struct rad_handle *radh; |
337 |
zval *z_radh; |
501 |
zval *z_radh; |
338 |
|
502 |
|
Lines 341-347
Obtained from: https://github.com/Jan-E/php-radius/commit/d2d10e1781dbae70c39112
Link Here
|
341 |
return; |
505 |
return; |
342 |
} |
506 |
} |
343 |
|
507 |
|
344 |
@@ -771,7 +771,7 @@ PHP_FUNCTION(radius_demangle) |
508 |
@@ -771,7 +867,7 @@ PHP_FUNCTION(radius_demangle) |
345 |
COMPAT_ARG_SIZE_T len; |
509 |
COMPAT_ARG_SIZE_T len; |
346 |
int res; |
510 |
int res; |
347 |
|
511 |
|
Lines 350-356
Obtained from: https://github.com/Jan-E/php-radius/commit/d2d10e1781dbae70c39112
Link Here
|
350 |
return; |
514 |
return; |
351 |
} |
515 |
} |
352 |
|
516 |
|
353 |
@@ -802,7 +802,7 @@ PHP_FUNCTION(radius_demangle_mppe_key) |
517 |
@@ -802,7 +898,7 @@ PHP_FUNCTION(radius_demangle_mppe_key) |
354 |
COMPAT_ARG_SIZE_T len; |
518 |
COMPAT_ARG_SIZE_T len; |
355 |
int res; |
519 |
int res; |
356 |
|
520 |
|
Lines 359-365
Obtained from: https://github.com/Jan-E/php-radius/commit/d2d10e1781dbae70c39112
Link Here
|
359 |
return; |
523 |
return; |
360 |
} |
524 |
} |
361 |
|
525 |
|
362 |
@@ -844,7 +844,7 @@ int _init_options(struct rad_attr_options *out, int op |
526 |
@@ -844,7 +940,7 @@ int _init_options(struct rad_attr_options *out, int options, int tag) { |
363 |
/* }}} */ |
527 |
/* }}} */ |
364 |
|
528 |
|
365 |
/* {{{ _radius_close() */ |
529 |
/* {{{ _radius_close() */ |
Lines 368-375
Obtained from: https://github.com/Jan-E/php-radius/commit/d2d10e1781dbae70c39112
Link Here
|
368 |
{ |
532 |
{ |
369 |
struct rad_handle *radh = (struct rad_handle *)res->ptr; |
533 |
struct rad_handle *radh = (struct rad_handle *)res->ptr; |
370 |
rad_close(radh); |
534 |
rad_close(radh); |
371 |
--- radlib.c.orig 2016-02-15 15:11:50 UTC |
535 |
--- radlib.c |
372 |
+++ radlib.c |
536 |
+++ radlib.c |
|
|
537 |
@@ -497,9 +497,9 @@ rad_continue_send_request(struct rad_handle *h, int selected, int *fd, |
538 |
|
539 |
if (selected) { |
540 |
struct sockaddr_in from; |
541 |
- int fromlen; |
542 |
+ socklen_t fromlen; |
543 |
|
544 |
- fromlen = sizeof from; |
545 |
+ fromlen = sizeof(from); |
546 |
h->resp_len = recvfrom(h->fd, h->response, |
547 |
MSGSIZE, MSG_WAITALL, (struct sockaddr *)&from, &fromlen); |
548 |
if (h->resp_len == -1) { |
373 |
@@ -581,8 +581,7 @@ rad_create_request(struct rad_handle *h, int code) |
549 |
@@ -581,8 +581,7 @@ rad_create_request(struct rad_handle *h, int code) |
374 |
/* Create a random authenticator */ |
550 |
/* Create a random authenticator */ |
375 |
for (i = 0; i < LEN_AUTH; i += 2) { |
551 |
for (i = 0; i < LEN_AUTH; i += 2) { |
Lines 394-400
Obtained from: https://github.com/Jan-E/php-radius/commit/d2d10e1781dbae70c39112
Link Here
|
394 |
h->errmsg[0] = '\0'; |
570 |
h->errmsg[0] = '\0'; |
395 |
memset(h->request, 0, sizeof h->request); |
571 |
memset(h->request, 0, sizeof h->request); |
396 |
h->req_len = 0; |
572 |
h->req_len = 0; |
397 |
@@ -1242,7 +1240,6 @@ int rad_salt_value(struct rad_handle *h, const char *i |
573 |
@@ -1035,7 +1033,7 @@ rad_put_vendor_attr(struct rad_handle *h, int vendor, int type, |
|
|
574 |
/* OK, allocate and start building the attribute. */ |
575 |
attr = emalloc(va_len); |
576 |
if (attr == NULL) { |
577 |
- generr(h, "malloc failure (%d bytes)", va_len); |
578 |
+ generr(h, "malloc failure (%zu bytes)", va_len); |
579 |
goto end; |
580 |
} |
581 |
|
582 |
@@ -1218,12 +1216,12 @@ rad_demangle_mppe_key(struct rad_handle *h, const void *mangled, size_t mlen, u_ |
583 |
*/ |
584 |
*len = *P; |
585 |
if (*len > mlen - 1) { |
586 |
- generr(h, "Mangled data seems to be garbage %d %d", *len, mlen-1); |
587 |
+ generr(h, "Mangled data seems to be garbage %zu %lu", *len, mlen-1); |
588 |
return -1; |
589 |
} |
590 |
|
591 |
if (*len > MPPE_KEY_LEN) { |
592 |
- generr(h, "Key to long (%d) for me max. %d", *len, MPPE_KEY_LEN); |
593 |
+ generr(h, "Key to long (%zu) for me max. %d", *len, MPPE_KEY_LEN); |
594 |
return -1; |
595 |
} |
596 |
|
597 |
@@ -1235,14 +1233,13 @@ int rad_salt_value(struct rad_handle *h, const char *in, size_t len, struct rad_ |
598 |
{ |
599 |
char authenticator[16]; |
600 |
size_t i; |
601 |
- char intermediate[16]; |
602 |
+ unsigned char intermediate[16]; |
603 |
const char *in_pos; |
604 |
MD5_CTX md5; |
605 |
char *out_pos; |
398 |
php_uint32 random; |
606 |
php_uint32 random; |
399 |
size_t salted_len; |
607 |
size_t salted_len; |
400 |
const char *secret; |
608 |
const char *secret; |
Lines 402-408
Obtained from: https://github.com/Jan-E/php-radius/commit/d2d10e1781dbae70c39112
Link Here
|
402 |
|
610 |
|
403 |
if (len == 0) { |
611 |
if (len == 0) { |
404 |
out->len = 0; |
612 |
out->len = 0; |
405 |
@@ -1289,7 +1286,7 @@ int rad_salt_value(struct rad_handle *h, const char *i |
613 |
@@ -1276,7 +1273,7 @@ int rad_salt_value(struct rad_handle *h, const char *in, size_t len, struct rad_ |
|
|
614 |
memset(out->data, 0, out->len); |
615 |
|
616 |
/* Grab the request authenticator. */ |
617 |
- if (rad_request_authenticator(h, authenticator, sizeof authenticator) != sizeof authenticator) { |
618 |
+ if (rad_request_authenticator(h, authenticator, sizeof(authenticator)) != sizeof(authenticator)) { |
619 |
generr(h, "Cannot obtain the RADIUS request authenticator"); |
620 |
goto err; |
621 |
} |
622 |
@@ -1289,7 +1286,7 @@ int rad_salt_value(struct rad_handle *h, const char *in, size_t len, struct rad_ |
406 |
} |
623 |
} |
407 |
|
624 |
|
408 |
/* Generate a random number to use as the salt. */ |
625 |
/* Generate a random number to use as the salt. */ |
Lines 411-413
Obtained from: https://github.com/Jan-E/php-radius/commit/d2d10e1781dbae70c39112
Link Here
|
411 |
|
628 |
|
412 |
/* The RFC requires that the high bit of the salt be 1. Otherwise, |
629 |
/* The RFC requires that the high bit of the salt be 1. Otherwise, |
413 |
* let's set up the header. */ |
630 |
* let's set up the header. */ |
|
|
631 |
@@ -1301,7 +1298,7 @@ int rad_salt_value(struct rad_handle *h, const char *in, size_t len, struct rad_ |
632 |
* calls b1 first. */ |
633 |
MD5Init(&md5); |
634 |
MD5Update(&md5, secret, strlen(secret)); |
635 |
- MD5Update(&md5, authenticator, sizeof authenticator); |
636 |
+ MD5Update(&md5, authenticator, sizeof(authenticator)); |
637 |
MD5Update(&md5, out->data, 2); |
638 |
MD5Final(intermediate, &md5); |
639 |
|