ring icon indicating copy to clipboard operation
ring copied to clipboard

haiku: Fix build on Haiku, use standard urandom paths

Open kallisti5 opened this issue 2 years ago • 1 comments

kallisti5 avatar Nov 15 '21 23:11 kallisti5

solves #1425

/Data/Code/ring> cargo test
  Downloaded tinytemplate v1.2.1
  Downloaded criterion-plot v0.4.4
  Downloaded crossbeam-deque v0.8.1
  Downloaded cast v0.2.7
  Downloaded criterion v0.3.5
  Downloaded rayon-core v1.9.1
  Downloaded csv-core v0.1.10
  Downloaded plotters-backend v0.3.2
  Downloaded plotters-svg v0.3.1
  Downloaded half v1.8.2
  Downloaded rayon v1.5.1
  Downloaded oorandom v11.1.3
  Downloaded rustc_version v0.4.0
  Downloaded crossbeam-channel v0.5.1
  Downloaded semver v1.0.4
  Downloaded walkdir v2.3.2
  Downloaded serde_cbor v0.11.2
  Downloaded bstr v0.2.17
  Downloaded csv v1.1.6
  Downloaded plotters v0.3.1
  Downloaded 20 crates (10.5 MB) in 6.17s (largest was `plotters` at 8.6 MB)
   Compiling autocfg v1.0.1
   Compiling lazy_static v1.4.0
   Compiling serde v1.0.130
   Compiling semver v1.0.4
   Compiling crossbeam-utils v0.8.5
   Compiling libc v0.2.107
   Compiling cfg-if v1.0.0
   Compiling crossbeam-epoch v0.9.5
   Compiling memchr v2.4.1
   Compiling proc-macro2 v1.0.32
   Compiling ryu v1.0.5
   Compiling rayon-core v1.9.1
   Compiling unicode-xid v0.2.2
   Compiling scopeguard v1.1.0
   Compiling either v1.6.1
   Compiling syn v1.0.81
   Compiling itoa v0.4.8
   Compiling serde_json v1.0.70
   Compiling unicode-width v0.1.9
   Compiling serde_derive v1.0.130
   Compiling regex-automata v0.1.10
   Compiling plotters-backend v0.3.2
   Compiling half v1.8.2
   Compiling regex-syntax v0.6.25
   Compiling bitflags v1.3.2
   Compiling same-file v1.0.6
   Compiling oorandom v11.1.3
   Compiling itertools v0.10.1
   Compiling textwrap v0.11.0
warning: Hard linking files in the incremental compilation cache failed. Copying files instead. Consider moving the cache directory to a file system which supports hard linking in session dir `/Data/Code/ring/target/debug/incremental/build_script_build-37lvu6utmefj1/s-g49wpc5clr-ulo0vw-working`

warning: `ring` (build script) generated 1 warning
   Compiling walkdir v2.3.2
   Compiling plotters-svg v0.3.1
   Compiling clap v2.33.3
   Compiling memoffset v0.6.4
   Compiling num-traits v0.2.14
   Compiling rayon v1.5.1
   Compiling crossbeam-channel v0.5.1
   Compiling rustc_version v0.4.0
   Compiling num_cpus v1.13.0
   Compiling atty v0.2.14
   Compiling csv-core v0.1.10
   Compiling regex v1.5.4
   Compiling quote v1.0.10
   Compiling crossbeam-deque v0.8.1
   Compiling cast v0.2.7
   Compiling criterion-plot v0.4.4
   Compiling plotters v0.3.1
   Compiling bstr v0.2.17
   Compiling serde_cbor v0.11.2
   Compiling csv v1.1.6
   Compiling tinytemplate v1.2.1
   Compiling criterion v0.3.5
   Compiling ring v0.17.0-not-released-yet (/Data/Code/ring)
    Finished test [unoptimized + debuginfo] target(s) in 4m 17s
     Running unittests (target/debug/deps/ring-e16d126a9125bd43)

