@@ -253,159 +253,171 @@ pub type SSL_custom_ext_parse_cb_ex = Option<
253
253
) -> c_int ,
254
254
> ;
255
255
256
- pub const SSL_OP_LEGACY_SERVER_CONNECT : c_ulong = 0x00000004 ;
256
+ cfg_if ! {
257
+ if #[ cfg( ossl300) ] {
258
+ macro_rules! ssl_op_type {
259
+ ( ) => { u64 } ;
260
+ }
261
+ } else {
262
+ macro_rules! ssl_op_type {
263
+ ( ) => { c_ulong} ;
264
+ }
265
+ }
266
+ }
267
+
268
+ pub const SSL_OP_LEGACY_SERVER_CONNECT : ssl_op_type ! ( ) = 0x00000004 ;
257
269
cfg_if ! {
258
270
if #[ cfg( libressl261) ] {
259
- pub const SSL_OP_TLSEXT_PADDING : c_ulong = 0x0 ;
271
+ pub const SSL_OP_TLSEXT_PADDING : ssl_op_type! ( ) = 0x0 ;
260
272
} else if #[ cfg( any( ossl102, libressl) ) ] {
261
- pub const SSL_OP_TLSEXT_PADDING : c_ulong = 0x10 ;
273
+ pub const SSL_OP_TLSEXT_PADDING : ssl_op_type! ( ) = 0x10 ;
262
274
}
263
275
}
264
276
#[ cfg( ossl101) ]
265
- pub const SSL_OP_SAFARI_ECDHE_ECDSA_BUG : c_ulong = 0x00000040 ;
277
+ pub const SSL_OP_SAFARI_ECDHE_ECDSA_BUG : ssl_op_type ! ( ) = 0x00000040 ;
266
278
267
- pub const SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS : c_ulong = 0x00000800 ;
279
+ pub const SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS : ssl_op_type ! ( ) = 0x00000800 ;
268
280
269
- pub const SSL_OP_NO_QUERY_MTU : c_ulong = 0x00001000 ;
270
- pub const SSL_OP_COOKIE_EXCHANGE : c_ulong = 0x00002000 ;
271
- pub const SSL_OP_NO_TICKET : c_ulong = 0x00004000 ;
281
+ pub const SSL_OP_NO_QUERY_MTU : ssl_op_type ! ( ) = 0x00001000 ;
282
+ pub const SSL_OP_COOKIE_EXCHANGE : ssl_op_type ! ( ) = 0x00002000 ;
283
+ pub const SSL_OP_NO_TICKET : ssl_op_type ! ( ) = 0x00004000 ;
272
284
cfg_if ! {
273
285
if #[ cfg( ossl101) ] {
274
- pub const SSL_OP_CISCO_ANYCONNECT : c_ulong = 0x00008000 ;
286
+ pub const SSL_OP_CISCO_ANYCONNECT : ssl_op_type! ( ) = 0x00008000 ;
275
287
} else {
276
- pub const SSL_OP_CISCO_ANYCONNECT : c_ulong = 0x0 ;
288
+ pub const SSL_OP_CISCO_ANYCONNECT : ssl_op_type! ( ) = 0x0 ;
277
289
}
278
290
}
279
291
280
- pub const SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION : c_ulong = 0x00010000 ;
292
+ pub const SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION : ssl_op_type ! ( ) = 0x00010000 ;
281
293
cfg_if ! {
282
294
if #[ cfg( ossl101) ] {
283
- pub const SSL_OP_NO_COMPRESSION : c_ulong = 0x00020000 ;
284
- pub const SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION : c_ulong = 0x00040000 ;
295
+ pub const SSL_OP_NO_COMPRESSION : ssl_op_type! ( ) = 0x00020000 ;
296
+ pub const SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION : ssl_op_type! ( ) = 0x00040000 ;
285
297
} else {
286
- pub const SSL_OP_NO_COMPRESSION : c_ulong = 0x0 ;
287
- pub const SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION : c_ulong = 0x0 ;
298
+ pub const SSL_OP_NO_COMPRESSION : ssl_op_type! ( ) = 0x0 ;
299
+ pub const SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION : ssl_op_type! ( ) = 0x0 ;
288
300
}
289
301
}
290
302
291
303
#[ cfg( ossl111) ]
292
- pub const SSL_OP_ENABLE_MIDDLEBOX_COMPAT : c_ulong = 0x00100000 ;
304
+ pub const SSL_OP_ENABLE_MIDDLEBOX_COMPAT : ssl_op_type ! ( ) = 0x00100000 ;
293
305
294
- pub const SSL_OP_CIPHER_SERVER_PREFERENCE : c_ulong = 0x00400000 ;
306
+ pub const SSL_OP_CIPHER_SERVER_PREFERENCE : ssl_op_type ! ( ) = 0x00400000 ;
295
307
cfg_if ! {
296
308
if #[ cfg( libressl280) ] {
297
- pub const SSL_OP_TLS_ROLLBACK_BUG : c_ulong = 0 ;
309
+ pub const SSL_OP_TLS_ROLLBACK_BUG : ssl_op_type! ( ) = 0 ;
298
310
} else {
299
- pub const SSL_OP_TLS_ROLLBACK_BUG : c_ulong = 0x00800000 ;
311
+ pub const SSL_OP_TLS_ROLLBACK_BUG : ssl_op_type! ( ) = 0x00800000 ;
300
312
}
301
313
}
302
314
303
315
cfg_if ! {
304
316
if #[ cfg( ossl101) ] {
305
- pub const SSL_OP_NO_SSLv3 : c_ulong = 0x02000000 ;
317
+ pub const SSL_OP_NO_SSLv3 : ssl_op_type! ( ) = 0x02000000 ;
306
318
} else {
307
- pub const SSL_OP_NO_SSLv3 : c_ulong = 0x0 ;
319
+ pub const SSL_OP_NO_SSLv3 : ssl_op_type! ( ) = 0x0 ;
308
320
}
309
321
}
310
- pub const SSL_OP_NO_TLSv1_1 : c_ulong = 0x10000000 ;
311
- pub const SSL_OP_NO_TLSv1_2 : c_ulong = 0x08000000 ;
322
+ pub const SSL_OP_NO_TLSv1_1 : ssl_op_type ! ( ) = 0x10000000 ;
323
+ pub const SSL_OP_NO_TLSv1_2 : ssl_op_type ! ( ) = 0x08000000 ;
312
324
313
- pub const SSL_OP_NO_TLSv1 : c_ulong = 0x04000000 ;
325
+ pub const SSL_OP_NO_TLSv1 : ssl_op_type ! ( ) = 0x04000000 ;
314
326
cfg_if ! {
315
327
if #[ cfg( ossl102) ] {
316
- pub const SSL_OP_NO_DTLSv1 : c_ulong = 0x04000000 ;
317
- pub const SSL_OP_NO_DTLSv1_2 : c_ulong = 0x08000000 ;
328
+ pub const SSL_OP_NO_DTLSv1 : ssl_op_type! ( ) = 0x04000000 ;
329
+ pub const SSL_OP_NO_DTLSv1_2 : ssl_op_type! ( ) = 0x08000000 ;
318
330
} else if #[ cfg( libressl332) ] {
319
- pub const SSL_OP_NO_DTLSv1 : c_ulong = 0x40000000 ;
320
- pub const SSL_OP_NO_DTLSv1_2 : c_ulong = 0x80000000 ;
331
+ pub const SSL_OP_NO_DTLSv1 : ssl_op_type! ( ) = 0x40000000 ;
332
+ pub const SSL_OP_NO_DTLSv1_2 : ssl_op_type! ( ) = 0x80000000 ;
321
333
}
322
334
}
323
335
#[ cfg( ossl111) ]
324
- pub const SSL_OP_NO_TLSv1_3 : c_ulong = 0x20000000 ;
336
+ pub const SSL_OP_NO_TLSv1_3 : ssl_op_type ! ( ) = 0x20000000 ;
325
337
326
338
#[ cfg( ossl110h) ]
327
- pub const SSL_OP_NO_RENEGOTIATION : c_ulong = 0x40000000 ;
339
+ pub const SSL_OP_NO_RENEGOTIATION : ssl_op_type ! ( ) = 0x40000000 ;
328
340
329
341
cfg_if ! {
330
342
if #[ cfg( ossl111) ] {
331
- pub const SSL_OP_NO_SSL_MASK : c_ulong = SSL_OP_NO_SSLv2
343
+ pub const SSL_OP_NO_SSL_MASK : ssl_op_type! ( ) = SSL_OP_NO_SSLv2
332
344
| SSL_OP_NO_SSLv3
333
345
| SSL_OP_NO_TLSv1
334
346
| SSL_OP_NO_TLSv1_1
335
347
| SSL_OP_NO_TLSv1_2
336
348
| SSL_OP_NO_TLSv1_3 ;
337
349
} else if #[ cfg( ossl102) ] {
338
- pub const SSL_OP_NO_SSL_MASK : c_ulong =
350
+ pub const SSL_OP_NO_SSL_MASK : ssl_op_type! ( ) =
339
351
SSL_OP_NO_SSLv2 | SSL_OP_NO_SSLv3 | SSL_OP_NO_TLSv1 | SSL_OP_NO_TLSv1_1 | SSL_OP_NO_TLSv1_2 ;
340
352
}
341
353
}
342
354
343
355
cfg_if ! {
344
356
if #[ cfg( libressl261) ] {
345
- pub const SSL_OP_CRYPTOPRO_TLSEXT_BUG : c_ulong = 0x0 ;
357
+ pub const SSL_OP_CRYPTOPRO_TLSEXT_BUG : ssl_op_type! ( ) = 0x0 ;
346
358
} else {
347
- pub const SSL_OP_CRYPTOPRO_TLSEXT_BUG : c_ulong = 0x80000000 ;
359
+ pub const SSL_OP_CRYPTOPRO_TLSEXT_BUG : ssl_op_type! ( ) = 0x80000000 ;
348
360
}
349
361
}
350
362
351
363
cfg_if ! {
352
364
if #[ cfg( ossl300) ] {
353
- pub const SSL_OP_ALL : c_ulong = SSL_OP_CRYPTOPRO_TLSEXT_BUG
365
+ pub const SSL_OP_ALL : ssl_op_type! ( ) = SSL_OP_CRYPTOPRO_TLSEXT_BUG
354
366
| SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS
355
367
| SSL_OP_TLSEXT_PADDING
356
368
| SSL_OP_SAFARI_ECDHE_ECDSA_BUG ;
357
369
} else if #[ cfg( ossl110f) ] {
358
- pub const SSL_OP_ALL : c_ulong = SSL_OP_CRYPTOPRO_TLSEXT_BUG
370
+ pub const SSL_OP_ALL : ssl_op_type! ( ) = SSL_OP_CRYPTOPRO_TLSEXT_BUG
359
371
| SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS
360
372
| SSL_OP_LEGACY_SERVER_CONNECT
361
373
| SSL_OP_TLSEXT_PADDING
362
374
| SSL_OP_SAFARI_ECDHE_ECDSA_BUG ;
363
375
} else if #[ cfg( libressl261) ] {
364
- pub const SSL_OP_ALL : c_ulong = 0x4 ;
376
+ pub const SSL_OP_ALL : ssl_op_type! ( ) = 0x4 ;
365
377
} else if #[ cfg( libressl) ] {
366
- pub const SSL_OP_ALL : c_ulong = 0x80000014 ;
378
+ pub const SSL_OP_ALL : ssl_op_type! ( ) = 0x80000014 ;
367
379
} else {
368
- pub const SSL_OP_ALL : c_ulong = 0x80000BFF ;
380
+ pub const SSL_OP_ALL : ssl_op_type! ( ) = 0x80000BFF ;
369
381
}
370
382
}
371
383
372
384
cfg_if ! {
373
385
if #[ cfg( ossl110) ] {
374
- pub const SSL_OP_MICROSOFT_SESS_ID_BUG : c_ulong = 0x00000000 ;
375
- pub const SSL_OP_NETSCAPE_CHALLENGE_BUG : c_ulong = 0x00000000 ;
376
- pub const SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG : c_ulong = 0x00000000 ;
377
- pub const SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER : c_ulong = 0x00000000 ;
378
- pub const SSL_OP_SSLEAY_080_CLIENT_DH_BUG : c_ulong = 0x00000000 ;
379
- pub const SSL_OP_TLS_D5_BUG : c_ulong = 0x00000000 ;
380
- pub const SSL_OP_TLS_BLOCK_PADDING_BUG : c_ulong = 0x00000000 ;
381
- pub const SSL_OP_SINGLE_ECDH_USE : c_ulong = 0x00000000 ;
382
- pub const SSL_OP_SINGLE_DH_USE : c_ulong = 0x00000000 ;
383
- pub const SSL_OP_NO_SSLv2 : c_ulong = 0x00000000 ;
386
+ pub const SSL_OP_MICROSOFT_SESS_ID_BUG : ssl_op_type! ( ) = 0x00000000 ;
387
+ pub const SSL_OP_NETSCAPE_CHALLENGE_BUG : ssl_op_type! ( ) = 0x00000000 ;
388
+ pub const SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG : ssl_op_type! ( ) = 0x00000000 ;
389
+ pub const SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER : ssl_op_type! ( ) = 0x00000000 ;
390
+ pub const SSL_OP_SSLEAY_080_CLIENT_DH_BUG : ssl_op_type! ( ) = 0x00000000 ;
391
+ pub const SSL_OP_TLS_D5_BUG : ssl_op_type! ( ) = 0x00000000 ;
392
+ pub const SSL_OP_TLS_BLOCK_PADDING_BUG : ssl_op_type! ( ) = 0x00000000 ;
393
+ pub const SSL_OP_SINGLE_ECDH_USE : ssl_op_type! ( ) = 0x00000000 ;
394
+ pub const SSL_OP_SINGLE_DH_USE : ssl_op_type! ( ) = 0x00000000 ;
395
+ pub const SSL_OP_NO_SSLv2 : ssl_op_type! ( ) = 0x00000000 ;
384
396
} else if #[ cfg( ossl101) ] {
385
- pub const SSL_OP_MICROSOFT_SESS_ID_BUG : c_ulong = 0x00000001 ;
386
- pub const SSL_OP_NETSCAPE_CHALLENGE_BUG : c_ulong = 0x00000002 ;
387
- pub const SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG : c_ulong = 0x00000008 ;
388
- pub const SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER : c_ulong = 0x00000020 ;
389
- pub const SSL_OP_SSLEAY_080_CLIENT_DH_BUG : c_ulong = 0x00000080 ;
390
- pub const SSL_OP_TLS_D5_BUG : c_ulong = 0x00000100 ;
391
- pub const SSL_OP_TLS_BLOCK_PADDING_BUG : c_ulong = 0x00000200 ;
392
- pub const SSL_OP_SINGLE_ECDH_USE : c_ulong = 0x00080000 ;
393
- pub const SSL_OP_SINGLE_DH_USE : c_ulong = 0x00100000 ;
394
- pub const SSL_OP_NO_SSLv2 : c_ulong = 0x01000000 ;
397
+ pub const SSL_OP_MICROSOFT_SESS_ID_BUG : ssl_op_type! ( ) = 0x00000001 ;
398
+ pub const SSL_OP_NETSCAPE_CHALLENGE_BUG : ssl_op_type! ( ) = 0x00000002 ;
399
+ pub const SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG : ssl_op_type! ( ) = 0x00000008 ;
400
+ pub const SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER : ssl_op_type! ( ) = 0x00000020 ;
401
+ pub const SSL_OP_SSLEAY_080_CLIENT_DH_BUG : ssl_op_type! ( ) = 0x00000080 ;
402
+ pub const SSL_OP_TLS_D5_BUG : ssl_op_type! ( ) = 0x00000100 ;
403
+ pub const SSL_OP_TLS_BLOCK_PADDING_BUG : ssl_op_type! ( ) = 0x00000200 ;
404
+ pub const SSL_OP_SINGLE_ECDH_USE : ssl_op_type! ( ) = 0x00080000 ;
405
+ pub const SSL_OP_SINGLE_DH_USE : ssl_op_type! ( ) = 0x00100000 ;
406
+ pub const SSL_OP_NO_SSLv2 : ssl_op_type! ( ) = 0x01000000 ;
395
407
} else {
396
- pub const SSL_OP_MICROSOFT_SESS_ID_BUG : c_ulong = 0x0 ;
397
- pub const SSL_OP_NETSCAPE_CHALLENGE_BUG : c_ulong = 0x0 ;
398
- pub const SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG : c_ulong = 0x0 ;
399
- pub const SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER : c_ulong = 0x0 ;
400
- pub const SSL_OP_SSLEAY_080_CLIENT_DH_BUG : c_ulong = 0x0 ;
401
- pub const SSL_OP_TLS_D5_BUG : c_ulong = 0x0 ;
402
- pub const SSL_OP_TLS_BLOCK_PADDING_BUG : c_ulong = 0x0 ;
408
+ pub const SSL_OP_MICROSOFT_SESS_ID_BUG : ssl_op_type! ( ) = 0x0 ;
409
+ pub const SSL_OP_NETSCAPE_CHALLENGE_BUG : ssl_op_type! ( ) = 0x0 ;
410
+ pub const SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG : ssl_op_type! ( ) = 0x0 ;
411
+ pub const SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER : ssl_op_type! ( ) = 0x0 ;
412
+ pub const SSL_OP_SSLEAY_080_CLIENT_DH_BUG : ssl_op_type! ( ) = 0x0 ;
413
+ pub const SSL_OP_TLS_D5_BUG : ssl_op_type! ( ) = 0x0 ;
414
+ pub const SSL_OP_TLS_BLOCK_PADDING_BUG : ssl_op_type! ( ) = 0x0 ;
403
415
#[ cfg( libressl261) ]
404
- pub const SSL_OP_SINGLE_ECDH_USE : c_ulong = 0x0 ;
416
+ pub const SSL_OP_SINGLE_ECDH_USE : ssl_op_type! ( ) = 0x0 ;
405
417
#[ cfg( not( libressl261) ) ]
406
- pub const SSL_OP_SINGLE_ECDH_USE : c_ulong = 0x00080000 ;
407
- pub const SSL_OP_SINGLE_DH_USE : c_ulong = 0x00100000 ;
408
- pub const SSL_OP_NO_SSLv2 : c_ulong = 0x0 ;
418
+ pub const SSL_OP_SINGLE_ECDH_USE : ssl_op_type! ( ) = 0x00080000 ;
419
+ pub const SSL_OP_SINGLE_DH_USE : ssl_op_type! ( ) = 0x00100000 ;
420
+ pub const SSL_OP_NO_SSLv2 : ssl_op_type! ( ) = 0x0 ;
409
421
}
410
422
}
411
423
0 commit comments