@@ -17,6 +17,11 @@ mod ossl110;
17
17
#[ cfg( ossl110) ]
18
18
pub use ossl110:: * ;
19
19
20
+ #[ cfg( libressl) ]
21
+ mod libressl;
22
+ #[ cfg( libressl) ]
23
+ pub use libressl:: * ;
24
+
20
25
pub enum ASN1_INTEGER { }
21
26
pub enum ASN1_STRING { }
22
27
pub enum ASN1_TIME { }
@@ -1075,8 +1080,11 @@ pub const SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER: c_long = 0x2;
1075
1080
pub const SSL_MODE_AUTO_RETRY : c_long = 0x4 ;
1076
1081
pub const SSL_MODE_NO_AUTO_CHAIN : c_long = 0x8 ;
1077
1082
pub const SSL_MODE_RELEASE_BUFFERS : c_long = 0x10 ;
1083
+ #[ cfg( not( libressl) ) ]
1078
1084
pub const SSL_MODE_SEND_CLIENTHELLO_TIME : c_long = 0x20 ;
1085
+ #[ cfg( not( libressl) ) ]
1079
1086
pub const SSL_MODE_SEND_SERVERHELLO_TIME : c_long = 0x40 ;
1087
+ #[ cfg( not( libressl) ) ]
1080
1088
pub const SSL_MODE_SEND_FALLBACK_SCSV : c_long = 0x80 ;
1081
1089
1082
1090
pub const SSL_ERROR_NONE : c_int = 0 ;
@@ -1095,26 +1103,31 @@ pub const SSL_VERIFY_FAIL_IF_NO_PEER_CERT: c_int = 2;
1095
1103
#[ cfg( not( ossl101) ) ]
1096
1104
pub const SSL_OP_TLSEXT_PADDING : c_ulong = 0x00000010 ;
1097
1105
pub const SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS : c_ulong = 0x00000800 ;
1106
+ #[ cfg( not( libressl) ) ]
1098
1107
pub const SSL_OP_ALL : c_ulong = 0x80000BFF ;
1099
1108
pub const SSL_OP_NO_QUERY_MTU : c_ulong = 0x00001000 ;
1100
1109
pub const SSL_OP_COOKIE_EXCHANGE : c_ulong = 0x00002000 ;
1101
1110
pub const SSL_OP_NO_TICKET : c_ulong = 0x00004000 ;
1111
+ #[ cfg( not( libressl) ) ]
1102
1112
pub const SSL_OP_CISCO_ANYCONNECT : c_ulong = 0x00008000 ;
1103
1113
pub const SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION : c_ulong = 0x00010000 ;
1114
+ #[ cfg( not( libressl) ) ]
1104
1115
pub const SSL_OP_NO_COMPRESSION : c_ulong = 0x00020000 ;
1116
+ #[ cfg( not( libressl) ) ]
1105
1117
pub const SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION : c_ulong = 0x00040000 ;
1106
1118
pub const SSL_OP_CIPHER_SERVER_PREFERENCE : c_ulong = 0x00400000 ;
1107
1119
pub const SSL_OP_TLS_ROLLBACK_BUG : c_ulong = 0x00800000 ;
1120
+ #[ cfg( not( libressl) ) ]
1108
1121
pub const SSL_OP_NO_SSLv3 : c_ulong = 0x02000000 ;
1109
1122
pub const SSL_OP_NO_TLSv1 : c_ulong = 0x04000000 ;
1110
1123
pub const SSL_OP_NO_TLSv1_2 : c_ulong = 0x08000000 ;
1111
1124
pub const SSL_OP_NO_TLSv1_1 : c_ulong = 0x10000000 ;
1112
1125
1113
- #[ cfg( not( ossl101) ) ]
1126
+ #[ cfg( not( any ( ossl101, libressl ) ) ) ]
1114
1127
pub const SSL_OP_NO_DTLSv1 : c_ulong = 0x04000000 ;
1115
- #[ cfg( not( ossl101) ) ]
1128
+ #[ cfg( not( any ( ossl101, libressl ) ) ) ]
1116
1129
pub const SSL_OP_NO_DTLSv1_2 : c_ulong = 0x08000000 ;
1117
- #[ cfg( not( ossl101) ) ]
1130
+ #[ cfg( not( any ( ossl101, libressl ) ) ) ]
1118
1131
pub const SSL_OP_NO_SSL_MASK : c_ulong = SSL_OP_NO_SSLv2 | SSL_OP_NO_SSLv3 |
1119
1132
SSL_OP_NO_TLSv1 | SSL_OP_NO_TLSv1_1 | SSL_OP_NO_TLSv1_2 ;
1120
1133
@@ -1292,9 +1305,9 @@ extern {
1292
1305
pub fn BIO_new_socket ( sock : c_int , close_flag : c_int ) -> * mut BIO ;
1293
1306
pub fn BIO_read ( b : * mut BIO , buf : * mut c_void , len : c_int ) -> c_int ;
1294
1307
pub fn BIO_write ( b : * mut BIO , buf : * const c_void , len : c_int ) -> c_int ;
1295
- #[ cfg( ossl101) ]
1308
+ #[ cfg( any ( ossl101, libressl ) ) ]
1296
1309
pub fn BIO_new_mem_buf ( buf : * mut c_void , len : c_int ) -> * mut BIO ;
1297
- #[ cfg( not( ossl101) ) ]
1310
+ #[ cfg( not( any ( ossl101, libressl ) ) ) ]
1298
1311
pub fn BIO_new_mem_buf ( buf : * const c_void , len : c_int ) -> * mut BIO ;
1299
1312
pub fn BIO_set_flags ( b : * mut BIO , flags : c_int ) ;
1300
1313
pub fn BIO_clear_flags ( b : * mut BIO , flags : c_int ) ;
@@ -1375,11 +1388,11 @@ extern {
1375
1388
1376
1389
pub fn DH_new ( ) -> * mut DH ;
1377
1390
pub fn DH_free ( dh : * mut DH ) ;
1378
- #[ cfg( not( ossl101) ) ]
1391
+ #[ cfg( not( any ( ossl101, libressl ) ) ) ]
1379
1392
pub fn DH_get_1024_160 ( ) -> * mut DH ;
1380
- #[ cfg( not( ossl101) ) ]
1393
+ #[ cfg( not( any ( ossl101, libressl ) ) ) ]
1381
1394
pub fn DH_get_2048_224 ( ) -> * mut DH ;
1382
- #[ cfg( not( ossl101) ) ]
1395
+ #[ cfg( not( any ( ossl101, libressl ) ) ) ]
1383
1396
pub fn DH_get_2048_256 ( ) -> * mut DH ;
1384
1397
1385
1398
pub fn EC_KEY_new ( ) -> * mut EC_KEY ;
@@ -1495,11 +1508,11 @@ extern {
1495
1508
type_ : * const EVP_MD ,
1496
1509
e : * mut ENGINE ,
1497
1510
pkey : * mut EVP_PKEY ) -> c_int ;
1498
- #[ cfg( ossl101) ]
1511
+ #[ cfg( any ( ossl101, libressl ) ) ]
1499
1512
pub fn EVP_DigestVerifyFinal ( ctx : * mut EVP_MD_CTX ,
1500
1513
sigret : * mut c_uchar ,
1501
1514
siglen : size_t ) -> c_int ;
1502
- #[ cfg( not( ossl101) ) ]
1515
+ #[ cfg( not( any ( ossl101, libressl ) ) ) ]
1503
1516
pub fn EVP_DigestVerifyFinal ( ctx : * mut EVP_MD_CTX ,
1504
1517
sigret : * const c_uchar ,
1505
1518
siglen : size_t ) -> c_int ;
@@ -1634,8 +1647,10 @@ extern {
1634
1647
pub fn SSL_get_ex_data_X509_STORE_CTX_idx ( ) -> c_int ;
1635
1648
pub fn SSL_get_SSL_CTX ( ssl : * const SSL ) -> * mut SSL_CTX ;
1636
1649
pub fn SSL_set_SSL_CTX ( ssl : * mut SSL , ctx : * mut SSL_CTX ) -> * mut SSL_CTX ;
1637
- #[ cfg( not( osslconf = "OPENSSL_NO_COMP" ) ) ]
1650
+ #[ cfg( not( any ( osslconf = "OPENSSL_NO_COMP" , libressl ) ) ) ]
1638
1651
pub fn SSL_get_current_compression ( ssl : * mut SSL ) -> * const COMP_METHOD ;
1652
+ #[ cfg( libressl) ]
1653
+ pub fn SSL_get_current_compression ( ssl : * mut SSL ) -> * const libc:: c_void ;
1639
1654
pub fn SSL_get_peer_certificate ( ssl : * const SSL ) -> * mut X509 ;
1640
1655
pub fn SSL_get_ssl_method ( ssl : * mut SSL ) -> * const SSL_METHOD ;
1641
1656
pub fn SSL_get_version ( ssl : * const SSL ) -> * const c_char ;
@@ -1648,14 +1663,14 @@ extern {
1648
1663
pub fn SSL_get_ex_data ( ssl : * const SSL , idx : c_int ) -> * mut c_void ;
1649
1664
pub fn SSL_get_servername ( ssl : * const SSL , name_type : c_int ) -> * const c_char ;
1650
1665
pub fn SSL_get_current_cipher ( ssl : * const SSL ) -> * const SSL_CIPHER ;
1651
- #[ cfg( not( ossl101) ) ]
1666
+ #[ cfg( not( any ( ossl101, libressl ) ) ) ]
1652
1667
pub fn SSL_get0_param ( ssl : * mut SSL ) -> * mut X509_VERIFY_PARAM ;
1653
1668
pub fn SSL_get_verify_result ( ssl : * const SSL ) -> c_long ;
1654
1669
pub fn SSL_shutdown ( ssl : * mut SSL ) -> c_int ;
1655
1670
pub fn SSL_get_certificate ( ssl : * const SSL ) -> * mut X509 ;
1656
- #[ cfg( ossl101) ]
1671
+ #[ cfg( any ( ossl101, libressl ) ) ]
1657
1672
pub fn SSL_get_privatekey ( ssl : * mut SSL ) -> * mut EVP_PKEY ;
1658
- #[ cfg( not( ossl101) ) ]
1673
+ #[ cfg( not( any ( ossl101, libressl ) ) ) ]
1659
1674
pub fn SSL_get_privatekey ( ssl : * const SSL ) -> * mut EVP_PKEY ;
1660
1675
pub fn SSL_load_client_CA_file ( file : * const c_char ) -> * mut stack_st_X509_NAME ;
1661
1676
pub fn SSL_set_tmp_dh_callback ( ctx : * mut SSL ,
@@ -1664,8 +1679,10 @@ extern {
1664
1679
keylength : c_int )
1665
1680
-> * mut DH ) ;
1666
1681
1667
- #[ cfg( not( osslconf = "OPENSSL_NO_COMP" ) ) ]
1682
+ #[ cfg( not( any ( osslconf = "OPENSSL_NO_COMP" , libressl ) ) ) ]
1668
1683
pub fn SSL_COMP_get_name ( comp : * const COMP_METHOD ) -> * const c_char ;
1684
+ #[ cfg( libressl) ]
1685
+ pub fn SSL_COMP_get_name ( comp : * const libc:: c_void ) -> * const c_char ;
1669
1686
1670
1687
pub fn SSL_CIPHER_get_name ( cipher : * const SSL_CIPHER ) -> * const c_char ;
1671
1688
pub fn SSL_CIPHER_get_bits ( cipher : * const SSL_CIPHER , alg_bits : * mut c_int ) -> c_int ;
@@ -1701,9 +1718,9 @@ extern {
1701
1718
keylength : c_int )
1702
1719
-> * mut DH ) ;
1703
1720
1704
- #[ cfg( not( ossl101) ) ]
1721
+ #[ cfg( not( any ( ossl101, libressl ) ) ) ]
1705
1722
pub fn SSL_CTX_get0_certificate ( ctx : * const SSL_CTX ) -> * mut X509 ;
1706
- #[ cfg( not( ossl101) ) ]
1723
+ #[ cfg( not( any ( ossl101, libressl ) ) ) ]
1707
1724
pub fn SSL_CTX_get0_privatekey ( ctx : * const SSL_CTX ) -> * mut EVP_PKEY ;
1708
1725
1709
1726
pub fn SSL_CTX_set_cipher_list ( ssl : * mut SSL_CTX , s : * const c_char ) -> c_int ;
@@ -1787,9 +1804,9 @@ extern {
1787
1804
1788
1805
#[ cfg( not( ossl101) ) ]
1789
1806
pub fn X509_VERIFY_PARAM_free ( param : * mut X509_VERIFY_PARAM ) ;
1790
- #[ cfg( not( ossl101) ) ]
1807
+ #[ cfg( not( any ( ossl101, libressl ) ) ) ]
1791
1808
pub fn X509_VERIFY_PARAM_set_hostflags ( param : * mut X509_VERIFY_PARAM , flags : c_uint ) ;
1792
- #[ cfg( not( ossl101) ) ]
1809
+ #[ cfg( not( any ( ossl101, libressl ) ) ) ]
1793
1810
pub fn X509_VERIFY_PARAM_set1_host ( param : * mut X509_VERIFY_PARAM ,
1794
1811
name : * const c_char ,
1795
1812
namelen : size_t ) -> c_int ;
0 commit comments