running 90 tests
test aead::aes::tests::test_aes ... ok
test aead::aes_gcm::tests::max_input_len_test ... ok
test aead::chacha20_poly1305::tests::max_input_len_test ... ok
test aead::chacha::tests::chacha20_test_default ... ok
test aead::chacha::tests::chacha20_test_fallback ... ok
test aead::poly1305::tests::test_poly1305 ... ok
test arithmetic::bigint::tests::test_elem_exp_consttime ... ok
test arithmetic::bigint::tests::test_elem_mul ... ok
test arithmetic::bigint::tests::test_elem_reduced ... ok
test arithmetic::bigint::tests::test_elem_reduced_once ... ok
test arithmetic::bigint::tests::test_elem_squared ... ok
test arithmetic::bigint::tests::test_modulus_debug ... ok
test arithmetic::bigint::tests::test_mul_add_words ... ok
test bssl::tests::result::semantics ... ok
test bssl::tests::result::size_and_alignment ... ok
test c::tests::test_libc_compatible ... ok
test constant_time::tests::test_constant_time ... ok
test cpu::intel::x86_64_tests::test_avx_movbe_mask ... ok
test digest::tests::max_input::SHA1_FOR_LEGACY_USE_ONLY::max_input_test ... ok
test digest::tests::max_input::SHA1_FOR_LEGACY_USE_ONLY::too_long_input_test_block - should panic ... ok
test digest::tests::max_input::SHA1_FOR_LEGACY_USE_ONLY::too_long_input_test_byte - should panic ... ok
test digest::tests::max_input::SHA256::max_input_test ... ok
test digest::tests::max_input::SHA256::too_long_input_test_block - should panic ... ok
test digest::tests::max_input::SHA256::too_long_input_test_byte - should panic ... ok
test digest::tests::max_input::SHA384::max_input_test ... ok
test digest::tests::max_input::SHA384::too_long_input_test_block - should panic ... ok
test digest::tests::max_input::SHA384::too_long_input_test_byte - should panic ... ok
test digest::tests::max_input::SHA512::max_input_test ... ok
test digest::tests::max_input::SHA512::too_long_input_test_block - should panic ... ok
test digest::tests::max_input::SHA512::too_long_input_test_byte - should panic ... ok
test ec::suite_b::ecdh::tests::test_agreement_suite_b_ecdh_generate ... ok
test ec::suite_b::ecdsa::digest_scalar::tests::test ... ok
test ec::suite_b::ecdsa::signing::tests::signature_ecdsa_sign_asn1_test ... ok
test ec::suite_b::ecdsa::signing::tests::signature_ecdsa_sign_fixed_test ... ok
test ec::suite_b::ecdsa::verification::tests::test_digest_based_test_vectors ... ok
test ec::suite_b::ops::tests::p256_elem_add_test ... ok
test ec::suite_b::ops::tests::p256_elem_mul_test ... ok
test ec::suite_b::ops::tests::p256_elem_neg_test ... ok
test ec::suite_b::ops::tests::p256_point_double_test ... ok
test ec::suite_b::ops::tests::p256_point_mul_base_test ... ok
test ec::suite_b::ops::tests::p256_point_mul_serialized_test ... ok
test ec::suite_b::ops::tests::p256_point_mul_test ... ok
test ec::suite_b::ops::tests::p256_point_sum_mixed_test ... ok
test ec::suite_b::ops::tests::p256_point_sum_test ... ok
test ec::suite_b::ops::tests::p256_q_minus_n_plus_n_equals_0_test ... ok
test ec::suite_b::ops::tests::p256_scalar_inv_to_mont_zero_panic_test - should panic ... ok
test ec::suite_b::ops::tests::p256_scalar_mul_test ... ok
test ec::suite_b::ops::tests::p256_scalar_square_test ... ok
test ec::suite_b::ops::tests::p384_elem_add_test ... ok
test ec::suite_b::ops::tests::p384_elem_div_by_2_test ... ok
test ec::suite_b::ops::tests::p384_elem_mul_test ... ok
test ec::suite_b::ops::tests::p384_elem_neg_test ... ok
test ec::suite_b::ops::tests::p384_elem_sub_test ... ok
test ec::suite_b::ops::tests::p384_point_double_test ... ok
test ec::suite_b::ops::tests::p384_point_mul_base_test ... ok
test ec::suite_b::ops::tests::p384_point_mul_test ... ok
test ec::suite_b::ops::tests::p384_point_sum_test ... ok
test ec::suite_b::ops::tests::p384_q_minus_n_plus_n_equals_0_test ... ok
test ec::suite_b::ops::tests::p384_scalar_inv_to_mont_zero_panic_test - should panic ... ok
test ec::suite_b::ops::tests::p384_scalar_mul_test ... ok
test ec::suite_b::public_key::tests::parse_uncompressed_point_test ... ok
test endian::tests::test_big_endian ... ok
test hmac::tests::hmac_signing_key_coverage ... ok
test io::der::tests::test_positive_integer ... ok
test io::der::tests::test_small_nonnegative_integer ... ok
test io::positive::tests::test_from_be_bytes ... ok
test limb::tests::test_big_endian_from_limbs_fewer_limbs - should panic ... ok
test limb::tests::test_big_endian_from_limbs_same_length ... ok
test limb::tests::test_limbs_are_even ... ok
test limb::tests::test_limbs_are_zero ... ok
test limb::tests::test_limbs_equal_limb ... ok
test limb::tests::test_limbs_less_than_limb_constant_time ... ok
test limb::tests::test_limbs_minimal_bits ... ok
test limb::tests::test_parse_big_endian_and_pad_consttime ... ok
test polyfill::array_flat_map::tests::test_array_flat_map ... ok
test polyfill::array_flat_map::tests::test_array_flat_map_len_overflow ... ok
test polyfill::leading_zeros_skipped::tests::test_leading_zeroes_stripped ... ok
test rsa::padding::test::test_pss_padding_encode ... ok
test rsa::padding::test::test_pss_padding_verify ... ok
test rsa::public_exponent::tests::test_public_exponent_constants ... ok
test test::tests::first_err - should panic ... ok
test test::tests::first_panic - should panic ... ok
test test::tests::last_err - should panic ... ok
test test::tests::last_panic - should panic ... ok
test test::tests::middle_err - should panic ... ok
test test::tests::middle_panic - should panic ... ok
test test::tests::one_err - should panic ... ok
test test::tests::one_ok ... ok
test test::tests::one_panics - should panic ... ok
test test::tests::syntax_error - should panic ... ok

