Skip to content

Commit b958a6c

Browse files
authored
chore(deps): bump getrandom from 0.2.15 to 0.3.1 (#529)
Bumps [getrandom](https://github.com/rust-random/getrandom) from 0.2.15 to 0.3.0. <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/rust-random/getrandom/blob/master/CHANGELOG.md">getrandom's changelog</a>.</em></p> <blockquote> <h2>[0.3.0] - 2025-01-25</h2> <h3>Breaking Changes</h3> <h4>Changed</h4> <ul> <li>Bump MSRV to 1.63 <a href="https://redirect.github.com/rust-random/getrandom/issues/542">#542</a></li> <li>Rename <code>getrandom</code> and <code>getrandom_uninit</code> functions to <code>fill</code> and <code>fill_uninit</code> respectively <a href="https://redirect.github.com/rust-random/getrandom/issues/532">#532</a></li> </ul> <h4>Removed</h4> <ul> <li><code>wasm32-wasi</code> target support (use <code>wasm32-wasip1</code> or <code>wasm32-wasip2</code> instead) <a href="https://redirect.github.com/rust-random/getrandom/issues/499">#499</a></li> <li><code>linux_disable_fallback</code>, <code>rdrand</code>, <code>js</code>, <code>test-in-browser</code>, and <code>custom</code> crate features in favor of configuration flags <a href="https://redirect.github.com/rust-random/getrandom/issues/504">#504</a></li> <li><code>register_custom_getrandom!</code> macro <a href="https://redirect.github.com/rust-random/getrandom/issues/504">#504</a></li> <li>Implementation of <code>From&lt;NonZeroU32&gt;</code> for <code>Error</code> and <code>Error::code</code> method <a href="https://redirect.github.com/rust-random/getrandom/issues/507">#507</a></li> <li>Internet Explorer 11 support <a href="https://redirect.github.com/rust-random/getrandom/issues/554">#554</a></li> <li>Target-specific assocciated <code>Error</code> constants <a href="https://redirect.github.com/rust-random/getrandom/issues/562">#562</a></li> </ul> <h3>Changed</h3> <ul> <li>Use <code>ProcessPrng</code> on Windows 10 and up, and use <code>RtlGenRandom</code> on older Windows versions <a href="https://redirect.github.com/rust-random/getrandom/issues/415">#415</a></li> <li>Do not use locale-specific <code>strerror_r</code> for retrieving error code descriptions <a href="https://redirect.github.com/rust-random/getrandom/issues/440">#440</a></li> <li>Avoid assuming <code>usize</code> is the native word size in the <code>rdrand</code> backend <a href="https://redirect.github.com/rust-random/getrandom/issues/442">#442</a></li> <li>Do not read from <code>errno</code> when <code>libc</code> did not indicate error on Solaris <a href="https://redirect.github.com/rust-random/getrandom/issues/448">#448</a></li> <li>Switch from <code>libpthread</code>'s mutex to <code>futex</code> on Linux and to <code>nanosleep</code>-based wait loop on other targets in the <code>use_file</code> backend <a href="https://redirect.github.com/rust-random/getrandom/issues/490">#490</a></li> <li>Do not retry on <code>EAGAIN</code> while polling <code>/dev/random</code> on Linux <a href="https://redirect.github.com/rust-random/getrandom/issues/522">#522</a></li> <li>Remove separate codepath for Node.js in the <code>wasm_js</code> backend (bumps minimum supported Node.js version to v19) <a href="https://redirect.github.com/rust-random/getrandom/issues/557">#557</a></li> <li>Use <code>js_namespace</code> in the <code>wasm_js</code> backend <a href="https://redirect.github.com/rust-random/getrandom/issues/559">#559</a></li> </ul> <h3>Added</h3> <ul> <li><code>wasm32-wasip1</code> and <code>wasm32-wasip2</code> support <a href="https://redirect.github.com/rust-random/getrandom/issues/499">#499</a></li> <li><code>getrandom_backend</code> configuration flag for selection of opt-in backends <a href="https://redirect.github.com/rust-random/getrandom/issues/504">#504</a></li> <li><code>Error::new_custom</code> method <a href="https://redirect.github.com/rust-random/getrandom/issues/507">#507</a></li> <li><code>rndr</code> opt-in backend <a href="https://redirect.github.com/rust-random/getrandom/issues/512">#512</a></li> <li>Automatic MemorySanitizer support <a href="https://redirect.github.com/rust-random/getrandom/issues/521">#521</a> <a href="https://redirect.github.com/rust-random/getrandom/issues/571">#571</a></li> <li><code>u32</code> and <code>u64</code> functions for generating random values of the respective type <a href="https://redirect.github.com/rust-random/getrandom/issues/544">#544</a></li> <li><code>wasm32v1-none</code> support in the <code>wasm_js</code> backend <a href="https://redirect.github.com/rust-random/getrandom/issues/560">#560</a></li> <li><code>wasm_js</code> crate feature which allows users to enable the <code>wasm_js</code> opt-in backend <a href="https://redirect.github.com/rust-random/getrandom/issues/574">#574</a></li> </ul> <h3>Fixed</h3> <ul> <li>NetBSD fallback code based on <code>KERN_ARND</code> <a href="https://redirect.github.com/rust-random/getrandom/issues/555">#555</a></li> </ul> <p><a href="https://redirect.github.com/rust-random/getrandom/issues/415">#415</a>: <a href="https://redirect.github.com/rust-random/getrandom/pull/415">rust-random/getrandom#415</a> <a href="https://redirect.github.com/rust-random/getrandom/issues/440">#440</a>: <a href="https://redirect.github.com/rust-random/getrandom/pull/440">rust-random/getrandom#440</a> <a href="https://redirect.github.com/rust-random/getrandom/issues/442">#442</a>: <a href="https://redirect.github.com/rust-random/getrandom/pull/442">rust-random/getrandom#442</a> <a href="https://redirect.github.com/rust-random/getrandom/issues/448">#448</a>: <a href="https://redirect.github.com/rust-random/getrandom/pull/448">rust-random/getrandom#448</a> <a href="https://redirect.github.com/rust-random/getrandom/issues/490">#490</a>: <a href="https://redirect.github.com/rust-random/getrandom/pull/490">rust-random/getrandom#490</a> <a href="https://redirect.github.com/rust-random/getrandom/issues/499">#499</a>: <a href="https://redirect.github.com/rust-random/getrandom/pull/499">rust-random/getrandom#499</a> <a href="https://redirect.github.com/rust-random/getrandom/issues/504">#504</a>: <a href="https://redirect.github.com/rust-random/getrandom/pull/504">rust-random/getrandom#504</a> <a href="https://redirect.github.com/rust-random/getrandom/issues/507">#507</a>: <a href="https://redirect.github.com/rust-random/getrandom/pull/507">rust-random/getrandom#507</a></p> <!-- raw HTML omitted --> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/rust-random/getrandom/commit/e38855c69882c2c1ff7438f9292512a0b91275fe"><code>e38855c</code></a> Fix release date for v0.3.0 (<a href="https://redirect.github.com/rust-random/getrandom/issues/587">#587</a>)</li> <li><a href="https://github.com/rust-random/getrandom/commit/d5683740ef9cd2d0ebfed73f2a629c0ebb47b5e8"><code>d568374</code></a> Release v0.3.0 (<a href="https://redirect.github.com/rust-random/getrandom/issues/563">#563</a>)</li> <li><a href="https://github.com/rust-random/getrandom/commit/5e62ce9fadb401539a08b329e4cbd98cc6393f60"><code>5e62ce9</code></a> rndr: minor tweaks (<a href="https://redirect.github.com/rust-random/getrandom/issues/586">#586</a>)</li> <li><a href="https://github.com/rust-random/getrandom/commit/3d0c01c35231b40f58b49f4455797c85c2e8c042"><code>3d0c01c</code></a> ci: disable broken Solaris and Emscripten cross jobs (<a href="https://redirect.github.com/rust-random/getrandom/issues/585">#585</a>)</li> <li><a href="https://github.com/rust-random/getrandom/commit/7cde98b9770eaefe1bcf6194f7ac55ce28d9b53e"><code>7cde98b</code></a> Add <code>wasm_js</code> feature flag (<a href="https://redirect.github.com/rust-random/getrandom/issues/574">#574</a>)</li> <li><a href="https://github.com/rust-random/getrandom/commit/6be40128a7c19bac658c6e85e808a6b5eadfd6b2"><code>6be4012</code></a> Web: use safe method to copy to <code>MaybeUninit</code> (<a href="https://redirect.github.com/rust-random/getrandom/issues/584">#584</a>)</li> <li><a href="https://github.com/rust-random/getrandom/commit/2648e60c5d27979f45043e379b1af7bee5e300a9"><code>2648e60</code></a> ESP-IDF: Enable unconditionally (<a href="https://redirect.github.com/rust-random/getrandom/issues/583">#583</a>)</li> <li><a href="https://github.com/rust-random/getrandom/commit/9f20e28392a32def691f692badf4fd31e6570d0f"><code>9f20e28</code></a> Remove unnecessary error branch of ProcessPrng (<a href="https://redirect.github.com/rust-random/getrandom/issues/579">#579</a>)</li> <li><a href="https://github.com/rust-random/getrandom/commit/9fb4a9a2481018e4ab58d597ecd167a609033149"><code>9fb4a9a</code></a> Add a link to PS Vita <code>getentropy</code> to the README (<a href="https://redirect.github.com/rust-random/getrandom/issues/577">#577</a>)</li> <li><a href="https://github.com/rust-random/getrandom/commit/a9edccf72ce3a54c877c1240ea548628ab15403c"><code>a9edccf</code></a> ci: disable NetBSD VM test job (<a href="https://redirect.github.com/rust-random/getrandom/issues/578">#578</a>)</li> <li>Additional commits viewable in <a href="https://github.com/rust-random/getrandom/compare/v0.2.15...v0.3.0">compare view</a></li> </ul> </details> <br /> [![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=getrandom&package-manager=cargo&previous-version=0.2.15&new-version=0.3.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details>
2 parents 5028875 + 1a79970 commit b958a6c

File tree

5 files changed

+47
-14
lines changed

5 files changed

+47
-14
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,5 @@ target/
1010
venv/
1111
__pycache__
1212
.pytest_cache
13-
.idea/**
13+
.idea/**
14+
.DS_Store

Cargo.lock

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

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ hmac = "0.12.1"
3939
sha1 = "0.10.6"
4040
sha2 = "0.10.8"
4141
chacha20poly1305 = "0.10.1"
42-
getrandom = "0.2.15"
42+
getrandom = "0.3.1"
4343
rust-argon2 = "2.1.0"
4444
scrypt = "0.11.0"
4545
aes-gcm = "0.10.3"

src/crypto/cryptography.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ pub fn argon_derive_key(password_bytes: &[u8], salt: &[u8]) -> color_eyre::Resul
2626

2727
pub fn gen_salt() -> color_eyre::Result<[u8; ARGON2ID_SALT_LENGTH]> {
2828
let mut salt: [u8; ARGON2ID_SALT_LENGTH] = [0; ARGON2ID_SALT_LENGTH];
29-
getrandom::getrandom(&mut salt).map_err(ErrReport::from)?;
29+
getrandom::fill(&mut salt).map_err(|e| eyre!(e))?;
3030
Ok(salt)
3131
}
3232

@@ -41,7 +41,7 @@ pub fn encrypt_string_with_key(
4141
let mut nonce_bytes: [u8; XCHACHA20_POLY1305_NONCE_LENGTH] =
4242
[0; XCHACHA20_POLY1305_NONCE_LENGTH];
4343

44-
getrandom::getrandom(&mut nonce_bytes).map_err(ErrReport::from)?;
44+
getrandom::fill(&mut nonce_bytes).map_err(|e| eyre!(e))?;
4545

4646
let nonce = XNonce::from_slice(&nonce_bytes);
4747
let cipher_text = aead

src/interface/app.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -265,10 +265,12 @@ impl<'a> App<'a> {
265265
)
266266
.highlight_symbol("-> ");
267267

268-
let selected_element = match self.table.state.selected() {
269-
Some(index) => self.database.get_element(index),
270-
None => None,
271-
};
268+
let selected_element = self
269+
.table
270+
.state
271+
.selected()
272+
.and_then(|i| self.database.get_element(i));
273+
272274
let mut text = if let Some(element) = selected_element {
273275
format!(
274276
"

0 commit comments

Comments
 (0)