@@ -654,8 +654,8 @@ impl SslVersion {
654
654
655
655
/// TLSv1.3
656
656
///
657
- /// Requires OpenSSL 1.1.1 or LibreSSL 3.4.0 or newer.
658
- #[ cfg( any( ossl111, libressl340) ) ]
657
+ /// Requires BoringSSL or OpenSSL 1.1.1 or LibreSSL 3.4.0 or newer.
658
+ #[ cfg( any( ossl111, libressl340, boringssl ) ) ]
659
659
pub const TLS1_3 : SslVersion = SslVersion ( ffi:: TLS1_3_VERSION ) ;
660
660
661
661
/// DTLSv1.0
@@ -666,7 +666,7 @@ impl SslVersion {
666
666
/// DTLSv1.2
667
667
///
668
668
/// DTLS 1.2 corresponds to TLS 1.2 to harmonize versions. There was never a DTLS 1.1.
669
- #[ cfg( any( ossl102, libressl332) ) ]
669
+ #[ cfg( any( ossl102, libressl332, boringssl ) ) ]
670
670
pub const DTLS1_2 : SslVersion = SslVersion ( ffi:: DTLS1_2_VERSION ) ;
671
671
}
672
672
@@ -1147,9 +1147,9 @@ impl SslContextBuilder {
1147
1147
/// A value of `None` will enable protocol versions down to the lowest version supported by
1148
1148
/// OpenSSL.
1149
1149
///
1150
- /// Requires OpenSSL 1.1.0 or LibreSSL 2.6.1 or newer.
1150
+ /// Requires BoringSSL or OpenSSL 1.1.0 or LibreSSL 2.6.1 or newer.
1151
1151
#[ corresponds( SSL_CTX_set_min_proto_version ) ]
1152
- #[ cfg( any( ossl110, libressl261) ) ]
1152
+ #[ cfg( any( ossl110, libressl261, boringssl ) ) ]
1153
1153
pub fn set_min_proto_version ( & mut self , version : Option < SslVersion > ) -> Result < ( ) , ErrorStack > {
1154
1154
unsafe {
1155
1155
cvt ( ffi:: SSL_CTX_set_min_proto_version (
@@ -1165,9 +1165,9 @@ impl SslContextBuilder {
1165
1165
/// A value of `None` will enable protocol versions up to the highest version supported by
1166
1166
/// OpenSSL.
1167
1167
///
1168
- /// Requires OpenSSL 1.1.0 or or LibreSSL 2.6.1 or newer.
1168
+ /// Requires BoringSSL or OpenSSL 1.1.0 or or LibreSSL 2.6.1 or newer.
1169
1169
#[ corresponds( SSL_CTX_set_max_proto_version ) ]
1170
- #[ cfg( any( ossl110, libressl261) ) ]
1170
+ #[ cfg( any( ossl110, libressl261, boringssl ) ) ]
1171
1171
pub fn set_max_proto_version ( & mut self , version : Option < SslVersion > ) -> Result < ( ) , ErrorStack > {
1172
1172
unsafe {
1173
1173
cvt ( ffi:: SSL_CTX_set_max_proto_version (
@@ -1223,16 +1223,16 @@ impl SslContextBuilder {
1223
1223
/// and `http/1.1` is encoded as `b"\x06spdy/1\x08http/1.1"`. The protocols are ordered by
1224
1224
/// preference.
1225
1225
///
1226
- /// Requires OpenSSL 1.0.2 or LibreSSL 2.6.1 or newer.
1226
+ /// Requires BoringSSL or OpenSSL 1.0.2 or LibreSSL 2.6.1 or newer.
1227
1227
#[ corresponds( SSL_CTX_set_alpn_protos ) ]
1228
- #[ cfg( any( ossl102, libressl261) ) ]
1228
+ #[ cfg( any( ossl102, libressl261, boringssl ) ) ]
1229
1229
pub fn set_alpn_protos ( & mut self , protocols : & [ u8 ] ) -> Result < ( ) , ErrorStack > {
1230
1230
unsafe {
1231
1231
assert ! ( protocols. len( ) <= c_uint:: max_value( ) as usize ) ;
1232
1232
let r = ffi:: SSL_CTX_set_alpn_protos (
1233
1233
self . as_ptr ( ) ,
1234
1234
protocols. as_ptr ( ) ,
1235
- protocols. len ( ) as c_uint ,
1235
+ protocols. len ( ) as _ ,
1236
1236
) ;
1237
1237
// fun fact, SSL_CTX_set_alpn_protos has a reversed return code D:
1238
1238
if r == 0 {
@@ -2480,19 +2480,16 @@ impl SslRef {
2480
2480
2481
2481
/// Like [`SslContextBuilder::set_alpn_protos`].
2482
2482
///
2483
- /// Requires OpenSSL 1.0.2 or LibreSSL 2.6.1 or newer.
2483
+ /// Requires BoringSSL or OpenSSL 1.0.2 or LibreSSL 2.6.1 or newer.
2484
2484
///
2485
2485
/// [`SslContextBuilder::set_alpn_protos`]: struct.SslContextBuilder.html#method.set_alpn_protos
2486
2486
#[ corresponds( SSL_set_alpn_protos ) ]
2487
- #[ cfg( any( ossl102, libressl261) ) ]
2487
+ #[ cfg( any( ossl102, libressl261, boringssl ) ) ]
2488
2488
pub fn set_alpn_protos ( & mut self , protocols : & [ u8 ] ) -> Result < ( ) , ErrorStack > {
2489
2489
unsafe {
2490
2490
assert ! ( protocols. len( ) <= c_uint:: max_value( ) as usize ) ;
2491
- let r = ffi:: SSL_set_alpn_protos (
2492
- self . as_ptr ( ) ,
2493
- protocols. as_ptr ( ) ,
2494
- protocols. len ( ) as c_uint ,
2495
- ) ;
2491
+ let r =
2492
+ ffi:: SSL_set_alpn_protos ( self . as_ptr ( ) , protocols. as_ptr ( ) , protocols. len ( ) as _ ) ;
2496
2493
// fun fact, SSL_set_alpn_protos has a reversed return code D:
2497
2494
if r == 0 {
2498
2495
Ok ( ( ) )
@@ -2639,9 +2636,9 @@ impl SslRef {
2639
2636
/// The protocol's name is returned is an opaque sequence of bytes. It is up to the client
2640
2637
/// to interpret it.
2641
2638
///
2642
- /// Requires OpenSSL 1.0.2 or LibreSSL 2.6.1 or newer.
2639
+ /// Requires BoringSSL or OpenSSL 1.0.2 or LibreSSL 2.6.1 or newer.
2643
2640
#[ corresponds( SSL_get0_alpn_selected ) ]
2644
- #[ cfg( any( ossl102, libressl261) ) ]
2641
+ #[ cfg( any( ossl102, libressl261, boringssl ) ) ]
2645
2642
pub fn selected_alpn_protocol ( & self ) -> Option < & [ u8 ] > {
2646
2643
unsafe {
2647
2644
let mut data: * const c_uchar = ptr:: null ( ) ;
@@ -3334,9 +3331,9 @@ impl SslRef {
3334
3331
/// A value of `None` will enable protocol versions down to the lowest version supported by
3335
3332
/// OpenSSL.
3336
3333
///
3337
- /// Requires OpenSSL 1.1.0 or LibreSSL 2.6.1 or newer.
3334
+ /// Requires BoringSSL or OpenSSL 1.1.0 or LibreSSL 2.6.1 or newer.
3338
3335
#[ corresponds( SSL_set_min_proto_version ) ]
3339
- #[ cfg( any( ossl110, libressl261) ) ]
3336
+ #[ cfg( any( ossl110, libressl261, boringssl ) ) ]
3340
3337
pub fn set_min_proto_version ( & mut self , version : Option < SslVersion > ) -> Result < ( ) , ErrorStack > {
3341
3338
unsafe {
3342
3339
cvt ( ffi:: SSL_set_min_proto_version (
@@ -3352,9 +3349,9 @@ impl SslRef {
3352
3349
/// A value of `None` will enable protocol versions up to the highest version supported by
3353
3350
/// OpenSSL.
3354
3351
///
3355
- /// Requires OpenSSL 1.1.0 or or LibreSSL 2.6.1 or newer.
3352
+ /// Requires BoringSSL or OpenSSL 1.1.0 or or LibreSSL 2.6.1 or newer.
3356
3353
#[ corresponds( SSL_set_max_proto_version ) ]
3357
- #[ cfg( any( ossl110, libressl261) ) ]
3354
+ #[ cfg( any( ossl110, libressl261, boringssl ) ) ]
3358
3355
pub fn set_max_proto_version ( & mut self , version : Option < SslVersion > ) -> Result < ( ) , ErrorStack > {
3359
3356
unsafe {
3360
3357
cvt ( ffi:: SSL_set_max_proto_version (
0 commit comments