Commit Graph

392 Commits

Author SHA1 Message Date
alnyan 0c156352b5 alnyan/yggdrasil: use std instead of yggdrasil-rt 2024-01-28 18:56:27 +02:00
alnyan 69a646b970 alnyan/yggdrasil: add Yggdrasil getrandom 2024-01-28 18:54:42 +02:00
Artyom Pavlov f68a940b4d Release v0.2.12 (#389) 2024-01-09 08:33:08 +03:00
BlackHoleFox 5fe3c8e34a Raise minimum supported Apple OS versions (#388) 2024-01-07 19:15:42 +03:00
BlackHoleFox 8aa4efb178 Document platform support policy (#387) 2024-01-04 23:55:54 +03:00
Artyom Pavlov 7249e6ec14 Improve robustness of the Hermit backend and sys_fill_exact (#386) 2023-12-03 00:01:11 +03:00
Artyom Pavlov 169944f107 Fix custom backend for targets without atomics (#385) 2023-11-08 08:58:24 +03:00
Joe Richey baf2198d2a Update README.md to have correct build status badge (#382) 2023-11-07 09:21:25 +03:00
Artyom Pavlov 853c1dc592 Release v0.2.11 (#379) 2023-11-06 22:04:43 -08:00
Artyom Pavlov 4c094c3754 Add workaround for cross-rs/cross#1345 (#380) 2023-11-07 07:39:49 +03:00
Samuel Thibault 8476c4436d Add GNU/Hurd support (#370)
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
2023-11-07 07:13:56 +03:00
Hugo 35808a4b27 Update broken link to hermit docs (#374) 2023-10-05 18:51:00 +03:00
Artyom Pavlov 8c8ca323f9 CI: replace MIPS cross tests with PPC32 (#372) 2023-10-02 14:56:45 -07:00
Joe Richey 1308930985 custom: rename __getrandom_internal to follow Rust conventions (#369) 2023-09-01 10:50:49 +00:00
Artyom Pavlov 2e483d68aa Release v0.2.10 (#364) 2023-06-06 18:07:03 +03:00
Artyom Pavlov e57fcac8dc emscripten: use getentropy from libc (#362) 2023-06-06 16:43:21 +03:00
Joyce 5aa4105c23 Create SECURITY.md (#361) 2023-05-20 23:50:19 +03:00
Nikolay Arhipov 53cf0cc3af Add support for PS Vita (armv7-sony-vita-newlibeabihf) (#359) 2023-05-07 10:35:48 +00:00
Artyom Pavlov 666b2d4c83 Fix v0.2.9 release date (#357) 2023-04-10 16:13:35 -07:00
Artyom Pavlov abe7ef3107 Release v0.2.9 (#354) 2023-04-06 16:20:27 -07:00
Joe Richey 03defac1e5 ci: use minimal permissions for Github Actions (#351)
Fixes #348

we only need to read the contents of the repo to run our tests, no other
permissions are needed, as we currently do not publish via our CI jobs.

Signed-off-by: Joe Richey <joerichey@google.com>
2023-03-24 19:30:06 -07:00
Joe Richey 8eb9c2d5a6 Merge pull request #350 from rust-random/android
Disable cross build/tests on Android
2023-03-24 14:35:47 -07:00
Joe Richey 5042b09742 Update wasm-pack
Signed-off-by: Joe Richey <joerichey@google.com>
2023-03-24 14:23:06 -07:00
Joe Richey 6cd1a12ef2 Disable cross build/tests on Android
Cross is currently broken on Android, see https://github.com/cross-rs/cross/issues/1222

The bug is fixed on master, but a new release of cross hasn't come out
yet.

Signed-off-by: Joe Richey <joerichey@google.com>
2023-03-23 18:04:35 -07:00
Artyom Pavlov 41cc07a099 Switch the custom backend to Rust ABI (#347)
Closes #345

This change makes the code safe against potential panics in custom functions.
2023-03-13 21:14:47 -07:00
Joseph Richey 2f9989fba1 Move __getrandom_custom definition into a const block (#344)
This supersedes #341, and makes the following changes
  - All the code for implementing `__getrandom_custom` is now in an
    **named** `const` block (unnamed consts require Rust 1.37)
    - I found this approch [here](https://internals.rust-lang.org/t/anonymous-modules/15441)
    - Nothing inside the block can be referenced outside of it
  - `__getrandom_custom` is marked `unsafe`
    - It can't be accessed externally, but is "logically" unsafe as it
      dereferences raw pointers
  - The type of the function is moved to a typedef, so we can check that
    the defined type matches that of `getrandom:getrandom`.
  - Use `::core::result::Result` instead of `Result`
    - Similar to use use of `from_raw_parts_mut` this prevents
      compilation errors if `Result` is redefined.

Signed-off-by: Joe Richey <joerichey@google.com>
2023-03-09 20:36:20 -08:00
Joseph Richey 75252bca49 ci: Fix the fuchsia tests (#343)
The target triple name was changed in https://github.com/rust-lang/rust/pull/106429

While `rustc` known the old spelling of the triple, `rustup` does not,
so the toolchain download was not working.

Signed-off-by: Joe Richey <joerichey@google.com>
2023-03-09 20:35:51 -08:00
Joseph Richey 41b89814e3 Allow Edge tests to fail (#339)
Window's `msedgedriver` seems to be unreliable, as port binding will
occasionally fail. Instead of wasting time trying to debug this, just
let the tests fail.

We take a similar approch for Safari's webdriver, we will allow the
tests to fail, but will hopefully see when they start succeeding (when
Safari fixes the COOP bug).

Signed-off-by: Joe Richey <joerichey@google.com>
2023-02-23 11:56:11 -08:00
Joseph Richey 74a2021ee1 ci: Don't use rust-cache for Cross Build/Link (#338)
I think the caching isn't interacting well with the libc build script.

Lets see if this fixes things.

Signed-off-by: Joe Richey <joerichey@google.com>
2023-02-22 13:01:58 -08:00
Chris H-C c526c898b3 Add in a RtlGenRandom fallback for non-UWP Windows (#337)
* Add in a RtlGenRandom fallback for non-UWP Windows

In some instances BCryptRandom will fail when RtlGenRandom will work.
On UWP, we might be unable to actually use RtlGenRandom.

Thread the needle and use RtlGenRandom when we have to, when we're able.

See also rust-lang/rust#108060

Fixes #314

* style suggestion

Co-authored-by: Artyom Pavlov <newpavlov@gmail.com>

* appease clippy

---------

Co-authored-by: Artyom Pavlov <newpavlov@gmail.com>
2023-02-22 12:42:52 -08:00
Artyom Pavlov 7c83ea0e57 Hermit: use sys_read_entropy syscall (#333)
* Hermit: use sys_read_entropy syscall

* Add doc link
2023-02-09 14:00:32 -08:00
Joseph Richey c65522b5c6 Merge pull request #336 from rust-random/ci
Reenable cross build/link tests and update cross
2023-02-09 03:29:01 -08:00
Joe Richey 8d8a882eb6 Move Web Tests to Ubuntu 22.04
Signed-off-by: Joe Richey <joerichey@google.com>
2023-02-08 17:12:14 -08:00
Joe Richey a2b48866b9 Reenable cross build/link tests and update cross
My not caching the build results, we should hopefuly prevent the linking
errors we were seeing before.

Signed-off-by: Joe Richey <joerichey@google.com>
2023-02-08 17:02:53 -08:00
Joseph Richey 8e46d0c055 Merge pull request #335 from rust-random/rdrand
rdrand: Remove checking for 0 and !0 and instead check CPU family and do a self-test
2023-02-08 16:24:46 -08:00
Joe Richey 5f7aadf0ea Make rdrand_exact #[target_feature(enable = "rdrand")]
Signed-off-by: Joe Richey <joerichey@google.com>
2023-02-08 14:42:06 -08:00
Joe Richey 6a3fac8a01 Remove comment implying this code only runs on SGX
Signed-off-by: Joe Richey <joerichey@google.com>
2023-02-08 14:42:06 -08:00
Joe Richey f39423084c Use !0 instead of usize::MAX
We could use core::usize::MAX, but that is deprecated.

Signed-off-by: Joe Richey <joerichey@google.com>
2023-02-08 14:42:06 -08:00
Joe Richey 82c3cb8901 rdrand: Add CPUID feature detection and self-test
Signed-off-by: Joe Richey <joerichey@google.com>
2023-02-08 14:42:06 -08:00
Joe Richey c4f7f45351 rdrand: Remove check for 0 and !0 values
Also makes rdrand() return an integer instead of an array of bytes. This
will make the self-test implementation easier. As we can just return a
`usize` we no longer need the `WORD_SIZE` constant.

Signed-off-by: Joe Richey <joerichey@google.com>
2023-02-08 14:42:06 -08:00
Joe Richey a56faa8ca5 Use correct flag name
The flag name is +rdrand not +rdrnd

Signed-off-by: Joe Richey <joerichey@google.com>
2023-02-08 14:42:06 -08:00
Artyom Pavlov 9ceb7e56ec Eliminate potential panic in sys_fill_exact (#334) 2023-01-27 15:30:37 -08:00
Joseph Richey 6536b9e60c Remove #cfg from bsd_arandom.rs (#332)
Followup to #331, we don't need the condidtional compilation anymore,
because this file is only used if
`any(target_os = "freebsd", target_os = "netbsd")` anyway.

Also cleans up `use` statements and type declarations to look like those
in macos.rs

Signed-off-by: Joe Richey <joerichey@google.com>
2023-01-26 12:13:27 -08:00
Tobias Klauser 6e3bbdebaa Add support for getrandom syscall on NetBSD ≥ 10.0 (#331)
NetBSD supports the getrandom system call since version 10.0 [1].
Use it if available, otherwise fall back to kern.arandom like on FreeBSD.

[1] https://man.netbsd.org/getrandom.2
2023-01-25 17:10:56 +00:00
Khem Raj 7f73e3ccc1 Use open instead of open64 (#326)
glibc is providing open64 and other lfs64 functions but musl aliases
them to normal equivalents since off_t is always 64-bit on musl,
therefore check for target env along when target OS is linux before
using open64, this is more available. Latest Musl has made these
namespace changes [1]

There is no need for using LFS64 open explicitly as we are only using it
for opening device files and not real files

[1] https://git.musl-libc.org/cgit/musl/commit/?id=246f1c811448f37a44b41cd8df8d0ef9736d95f4

Signed-off-by: Khem Raj <raj.khem@gmail.com>

Signed-off-by: Khem Raj <raj.khem@gmail.com>
2023-01-06 08:43:34 +00:00
Artyom Pavlov 698a6d1a06 Disable cross build/link tests (#328) 2023-01-04 00:44:52 -08:00
Kian-Meng Ang ea5ef25714 Fix typos (#327) 2023-01-04 06:58:29 +00:00
Qiu Chaofan e0e406df8a Support random file of AIX (#282) 2022-12-30 10:44:40 +00:00
Joseph Richey beb65e241e Merge pull request #325 from flba-eb/add_qnx_nto_support
Add QNX/nto support
2022-12-23 23:49:19 -08:00
Florian Bartels 993505c17f Enable tests for QNX/Neutrino, integrate new libc version 2022-12-23 07:50:53 +01:00