From ba01417bbc27aaf756e7c4db4321b385dcc3e159 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D1=80=D1=82=D1=91=D0=BC=20=D0=9F=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=BE=D0=B2=20=5BArtyom=20Pavlov=5D?= Date: Sun, 7 Jan 2024 19:27:30 +0300 Subject: [PATCH 1/6] Release v0.2.12 --- CHANGELOG.md | 16 ++++++++++++++-- Cargo.toml | 2 +- LICENSE-MIT | 2 +- src/3ds.rs | 2 +- src/apple-other.rs | 2 +- src/bsd_arandom.rs | 2 +- src/custom.rs | 2 +- src/dragonfly.rs | 2 +- src/error.rs | 2 +- src/error_impls.rs | 2 +- src/espidf.rs | 2 +- src/fuchsia.rs | 2 +- src/hurd.rs | 2 +- src/js.rs | 2 +- src/lib.rs | 4 ++-- src/linux_android.rs | 2 +- src/macos.rs | 2 +- src/openbsd.rs | 2 +- src/rdrand.rs | 2 +- src/solaris_illumos.rs | 2 +- src/solid.rs | 2 +- src/use_file.rs | 2 +- src/util.rs | 2 +- src/util_libc.rs | 2 +- src/vita.rs | 2 +- src/vxworks.rs | 2 +- src/wasi.rs | 2 +- src/windows.rs | 2 +- 28 files changed, 42 insertions(+), 30 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index eaa379dc3..cf8815a8f 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-07 +### 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 ba2c6b7e7..ea57331de 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 d93b5baf3..6e4737c80 100644 --- a/LICENSE-MIT +++ b/LICENSE-MIT @@ -1,4 +1,4 @@ -Copyright 2018 Developers of the Rand project +Copyright 2018-2024 Developers of the Rand project Copyright (c) 2014 The Rust Project Developers Permission is hereby granted, free of charge, to any diff --git a/src/3ds.rs b/src/3ds.rs index 87a32a1e8..f777615b0 100644 --- a/src/3ds.rs +++ b/src/3ds.rs @@ -1,4 +1,4 @@ -// Copyright 2021 Developers of the Rand project. +// Copyright 2021-2024 Developers of the Rand project. // // Licensed under the Apache License, Version 2.0 or the MIT license diff --git a/src/apple-other.rs b/src/apple-other.rs index 9eeb513c4..6cbd209f2 100644 --- a/src/apple-other.rs +++ b/src/apple-other.rs @@ -1,4 +1,4 @@ -// Copyright 2023 Developers of the Rand project. +// Copyright 2023-2024 Developers of the Rand project. // // Licensed under the Apache License, Version 2.0 or the MIT license diff --git a/src/bsd_arandom.rs b/src/bsd_arandom.rs index 5314c48f1..147e205b7 100644 --- a/src/bsd_arandom.rs +++ b/src/bsd_arandom.rs @@ -1,4 +1,4 @@ -// Copyright 2018 Developers of the Rand project. +// Copyright 2018-2024 Developers of the Rand project. // // Licensed under the Apache License, Version 2.0 or the MIT license diff --git a/src/custom.rs b/src/custom.rs index 66e4256fa..46a2c73fe 100644 --- a/src/custom.rs +++ b/src/custom.rs @@ -1,4 +1,4 @@ -// Copyright 2018 Developers of the Rand project. +// Copyright 2018-2024 Developers of the Rand project. // // Licensed under the Apache License, Version 2.0 or the MIT license diff --git a/src/dragonfly.rs b/src/dragonfly.rs index d3ef00aa9..ee64a5458 100644 --- a/src/dragonfly.rs +++ b/src/dragonfly.rs @@ -1,4 +1,4 @@ -// Copyright 2021 Developers of the Rand project. +// Copyright 2021-2024 Developers of the Rand project. // // Licensed under the Apache License, Version 2.0 or the MIT license diff --git a/src/error.rs b/src/error.rs index e29d8a7e5..10544dfb1 100644 --- a/src/error.rs +++ b/src/error.rs @@ -1,4 +1,4 @@ -// Copyright 2018 Developers of the Rand project. +// Copyright 2018-2024 Developers of the Rand project. // // Licensed under the Apache License, Version 2.0 or the MIT license diff --git a/src/error_impls.rs b/src/error_impls.rs index 61f46d227..d23d1b608 100644 --- a/src/error_impls.rs +++ b/src/error_impls.rs @@ -1,4 +1,4 @@ -// Copyright 2018 Developers of the Rand project. +// Copyright 2018-2024 Developers of the Rand project. // // Licensed under the Apache License, Version 2.0 or the MIT license diff --git a/src/espidf.rs b/src/espidf.rs index d074dc4ce..b0a700efa 100644 --- a/src/espidf.rs +++ b/src/espidf.rs @@ -1,4 +1,4 @@ -// Copyright 2021 Developers of the Rand project. +// Copyright 2021-2024 Developers of the Rand project. // // Licensed under the Apache License, Version 2.0 or the MIT license diff --git a/src/fuchsia.rs b/src/fuchsia.rs index 5a135f343..22df5ca21 100644 --- a/src/fuchsia.rs +++ b/src/fuchsia.rs @@ -1,4 +1,4 @@ -// Copyright 2018 Developers of the Rand project. +// Copyright 2018-2024 Developers of the Rand project. // // Licensed under the Apache License, Version 2.0 or the MIT license diff --git a/src/hurd.rs b/src/hurd.rs index 842b9bc48..02fe1867f 100644 --- a/src/hurd.rs +++ b/src/hurd.rs @@ -1,4 +1,4 @@ -// Copyright 2021 Developers of the Rand project. +// Copyright 2021-2024 Developers of the Rand project. // // Licensed under the Apache License, Version 2.0 or the MIT license diff --git a/src/js.rs b/src/js.rs index d03128226..a58bf591a 100644 --- a/src/js.rs +++ b/src/js.rs @@ -1,4 +1,4 @@ -// Copyright 2018 Developers of the Rand project. +// Copyright 2018-2024 Developers of the Rand project. // // Licensed under the Apache License, Version 2.0 or the MIT license diff --git a/src/lib.rs b/src/lib.rs index b8bd65b51..6db3bb572 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,4 +1,4 @@ -// Copyright 2019 Developers of the Rand project. +// Copyright 2019-2024 Developers of the Rand project. // // Licensed under the Apache License, Version 2.0 or the MIT license @@ -194,7 +194,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 bfeb793e2..8eba550ce 100644 --- a/src/linux_android.rs +++ b/src/linux_android.rs @@ -1,4 +1,4 @@ -// Copyright 2018 Developers of the Rand project. +// Copyright 2018-2024 Developers of the Rand project. // // Licensed under the Apache License, Version 2.0 or the MIT license diff --git a/src/macos.rs b/src/macos.rs index 617732472..a6086e67f 100644 --- a/src/macos.rs +++ b/src/macos.rs @@ -1,4 +1,4 @@ -// Copyright 2023 Developers of the Rand project. +// Copyright 2023-2024 Developers of the Rand project. // // Licensed under the Apache License, Version 2.0 or the MIT license diff --git a/src/openbsd.rs b/src/openbsd.rs index 7a76f61d5..9955ae6be 100644 --- a/src/openbsd.rs +++ b/src/openbsd.rs @@ -1,4 +1,4 @@ -// Copyright 2018 Developers of the Rand project. +// Copyright 2018-2024 Developers of the Rand project. // // Licensed under the Apache License, Version 2.0 or the MIT license diff --git a/src/rdrand.rs b/src/rdrand.rs index 59d5249aa..a72f4ea67 100644 --- a/src/rdrand.rs +++ b/src/rdrand.rs @@ -1,4 +1,4 @@ -// Copyright 2018 Developers of the Rand project. +// Copyright 2018-2024 Developers of the Rand project. // // Licensed under the Apache License, Version 2.0 or the MIT license diff --git a/src/solaris_illumos.rs b/src/solaris_illumos.rs index 501c610d7..cb4e5a37d 100644 --- a/src/solaris_illumos.rs +++ b/src/solaris_illumos.rs @@ -1,4 +1,4 @@ -// Copyright 2018 Developers of the Rand project. +// Copyright 2018-2024 Developers of the Rand project. // // Licensed under the Apache License, Version 2.0 or the MIT license diff --git a/src/solid.rs b/src/solid.rs index aeccc4e2b..2e525c383 100644 --- a/src/solid.rs +++ b/src/solid.rs @@ -1,4 +1,4 @@ -// Copyright 2021 Developers of the Rand project. +// Copyright 2021-2024 Developers of the Rand project. // // Licensed under the Apache License, Version 2.0 or the MIT license diff --git a/src/use_file.rs b/src/use_file.rs index 273be65fb..60779743b 100644 --- a/src/use_file.rs +++ b/src/use_file.rs @@ -1,4 +1,4 @@ -// Copyright 2023 Developers of the Rand project. +// Copyright 2023-2024 Developers of the Rand project. // // Licensed under the Apache License, Version 2.0 or the MIT license diff --git a/src/util.rs b/src/util.rs index bd58c5674..354060d20 100644 --- a/src/util.rs +++ b/src/util.rs @@ -1,4 +1,4 @@ -// Copyright 2019 Developers of the Rand project. +// Copyright 2019-2024 Developers of the Rand project. // // Licensed under the Apache License, Version 2.0 or the MIT license diff --git a/src/util_libc.rs b/src/util_libc.rs index f64cc3120..f25ede00b 100644 --- a/src/util_libc.rs +++ b/src/util_libc.rs @@ -1,4 +1,4 @@ -// Copyright 2019 Developers of the Rand project. +// Copyright 2019-2024 Developers of the Rand project. // // Licensed under the Apache License, Version 2.0 or the MIT license diff --git a/src/vita.rs b/src/vita.rs index 4f19b9cb0..3aeb5d888 100644 --- a/src/vita.rs +++ b/src/vita.rs @@ -1,4 +1,4 @@ -// Copyright 2021 Developers of the Rand project. +// Copyright 2021-2024 Developers of the Rand project. // // Licensed under the Apache License, Version 2.0 or the MIT license diff --git a/src/vxworks.rs b/src/vxworks.rs index 9b2090fb0..d3e08296a 100644 --- a/src/vxworks.rs +++ b/src/vxworks.rs @@ -1,4 +1,4 @@ -// Copyright 2018 Developers of the Rand project. +// Copyright 2018-2024 Developers of the Rand project. // // Licensed under the Apache License, Version 2.0 or the MIT license diff --git a/src/wasi.rs b/src/wasi.rs index 9276ee74f..e98d210fa 100644 --- a/src/wasi.rs +++ b/src/wasi.rs @@ -1,4 +1,4 @@ -// Copyright 2018 Developers of the Rand project. +// Copyright 2018-2024 Developers of the Rand project. // // Licensed under the Apache License, Version 2.0 or the MIT license diff --git a/src/windows.rs b/src/windows.rs index 92d70429e..a2d9e8ba6 100644 --- a/src/windows.rs +++ b/src/windows.rs @@ -1,4 +1,4 @@ -// Copyright 2018 Developers of the Rand project. +// Copyright 2018-2024 Developers of the Rand project. // // Licensed under the Apache License, Version 2.0 or the MIT license From 268445e6277ccec6c4dae8e05deefad269a87772 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D1=80=D1=82=D1=91=D0=BC=20=D0=9F=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=BE=D0=B2=20=5BArtyom=20Pavlov=5D?= Date: Sun, 7 Jan 2024 21:46:28 +0300 Subject: [PATCH 2/6] Remove copyright notices from source files --- 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 | 8 -------- 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 +-------- 26 files changed, 4 insertions(+), 194 deletions(-) diff --git a/src/3ds.rs b/src/3ds.rs index f777615b0..a5aae77d1 100644 --- a/src/3ds.rs +++ b/src/3ds.rs @@ -1,11 +1,3 @@ -// Copyright 2021-2024 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 6cbd209f2..167d8cf0f 100644 --- a/src/apple-other.rs +++ b/src/apple-other.rs @@ -1,11 +1,3 @@ -// Copyright 2023-2024 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 147e205b7..6e133d895 100644 --- a/src/bsd_arandom.rs +++ b/src/bsd_arandom.rs @@ -1,11 +1,3 @@ -// Copyright 2018-2024 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 46a2c73fe..8dc9cb796 100644 --- a/src/custom.rs +++ b/src/custom.rs @@ -1,11 +1,3 @@ -// Copyright 2018-2024 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 ee64a5458..ac4794cdd 100644 --- a/src/dragonfly.rs +++ b/src/dragonfly.rs @@ -1,11 +1,3 @@ -// Copyright 2021-2024 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 10544dfb1..13c81c7af 100644 --- a/src/error.rs +++ b/src/error.rs @@ -1,10 +1,3 @@ -// Copyright 2018-2024 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 d23d1b608..a7bffb897 100644 --- a/src/error_impls.rs +++ b/src/error_impls.rs @@ -1,10 +1,3 @@ -// Copyright 2018-2024 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 b0a700efa..7da5ca88e 100644 --- a/src/espidf.rs +++ b/src/espidf.rs @@ -1,11 +1,3 @@ -// Copyright 2021-2024 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 22df5ca21..11970685c 100644 --- a/src/fuchsia.rs +++ b/src/fuchsia.rs @@ -1,11 +1,3 @@ -// Copyright 2018-2024 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 21649d1f6..c4f619417 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 02fe1867f..472a7d86b 100644 --- a/src/hurd.rs +++ b/src/hurd.rs @@ -1,11 +1,3 @@ -// Copyright 2021-2024 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 a58bf591a..e5428f50d 100644 --- a/src/js.rs +++ b/src/js.rs @@ -1,10 +1,4 @@ -// Copyright 2018-2024 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 6db3bb572..e80ec6f50 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,11 +1,3 @@ -// Copyright 2019-2024 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 diff --git a/src/linux_android.rs b/src/linux_android.rs index 8eba550ce..2517159e2 100644 --- a/src/linux_android.rs +++ b/src/linux_android.rs @@ -1,11 +1,3 @@ -// Copyright 2018-2024 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 a6086e67f..44af76b03 100644 --- a/src/macos.rs +++ b/src/macos.rs @@ -1,11 +1,3 @@ -// Copyright 2023-2024 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 9955ae6be..f4d64daf6 100644 --- a/src/openbsd.rs +++ b/src/openbsd.rs @@ -1,11 +1,3 @@ -// Copyright 2018-2024 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 a72f4ea67..f527c8c64 100644 --- a/src/rdrand.rs +++ b/src/rdrand.rs @@ -1,10 +1,4 @@ -// Copyright 2018-2024 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 cb4e5a37d..fbc239433 100644 --- a/src/solaris_illumos.rs +++ b/src/solaris_illumos.rs @@ -1,11 +1,3 @@ -// Copyright 2018-2024 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 2e525c383..cae8caf66 100644 --- a/src/solid.rs +++ b/src/solid.rs @@ -1,11 +1,3 @@ -// Copyright 2021-2024 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 60779743b..333325b5a 100644 --- a/src/use_file.rs +++ b/src/use_file.rs @@ -1,11 +1,3 @@ -// Copyright 2023-2024 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 354060d20..1c4e70ba4 100644 --- a/src/util.rs +++ b/src/util.rs @@ -1,10 +1,3 @@ -// Copyright 2019-2024 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 f25ede00b..0b792c35f 100644 --- a/src/util_libc.rs +++ b/src/util_libc.rs @@ -1,10 +1,3 @@ -// Copyright 2019-2024 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 3aeb5d888..20a987824 100644 --- a/src/vita.rs +++ b/src/vita.rs @@ -1,11 +1,3 @@ -// Copyright 2021-2024 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 d3e08296a..7ca9d6bfd 100644 --- a/src/vxworks.rs +++ b/src/vxworks.rs @@ -1,11 +1,3 @@ -// Copyright 2018-2024 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 e98d210fa..d6c8a912c 100644 --- a/src/wasi.rs +++ b/src/wasi.rs @@ -1,11 +1,3 @@ -// Copyright 2018-2024 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 a2d9e8ba6..2d1c48351 100644 --- a/src/windows.rs +++ b/src/windows.rs @@ -1,11 +1,4 @@ -// Copyright 2018-2024 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}; From 62f40d14830f644c74936aca535ac8067b26bccf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D1=80=D1=82=D1=91=D0=BC=20=D0=9F=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=BE=D0=B2=20=5BArtyom=20Pavlov=5D?= Date: Sun, 7 Jan 2024 21:55:18 +0300 Subject: [PATCH 3/6] Add license and contribution sections to README and lib.rs --- README.md | 15 ++++++++++++--- src/lib.rs | 18 ++++++++++++++++++ 2 files changed, 30 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index f1512260e..b4b5a2b56 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/lib.rs b/src/lib.rs index e80ec6f50..42e09de75 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -150,6 +150,21 @@ //! on every call to `getrandom`, hence after the first successful call one //! can be reasonably confident that no errors will occur. //! +//! # License +//! +//! The `getrandom` library is distributed under either of +//! +//! * [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. +//! //! [1]: http://man7.org/linux/man-pages/man2/getrandom.2.html //! [2]: http://man7.org/linux/man-pages/man4/urandom.4.html //! [3]: https://www.unix.com/man-page/mojave/2/getentropy/ @@ -182,6 +197,9 @@ //! [CommonJS modules]: https://nodejs.org/api/modules.html //! [ES modules]: https://nodejs.org/api/esm.html //! [`sys_read_entropy`]: https://github.com/hermit-os/kernel/blob/315f58ff5efc81d9bf0618af85a59963ff55f8b1/src/syscalls/entropy.rs#L47-L55 +//! +//! [LICENSE-APACHE]: https://github.com/rust-random/getrandom/blob/master/LICENSE-APACHE +//! [LICENSE-MIT]: https://github.com/rust-random/getrandom/blob/master/LICENSE-MIT #![doc( html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk.png", From 38d9c4c92e7cb02d3692b479d7d7adb9ddb47514 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D1=80=D1=82=D1=91=D0=BC=20=D0=9F=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=BE=D0=B2=20=5BArtyom=20Pavlov=5D?= Date: Sun, 7 Jan 2024 22:23:05 +0300 Subject: [PATCH 4/6] Tweak copyright notice --- LICENSE-MIT | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE-MIT b/LICENSE-MIT index 6e4737c80..8ca28a1a0 100644 --- a/LICENSE-MIT +++ b/LICENSE-MIT @@ -1,4 +1,4 @@ -Copyright 2018-2024 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 From f9d09b4cf6465983dab39a2d74363674c2d5c292 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D1=80=D1=82=D1=91=D0=BC=20=D0=9F=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=BE=D0=B2=20=5BArtyom=20Pavlov=5D?= Date: Tue, 9 Jan 2024 07:46:41 +0300 Subject: [PATCH 5/6] Remove licensing info from lib.rs --- src/lib.rs | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 42e09de75..e80ec6f50 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -150,21 +150,6 @@ //! on every call to `getrandom`, hence after the first successful call one //! can be reasonably confident that no errors will occur. //! -//! # License -//! -//! The `getrandom` library is distributed under either of -//! -//! * [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. -//! //! [1]: http://man7.org/linux/man-pages/man2/getrandom.2.html //! [2]: http://man7.org/linux/man-pages/man4/urandom.4.html //! [3]: https://www.unix.com/man-page/mojave/2/getentropy/ @@ -197,9 +182,6 @@ //! [CommonJS modules]: https://nodejs.org/api/modules.html //! [ES modules]: https://nodejs.org/api/esm.html //! [`sys_read_entropy`]: https://github.com/hermit-os/kernel/blob/315f58ff5efc81d9bf0618af85a59963ff55f8b1/src/syscalls/entropy.rs#L47-L55 -//! -//! [LICENSE-APACHE]: https://github.com/rust-random/getrandom/blob/master/LICENSE-APACHE -//! [LICENSE-MIT]: https://github.com/rust-random/getrandom/blob/master/LICENSE-MIT #![doc( html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk.png", From 17fd8bb6f838a0e06c40a05cc1f0a11700cef22f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D1=80=D1=82=D1=91=D0=BC=20=D0=9F=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=BE=D0=B2=20=5BArtyom=20Pavlov=5D?= Date: Tue, 9 Jan 2024 07:47:04 +0300 Subject: [PATCH 6/6] Update release date --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cf8815a8f..a283d3807 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ 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). -## [0.2.12] - 2024-01-07 +## [0.2.12] - 2024-01-09 ### Fixed - Custom backend for targets without atomics [#385]