test result: ok. 90 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 6.20s

     Running tests/aead_tests.rs (target/debug/deps/aead_tests-81290b8338987d37)

running 38 tests
test aead_chacha20_poly1305_openssh ... ok
test aead_test::AES_128_GCM::key_sizes ... ok
test aead_test::AES_128_GCM::less_safe_key_open_in_place ... ok
test aead_test::AES_128_GCM::less_safe_key_open_within ... ok
test aead_test::AES_128_GCM::less_safe_key_seal_in_place_append_tag ... ok
test aead_test::AES_128_GCM::less_safe_key_seal_in_place_separate_tag ... ok
test aead_test::AES_128_GCM::opening_key_open_in_place ... ok
test aead_test::AES_128_GCM::opening_key_open_within ... ok
test aead_test::AES_128_GCM::sealing_key_seal_in_place_append_tag ... ok
test aead_test::AES_128_GCM::sealing_key_seal_in_place_separate_tag ... ok
test aead_test::AES_128_GCM::test_open_in_place_seperate_tag ... ok
test aead_test::AES_256_GCM::key_sizes ... ok
test aead_test::AES_256_GCM::less_safe_key_open_in_place ... ok
test aead_test::AES_256_GCM::less_safe_key_open_within ... ok
test aead_test::AES_256_GCM::less_safe_key_seal_in_place_append_tag ... ok
test aead_test::AES_256_GCM::less_safe_key_seal_in_place_separate_tag ... ok
test aead_test::AES_256_GCM::opening_key_open_in_place ... ok
test aead_test::AES_256_GCM::opening_key_open_within ... ok
test aead_test::AES_256_GCM::sealing_key_seal_in_place_append_tag ... ok
test aead_test::AES_256_GCM::sealing_key_seal_in_place_separate_tag ... ok
test aead_test::AES_256_GCM::test_open_in_place_seperate_tag ... ok
test aead_test::CHACHA20_POLY1305::key_sizes ... ok
test aead_test::CHACHA20_POLY1305::less_safe_key_open_in_place ... ok
test aead_test::CHACHA20_POLY1305::less_safe_key_open_within ... ok
test aead_test::CHACHA20_POLY1305::less_safe_key_seal_in_place_append_tag ... ok
test aead_test::CHACHA20_POLY1305::less_safe_key_seal_in_place_separate_tag ... ok
test aead_test::CHACHA20_POLY1305::opening_key_open_in_place ... ok
test aead_test::CHACHA20_POLY1305::opening_key_open_within ... ok
test aead_test::CHACHA20_POLY1305::sealing_key_seal_in_place_append_tag ... ok
test aead_test::CHACHA20_POLY1305::sealing_key_seal_in_place_separate_tag ... ok
test aead_test::CHACHA20_POLY1305::test_open_in_place_seperate_tag ... ok
test aead_test_aad_traits ... ok
test test_aead_key_debug ... ok
test test_aead_lesssafekey_clone_aes_128_gcm ... ok
test test_aead_lesssafekey_clone_aes_256_gcm ... ok
test test_aead_lesssafekey_clone_chacha20_poly1305 ... ok
test test_aead_nonce_sizes ... ok
test test_tag_traits ... ok

