Skip to content

Commit

Permalink
signature: Rust 2021 edition upgrade; MSRV 1.56 (#1081)
Browse files Browse the repository at this point in the history
Since we have PRs that demand an MSRV bump (#1080), bumps the crate's
edition to the latest, which requires MSRV 1.56.
  • Loading branch information
tarcieri committed Aug 13, 2022
1 parent 6af5706 commit 54d32dc
Show file tree
Hide file tree
Showing 10 changed files with 34 additions and 81 deletions.
8 changes: 2 additions & 6 deletions .github/workflows/signature.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
strategy:
matrix:
rust:
- 1.41.0 # MSRV
- 1.56.0 # MSRV
- stable
target:
- thumbv7em-none-eabi
Expand All @@ -36,8 +36,6 @@ jobs:
target: ${{ matrix.target }}
override: true
profile: minimal
# Isolate this crate from workspace which is otherwise MSRV 1.56 due to 2021 edition crates
- run: rm ../Cargo.toml
- run: cargo build --no-default-features --release --target ${{ matrix.target }}

minimal-versions:
Expand All @@ -50,7 +48,7 @@ jobs:
strategy:
matrix:
rust:
- 1.41.0 # MSRV
- 1.56.0 # MSRV
- stable
steps:
- uses: actions/checkout@v2
Expand All @@ -60,8 +58,6 @@ jobs:
toolchain: ${{ matrix.rust }}
override: true
profile: minimal
# Isolate this crate from workspace which is otherwise MSRV 1.56 due to 2021 edition crates
- run: rm ../Cargo.toml
- run: cargo check --all-features
- run: cargo test --no-default-features --release
- run: cargo test --release
Expand Down
6 changes: 3 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion crypto/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ cipher = { version = "0.4", optional = true }
digest = { version = "0.10", optional = true, features = ["mac"] }
elliptic-curve = { version = "0.12", optional = true, path = "../elliptic-curve" }
password-hash = { version = "0.4", optional = true, path = "../password-hash" }
signature = { version = "1.5", optional = true, default-features = false, path = "../signature" }
signature = { version = "=1.6.0-pre", optional = true, default-features = false, path = "../signature" }
universal-hash = { version = "0.5", optional = true, path = "../universal-hash" }

[features]
Expand Down
5 changes: 3 additions & 2 deletions signature/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
[package]
name = "signature"
description = "Traits for cryptographic signature algorithms (e.g. ECDSA, Ed25519)"
version = "1.5.0" # Also update html_root_url in lib.rs when bumping this
version = "1.6.0-pre"
authors = ["RustCrypto Developers"]
license = "Apache-2.0 OR MIT"
documentation = "https://docs.rs/signature"
repository = "https://github.com/RustCrypto/traits/tree/master/signature"
readme = "README.md"
edition = "2018"
edition = "2021"
rust-version = "1.56"
keywords = ["crypto", "ecdsa", "ed25519", "signature", "signing"]
categories = ["cryptography", "no-std"]

Expand Down
14 changes: 7 additions & 7 deletions signature/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,26 @@

[![crate][crate-image]][crate-link]
[![Docs][docs-image]][docs-link]
[![Build Status][build-image]][build-link]
![Apache2/MIT licensed][license-image]
![Rust Version][rustc-image]
[![Project Chat][chat-image]][chat-link]
[![Build Status][build-image]][build-link]

This crate contains traits which provide generic, object-safe APIs for
generating and verifying [digital signatures][1].

Used by the [`ecdsa`][2] and [`ed25519`][3] crates, with forthcoming support
in the [`rsa`][4] crate.

See also the [Signatory][5] project for trait wrappers for using these traits
See also the [Signatory][5] crate for trait wrappers for using these traits
with many popular Rust cryptography crates, including `ed25519-dalek`, *ring*,
`secp256k1-rs`, and `sodiumoxide`.

[Documentation][docs-link]

## Minimum Supported Rust Version

Rust **1.41** or higher.
Rust **1.56** 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 @@ -52,16 +52,16 @@ dual licensed as above, without any additional terms or conditions.

[//]: # (badges)

[crate-image]: https://img.shields.io/crates/v/signature.svg
[crate-image]: https://buildstats.info/crate/signature
[crate-link]: https://crates.io/crates/signature
[docs-image]: https://docs.rs/signature/badge.svg
[docs-link]: https://docs.rs/signature/
[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.41+-blue.svg
[rustc-image]: https://img.shields.io/badge/rustc-1.56+-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/signature/badge.svg?branch=master&event=push
[build-link]: https://github.com/RustCrypto/traits/actions?query=workflow%3Asignature

[//]: # (general links)

Expand Down
4 changes: 2 additions & 2 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.2.0-pre" # Also update html_root_url in lib.rs when bumping this
version = "0.2.0-pre"
authors = ["RustCrypto Developers"]
license = "Apache-2.0 OR MIT"
documentation = "https://docs.rs/async-signature"
Expand All @@ -14,7 +14,7 @@ rust-version = "1.56"

[dependencies]
async-trait = "0.1.9"
signature = { version = "1.5", path = ".." }
signature = { version = "=1.6.0-pre", path = ".." }

[features]
digest = ["signature/digest-preview"]
Expand Down
25 changes: 3 additions & 22 deletions signature/async/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,28 +1,9 @@
//! RustCrypto: `async-signature` crate.
//!
//! This is an experimental crate containing `async` versions of select traits
//! from the [`signature`] crate, namely [`AsyncSigner`] and when the `digest`
//! feature is enabled, [`AsyncDigestSigner`].
//!
//! Traits are implemented using [`async-trait`], which rewrites the traits to
//! use `Box`-ed futures.
//!
//! The longer-term goal is to move these traits into the [`signature`] crate
//! itself, however before doing so we'd like to remove the [`async-trait`]
//! dependency in order to enable use in `no_std` environments. This crate
//! is a stopgap until that happens.
//!
//! For more information, see:
//! <https://github.com/RustCrypto/traits/issues/304>
//!
//! [`async-trait`]: https://docs.rs/async-trait

#![cfg_attr(docsrs, feature(doc_cfg))]
#![doc = include_str!("../README.md")]
#![doc(
html_logo_url = "https://raw.githubusercontent.com/RustCrypto/media/8f1a9894/logo.svg",
html_favicon_url = "https://raw.githubusercontent.com/RustCrypto/media/8f1a9894/logo.svg",
html_root_url = "https://docs.rs/async-signature/0.2.0-pre"
html_favicon_url = "https://raw.githubusercontent.com/RustCrypto/media/8f1a9894/logo.svg"
)]
#![cfg_attr(docsrs, feature(doc_cfg))]
#![forbid(unsafe_code)]
#![warn(missing_docs, rust_2018_idioms, unused_qualifications)]

Expand Down
3 changes: 2 additions & 1 deletion signature/derive/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ description = "Custom derive support for the 'signature' crate"
documentation = "https://docs.rs/signature"
repository = "https://github.com/RustCrypto/traits/tree/master/signature/derive"
readme = "README.md"
edition = "2018"
edition = "2021"
rust-version = "1.56"
keywords = ["crypto", "ecdsa", "ed25519", "signature", "signing"]
categories = ["cryptography", "no-std"]

Expand Down
6 changes: 1 addition & 5 deletions signature/derive/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
//! Custom derive support for the `signature` crate.
//!
//! This crate can be used to derive `Signer` and `Verifier` impls for
//! types that impl `DigestSigner` or `DigestVerifier` respectively.

#![crate_type = "proc-macro"]
#![doc = include_str!("../README.md")]
#![deny(warnings, unused_import_braces, unused_qualifications)]
#![forbid(unsafe_code)]

Expand Down
42 changes: 10 additions & 32 deletions signature/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,25 +1,13 @@
//! RustCrypto: `signature` crate.
//!
//! Traits which provide generic, object-safe APIs for generating and verifying
//! digital signatures, i.e. message authentication using public-key cryptography.
//!
//! ## Minimum Supported Rust Version
//!
//! Rust **1.41** or higher.
//!
//! Minimum supported Rust version may be changed in the future, but such
//! changes will be accompanied with a minor version bump.
//!
//! ## SemVer policy
//!
//! - MSRV is considered exempt from SemVer as noted above
//! - All on-by-default features of this library are covered by SemVer
//! - Off-by-default features ending in `*-preview` (e.g. `derive-preview`,
//! `digest-preview`) are unstable "preview" features which are also
//! considered exempt from SemVer (typically because they rely on pre-1.0
//! crates as dependencies). However, breaking changes to these features
//! will, like MSRV, also be accompanied by a minor version bump.
//!
#![no_std]
#![doc = include_str!("../README.md")]
#![doc(
html_logo_url = "https://raw.githubusercontent.com/RustCrypto/media/8f1a9894/logo.svg",
html_favicon_url = "https://raw.githubusercontent.com/RustCrypto/media/8f1a9894/logo.svg"
)]
#![cfg_attr(docsrs, feature(doc_cfg))]
#![forbid(unsafe_code)]
#![warn(missing_docs, rust_2018_idioms, unused_qualifications)]

//! # Design
//!
//! This crate provides a common set of traits for signing and verifying
Expand Down Expand Up @@ -155,16 +143,6 @@
//! [`Digest`]: https://docs.rs/digest/latest/digest/trait.Digest.html
//! [Fiat-Shamir heuristic]: https://en.wikipedia.org/wiki/Fiat%E2%80%93Shamir_heuristic

#![no_std]
#![cfg_attr(docsrs, feature(doc_cfg))]
#![doc(
html_logo_url = "https://raw.githubusercontent.com/RustCrypto/media/8f1a9894/logo.svg",
html_favicon_url = "https://raw.githubusercontent.com/RustCrypto/media/8f1a9894/logo.svg",
html_root_url = "https://docs.rs/signature/1.5.0"
)]
#![forbid(unsafe_code)]
#![warn(missing_docs, rust_2018_idioms, unused_qualifications)]

#[cfg(feature = "std")]
extern crate std;

Expand Down

0 comments on commit 54d32dc

Please sign in to comment.