124 Commits

Author SHA1 Message Date
Arthur Gautier
a801f53a77
v0.9.6 (#397)
Added
 - expose a `pss::get_default_pss_signature_algo_id` helper ([#393])
 - expose `pkcs1v15::RsaSignatureAssociatedOid` ([#392])
2023-12-01 11:36:48 -07:00
dependabot[bot]
a2ed9dd3c0
build(deps): bump spki from 0.7.2 to 0.7.3 (#396)
Bumps [spki](https://github.com/RustCrypto/formats) from 0.7.2 to 0.7.3.
- [Commits](https://github.com/RustCrypto/formats/compare/spki/v0.7.2...spki/v0.7.3)

---
updated-dependencies:
- dependency-name: spki
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-01 09:05:37 -07:00
Arthur Gautier
6df6d08729
v0.9.5 (#388) 2023-11-27 20:43:10 -07:00
Tony Arcieri
3eb4e38e37
v0.9.4 (#384) 2023-11-20 13:36:27 -07:00
Tony Arcieri
d855f2963c
v0.9.3 (#376) 2023-10-26 11:26:21 -06:00
Artyom Pavlov
dfb12ac5bc
Set min version of serde to 1.0.184 (#360) 2023-08-21 11:47:22 +00:00
Artyom Pavlov
3e17a67d5e
Pin serde to <1.0.172 (#359) 2023-08-19 18:08:54 +03:00
Uli Schlachter
c04c65447e
Remove unused dependencies (#357)
Signed-off-by: Uli Schlachter <psychon@znc.in>
2023-08-18 06:53:24 -06:00
Tom Hebb
eb7e507f56
Add hazmat feature as a replacement for expose-internals (#352)
External access to these functions was removed in #304 when the old
`internals` module and `expose-internals` feature were removed. There
are some valid use cases for them, though (see #351), so let's bring
back a subset of what was in `internals` using the same naming and
documentation conventions that the aes crate uses for its hazardous
functions.

Much of the added or changed documentation is derived from that in
the `aes` crate.

Fixes #351.
2023-07-23 10:43:48 -06:00
Tony Arcieri
dfa23bccb4
v0.9.2 (#331) 2023-05-08 07:15:09 -06:00
Arthur Gautier
7a58281a05
Adds support for the SignatureBitStringEncoding trait (#328) 2023-05-04 17:12:43 -06:00
Tony Arcieri
d61b501182
v0.9.1 (#327) 2023-05-03 19:36:27 -06:00
Tony Arcieri
1d1037b912
Initial proptests (#326)
Adds proptests for RSASSA-PKCS1-v1_5.

Includes a commented-out test for RSASSA-PSS which is currently failing.
2023-05-03 18:50:04 -06:00
dependabot[bot]
901765df7c
build(deps): bump sha3 from 0.10.6 to 0.10.7 (#321)
Bumps [sha3](https://github.com/RustCrypto/hashes) from 0.10.6 to 0.10.7.
- [Release notes](https://github.com/RustCrypto/hashes/releases)
- [Commits](https://github.com/RustCrypto/hashes/compare/sha3-v0.10.6...sha3-v0.10.7)

---
updated-dependencies:
- dependency-name: sha3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-01 06:12:11 -06:00
dependabot[bot]
cbf6685c5e
build(deps): bump hex-literal from 0.3.4 to 0.4.1 (#319)
Bumps [hex-literal](https://github.com/RustCrypto/utils) from 0.3.4 to 0.4.1.
- [Release notes](https://github.com/RustCrypto/utils/releases)
- [Commits](https://github.com/RustCrypto/utils/compare/hex-literal-v0.3.4...hex-literal-v0.4.1)

---
updated-dependencies:
- dependency-name: hex-literal
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-01 06:11:58 -06:00
Tony Arcieri
c611408a2e
v0.9.0 (#318) 2023-04-27 12:57:20 -06:00
Tony Arcieri
a8bddc2f6b
Add u64_digit feature (#313)
Adds an on-by-default feature which enables `num-bigint-dig/u64_digit`.

Disabling this on 32-bit platforms (e.g. WASM) should improve
performance.

Closes #252
2023-04-27 07:39:25 -06:00
Tony Arcieri
78ea9cb7da
Impl ZeroizeOnDrop for RsaPrivateKey+newtypes (#311)
`RsaPrivateKey` self-zeroizes on drop, so add the `ZeroizeOnDrop` marker
trait to `RsaPrivateKey` and all newtypes thereof, i.e. `DecryptingKey`
and `SigningKey` for the various padding modes.

This also removes the `Zeroize` impl on `RsaPrivateKey`, since it
self-zeroizes on `Drop`, and allowing `Zeroize` might accidentally
permit use-after-zeroize vulnerabilities.
2023-04-26 10:39:18 -06:00
Tony Arcieri
b1151dfb0e
v0.9.0-rc.0 (#309) 2023-04-25 08:48:24 -06:00
Tony Arcieri
bd14ee90b6
Bump pkcs1 dependency to v0.7.5 (#305)
Workaround for RustCrypto/formats#1021
2023-04-24 13:43:49 -06:00
Dmitry Baryshkov
574664808d
Internals refactoring (#304)
* feat: decouple key generation and random generation

Make generate_multi_prime_key_with_exp() generic enough to generate
abstract key structure. Rewrite RsaPrivateKey constructors to use
RsaPrivateKey::from_components().

* feat: move key-related traits to separate module

Move PublicKeyParts to the separate module.

* feat: stop using RsaPrivateKey in internals.rs

Make internals.rs generic enough to be moved to the algorithms module.

* feat: move soft RSA implementation to crate::algorithms::rsa.rs

Separate software RSA implementation to separate module under
crate::algorithms.

* key: drop raw_int_*_primitive wrappers

Now as raw_int_encryption_primitive() and raw_int_decryption_primitive()
became simple wrappers around properly defined functions we can inline
them and always use software RSA algorithm from src::algorithms::rsa.rs.

* feat: move internals.rs to src/algortihms/pad.rs

internals.rs now contains only small functions related to BigUint to
Vec<u8> conversion. Move them to src/algorithms/pad.rs and get rid of
internals.rs

* algorithms: protect all functions with pub(crate)

While it is expected that the functions inside algorithms crates might
be useful (and used) by other parties, they are low level functions and
as such impose a high risk of being misused. Protect all of them with
pub(crate) to prevent them from being exposed by mistake.

Also add big fat warnings to raw RSA functions, which should never be
used unless authors knows exactly what they are using.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
2023-04-23 16:53:21 -06:00
Tony Arcieri
3292db138d
v0.9.0-pre.2 (#302) 2023-04-19 09:06:51 -06:00
Dmitry Baryshkov
a6fd36d5c5
feat: switch to RsaPssParams::new() (#299)
Switch to using RsaPssParams::new() from pkcs1 crate. This fixes the
issue reported by zlint for x509-cert, where SHA* digest algorithms had
empty parameters instead of NULL parameters (as required by Mozilla
policy and permitted by RFC4055).

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
2023-04-18 11:13:52 -06:00
Tony Arcieri
d3a25cd2b2
Cargo.toml: alphabetize feature names (#296) 2023-04-17 14:57:00 -06:00
Tony Arcieri
534eca6ae8
v0.9.0-pre.1 (#286) 2023-04-04 21:10:12 -06:00
Dmitry Baryshkov
cf90255057
AssociatedAlgorithmIdentifier implementation (#278)
Implement associated AlgorithmIdentifier traits for PKCS1v15 and PSS keys

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
2023-04-04 20:12:08 -06:00
Tony Arcieri
31f25dacee
v0.9.0-pre.0 (#271) 2023-03-06 13:51:13 -07:00
Tony Arcieri
54ddb2802f
Bump pkcs1 to v0.7, pkcs8 to v0.10; MSRV 1.65 (#270) 2023-03-06 13:31:16 -07:00
Tony Arcieri
99397db9ca
Use namespaced features for serde; MSRV 1.60 (#268)
Reverts-the-revert from #254, reinstating #251

This reverts commit 26f38ad66a09fc42ed6d73e3b1864f0251db4e2d.

Since we need to upgrade `pkcs1` and `pkcs8`, which are MSRV 1.65, now
is a good time to start making brekaing changes again.
2023-03-05 18:34:51 -07:00
Tony Arcieri
c2a16aac47
v0.8.2 (#266) 2023-03-01 21:54:18 -07:00
Tony Arcieri
d10fcd9081
rsa v0.8.1 (#256) 2023-01-21 09:25:00 -07:00
Tony Arcieri
134a061237
Add sha2 feature with oid subfeature enabled (#255)
We seem to be running into a lot of people who are having trouble with
PKCS#1 v1.5 signatures because the failure mode for the `oid` feature of
the `sha2` crate being disabled is fairly unscrutable.

See #234, #253, and the semi-related tracking issue for #238.

If `rsa` has a `sha2` feature, we can always ensure `oid` is enabled,
and this can be used in code examples. It also means users don't need
two crates to create/verify PKCS#1 v1.5 signatures.

RSA is used commonly enough with the SHA2 family that this integration
probably makes sense.
2023-01-20 16:46:27 -07:00
Tony Arcieri
26f38ad66a
Revert "Use namespaced features for serde; MSRV 1.60 (#251)" (#254)
This reverts commit da1997d0b786181f3e3375e3eef09899486a3833.

I was probably over-eager on this: it's a breaking change.

There are probably some non-breaking changes we can make first, and when
we're ready to make breaking changes again, we can revert the revert.
2023-01-19 16:26:52 -07:00
Tony Arcieri
da1997d0b7
Use namespaced features for serde; MSRV 1.60 (#251)
Gets rid of the `serde_crate` hacks.

Weak/namespaced features should also make it possible to make more of
the functionality in this crate optional.
2023-01-17 09:20:29 -07:00
Tony Arcieri
3c2a3f8ee6
v0.8.0 (#250) 2023-01-17 09:04:52 -07:00
Tony Arcieri
b10b924c5d
Bump signature crate dependency to v2 (#249)
Release notes: https://github.com/RustCrypto/traits/pull/1211
2023-01-16 13:25:29 -07:00
Tony Arcieri
37c1e14069
rsa v0.8.0-rc.0 (#248) 2023-01-10 21:29:34 -07:00
Tony Arcieri
35a32093f0
Bump signature to v2.0.0-rc.1 (#247) 2023-01-07 21:26:52 -07:00
Tony Arcieri
47b8aaae69
Bump signature to v2.0.0-rc.0 (#242) 2023-01-05 13:37:02 -07:00
Dmitry Baryshkov
8c96243f9f
v0.8.0-pre.0 (#237)
Also uses the new `CryptoRngCore` where possible instead of separate
`CryptoRng + RngCore`, and switches to `signature` v2.0.0-pre.3

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
2022-12-17 08:26:59 -07:00
Dmitry Baryshkov
b39752d4d8
feat: switch to version 2.0 (pre) of the signature crate (#217)
Rework the crate to implement traits from the preview of the signature
crate. Use `Vec<u8>` as `Self::Repr` type.

Drop the hand-crafted `From` traits, replacing them with the
implementation of the `Keypair` trait.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
2022-12-04 19:03:38 -07:00
Tony Arcieri
35f7ae2d97
Remove minimal-versions workaround (#228)
Now that https://github.com/dignifiedquire/num-bigint/pull/42 has landed
it is no longer needed.
2022-11-21 08:28:25 -07:00
Tony Arcieri
0c7feac620
v0.7.2 (#224) 2022-11-14 19:47:48 -07:00
Tony Arcieri
4f1d413845
v0.7.1 (#218) 2022-10-31 15:03:26 -06:00
Tony Arcieri
942571f544
v0.7.0 (#211) 2022-10-10 12:15:14 -06:00
Dmitry Baryshkov
2cac57a360
feat: implement hazmat signature traits for PSS keys (#202)
Implement PrehashSigner and PrehashVerifier traits for PSS
key structures.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
2022-10-06 11:31:12 -06:00
Tony Arcieri
bfd17e2ec6
v0.7.0-rc.1 (#204) 2022-10-05 17:18:05 -06:00
Tony Arcieri
cfc27dc85c
Fix signature version requirement (#203)
The crate is now using the `PrehashSigner`/`PrehashVerifier` traits,
which were added in `signature` v1.6.1.

However, that release was also yanked, so this commit pins to 1.6.2.
2022-10-05 16:57:59 -06:00
Dmitry Baryshkov
165f06f9cd
feat: iplement hazmat signature traits for PKCS1v15 keys (#195)
Implement PrehashSigner and PrehashVerifier traits for PKCS1v15
structures.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
2022-09-22 10:03:46 -06:00
Tony Arcieri
18da70ae57
v0.7.0-rc.0 (#188) 2022-09-16 11:46:43 -06:00