sfackler / rust-openssl

OpenSSL bindings for Rust
1.39k stars 743 forks source link

Tests fail on win64 if openssl is installed with vcpkg #828

Closed jaysonsantos closed 6 years ago

jaysonsantos commented 6 years ago

Hi, I downloaded master on windows and tried to run the tests but they fail and the only difference is that on appveyour on win64 you install OpenSSL with vpkg install OpenSSL and I installed the OpenSSL:x64-windows version. Shouldn't appveyor tests also be tested with the x64 version?

This is the test output.

PS D:\src\rust-openssl\openssl> cargo test
    Updating registry `https://github.com/rust-lang/crates.io-index`
 Downloading data-encoding v2.1.0
 Downloading libc v0.2.36
   Compiling bitflags v1.0.1
   Compiling openssl v0.10.2 (file:///D:/src/rust-openssl/openssl)
   Compiling data-encoding v2.1.0
   Compiling vcpkg v0.2.2
   Compiling lazy_static v1.0.0
   Compiling pkg-config v0.3.9
   Compiling libc v0.2.36
   Compiling cc v1.0.4
   Compiling foreign-types-shared v0.1.1
   Compiling hex v0.3.1
   Compiling rand v0.3.20
   Compiling foreign-types v0.3.2
   Compiling openssl-sys v0.9.24 (file:///D:/src/rust-openssl/openssl-sys)
   Compiling tempdir v0.3.5
warning: expando.c
    Finished dev [unoptimized + debuginfo] target(s) in 33.37 secs
     Running D:\src\rust-openssl\target\debug\deps\openssl-0089f1b5d3ab9e4a.exe

running 149 tests
test aes::test::ige_vector_1 ... ok
test bn::tests::test_negation ... ok
test bn::tests::test_to_from_slice ... ok
test bn::tests::test_shift ... ok
test dh::tests::test_dh_from_der ... ok
test bn::tests::test_pseudo_rand_range ... ok
test bn::tests::test_rand_range ... ok
test dh::tests::test_dh ... ok
test dh::tests::test_dh_from_pem ... ok
test derive::test::derive_without_peer ... ok
test derive::test::test_ec_key_derive ... ok
test ec::test::dup ... ok
test ec::test::generate ... ok
test ec::test::get_affine_coordinates ... ok
test ec::test::key_from_affine_coordinates ... ok
test ec::test::key_from_public_key ... ok
test ec::test::key_new_by_curve_name ... ok
test ec::test::mul_generator ... ok
test ec::test::point_bytes ... ok
test ec::test::point_new ... ok
test hash::tests::test_clone ... ok
test bn::tests::test_prime_numbers ... ok
test hash::tests::test_finish_twice ... ok
test hash::tests::test_md5 ... ok
test hash::tests::test_md5_recycle ... ok
test hash::tests::test_ripemd160 ... ok
test hash::tests::test_sha1 ... ok
test hash::tests::test_sha256 ... ok
test memcmp::tests::test_diff_lens ... ok
test memcmp::tests::test_eq ... ok
test pkcs12::test::parse ... ok
test pkcs5::tests::bytes_to_key ... ok
test pkcs12::test::parse_empty_chain ... ok
test pkcs5::tests::pbkdf2_hmac_sha512 ... ok
test pkey::tests::test_dh_accessor ... ok
test pkey::tests::test_ec_key_accessor ... ok
test pkey::tests::test_encrypted_pkcs8_callback ... ok
test pkey::tests::test_pem ... ok
test pkey::tests::test_private_key_from_der ... ok
test pkey::tests::test_private_key_from_pem ... ok
test dsa::test::test_generate ... ok
test pkcs12::test::create ... ok
test pkey::tests::test_encrypted_pkcs8_passphrase ... ok
test pkey::tests::test_public_key_from_der ... ok
test pkey::tests::test_public_key_from_pem ... ok
test rand::tests::test_rand_bytes ... ok
test rsa::test::test_from_password ... ok
test rsa::test::test_from_password_callback ... ok
test rsa::test::test_private_encrypt ... ok
test rsa::test::test_public_encrypt_private_decrypt_with_padding ... ok
test rsa::test::test_public_encrypt ... ok
test sha::test::standalone_1 ... ok
test sha::test::standalone_224 ... ok
test sha::test::standalone_256 ... ok
test sha::test::standalone_384 ... ok
test sha::test::standalone_512 ... ok
test sha::test::struct_1 ... ok
test pkcs5::tests::pbkdf2_hmac_sha256 ... ok
test sha::test::struct_224 ... ok
test sha::test::struct_256 ... ok
test sha::test::struct_384 ... ok
test sha::test::struct_512 ... ok
test sign::test::ec ... ok
test sign::test::hmac_md5 ... ok
test sign::test::hmac_sha1 ... ok
test sign::test::rsa_verify_invalid ... ok
test sign::test::rsa_sign ... ok
test sign::test::rsa_verify_ok ... ok
test ssl::test::add_extra_chain_cert ... ok
test ssl::test::client_ca_list ... ok
test rsa::test::test_to_password ... ok
test ssl::test::cert_store ... FAILED
test ssl::test::clear_ctx_options::sslv23 ... FAILED
test pkey::tests::test_to_password ... ok
test ssl::test::connector_client_server_mozilla_intermediate ... ok
test ssl::test::connector_client_server_mozilla_modern ... ok
test ssl::test::connector_no_hostname_can_disable_verify ... FAILED
test ssl::test::connector_no_hostname_still_verifies ... FAILED
test ssl::test::flush_panic ... FAILED
test pkey::tests::test_rsa_accessor ... ok
test ssl::test::get_ctx_options::sslv23 ... FAILED
test ssl::test::idle_session ... ok
test ssl::test::get_peer_certificate::sslv23 ... FAILED
test ssl::test::new_ctx::sslv23 ... FAILED
test ssl::test::refcount_ssl_context ... ok
test ssl::test::read_panic ... FAILED
test ssl::test::shutdown ... ok
test ssl::test::set_ctx_options::sslv23 ... FAILED
test ssl::test::status_callbacks ... ok
test ssl::test::ssl_verify_callback::sslv23 ... FAILED
test ssl::test::connector_invalid_hostname ... ok
test ssl::test::test_set_certificate_and_private_key ... ok
test ssl::test::test_pending ... FAILED
test ssl::test::test_read ... FAILED
test ssl::test::test_write_hits_stream ... ok
test ssl::test::test_state ... FAILED
test ssl::test::test_write ... FAILED
test ssl::test::active_session ... ok
test ssl::test::tmp_dh_callback ... ok
test ssl::test::connector_invalid_no_hostname_verification ... ok
test ssl::test::verify_callback_data::sslv23 ... FAILED
test ssl::test::tmp_dh_callback_ssl ... ok
test ssl::test::verify_callback_load_certs::sslv23 ... FAILED
test ssl::test::verify_trusted::sslv23 ... FAILED
test ssl::test::verify_trusted_callback_override_bad::sslv23 ... FAILED
test ssl::test::verify_trusted_callback_override_ok::sslv23 ... FAILED
test ssl::test::verify_trusted_get_error_err::sslv23 ... FAILED
test ssl::test::verify_trusted_get_error_ok::sslv23 ... FAILED
test ssl::test::verify_untrusted::sslv23 ... FAILED
test symm::tests::test_aes128_cfb1 ... ok
test ssl::test::verify_untrusted_callback_override_bad::sslv23 ... FAILED
test symm::tests::test_aes128_cfb128 ... ok
test ssl::test::connector_valid_hostname ... ok
test ssl::test::verify_untrusted_callback_override_ok::sslv23 ... FAILED
test symm::tests::test_aes128_cfb8 ... ok
test symm::tests::test_aes128_ctr ... ok
test ssl::test::default_verify_paths ... ok
test ssl::test::write_panic ... FAILED
test symm::tests::test_aes128_gcm ... ok
test symm::tests::test_aes256_cfb1 ... ok
test symm::tests::test_aes256_cfb128 ... ok
test ssl::test::zero_length_buffers ... FAILED
test symm::tests::test_aes256_cfb8 ... ok
test symm::tests::test_aes256_xts ... ok
test symm::tests::test_aes_256_cbc_decrypt ... ok
test symm::tests::test_aes_256_ecb ... ok
test symm::tests::test_bf_cbc ... ok
test symm::tests::test_bf_cfb64 ... ok
test symm::tests::test_bf_ecb ... ok
test symm::tests::test_bf_ofb ... ok
test symm::tests::test_des_cbc ... ok
test symm::tests::test_des_ecb ... ok
test symm::tests::test_rc4 ... ok
test version::test_versions ... FAILED
test x509::tests::clone_x509 ... ok
test x509::tests::issued ... ok
test x509::tests::signature ... ok
test x509::tests::test_cert_issue_validity ... ok
test x509::tests::test_cert_loading ... ok
test x509::tests::test_nid_uid_value ... ok
test x509::tests::test_nid_values ... ok
test x509::tests::test_save_der ... ok
test x509::tests::test_stack_from_pem ... ok
test x509::tests::test_subject_alt_name ... ok
test x509::tests::test_subject_alt_name_iter ... ok
test x509::tests::test_subject_read_cn ... ok
test x509::tests::x509_builder ... ok
test x509::tests::x509_req_builder ... ok
test pkey::tests::test_dsa_accessor ... ok

failures:

---- ssl::test::cert_store stdout ----
        thread 'ssl::test::cert_store' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 2, kind: NotFound, message: "The system cannot find the file specified." }', libcore\result.rs:916:5

---- ssl::test::clear_ctx_options::sslv23 stdout ----
        thread 'ssl::test::clear_ctx_options::sslv23' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 2, kind: NotFound, message: "The system cannot find the file specified." }', libcore\result.rs:916:5

