24 Commits

Author SHA1 Message Date
Tony Arcieri
ec1cebf449
CI: pin nightly; test minimal-versions on stable (#378)
- Pins to nightly-2023-10-01 to prevent regressions
- On `minimal-versions`, only uses nightly to resolve versions, and runs
  tests on stable instead
2023-10-26 10:04:58 -06:00
dependabot[bot]
d7ba15c9ff
build(deps): bump actions/checkout from 3 to 4 (#370)
Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-02 06:44:44 -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
Dirk Stolle
1ea5055cbd
Replace unmaintained actions-rs/toolchain action in CI workflows (#275)
Basically all of the `actions-rs/*` actions are unmaintained. See
<https://github.com/actions-rs/toolchain/issues/216> for more
information. Due to their age they generate several warnings in
CI runs.

To get rid of some of those warnings the occurrences of
`actions-rs/toolchain` are replaced by `dtolnay/rust-toolchain`.
2023-03-20 18:06:12 -06: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
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
8f41d209e6
Fix benches (#225)
...and test they build in CI
2022-11-15 10:38:48 -07:00
Dirk Stolle
43127dc119
chore: extend Dependabot configuration for GitHub Actions updates (#198) 2022-10-05 17:53:17 -06:00
Dirk Stolle
ba0539e223
chore: update actions used in GitHub Actions workflows (#197) 2022-10-05 17:52:34 -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
82b0dbcfb2
Fix rustdoc warnings and add rustdoc CI (#157)
- Fixes some broken links to the `pkcs1`/`pkcs8` crate traits
- Fixes other rustdoc warnings
- Adds rustdoc CI job to ensure docs build without warnings
2022-04-11 08:19:13 +02: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
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
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
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
Jesse Luehrs
366ff6eac3
fix: compile when the pem feature is disabled 2021-04-26 17:32:10 +02:00
dignifiedquire
2012ea5323 feat: bump dependencies and MSRV to 1.44 accordingly 2020-12-02 17:14:21 +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
Artyom Pavlov
c879eb2717
chore: add Dependabot 2020-08-18 23:55:29 +02: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
Robin Lambertz
af31a45291
ci: move to github actions 2020-07-24 18:45:52 +02:00