From f68a940b4dac78b49f00599aebd56c72284a92d9 Mon Sep 17 00:00:00 2001 From: Artyom Pavlov Date: Tue, 9 Jan 2024 08:33:08 +0300 Subject: [PATCH] Release v0.2.12 (#389) --- CHANGELOG.md | 16 ++++++++++++++-- Cargo.toml | 2 +- LICENSE-MIT | 2 +- README.md | 15 ++++++++++++--- src/3ds.rs | 8 -------- src/apple-other.rs | 8 -------- src/bsd_arandom.rs | 8 -------- src/custom.rs | 8 -------- src/dragonfly.rs | 8 -------- src/error.rs | 7 ------- src/error_impls.rs | 7 ------- src/espidf.rs | 8 -------- src/fuchsia.rs | 8 -------- src/hermit.rs | 1 + src/hurd.rs | 8 -------- src/js.rs | 8 +------- src/lib.rs | 10 +--------- src/linux_android.rs | 8 -------- src/macos.rs | 8 -------- src/openbsd.rs | 8 -------- src/rdrand.rs | 8 +------- src/solaris_illumos.rs | 8 -------- src/solid.rs | 8 -------- src/use_file.rs | 8 -------- src/util.rs | 7 ------- src/util_libc.rs | 7 ------- src/vita.rs | 8 -------- src/vxworks.rs | 8 -------- src/wasi.rs | 8 -------- src/windows.rs | 9 +-------- 30 files changed, 33 insertions(+), 202 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index eaa379dc..a283d380 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,10 +4,21 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [Unreleased] +## [0.2.12] - 2024-01-09 +### Fixed +- Custom backend for targets without atomics [#385] ### Changed -- Raise minimum supported Apple OS versions to macOS 10.12 and iOS 10. +- Improve robustness of the Hermit backend and `sys_fill_exact` [#386] +- Raise minimum supported Apple OS versions to macOS 10.12 and iOS 10 [#388] + +### Added +- Document platform support policy [#387] + +[#385]: https://github.com/rust-random/getrandom/pull/385 +[#386]: https://github.com/rust-random/getrandom/pull/386 +[#387]: https://github.com/rust-random/getrandom/pull/387 +[#388]: https://github.com/rust-random/getrandom/pull/388 ## [0.2.11] - 2023-11-08 ### Added @@ -408,6 +419,7 @@ Publish initial implementation. ## [0.0.0] - 2019-01-19 Publish an empty template library. +[0.2.12]: https://github.com/rust-random/getrandom/compare/v0.2.11...v0.2.12 [0.2.11]: https://github.com/rust-random/getrandom/compare/v0.2.10...v0.2.11 [0.2.10]: https://github.com/rust-random/getrandom/compare/v0.2.9...v0.2.10 [0.2.9]: https://github.com/rust-random/getrandom/compare/v0.2.8...v0.2.9 diff --git a/Cargo.toml b/Cargo.toml index ba2c6b7e..ea57331d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "getrandom" -version = "0.2.11" # Also update html_root_url in lib.rs when bumping this +version = "0.2.12" # Also update html_root_url in lib.rs when bumping this edition = "2018" authors = ["The Rand Project Developers"] license = "MIT OR Apache-2.0" diff --git a/LICENSE-MIT b/LICENSE-MIT index d93b5baf..8ca28a1a 100644 --- a/LICENSE-MIT +++ b/LICENSE-MIT @@ -1,4 +1,4 @@ -Copyright 2018 Developers of the Rand project +Copyright (c) 2018-2024 The rust-random Project Developers Copyright (c) 2014 The Rust Project Developers Permission is hereby granted, free of charge, to any diff --git a/README.md b/README.md index f1512260..b4b5a2b5 100644 --- a/README.md +++ b/README.md @@ -62,11 +62,20 @@ Additional targets may be supported using pluggable custom implementations. This means that as Rust drops support for old versions of operating systems (such as old Linux kernel versions, Android API levels, etc) in stable releases, `getrandom` may create new patch releases (`0.N.x`) that remove support for outdated platform versions. -# License +## License The `getrandom` library is distributed under either of - * [Apache License, Version 2.0](LICENSE-APACHE) - * [MIT license](LICENSE-MIT) + * [Apache License, Version 2.0][LICENSE-APACHE] + * [MIT license][LICENSE-MIT] at your option. + +### Contribution + +Unless you explicitly state otherwise, any contribution intentionally submitted +for inclusion in the work by you, as defined in the Apache-2.0 license, shall be +dual licensed as above, without any additional terms or conditions. + +[LICENSE-APACHE]: https://github.com/rust-random/getrandom/blob/master/LICENSE-APACHE +[LICENSE-MIT]: https://github.com/rust-random/getrandom/blob/master/LICENSE-MIT diff --git a/src/3ds.rs b/src/3ds.rs index 87a32a1e..a5aae77d 100644 --- a/src/3ds.rs +++ b/src/3ds.rs @@ -1,11 +1,3 @@ -// Copyright 2021 Developers of the Rand project. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - //! Implementation for Nintendo 3DS use crate::util_libc::sys_fill_exact; use crate::Error; diff --git a/src/apple-other.rs b/src/apple-other.rs index 9eeb513c..167d8cf0 100644 --- a/src/apple-other.rs +++ b/src/apple-other.rs @@ -1,11 +1,3 @@ -// Copyright 2023 Developers of the Rand project. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - //! Implementation for iOS, tvOS, and watchOS where `getentropy` is unavailable. use crate::Error; use core::{ffi::c_void, mem::MaybeUninit}; diff --git a/src/bsd_arandom.rs b/src/bsd_arandom.rs index 5314c48f..6e133d89 100644 --- a/src/bsd_arandom.rs +++ b/src/bsd_arandom.rs @@ -1,11 +1,3 @@ -// Copyright 2018 Developers of the Rand project. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - //! Implementation for FreeBSD and NetBSD use crate::{ util_libc::{sys_fill_exact, Weak}, diff --git a/src/custom.rs b/src/custom.rs index 66e4256f..8dc9cb79 100644 --- a/src/custom.rs +++ b/src/custom.rs @@ -1,11 +1,3 @@ -// Copyright 2018 Developers of the Rand project. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - //! An implementation which calls out to an externally defined function. use crate::{util::uninit_slice_fill_zero, Error}; use core::{mem::MaybeUninit, num::NonZeroU32}; diff --git a/src/dragonfly.rs b/src/dragonfly.rs index d3ef00aa..ac4794cd 100644 --- a/src/dragonfly.rs +++ b/src/dragonfly.rs @@ -1,11 +1,3 @@ -// Copyright 2021 Developers of the Rand project. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - //! Implementation for DragonFly BSD use crate::{ use_file, diff --git a/src/error.rs b/src/error.rs index e29d8a7e..13c81c7a 100644 --- a/src/error.rs +++ b/src/error.rs @@ -1,10 +1,3 @@ -// Copyright 2018 Developers of the Rand project. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. use core::{fmt, num::NonZeroU32}; /// A small and `no_std` compatible error type diff --git a/src/error_impls.rs b/src/error_impls.rs index 61f46d22..a7bffb89 100644 --- a/src/error_impls.rs +++ b/src/error_impls.rs @@ -1,10 +1,3 @@ -// Copyright 2018 Developers of the Rand project. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. #![cfg_attr(docsrs, doc(cfg(feature = "std")))] extern crate std; diff --git a/src/espidf.rs b/src/espidf.rs index d074dc4c..7da5ca88 100644 --- a/src/espidf.rs +++ b/src/espidf.rs @@ -1,11 +1,3 @@ -// Copyright 2021 Developers of the Rand project. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - //! Implementation for ESP-IDF use crate::Error; use core::{ffi::c_void, mem::MaybeUninit}; diff --git a/src/fuchsia.rs b/src/fuchsia.rs index 5a135f34..11970685 100644 --- a/src/fuchsia.rs +++ b/src/fuchsia.rs @@ -1,11 +1,3 @@ -// Copyright 2018 Developers of the Rand project. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - //! Implementation for Fuchsia Zircon use crate::Error; use core::mem::MaybeUninit; diff --git a/src/hermit.rs b/src/hermit.rs index 21649d1f..c4f61941 100644 --- a/src/hermit.rs +++ b/src/hermit.rs @@ -1,3 +1,4 @@ +//! Implementation for Hermit use crate::Error; use core::{mem::MaybeUninit, num::NonZeroU32}; diff --git a/src/hurd.rs b/src/hurd.rs index 842b9bc4..472a7d86 100644 --- a/src/hurd.rs +++ b/src/hurd.rs @@ -1,11 +1,3 @@ -// Copyright 2021 Developers of the Rand project. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - //! Implementation for GNU/Hurd use crate::util_libc::sys_fill_exact; use crate::Error; diff --git a/src/js.rs b/src/js.rs index d0312822..e5428f50 100644 --- a/src/js.rs +++ b/src/js.rs @@ -1,10 +1,4 @@ -// Copyright 2018 Developers of the Rand project. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. +//! Implementation for WASM based on Web and Node.js use crate::Error; extern crate std; diff --git a/src/lib.rs b/src/lib.rs index b8bd65b5..e80ec6f5 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,11 +1,3 @@ -// Copyright 2019 Developers of the Rand project. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - //! Interface to the operating system's random number generator. //! //! # Supported targets @@ -194,7 +186,7 @@ #![doc( html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk.png", html_favicon_url = "https://www.rust-lang.org/favicon.ico", - html_root_url = "https://docs.rs/getrandom/0.2.11" + html_root_url = "https://docs.rs/getrandom/0.2.12" )] #![no_std] #![warn(rust_2018_idioms, unused_lifetimes, missing_docs)] diff --git a/src/linux_android.rs b/src/linux_android.rs index bfeb793e..2517159e 100644 --- a/src/linux_android.rs +++ b/src/linux_android.rs @@ -1,11 +1,3 @@ -// Copyright 2018 Developers of the Rand project. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - //! Implementation for Linux / Android use crate::{ lazy::LazyBool, diff --git a/src/macos.rs b/src/macos.rs index 61773247..44af76b0 100644 --- a/src/macos.rs +++ b/src/macos.rs @@ -1,11 +1,3 @@ -// Copyright 2023 Developers of the Rand project. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - //! Implementation for macOS use crate::{util_libc::last_os_error, Error}; use core::mem::MaybeUninit; diff --git a/src/openbsd.rs b/src/openbsd.rs index 7a76f61d..f4d64daf 100644 --- a/src/openbsd.rs +++ b/src/openbsd.rs @@ -1,11 +1,3 @@ -// Copyright 2018 Developers of the Rand project. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - //! Implementation for OpenBSD use crate::{util_libc::last_os_error, Error}; use core::mem::MaybeUninit; diff --git a/src/rdrand.rs b/src/rdrand.rs index 59d5249a..f527c8c6 100644 --- a/src/rdrand.rs +++ b/src/rdrand.rs @@ -1,10 +1,4 @@ -// Copyright 2018 Developers of the Rand project. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. +//! RDRAND backend for x86(-64) targets use crate::{lazy::LazyBool, util::slice_as_uninit, Error}; use core::mem::{size_of, MaybeUninit}; diff --git a/src/solaris_illumos.rs b/src/solaris_illumos.rs index 501c610d..fbc23943 100644 --- a/src/solaris_illumos.rs +++ b/src/solaris_illumos.rs @@ -1,11 +1,3 @@ -// Copyright 2018 Developers of the Rand project. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - //! Implementation for the Solaris family //! //! `/dev/random` uses the Hash_DRBG with SHA512 algorithm from NIST SP 800-90A. diff --git a/src/solid.rs b/src/solid.rs index aeccc4e2..cae8caf6 100644 --- a/src/solid.rs +++ b/src/solid.rs @@ -1,11 +1,3 @@ -// Copyright 2021 Developers of the Rand project. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - //! Implementation for SOLID use crate::Error; use core::{mem::MaybeUninit, num::NonZeroU32}; diff --git a/src/use_file.rs b/src/use_file.rs index 273be65f..333325b5 100644 --- a/src/use_file.rs +++ b/src/use_file.rs @@ -1,11 +1,3 @@ -// Copyright 2023 Developers of the Rand project. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - //! Implementations that just need to read from a file use crate::{ util_libc::{open_readonly, sys_fill_exact}, diff --git a/src/util.rs b/src/util.rs index bd58c567..1c4e70ba 100644 --- a/src/util.rs +++ b/src/util.rs @@ -1,10 +1,3 @@ -// Copyright 2019 Developers of the Rand project. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. #![allow(dead_code)] use core::{mem::MaybeUninit, ptr}; diff --git a/src/util_libc.rs b/src/util_libc.rs index f64cc312..0b792c35 100644 --- a/src/util_libc.rs +++ b/src/util_libc.rs @@ -1,10 +1,3 @@ -// Copyright 2019 Developers of the Rand project. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. #![allow(dead_code)] use crate::Error; use core::{ diff --git a/src/vita.rs b/src/vita.rs index 4f19b9cb..20a98782 100644 --- a/src/vita.rs +++ b/src/vita.rs @@ -1,11 +1,3 @@ -// Copyright 2021 Developers of the Rand project. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - //! Implementation for PS Vita use crate::{util_libc::last_os_error, Error}; use core::mem::MaybeUninit; diff --git a/src/vxworks.rs b/src/vxworks.rs index 9b2090fb..7ca9d6bf 100644 --- a/src/vxworks.rs +++ b/src/vxworks.rs @@ -1,11 +1,3 @@ -// Copyright 2018 Developers of the Rand project. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - //! Implementation for VxWorks use crate::{util_libc::last_os_error, Error}; use core::{ diff --git a/src/wasi.rs b/src/wasi.rs index 9276ee74..d6c8a912 100644 --- a/src/wasi.rs +++ b/src/wasi.rs @@ -1,11 +1,3 @@ -// Copyright 2018 Developers of the Rand project. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - //! Implementation for WASI use crate::Error; use core::{ diff --git a/src/windows.rs b/src/windows.rs index 92d70429..2d1c4835 100644 --- a/src/windows.rs +++ b/src/windows.rs @@ -1,11 +1,4 @@ -// Copyright 2018 Developers of the Rand project. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - +//! Implementation for Windows use crate::Error; use core::{ffi::c_void, mem::MaybeUninit, num::NonZeroU32, ptr};