---- ssl::test::connector_no_hostname_can_disable_verify stdout ----
        thread 'ssl::test::connector_no_hostname_can_disable_verify' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 2, kind: NotFound, message: "The system cannot find the file specified." }', libcore\result.rs:916:5

---- ssl::test::connector_no_hostname_still_verifies stdout ----
        thread 'ssl::test::connector_no_hostname_still_verifies' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 2, kind: NotFound, message: "The system cannot find the file specified." }', libcore\result.rs:916:5

---- ssl::test::flush_panic stdout ----
        thread 'ssl::test::flush_panic' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 2, kind: NotFound, message: "The system cannot find the file specified." }', libcore\result.rs:916:5
note: Panic did not include expected string 'blammo'
---- ssl::test::get_ctx_options::sslv23 stdout ----
        thread 'ssl::test::get_ctx_options::sslv23' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 2, kind: NotFound, message: "The system cannot find the file specified." }', libcore\result.rs:916:5

---- ssl::test::get_peer_certificate::sslv23 stdout ----
        thread 'ssl::test::get_peer_certificate::sslv23' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 2, kind: NotFound, message: "The system cannot find the file specified." }', libcore\result.rs:916:5

---- ssl::test::new_ctx::sslv23 stdout ----
        thread 'ssl::test::new_ctx::sslv23' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 2, kind: NotFound, message: "The system cannot find the file specified." }', libcore\result.rs:916:5

