mirror of
https://github.com/shadowsocks/shadowsocks-rust.git
synced 2026-02-09 01:59:16 +08:00
some libcrypto does not contain some functions (redefined as a marco)
This commit is contained in:
17
.travis.yml
17
.travis.yml
@@ -1,18 +1,17 @@
|
||||
language: rust
|
||||
|
||||
before_install:
|
||||
- wget https://www.openssl.org/source/openssl-1.0.1j.tar.gz
|
||||
- tar xf openssl-1.0.1j.tar.gz
|
||||
- cd openssl-1.0.1j
|
||||
- ./config -shared
|
||||
- echo $PWD
|
||||
- make
|
||||
# - wget https://www.openssl.org/source/openssl-1.0.1j.tar.gz
|
||||
# - tar xf openssl-1.0.1j.tar.gz
|
||||
# - cd openssl-1.0.1j
|
||||
# - ./config -shared
|
||||
# - make
|
||||
- sudo apt-get update -qq
|
||||
- sudo apt-get install libssl-dev
|
||||
|
||||
env:
|
||||
- LD_LIBRARY_PATH=$TRAVIS_BUILD_DIR/openssl-1.0.1j:$LD_LIBRARY_PATH
|
||||
# - LD_LIBRARY_PATH=$TRAVIS_BUILD_DIR/openssl-1.0.1j:$LD_LIBRARY_PATH
|
||||
|
||||
script:
|
||||
- export LD_LIBRARY_PATH=$TRAVIS_BUILD_DIR/openssl-1.0.1j:$LD_LIBRARY_PATH
|
||||
- echo $LD_LIBRARY_PATH
|
||||
- cargo build -v
|
||||
- cargo test -v
|
||||
|
||||
@@ -63,16 +63,12 @@ extern {
|
||||
|
||||
// Ciphers
|
||||
#[cfg(feature="cipher-aes-cfb")]
|
||||
fn EVP_aes_128_cfb() -> EVP_CIPHER;
|
||||
#[cfg(feature="cipher-aes-cfb")]
|
||||
fn EVP_aes_128_cfb1() -> EVP_CIPHER;
|
||||
#[cfg(feature="cipher-aes-cfb")]
|
||||
fn EVP_aes_128_cfb8() -> EVP_CIPHER;
|
||||
#[cfg(feature="cipher-aes-cfb")]
|
||||
fn EVP_aes_128_cfb128() -> EVP_CIPHER;
|
||||
|
||||
#[cfg(feature="cipher-aes-cfb")]
|
||||
fn EVP_aes_192_cfb() -> EVP_CIPHER;
|
||||
#[cfg(feature="cipher-aes-cfb")]
|
||||
fn EVP_aes_192_cfb1() -> EVP_CIPHER;
|
||||
#[cfg(feature="cipher-aes-cfb")]
|
||||
@@ -80,8 +76,6 @@ extern {
|
||||
#[cfg(feature="cipher-aes-cfb")]
|
||||
fn EVP_aes_192_cfb128() -> EVP_CIPHER;
|
||||
|
||||
#[cfg(feature="cipher-aes-cfb")]
|
||||
fn EVP_aes_256_cfb() -> EVP_CIPHER;
|
||||
#[cfg(feature="cipher-aes-cfb")]
|
||||
fn EVP_aes_256_cfb1() -> EVP_CIPHER;
|
||||
#[cfg(feature="cipher-aes-cfb")]
|
||||
@@ -104,27 +98,27 @@ extern {
|
||||
fn EVP_aes_256_ctr() -> EVP_CIPHER;
|
||||
|
||||
#[cfg(feature="cipher-bf-cfb")]
|
||||
fn EVP_bf_cfb() -> EVP_CIPHER;
|
||||
fn EVP_bf_cfb64() -> EVP_CIPHER;
|
||||
|
||||
#[cfg(feature="cipher-camellia-cfb")]
|
||||
fn EVP_camellia_128_cfb() -> EVP_CIPHER;
|
||||
fn EVP_camellia_128_cfb128() -> EVP_CIPHER;
|
||||
#[cfg(feature="cipher-camellia-cfb")]
|
||||
fn EVP_camellia_192_cfb() -> EVP_CIPHER;
|
||||
fn EVP_camellia_192_cfb128() -> EVP_CIPHER;
|
||||
#[cfg(feature="cipher-camellia-cfb")]
|
||||
fn EVP_camellia_256_cfb() -> EVP_CIPHER;
|
||||
fn EVP_camellia_256_cfb128() -> EVP_CIPHER;
|
||||
|
||||
#[cfg(feature="cipher-cast5-cfb")]
|
||||
fn EVP_cast5_cfb() -> EVP_CIPHER;
|
||||
fn EVP_cast5_cfb64() -> EVP_CIPHER;
|
||||
#[cfg(feature="cipher-des-cfb")]
|
||||
fn EVP_des_cfb() -> EVP_CIPHER;
|
||||
fn EVP_des_cfb64() -> EVP_CIPHER;
|
||||
#[cfg(feature="cipher-idea-cfb")]
|
||||
fn EVP_idea_cfb() -> EVP_CIPHER;
|
||||
fn EVP_idea_cfb64() -> EVP_CIPHER;
|
||||
#[cfg(feature="cipher-rc2-cfb")]
|
||||
fn EVP_rc2_cfb() -> EVP_CIPHER;
|
||||
fn EVP_rc2_cfb64() -> EVP_CIPHER;
|
||||
#[cfg(feature="cipher-rc4-hmac-md5")]
|
||||
fn EVP_rc4_hmac_md5() -> EVP_CIPHER;
|
||||
#[cfg(feature="cipher-seed-cfb")]
|
||||
fn EVP_seed_cfb() -> EVP_CIPHER;
|
||||
fn EVP_seed_cfb128() -> EVP_CIPHER;
|
||||
|
||||
// MD
|
||||
fn EVP_md5() -> EVP_MD;
|
||||
@@ -200,7 +194,7 @@ impl OpenSSLCrypto {
|
||||
unsafe {
|
||||
match cipher_type {
|
||||
#[cfg(feature="cipher-aes-cfb")]
|
||||
cipher::CipherTypeAes128Cfb => { (EVP_aes_128_cfb(), 16, 16) },
|
||||
cipher::CipherTypeAes128Cfb => { (EVP_aes_128_cfb128(), 16, 16) },
|
||||
#[cfg(feature="cipher-aes-cfb")]
|
||||
cipher::CipherTypeAes128Cfb1 => { (EVP_aes_128_cfb1(), 16, 16) },
|
||||
#[cfg(feature="cipher-aes-cfb")]
|
||||
@@ -209,7 +203,7 @@ impl OpenSSLCrypto {
|
||||
cipher::CipherTypeAes128Cfb128 => { (EVP_aes_128_cfb128(), 16, 16) },
|
||||
|
||||
#[cfg(feature="cipher-aes-cfb")]
|
||||
cipher::CipherTypeAes192Cfb => { (EVP_aes_192_cfb(), 24, 16) },
|
||||
cipher::CipherTypeAes192Cfb => { (EVP_aes_192_cfb128(), 24, 16) },
|
||||
#[cfg(feature="cipher-aes-cfb")]
|
||||
cipher::CipherTypeAes192Cfb1 => { (EVP_aes_192_cfb1(), 24, 16) },
|
||||
#[cfg(feature="cipher-aes-cfb")]
|
||||
@@ -218,7 +212,7 @@ impl OpenSSLCrypto {
|
||||
cipher::CipherTypeAes192Cfb128 => { (EVP_aes_192_cfb128(), 24, 16) },
|
||||
|
||||
#[cfg(feature="cipher-aes-cfb")]
|
||||
cipher::CipherTypeAes256Cfb => { (EVP_aes_256_cfb(), 32, 16) },
|
||||
cipher::CipherTypeAes256Cfb => { (EVP_aes_256_cfb128(), 32, 16) },
|
||||
#[cfg(feature="cipher-aes-cfb")]
|
||||
cipher::CipherTypeAes256Cfb1 => { (EVP_aes_256_cfb1(), 32, 16) },
|
||||
#[cfg(feature="cipher-aes-cfb")]
|
||||
@@ -241,27 +235,27 @@ impl OpenSSLCrypto {
|
||||
cipher::CipherTypeAes256Ctr => { (EVP_aes_256_ctr(), 32, 16) },
|
||||
|
||||
#[cfg(feature="cipher-bf-cfb")]
|
||||
cipher::CipherTypeBfCfb => { (EVP_bf_cfb(), 16, 8) },
|
||||
cipher::CipherTypeBfCfb => { (EVP_bf_cfb64(), 16, 8) },
|
||||
|
||||
#[cfg(feature="cipher-camellia-cfb")]
|
||||
cipher::CipherTypeCamellia128Cfb => { (EVP_camellia_128_cfb(), 16, 16) },
|
||||
cipher::CipherTypeCamellia128Cfb => { (EVP_camellia_128_cfb128(), 16, 16) },
|
||||
#[cfg(feature="cipher-camellia-cfb")]
|
||||
cipher::CipherTypeCamellia192Cfb => { (EVP_camellia_192_cfb(), 24, 16) },
|
||||
cipher::CipherTypeCamellia192Cfb => { (EVP_camellia_192_cfb128(), 24, 16) },
|
||||
#[cfg(feature="cipher-camellia-cfb")]
|
||||
cipher::CipherTypeCamellia256Cfb => { (EVP_camellia_256_cfb(), 32, 16) },
|
||||
cipher::CipherTypeCamellia256Cfb => { (EVP_camellia_256_cfb128(), 32, 16) },
|
||||
|
||||
#[cfg(feature="cipher-cast5-cfb")]
|
||||
cipher::CipherTypeCast5Cfb => { (EVP_cast5_cfb(), 16, 8) },
|
||||
cipher::CipherTypeCast5Cfb => { (EVP_cast5_cfb64(), 16, 8) },
|
||||
#[cfg(feature="cipher-des-cfb")]
|
||||
cipher::CipherTypeDesCfb => { (EVP_des_cfb(), 8, 8) },
|
||||
cipher::CipherTypeDesCfb => { (EVP_des_cfb64(), 8, 8) },
|
||||
#[cfg(feature="cipher-idea-cfb")]
|
||||
cipher::CipherTypeIdeaCfb => { (EVP_idea_cfb(), 16, 8) },
|
||||
cipher::CipherTypeIdeaCfb => { (EVP_idea_cfb64(), 16, 8) },
|
||||
#[cfg(feature="cipher-rc2-cfb")]
|
||||
cipher::CipherTypeRc2Cfb => { (EVP_rc2_cfb(), 16, 8) },
|
||||
cipher::CipherTypeRc2Cfb => { (EVP_rc2_cfb64(), 16, 8) },
|
||||
#[cfg(feature="cipher-rc4-hmac-md5")]
|
||||
cipher::CipherTypeRc4HmacMd5 => { (EVP_rc4_hmac_md5(), 16, 0) },
|
||||
#[cfg(feature="cipher-seed-cfb")]
|
||||
cipher::CipherTypeSeedCfb => { (EVP_seed_cfb(), 16, 16) },
|
||||
cipher::CipherTypeSeedCfb => { (EVP_seed_cfb128(), 16, 16) },
|
||||
|
||||
cipher::CipherTypeUnknown => { (ptr::null(), 0, 0) },
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user