Skip to content

Commit

Permalink
(async-)signature: MSRV 1.60
Browse files Browse the repository at this point in the history
To simplify the workspace, which contains weak/namespaced features, this
bumps both `async-signature` and `signature` to MSRV 1.60.

So as for the bump to have some justification, it adds weak feature
activation for `rand_core?/std`, and uses this impl to write a
`From<rand_core::Error>` conversion which can preserve the original
error as the boxed source.
  • Loading branch information
tarcieri committed Nov 12, 2023
1 parent 8b24dd9 commit 2e0e947
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 205 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/async-signature.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
strategy:
matrix:
rust:
- 1.56.0 # MSRV
- 1.60.0 # MSRV
- stable
steps:
- uses: actions/checkout@v4
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/signature.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
strategy:
matrix:
rust:
- 1.56.0 # MSRV
- 1.60.0 # MSRV
- stable
target:
- thumbv7em-none-eabi
Expand Down Expand Up @@ -51,7 +51,7 @@ jobs:
strategy:
matrix:
rust:
- 1.56.0 # MSRV
- 1.60.0 # MSRV
- stable
steps:
- uses: actions/checkout@v4
Expand All @@ -69,7 +69,7 @@ jobs:
strategy:
matrix:
rust:
- 1.56.0 # MSRV
- 1.60.0 # MSRV
- stable
steps:
- uses: actions/checkout@v4
Expand Down
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ members = [
"elliptic-curve",
"kem",
"password-hash",
"signature",
"signature/async",
]
# TODO: re-add to `members` when MSRV has been bumped to 1.60+
exclude = [
"signature",
"signature/async",
"universal-hash",
]

Expand Down
189 changes: 0 additions & 189 deletions signature/Cargo.lock

This file was deleted.

6 changes: 3 additions & 3 deletions signature/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "signature"
description = "Traits for cryptographic signature algorithms (e.g. ECDSA, Ed25519)"
version = "2.1.0"
version = "2.2.0-pre"
authors = ["RustCrypto Developers"]
license = "Apache-2.0 OR MIT"
documentation = "https://docs.rs/signature"
Expand All @@ -10,7 +10,7 @@ readme = "README.md"
keywords = ["crypto", "ecdsa", "ed25519", "signature", "signing"]
categories = ["cryptography", "no-std"]
edition = "2021"
rust-version = "1.56"
rust-version = "1.60"

[dependencies]
derive = { package = "signature_derive", version = "2", optional = true, path = "derive" }
Expand All @@ -23,7 +23,7 @@ sha2 = { version = "0.10", default-features = false }

[features]
alloc = []
std = ["alloc"]
std = ["alloc", "rand_core?/std"]

[package.metadata.docs.rs]
all-features = true
Expand Down
4 changes: 2 additions & 2 deletions signature/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ the [RustCrypto] organization, as well as [`ed25519-dalek`].

## Minimum Supported Rust Version

Rust **1.56** or higher.
Rust **1.65** or higher.

Minimum supported Rust version can be changed in the future, but it will be
done with a minor version bump.
Expand Down Expand Up @@ -56,7 +56,7 @@ dual licensed as above, without any additional terms or conditions.
[build-image]: https://github.com/RustCrypto/traits/actions/workflows/signature.yml/badge.svg
[build-link]: https://github.com/RustCrypto/traits/actions/workflows/signature.yml
[license-image]: https://img.shields.io/badge/license-Apache2.0/MIT-blue.svg
[rustc-image]: https://img.shields.io/badge/rustc-1.56+-blue.svg
[rustc-image]: https://img.shields.io/badge/rustc-1.65+-blue.svg
[chat-image]: https://img.shields.io/badge/zulip-join_chat-blue.svg
[chat-link]: https://rustcrypto.zulipchat.com/#narrow/stream/260048-signatures

Expand Down
6 changes: 3 additions & 3 deletions signature/async/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "async-signature"
description = "Traits for cryptographic signature algorithms (e.g. ECDSA, Ed25519)"
version = "0.3.0"
version = "0.4.0-pre"
authors = ["RustCrypto Developers"]
license = "Apache-2.0 OR MIT"
documentation = "https://docs.rs/async-signature"
Expand All @@ -10,11 +10,11 @@ readme = "README.md"
keywords = ["crypto", "ecdsa", "ed25519", "signature", "signing"]
categories = ["cryptography", "no-std"]
edition = "2021"
rust-version = "1.56"
rust-version = "1.60"

[dependencies]
async-trait = "0.1.9"
signature = { version = "2.0, <2.2", path = ".." }
signature = { version = "=2.2.0-pre", path = ".." }

[features]
digest = ["signature/digest"]
Expand Down
4 changes: 2 additions & 2 deletions signature/async/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

## Minimum Supported Rust Version

Rust **1.56** or higher.
Rust **1.60** or higher.

Minimum supported Rust version can be changed in the future, but it will be
done with a minor version bump.
Expand All @@ -36,7 +36,7 @@ dual licensed as above, without any additional terms or conditions.
[docs-image]: https://docs.rs/async-signature/badge.svg
[docs-link]: https://docs.rs/async-signature/
[license-image]: https://img.shields.io/badge/license-Apache2.0/MIT-blue.svg
[rustc-image]: https://img.shields.io/badge/rustc-1.56+-blue.svg
[rustc-image]: https://img.shields.io/badge/rustc-1.60+-blue.svg
[chat-image]: https://img.shields.io/badge/zulip-join_chat-blue.svg
[chat-link]: https://rustcrypto.zulipchat.com/#narrow/stream/260048-signatures
[build-image]: https://github.com/RustCrypto/traits/workflows/async-signature/badge.svg?branch=master&event=push
Expand Down
13 changes: 13 additions & 0 deletions signature/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,19 @@ impl From<Box<dyn std::error::Error + Send + Sync + 'static>> for Error {
}
}

#[cfg(feature = "rand_core")]
impl From<rand_core::Error> for Error {
#[cfg(not(feature = "std"))]
fn from(_source: rand_core::Error) -> Error {
Error::new()
}

#[cfg(feature = "std")]
fn from(source: rand_core::Error) -> Error {
Error::from_source(source)
}
}

#[cfg(feature = "std")]
impl std::error::Error for Error {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
Expand Down

0 comments on commit 2e0e947

Please sign in to comment.