Skip to content

Commit 5d623ad

Browse files
authored
Import zeroize and zeroize_derive (#647)
Moves the source code for the `zeroize` and `zeroize_derive` crates into this repository. History is not preserved. Sources are imported with some minor modifications to URLs and documentation as of this commit: iqlusioninc/crates@880f456 Author: Tony Arcieri (iqlusion) <[email protected]> Date: Thu Nov 4 18:10:33 2021 -0700 Remove `harp` crate (#905)
1 parent f181689 commit 5d623ad

17 files changed

+2128
-0
lines changed

.github/workflows/zeroize.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: zeroize
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- "zeroize/**"
7+
- "Cargo.*"
8+
push:
9+
branches: main
10+
11+
defaults:
12+
run:
13+
working-directory: zeroize
14+
15+
env:
16+
CARGO_INCREMENTAL: 0
17+
RUSTFLAGS: "-Dwarnings"
18+
19+
jobs:
20+
build:
21+
runs-on: ubuntu-latest
22+
strategy:
23+
matrix:
24+
rust:
25+
- 1.51.0 # MSRV
26+
- stable
27+
target:
28+
- armv7a-none-eabi
29+
- thumbv7em-none-eabi
30+
- wasm32-unknown-unknown
31+
steps:
32+
- uses: actions/checkout@v1
33+
- uses: actions-rs/toolchain@v1
34+
with:
35+
toolchain: ${{ matrix.rust }}
36+
target: ${{ matrix.target }}
37+
override: true
38+
profile: minimal
39+
- run: cargo build --no-default-features --release --target ${{ matrix.target }}
40+
41+
test:
42+
strategy:
43+
matrix:
44+
platform:
45+
- ubuntu-latest
46+
- macos-latest
47+
- windows-latest
48+
toolchain:
49+
- 1.51.0 # MSRV
50+
- stable
51+
runs-on: ${{ matrix.platform }}
52+
steps:
53+
- uses: actions/checkout@v2
54+
- uses: actions-rs/toolchain@v1
55+
with:
56+
toolchain: ${{ matrix.toolchain }}
57+
override: true
58+
profile: minimal
59+
- run: cargo test --release
60+
- run: cargo test --release --all-features

Cargo.lock

Lines changed: 29 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,6 @@ members = [
99
"hex-literal",
1010
"opaque-debug",
1111
"wycheproof2blb",
12+
"zeroize",
13+
"zeroize/derive"
1214
]

zeroize/CHANGELOG.md

Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
# Changelog
2+
All notable changes to this project will be documented in this file.
3+
4+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6+
7+
## 1.4.2 (2021-09-21)
8+
### Added
9+
- Derive `Default` on `Zeroizing`
10+
11+
## 1.4.1 (2021-07-20)
12+
### Added
13+
- Implement Zeroize for `[MaybeUninit<Z>]`
14+
15+
## 1.4.0 (2021-07-18)
16+
NOTE: This release includes an MSRV bump to Rust 1.51. Please use `zeroize = "1.3.0"`
17+
if you would like to support older Rust versions.
18+
19+
### Added
20+
- Use const generics to impl `Zeroize` for `[Z; N]`; MSRV 1.51
21+
- `Zeroizing::clone_from` now zeroizes the destination before cloning
22+
23+
## 1.3.0 (2021-04-19)
24+
### Added
25+
- impl `Zeroize` for `Box<[Z]>`
26+
- Clear residual space within `Option
27+
28+
### Changed
29+
- Ensure `Option` is `None` when zeroized
30+
- Bump MSRV to 1.47
31+
32+
## 1.2.0 (2020-12-09)
33+
### Added
34+
- `Zeroize` support for x86(_64) SIMD registers
35+
36+
### Changed
37+
- Simplify `String::zeroize`
38+
- MSRV 1.44+
39+
40+
## 1.1.1 (2020-09-15)
41+
- Add `doc_cfg`
42+
- zeroize entire capacity of `String`
43+
- zeroize entire capacity of `Vec`
44+
45+
## 1.1.0 (2019-12-02)
46+
- Add `TryZeroize` trait
47+
- Add `From<Z: Zeroize>` impl for `Zeroizing<Z>`
48+
- Remove `bytes-preview` feature
49+
50+
## 1.0.0 (2019-10-13)
51+
- Initial 1.0 release 🎉
52+
- zeroize_derive: Remove legacy `no_drop` attribute support
53+
- Rename `bytes` feature to `bytes-preview`
54+
- Further relax `Zeroize` trait bounds for `Vec`
55+
- Derive `Clone`, `Debug`, and `Eq` for `Zeroizing`
56+
57+
## 1.0.0-pre (2019-09-30)
58+
- Loosen `Vec` trait bounds for `Zeroize`
59+
60+
## 0.10.1 (2019-09-03)
61+
- (Optionally) Impl `Zeroize` for `Bytes` and `BytesMut`
62+
63+
## 0.10.0 (2019-08-19)
64+
Barring unforeseen circumstances, this release aims to be the last `0.x`
65+
release prior to a `zeroize` 1.0 release.
66+
67+
- Disable `zeroize_derive` Cargo feature by default
68+
- Remove `std` feature in favor of `alloc`; MSRV 1.36+
69+
- Deprecate `#[zeroize(no_drop)]` attribute
70+
- Use 1.0 `proc-macro2`, `quote`, and `syn` crates
71+
72+
## 0.9.3 (2019-07-27)
73+
- Improved attribute parser; fixes nightly build
74+
75+
## 0.9.2 (2019-06-28)
76+
- README.md: add Gitter badges; update image links
77+
78+
## 0.9.1 (2019-06-04)
79+
- Impl `Zeroize` for `Option<Z: Zeroize>`
80+
81+
## 0.9.0 (2019-06-04)
82+
**NOTICE**: This release changes the default behavior of `derive(Zeroize)`
83+
to no longer derive a `Drop` impl. If you wish to derive `Drop`, you must
84+
now explicitly add a `#[zeroize(drop)]` attribute on the type for which you
85+
are deriving `Zeroize`.
86+
87+
- Remove CPU fences
88+
- Remove scary language about undefined behavior
89+
- Bound blanket array impls on `Zeroize` instead of `DefaultIsZeroes`
90+
- Require `zeroize(drop)` or `zeroize(no_drop)` attributes when deriving
91+
`Zeroize` .
92+
- Support stablized 'alloc' crate
93+
94+
## 0.8.0 (2019-05-20)
95+
- Impl `Drop` by default when deriving `Zeroize`
96+
97+
## 0.7.0 (2019-05-19)
98+
- Use synstructure for custom derive
99+
- Add explicit array impls for `DefaultIsZeroes`
100+
- Remove `nightly` feature
101+
- Add `Zeroizing<Z>` to zeroize values on drop
102+
103+
## 0.6.0 (2019-03-23)
104+
- Add ZeroizeOnDrop marker trait + custom derive
105+
- Custom derive support for `Zeroize`
106+
- Rename `ZeroizeWithDefault` to `DefaultIsZeroes`
107+
108+
## 0.5.2 (2018-12-25)
109+
- Add `debug_assert!` to ensure string interiors are zeroized
110+
111+
## 0.5.1 (2018-12-24)
112+
- Avoid re-exporting the whole prelude
113+
114+
## 0.5.0 (2018-12-24)
115+
This release is a rewrite which replaces FFI bindings to OS-specific APIs with
116+
a pure Rust solution.
117+
118+
- Use `core::sync::atomic` fences
119+
- Test wasm target
120+
- Rewrite using `core::ptr::write_volatile`
121+
122+
## 0.4.2 (2018-10-12)
123+
- Fix ldd scraper for older glibc versions
124+
125+
## 0.4.1 (2018-10-12)
126+
- Support musl-libc
127+
128+
## 0.4.0 (2018-10-12)
129+
- Impl `Zeroize` trait on concrete types
130+
131+
## 0.3.0 (2018-10-11)
132+
- Replace `secure_zero_memory` with `Zeroize`
133+
134+
## 0.2.0 (2018-10-11)
135+
- Add `Zeroize` trait
136+
137+
## 0.1.2 (2018-10-03)
138+
- README.md: Fix intrinsic links
139+
140+
## 0.1.1 (2018-10-03)
141+
- Documentation improvements
142+
143+
## 0.1.0 (2018-10-03)
144+
- Initial release

zeroize/Cargo.toml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
[package]
2+
name = "zeroize"
3+
description = """
4+
Securely clear secrets from memory with a simple trait built on
5+
stable Rust primitives which guarantee memory is zeroed using an
6+
operation will not be 'optimized away' by the compiler.
7+
Uses a portable pure Rust implementation that works everywhere,
8+
even WASM!
9+
"""
10+
version = "1.4.2" # Also update html_root_url in lib.rs when bumping this
11+
authors = ["The RustCrypto Project Developers"]
12+
license = "Apache-2.0 OR MIT"
13+
repository = "https://github.com/RustCrypto/utils/tree/master/zeroize"
14+
readme = "README.md"
15+
categories = ["cryptography", "memory-management", "no-std", "os"]
16+
keywords = ["memory", "memset", "secure", "volatile", "zero"]
17+
edition = "2018"
18+
19+
[dependencies]
20+
zeroize_derive = { version = "1", path = "derive", optional = true }
21+
22+
[features]
23+
default = ["alloc"]
24+
alloc = []
25+
26+
[package.metadata.docs.rs]
27+
all-features = true
28+
rustdoc-args = ["--cfg", "docsrs"]

0 commit comments

Comments
 (0)