test result: ok. 38 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.73s

     Running tests/agreement_tests.rs (target/debug/deps/agreement_tests-4382bcf1f664a619)

running 3 tests
test agreement_agree_ephemeral ... ok
test agreement_traits ... ok
test test_agreement_ecdh_x25519_rfc_iterated ... ok

test result: ok. 3 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 3.42s

     Running tests/constant_time_tests.rs (target/debug/deps/constant_time_tests-897a4362cddd2043)

running 1 test
test test_verify_slices_are_equal ... ok

test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.47s

     Running tests/digest_tests.rs (target/debug/deps/digest_tests-0ce4ba621af8b51f)

running 15 tests
test digest_misc ... ok
test digest_shavs::SHA1_FOR_LEGACY_USE_ONLY::long_msg_known_answer_test ... ok
test digest_shavs::SHA1_FOR_LEGACY_USE_ONLY::monte_carlo_test ... ok
test digest_shavs::SHA1_FOR_LEGACY_USE_ONLY::short_msg_known_answer_test ... ok
test digest_shavs::SHA256::long_msg_known_answer_test ... ok
test digest_shavs::SHA256::monte_carlo_test ... ok
test digest_shavs::SHA256::short_msg_known_answer_test ... ok
test digest_shavs::SHA384::long_msg_known_answer_test ... ok
test digest_shavs::SHA384::monte_carlo_test ... ok
test digest_shavs::SHA384::short_msg_known_answer_test ... ok
test digest_shavs::SHA512::long_msg_known_answer_test ... ok
test digest_shavs::SHA512::monte_carlo_test ... ok
test digest_shavs::SHA512::short_msg_known_answer_test ... ok
test digest_test_fmt ... ok
test test_fmt_algorithm ... ok

test result: ok. 15 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 4.02s

     Running tests/ecdsa_tests.rs (target/debug/deps/ecdsa_tests-fa3ed5ff5b66670b)

