rustls / rustls-ffi

Use Rustls from any language
Other
132 stars 30 forks source link

Add tests for server and client connection_new #208

Closed jsha closed 2 years ago

jsha commented 2 years ago

Error is:

   --> /home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/ring-0.16.20/src/cpu.rs:46:21
    |
46  |                     GFp_cpuid_setup();
    |                     ^^^^^^^^^^^^^^^^^ can't call foreign function: GFp_cpuid_setup
    |
    = help: this is likely not a bug in the program; it indicates that the program performed an operation that the interpreter does not support

    = note: inside closure at /home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/ring-0.16.20/src/cpu.rs:46:21
    = note: inside `spin::once::Once::<()>::call_once::<[closure@ring::cpu::features::{closure#0}]>` at /home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/spin-0.5.2/src/once.rs:110:50
    = note: inside `ring::cpu::features` at /home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/ring-0.16.20/src/cpu.rs:39:18
    = note: inside `ring::agreement::EphemeralPrivateKey::generate` at /home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/ring-0.16.20/src/agreement.rs:111:28
    = note: inside `rustls::kx::KeyExchange::start` at /home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/rustls-0.20.0/src/kx.rs:37:13
    = note: inside `rustls::client::tls13::initial_key_share` at /home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/rustls-0.20.0/src/client/tls13.rs:219:5
    = note: inside `rustls::client::hs::start_handshake` at /home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/rustls-0.20.0/src/client/hs.rs:115:14
    = note: inside `rustls::ClientConnection::new_inner` at /home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/rustls-0.20.0/src/client/client_conn.rs:432:21
    = note: inside `rustls::ClientConnection::new` at /home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/rustls-0.20.0/src/client/client_conn.rs:414:9

Presumably this is because miri doesn't support FFI, but *ring* needs it during key generation.

https://github.com/rust-lang/miri

Miri runs the program as a platform-independent interpreter, so the program has no access to most platform-specific APIs or FFI.

jsha commented 2 years ago

I added an annotation for Miri to ignore these tests. Ready for review.

kevinburke commented 2 years ago

Looks good to me, I am not sure whether 42u8 has some meaning to ALPN, or is literally a byte chosen at random

jsha commented 2 years ago

Literally a byte chosen at random, the answer to life the universe and everything according to hitchhikers guide. Had to choose a nonzero number so I could confirm it changed to zero. :-)

On Wed, Nov 10, 2021, 13:46 Kevin Burke @.***> wrote:

Looks good to me, I am not sure whether 42u8 has some meaning to ALPN, or is literally a byte chosen at random

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/rustls/rustls-ffi/pull/208#issuecomment-965774723, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABVYLIBB5NQ47FUODGOMGTULLR2HANCNFSM5HXDLWQA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.