---- ssl::test::read_panic stdout ----
        thread 'ssl::test::read_panic' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 2, kind: NotFound, message: "The system cannot find the file specified." }', libcore\result.rs:916:5
note: Panic did not include expected string 'blammo'
---- ssl::test::set_ctx_options::sslv23 stdout ----
        thread 'ssl::test::set_ctx_options::sslv23' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 2, kind: NotFound, message: "The system cannot find the file specified." }', libcore\result.rs:916:5

---- ssl::test::ssl_verify_callback::sslv23 stdout ----
        thread 'ssl::test::ssl_verify_callback::sslv23' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 2, kind: NotFound, message: "The system cannot find the file specified." }', libcore\result.rs:916:5

---- ssl::test::test_pending stdout ----
        thread 'ssl::test::test_pending' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 2, kind: NotFound, message: "The system cannot find the file specified." }', libcore\result.rs:916:5

---- ssl::test::test_read stdout ----
        thread 'ssl::test::test_read' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 2, kind: NotFound, message: "The system cannot find the file specified." }', libcore\result.rs:916:5

---- ssl::test::test_state stdout ----
        thread 'ssl::test::test_state' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 2, kind: NotFound, message: "The system cannot find the file specified." }', libcore\result.rs:916:5

---- ssl::test::test_write stdout ----
        thread 'ssl::test::test_write' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 2, kind: NotFound, message: "The system cannot find the file specified." }', libcore\result.rs:916:5

---- ssl::test::verify_callback_data::sslv23 stdout ----
        thread 'ssl::test::verify_callback_data::sslv23' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 2, kind: NotFound, message: "The system cannot find the file specified." }', libcore\result.rs:916:5

---- ssl::test::verify_callback_load_certs::sslv23 stdout ----
        thread 'ssl::test::verify_callback_load_certs::sslv23' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 2, kind: NotFound, message: "The system cannot find the file specified." }', libcore\result.rs:916:5

---- ssl::test::verify_trusted::sslv23 stdout ----
        thread 'ssl::test::verify_trusted::sslv23' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 2, kind: NotFound, message: "The system cannot find the file specified." }', libcore\result.rs:916:5

---- ssl::test::verify_trusted_callback_override_bad::sslv23 stdout ----
        thread 'ssl::test::verify_trusted_callback_override_bad::sslv23' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 2, kind: NotFound, message: "The system cannot find the file specified." }', libcore\result.rs:916:5

---- ssl::test::verify_trusted_callback_override_ok::sslv23 stdout ----
        thread 'ssl::test::verify_trusted_callback_override_ok::sslv23' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 2, kind: NotFound, message: "The system cannot find the file specified." }', libcore\result.rs:916:5

---- ssl::test::verify_trusted_get_error_err::sslv23 stdout ----
        thread 'ssl::test::verify_trusted_get_error_err::sslv23' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 2, kind: NotFound, message: "The system cannot find the file specified." }', libcore\result.rs:916:5

