125 Commits

Author SHA1 Message Date
Tony Arcieri
18da70ae57
v0.7.0-rc.0 (#188) 2022-09-16 11:46:43 -06:00
Dmitry Baryshkov
92ef4c823b
pkcs1v15: use AssociatedOid for getting the RSA prefix (#183)
Drop internal implementation of `AssociatedHash` and use `AssociatedOid`
trait from `const_oid` to get the OID corresponding to the `Digest` and to
format the ASN.1 prefix.

Also removes the previous `Hash` enum as it was used for looking up OIDs.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
2022-09-16 11:25:05 -06:00
Dmitry Baryshkov
d68e2731dc
Update RSA signature traits implementations (#179)
- Change the `SigningKey` and `VerifiyingKey` implementations accept raw
message rather than pre-hashed message.

- Implement the experimental (preview) `DigestSigner` and `DigestVerifier`
traits for the PKCS1v15 structs.

- Implement the experimental (preview) `RandomizedDigestSigner` and
`DigestVerifier` traits for the PSS structs.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
2022-09-07 11:47:03 -06:00
Dmitry Baryshkov
40242fbbb0
Implement Signer/Verifier/Signature interfaces for the RSA signatures (#174)
Refactor the `rsa` crate to use the API defined by the signature crate.

This adds `pss` and `pkcs1v15` modules, each of them providing
`Signature`, `Verifier` and `Signer`/`RandomizedSigner` implementations.

Add tests for pkcs1v15 and pss signature verification functions to check
that verifying invalid signatures returns an error.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
2022-08-19 11:46:40 -06:00
Tony Arcieri
4ccdcf92a9
Make RsaPrivateKey::from_components fallible (#167)
Adds an error case in the event the number of `primes` provides is fewer
than 2, which prevents panics when invoking methods which expect primes
to always be present at indices 0 and 1 (i.e. `p` and `q`)

Fixes #163
2022-07-25 06:35:47 -06:00
Tony Arcieri
b626d48a4f
v0.7.0-pre (#164) 2022-05-23 21:29:10 -06:00
Quentin Gliech
2b8b7dd4bb
Bump pkcs1 => 0.4, pkcs8 => 0.9 (#162)
Also bumps MSRV to 1.57
2022-05-23 20:44:33 -06:00
Tony Arcieri
4b8fa4fb67 chore(rsa): release 0.6.1 2022-04-11 07:43:19 -06:00
dignifiedquire
cc3c9e0040 chore(rsa): release 0.6.0 2022-04-08 16:24:49 +02:00
Artyom Pavlov
bc44abf96e
Address RUSTSEC-2021-0003 by bumping smallvec to 1.6.1 (#156) 2022-03-22 14:38:12 +00:00
Artyom Pavlov
bbfd911207
Remove nondeterministic tests (#152) 2022-03-14 14:22:48 +00:00
Artyom Pavlov
0844aeb88d
Fix min versions build (#150) 2022-03-13 21:07:40 +00:00
Artyom Pavlov
cf27569687
Replace rand dependency with rand_core (#148) 2022-03-13 19:50:05 +00:00
Tony Arcieri
56c02cfd24
v0.6.0-pre (#147) 2022-03-10 13:27:39 -07:00
Friedel Ziegelmayer
190a8ec856
feat: update to rust edition 2021 (#135)
bumps MSRV to 1.56.0

Co-authored-by: Tony Arcieri <bascule@gmail.com>
2022-03-10 11:25:50 -07:00
Tony Arcieri
7395997c40
Impl zeroize without using zeroize_derive (#143)
The `zeroize_derive` crate has quite a few dependencies, and in
particular `syn` is a fairly large one with not-insignificant compile
times.

Together with dignifiedquire/num-bigint#35, this will remove the
following dependencies from the dependency tree:

- `proc-macro2`
- `quote`
- `syn`
- `synstructure`
- `zeroize_derive`
2022-02-02 05:49:01 -07:00
Tony Arcieri
e4366a7e8f Bump pkcs1 => v0.3, pkcs8 => v0.8; MSRV 1.56
Updates the `pkcs1` and `pkcs8` crates to their latest versions.

These releases reversed the blanket impl relationship between the traits
in the two respective crates.

The names of the traits have changed:
- `From*Key` => `Decode*Key` (e.g. `DecodePrivateKey`)
- `To*Key` => `Encode*Key` (e.g. `EncodePrivateKey`).

Previously there was a blanket impl of `pkcs8` traits for the `pkcs1`
crates, e.g. `DecodePrivateKey` was impl'd for `DecodeRsaPrivateKey`.

This relationship has been reversed in the latest releases, and as such
this commit now implements the `pkcs8` traits instead of the `pkcs1`
traits (even though this internally involves decoding a PKCS#1 document
as part of PKCS#8 decoding).

The reasoning is this was necessary to make it possible for traits for
multiple formats to have blanket impls for the PKCS#8 traits. Concretely
this was needed to allow blanket impls of the traits in the `sec1` crate
for types which impl traits from the `pkcs8` crate.

Both of these crates are MSRV 1.56 and hard dependencies, so the MSRV of
the `rsa` crate is accordingly bumped to 1.56.
2022-01-16 10:57:11 -07:00
Poliorcetics
024a61b6ed
chore(deps): Update crypto crates
Co-authored-by: Alexis Bourget <alexis@harfanglab.fr>
2022-01-05 22:59:20 +01:00
Expyron
1ad5f1c4df
refactor: remove lazy_static dependency 2021-12-07 01:08:36 +01:00
dignifiedquire
a1c1f2b8f0 chore(rsa): release 0.5.0 2021-07-27 08:47:48 +02:00
Tony Arcieri
f251dee5a9
Use pkcs1 and pkcs8 crates; MSRV 1.51+ (#104)
This is an initial attempt to switch the `rsa` crate to use the `pkcs1`
and `pkcs8` crates from https://github.com/rustcrypto/utils
2021-07-26 13:57:23 -07:00
dignifiedquire
dc103e1453 chore(rsa): release 0.4.1 2021-07-26 22:45:43 +02:00
Tony Arcieri
2ea84ba54b Lock zeroize to v1.3
1.4 requires MSRV 1.51
2021-07-19 12:55:29 -07:00
dignifiedquire
c047ce9b3b chore(rsa): release 0.4.0 2021-03-28 19:40:33 +02:00
littledivy
5d3a76c429 chores: upgrade to rand-0.8 2021-03-22 10:15:28 +05:30
dignifiedquire
55e6cc0471 fix: bump num-bigint to fix nightly compiles 2020-12-02 17:48:19 +01:00
dignifiedquire
cf044126a0 feat: remove deprecated serde1 feature 2020-12-02 17:14:21 +01:00
dignifiedquire
2012ea5323 feat: bump dependencies and MSRV to 1.44 accordingly 2020-12-02 17:14:21 +01:00
dependabot[bot]
f295811166
chore(deps): update simple_asn1 requirement from 0.4 to 0.5 (#69)
Updates the requirements on [simple_asn1](https://github.com/acw/simple_asn1) to permit the latest version.
- [Release notes](https://github.com/acw/simple_asn1/releases)
- [Commits](https://github.com/acw/simple_asn1/commits)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-11-30 11:08:40 +01:00
Tony Arcieri
f6b445b660
fix: pin subtle to 2.1.1 to avoid MSRV downgrades (#71)
Co-authored-by: Tony Arcieri <bascule@gmail.com>
Co-authored-by: dignifiedquire <me@dignifiedquire.com>
2020-11-24 06:11:56 -08:00
Robin Lambertz
e8152949f9
feat: nostd, core+alloc support
* No-std support

* Fix tests

* Cleanly error out when building without the alloc feature

* Run no-std tests on arm-linux-gnu target

* Fix nostd tests

* Attempt 2 at fixing nostd tests

* Fix warnings when running tests in nostd mode

* fixup! No-std support
2020-08-07 22:39:36 +02:00
dignifiedquire
02689d1b28 chore(rsa): release 0.3.0 2020-06-11 14:13:09 +02:00
dignifiedquire
f3e99b434d feat: update dependencies to rustcrypto 0.9 releases 2020-06-11 13:24:03 +02:00
dignifiedquire
b50fa5238e refactor: bring oaep implementation into the regular interface 2020-03-06 20:05:24 +01:00
lucdew
79439a004e Add oaep encrypt and only with sha1 digest
Test assertion is manual and done with openssl
2020-03-06 18:24:58 +01:00
Tony Arcieri
d26bb6a057
Merge pull request #41 from aloucks/serdename
Rename `serde1` feature to `serde`
2020-02-25 17:55:29 -10:00
Aaron Loucks
092fc3b1dc Use thiserror instead of failure
Fixes #39
2020-02-25 21:29:05 -05:00
Aaron Loucks
3d4500036f Rename serde1 feature to serde 2020-02-25 20:37:17 -05:00
Aaron Loucks
783b82d493 Add parsing for pkcs1 and pkcs8 encoded rsa keys
Fixes #37
2020-02-13 18:12:07 -05:00
dignifiedquire
3818b74b52 chore(rsa): release 0.2.0 2019-12-11 01:16:23 +01:00
Friedel Ziegelmayer
e38553f8e8
feat: update dependencies 2019-12-11 01:15:49 +01:00
dignifiedquire
fcd1e537d5 chore(rsa): release 0.1.4 2019-10-13 16:32:39 +02:00
dignifiedquire
6f6076702a feat(deps): update to the latest 2019-10-13 16:31:11 +02:00
dignifiedquire
41897b7472 (cargo-release) start next development iteration 0.1.3 2019-03-26 15:24:53 +01:00
dignifiedquire
380c7e34b7 (cargo-release) version 0.1.3 2019-03-26 15:24:35 +01:00
dignifiedquire
021ae799da feat: implement zeroing using the zeroize crate 2019-03-26 14:53:53 +01:00
Patrick D Hayes
8e5ce15e18 feat(deps): update dependencies 2019-03-25 16:40:55 +01:00
Friedel Ziegelmayer
5f9b8fda74
Merge pull request #14 from phayes/master
Moving to 2018 edition
2019-03-19 16:09:19 +01:00
Patrick D Hayes
df157b4105 docs(cargo.toml): add readme reference
This will make the readme appear on crates.io
2019-03-19 16:07:14 +01:00
phayes
558d34f155
Moving to 2018 edition and applying 2018 idioms 2019-03-18 09:34:29 -07:00