Skip to content

Commit 99397db

Browse files
authored
Use namespaced features for serde; MSRV 1.60 (#268)
Reverts-the-revert from #254, reinstating #251 This reverts commit 26f38ad. Since we need to upgrade `pkcs1` and `pkcs8`, which are MSRV 1.65, now is a good time to start making brekaing changes again.
1 parent 39d3eb9 commit 99397db

5 files changed

Lines changed: 14 additions & 33 deletions

File tree

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
strategy:
1717
matrix:
1818
rust:
19-
- 1.57.0 # MSRV
19+
- 1.60.0 # MSRV
2020
- stable
2121
target:
2222
- thumbv7em-none-eabi
@@ -37,7 +37,7 @@ jobs:
3737
strategy:
3838
matrix:
3939
rust:
40-
- 1.57.0 # MSRV
40+
- 1.60.0 # MSRV
4141
- stable
4242
steps:
4343
- uses: actions/checkout@v3

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "rsa"
3-
version = "0.8.2"
3+
version = "0.9.0-pre"
44
authors = ["RustCrypto Developers", "dignifiedquire <dignifiedquire@gmail.com>"]
55
edition = "2021"
66
description = "Pure Rust RSA implementation"
@@ -10,7 +10,7 @@ repository = "https://github.com/RustCrypto/RSA"
1010
keywords = ["rsa", "encryption", "security", "crypto"]
1111
categories = ["cryptography"]
1212
readme = "README.md"
13-
rust-version = "1.57"
13+
rust-version = "1.60"
1414

1515
[dependencies]
1616
num-bigint = { version = "0.8.2", features = ["i128", "u64_digit", "prime", "zeroize"], default-features = false, package = "num-bigint-dig" }
@@ -23,22 +23,11 @@ subtle = { version = "2.1.1", default-features = false }
2323
digest = { version = "0.10.5", default-features = false, features = ["alloc", "oid"] }
2424
pkcs1 = { version = "0.4", default-features = false, features = ["pkcs8", "alloc"] }
2525
pkcs8 = { version = "0.9", default-features = false, features = ["alloc"] }
26+
serde = { version = "1.0.103", optional = true, default-features = false, features = ["derive"] }
27+
sha2 = { version = "0.10.6", optional = true, default-features = false, features = ["oid"] }
2628
signature = { version = "2", default-features = false , features = ["digest", "rand_core"] }
2729
zeroize = { version = "1", features = ["alloc"] }
2830

29-
[dependencies.sha2]
30-
version = "0.10.6"
31-
optional = true
32-
default-features = false
33-
features = ["oid"]
34-
35-
[dependencies.serde_crate]
36-
package = "serde"
37-
optional = true
38-
version = "1.0.103"
39-
default-features = false
40-
features = ["derive"]
41-
4231
[dev-dependencies]
4332
base64ct = { version = "1", features = ["alloc"] }
4433
hex-literal = "0.3.3"
@@ -57,7 +46,7 @@ name = "key"
5746
[features]
5847
default = ["std", "pem"]
5948
nightly = ["num-bigint/nightly"]
60-
serde = ["num-bigint/serde", "serde_crate"]
49+
serde = ["dep:serde", "num-bigint/serde"]
6150
expose-internals = []
6251
std = ["digest/std", "pkcs1/std", "pkcs8/std", "rand_core/std", "signature/std"]
6352
pem = ["pkcs1/pem", "pkcs8/pem"]

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
[![crates.io][crate-image]][crate-link]
44
[![Documentation][doc-image]][doc-link]
55
[![Build Status][build-image]][build-link]
6-
![minimum rustc 1.57][msrv-image]
6+
![MSRV][msrv-image]
77
[![Project Chat][chat-image]][chat-link]
88
[![dependency status][deps-image]][deps-link]
99

@@ -70,7 +70,7 @@ There will be three phases before `1.0` 🚢 can be released.
7070
7171
## Minimum Supported Rust Version (MSRV)
7272
73-
All crates in this repository support Rust 1.57 or higher. In future
73+
All crates in this repository support Rust 1.60 or higher. In future
7474
minimally supported version of Rust can be changed, but it will be done with
7575
a minor version bump.
7676
@@ -97,7 +97,7 @@ dual licensed as above, without any additional terms or conditions.
9797
[doc-link]: https://docs.rs/rsa
9898
[build-image]: https://github.com/rustcrypto/RSA/workflows/CI/badge.svg
9999
[build-link]: https://github.com/RustCrypto/RSA/actions?query=workflow%3ACI+branch%3Amaster
100-
[msrv-image]: https://img.shields.io/badge/rustc-1.57+-blue.svg
100+
[msrv-image]: https://img.shields.io/badge/rustc-1.60+-blue.svg
101101
[chat-image]: https://img.shields.io/badge/zulip-join_chat-blue.svg
102102
[chat-link]: https://rustcrypto.zulipchat.com/#narrow/stream/260047-RSA
103103
[deps-image]: https://deps.rs/repo/github/RustCrypto/RSA/status.svg

src/key.rs

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use num_bigint::{BigInt, BigUint};
66
use num_traits::{One, ToPrimitive};
77
use rand_core::CryptoRngCore;
88
#[cfg(feature = "serde")]
9-
use serde_crate::{Deserialize, Serialize};
9+
use serde::{Deserialize, Serialize};
1010
use zeroize::Zeroize;
1111

1212
use crate::algorithms::{generate_multi_prime_key, generate_multi_prime_key_with_exp};
@@ -35,23 +35,15 @@ pub trait PrivateKey: DecryptionPrimitive + PublicKeyParts {}
3535

3636
/// Represents the public part of an RSA key.
3737
#[derive(Debug, Clone, Hash, PartialEq, Eq)]
38-
#[cfg_attr(
39-
feature = "serde",
40-
derive(Serialize, Deserialize),
41-
serde(crate = "serde_crate")
42-
)]
38+
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4339
pub struct RsaPublicKey {
4440
n: BigUint,
4541
e: BigUint,
4642
}
4743

4844
/// Represents a whole RSA key, public and private parts.
4945
#[derive(Debug, Clone)]
50-
#[cfg_attr(
51-
feature = "serde",
52-
derive(Serialize, Deserialize),
53-
serde(crate = "serde_crate")
54-
)]
46+
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5547
pub struct RsaPrivateKey {
5648
/// Public components of the private key.
5749
pubkey_components: RsaPublicKey,

0 commit comments

Comments
 (0)