---- ssl::test::verify_trusted_get_error_ok::sslv23 stdout ----
        thread 'ssl::test::verify_trusted_get_error_ok::sslv23' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 2, kind: NotFound, message: "The system cannot find the file specified." }', libcore\result.rs:916:5

---- ssl::test::verify_untrusted::sslv23 stdout ----
        thread 'ssl::test::verify_untrusted::sslv23' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 2, kind: NotFound, message: "The system cannot find the file specified." }', libcore\result.rs:916:5

---- ssl::test::verify_untrusted_callback_override_bad::sslv23 stdout ----
        thread 'ssl::test::verify_untrusted_callback_override_bad::sslv23' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 2, kind: NotFound, message: "The system cannot find the file specified." }', libcore\result.rs:916:5

---- ssl::test::verify_untrusted_callback_override_ok::sslv23 stdout ----
        thread 'ssl::test::verify_untrusted_callback_override_ok::sslv23' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 2, kind: NotFound, message: "The system cannot find the file specified." }', libcore\result.rs:916:5

---- ssl::test::write_panic stdout ----
        thread 'ssl::test::write_panic' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 2, kind: NotFound, message: "The system cannot find the file specified." }', libcore\result.rs:916:5
note: Panic did not include expected string 'blammo'
---- ssl::test::zero_length_buffers stdout ----
        thread 'ssl::test::zero_length_buffers' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 2, kind: NotFound, message: "The system cannot find the file specified." }', libcore\result.rs:916:5

---- version::test_versions stdout ----
        Number: '268443887'
Version: 'OpenSSL 1.0.2n  7 Dec 2017'
C flags: '"compiler: cl -utf-8 -FS  /MD /Ox -DOPENSSL_THREADS  -DDSO_WIN32 -utf-8 -FS -W3 -Gs0 -Gy -nologo -DOPENSSL_SYSNAME_WIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -DUNICODE -D_UNICODE -D_CRT_SECURE_NO_DEPRECATE -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_BN_ASM_GF2m -DRC4_ASM -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DMD5_ASM -DAES_ASM -DVPAES_ASM -DBSAES_ASM -DWHIRLPOOL_ASM -DGHASH_ASM -DECP_NISTZ256_ASM -DOPENSSL_USE_APPLINK -I. -DOPENSSL_NO_RC5 -DOPENSSL_NO_MD2 -DOPENSSL_NO_SSL2 -DOPENSSL_NO_KRB5 -DOPENSSL_NO_JPAKE -DOPENSSL_NO_WEAK_SSL_CIPHERS -DOPENSSL_NO_DYNAMIC_ENGINE    "'
Built on: 'built on: reproducible build, date unspecified'
Platform: 'VC-WIN64A'
Dir: 'OPENSSLDIR: "D:/src/vcpkg/packages/openssl_x64-windows"'
thread 'version::test_versions' panicked at 'assertion failed: c_flags().starts_with("compiler:")', openssl\src\version.rs:123:5

failures:
    ssl::test::cert_store
    ssl::test::clear_ctx_options::sslv23
    ssl::test::connector_no_hostname_can_disable_verify
    ssl::test::connector_no_hostname_still_verifies
    ssl::test::flush_panic
    ssl::test::get_ctx_options::sslv23
    ssl::test::get_peer_certificate::sslv23
    ssl::test::new_ctx::sslv23
    ssl::test::read_panic
    ssl::test::set_ctx_options::sslv23
    ssl::test::ssl_verify_callback::sslv23
    ssl::test::test_pending
    ssl::test::test_read
    ssl::test::test_state
    ssl::test::test_write
    ssl::test::verify_callback_data::sslv23
    ssl::test::verify_callback_load_certs::sslv23
    ssl::test::verify_trusted::sslv23
    ssl::test::verify_trusted_callback_override_bad::sslv23
    ssl::test::verify_trusted_callback_override_ok::sslv23
    ssl::test::verify_trusted_get_error_err::sslv23
    ssl::test::verify_trusted_get_error_ok::sslv23
    ssl::test::verify_untrusted::sslv23
    ssl::test::verify_untrusted_callback_override_bad::sslv23
    ssl::test::verify_untrusted_callback_override_ok::sslv23
    ssl::test::write_panic
    ssl::test::zero_length_buffers
    version::test_versions

test result: FAILED. 121 passed; 28 failed; 0 ignored; 0 measured; 0 filtered out

error: test failed, to rerun pass '--lib'
sfackler commented 6 years ago

Those tests are trying to run the openssl binary. Is it in your PATH?

jaysonsantos commented 6 years ago

Indeed that is what was missing. Thanks!