running 7 tests
test ecdsa_from_pkcs8_test ... ok
test ecdsa_generate_pkcs8_test ... ok
test ecdsa_test_public_key_coverage ... ok
test signature_ecdsa_sign_asn1_test ... ok
test signature_ecdsa_sign_fixed_sign_and_verify_test ... ok
test signature_ecdsa_verify_asn1_test ... ok
test signature_ecdsa_verify_fixed_test ... ok

test result: ok. 7 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.26s

     Running tests/ed25519_tests.rs (target/debug/deps/ed25519_tests-2226b88d18bec44d)

running 6 tests
test ed25519_test_public_key_coverage ... ok
test test_ed25519_from_pkcs8 ... ok
test test_ed25519_from_pkcs8_unchecked ... ok
test test_ed25519_from_seed_and_public_key_misuse ... ok
test test_signature_ed25519 ... ok
test test_signature_ed25519_verify ... ok

test result: ok. 6 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.85s

     Running tests/error_tests.rs (target/debug/deps/error_tests-a4fcb9f462484701)

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

     Running tests/hkdf_tests.rs (target/debug/deps/hkdf_tests-0f67f55193ae2f67)

running 2 tests
test hkdf_output_len_tests ... ok
test hkdf_tests ... ok

test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

     Running tests/hmac_tests.rs (target/debug/deps/hmac_tests-fbbda6642c7f5750)

running 2 tests
test hmac_debug ... ok
test hmac_tests ... ok

test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

     Running tests/pbkdf2_tests.rs (target/debug/deps/pbkdf2_tests-17892bea5e8afd39)

running 1 test
test pbkdf2_tests ... ok

test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.82s

     Running tests/quic_tests.rs (target/debug/deps/quic_tests-310cfd3641f32987)

running 3 tests
test quic_aes_128 ... ok
test quic_aes_256 ... ok
test quic_chacha20 ... ok

test result: ok. 3 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

     Running tests/rand_tests.rs (target/debug/deps/rand_tests-5811a548d233da86)

running 2 tests
test test_system_random_lengths ... ok
test test_system_random_traits ... ok

test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.03s

     Running tests/rsa_tests.rs (target/debug/deps/rsa_tests-890a163d83d7d66a)

running 8 tests
test rsa_from_pkcs8_test ... ok
test rsa_test_keypair_coverage ... ok
test test_signature_rsa_pkcs1_sign ... ok
test test_signature_rsa_pkcs1_sign_output_buffer_len ... ok
test test_signature_rsa_pkcs1_verify ... ok
test test_signature_rsa_primitive_verification ... ok
test test_signature_rsa_pss_sign ... ok
test test_signature_rsa_pss_verify ... ok

test result: ok. 8 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.45s

     Running tests/signature_tests.rs (target/debug/deps/signature_tests-e76d242eb9973b10)

running 1 test
test signature_impl_test ... ok

test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

   Doc-tests ring

running 11 tests
test src/agreement.rs - agreement (line 23) ... ok
test src/digest.rs - digest::Context (line 125) ... ok
test src/digest.rs - digest::digest (line 213) ... ok
test src/error.rs - error::Unspecified (line 34) ... ok
test src/hmac.rs - hmac (line 31) ... ok
test src/hmac.rs - hmac (line 51) ... ok
test src/hmac.rs - hmac (line 75) ... ok
test src/pbkdf2.rs - pbkdf2 (line 32) ... ok
test src/signature.rs - signature (line 129) ... ok
test src/signature.rs - signature (line 193) ... ok
test src/test.rs - test (line 53) ... ignored

test result: ok. 10 passed; 0 failed; 1 ignored; 0 measured; 0 filtered out; finished in 3.83s

kallisti5 avatar Nov 15 '21 23:11 kallisti5

Thanks for the PR. See the draft PR https://github.com/briansmith/ring/pull/1531 where I propose we delegate the randomness stuff to the getrandom crate. I'm going to close this as a new PR will need to be written on top of that one that adds a single target_os = "haiku" line.

briansmith avatar Oct 25 '22 19:10 briansmith