159 Commits

Author SHA1 Message Date
Brian Smith
a25271beb0 Ed25519 malleability test: Add control case. 2020-12-17 20:55:22 -08:00
Brian Smith
6e3c8a331e Ed25519 Tests: Import Ed25519 malleability test case from BoringSSL. 2020-12-17 20:55:22 -08:00
Brian Smith
47dfb4814f Ed25519 Tests: Refactor tests to prepare for more complete testing of invalid signatures. 2020-12-17 20:55:22 -08:00
Brian Smith
b9d7d089d9 Remove #![forbid(warnings)]; reply on Clippy in CI/CD instead.
The newest Rust Nightly is getting stricter about `forbid(warnings)`
which breaks the build.

Use "deny" instead of "forbid". And only deny when running Clippy in
CI/CD, so that when hacking on *ring* we don't have to deal with
warnings right away; we now only have to deal with them when we're ready
to submit a change to be merged.
2020-12-03 17:40:33 -08:00
Brian Smith
1cfafdcab7 ECDSA tests: Tell clippy to allow an intetionally redundant clone. 2020-12-03 17:40:33 -08:00
Brian Smith
d57c8d56a2 Signature tests: Remove redundant clones found by Clippy. 2020-12-03 17:40:33 -08:00
Brian Smith
d58e2dadde Agreement tests: Make clippy happy about an assertion. 2020-12-03 17:40:33 -08:00
Brian Smith
a2fec64d10 AEAD tests: Use Vec::resize() to make Clippy happy. 2020-12-03 17:40:33 -08:00
Brian Smith
4be97e91e2 Revert "Remove definitions of deprecated Error::description() ..."
This reverts commit f06811a150fcded1555911678bbca6dcb5440cda because it changed the
pulic API in a non-backward-compatible way.
2020-11-18 16:20:48 -08:00
Brian Smith
cb45bf0ddc Constant-time tests: Take Clippy's op_ref advice. 2020-11-11 16:46:41 -08:00
Brian Smith
8015140fa6 Constant-time tests: Replace clone with copy. 2020-11-11 16:46:41 -08:00
Brian Smith
524c37bace ECDSA/ED25519 tests: Improve Copy/Clone tests based on Clippy's feedback. 2020-11-11 16:46:41 -08:00
Brian Smith
bd7f4ca82d AEAD tests: Take Clippy's advice regarding op_ref. 2020-11-11 16:46:41 -08:00
Brian Smith
aa7a962f9f Constant-time tests: Remove useless clone. 2020-11-11 16:46:41 -08:00
Brian Smith
3de43630d9 ED25519 tests: Remove useless static lifetime annotation. 2020-11-11 16:46:41 -08:00
Brian Smith
5fe025b16e AEAD tests: Remove useless let () =. 2020-11-11 16:46:41 -08:00
Brian Smith
ded14f067e Agreement Tests: Remove unneeded lifetime annotations. 2020-11-11 16:46:41 -08:00
Brian Smith
898a93f632 Tests: Silence some Clippy warnings. 2020-11-11 16:46:41 -08:00
Brian Smith
bc2d01adfb Agreement tests: Address clippy::needless_return. 2020-11-11 16:46:41 -08:00
Brian Smith
f06811a150 Remove definitions of deprecated Error::description() and
`Error::cause()`.
2020-06-19 11:50:49 -05:00
Brian Smith
432670f135 Implement ECDSA nonce hardening to pretect against bad PRNG. 2020-05-29 21:43:35 -05:00
Brian Smith
e8bdd5b7b1 Make RSA work for WebAssembly targets when the "wasm32_c" feature is enabled.
Run the RSA and signature tests in WebAssembly.

Implement Elem*Elem multiplication for platforms for which we have no assembly
language implementation of it. Refactor the code to accomodate this.

`elem_reduced` was infallible previously as it always ensured the prerequisites
for the reduction were met. Make this clear in the return type, as a side-effect
of the refactoring needed for implementing the multiplication.

This implementation is far from efficient. More work needs to be done to make it
faster.
2020-05-29 21:07:20 -05:00
Brian Smith
0d5ab53e50 Simplify wasm32 test conditional uses. 2020-05-28 11:12:37 -05:00
Brian Smith
0c5f61b14f Merge BoringSSL c556d87: Add aes_nohw.c fallback AES implementation.
Add the BoringSSL aes_nohw implementation with minimal changes needed to
build. Enable the AES-GCM AEAD tests for wasm32 targets gated on the "wasm_c"
feature.
2020-05-28 10:51:03 -05:00
Brian Smith
10c4b68e63 Add new "wasm32_c" feature to enable more functionality for wasm32 targets. 2020-05-27 14:59:52 -05:00
Brian Smith
42f110abe5 Clean up conditional compilation logic w.r.t wasm_bindgen_test.
When I wrote the tests, `#[cfg_attr(not(target_arch = "wasm32"), test)]` seemed
to be necessary, but now `#[test]` works.
2020-05-27 14:59:52 -05:00
Brian Smith
12c02bfa04 Add tests specifically for constant_time::verify_slices_are_equal. 2020-05-27 14:59:52 -05:00
Marek Vavrusa
f376d70669 Regenerated tests for rsa_pkcs1_sign_tests, rsa_pkcs1_verify_tests
I agree to license my contributions to each file under the terms given
at the top of each file I changed.
2020-04-28 11:23:00 -05:00
Marek Vavrusa
5b3dc70fc3 Add support for verifying 1024-bit RSA SHA-512 signatures
I agree to license my contributions to each file under the terms given
at the top of each file I changed.
2020-04-28 11:23:00 -05:00
Brian Smith
6d9bedcafa Clarify RSA signature test bit length checks. 2020-02-04 12:35:32 -06:00
Andrew Tunnell-Jones
682ad80784 Test that RSA PKCS1 variants only accept appropriately sized keys
I agree to license my contributions to each file under the terms given
at the top of each file I changed.
2020-02-04 12:29:55 -06:00
Andrew Tunnell-Jones
bbbe6edce0 Add support for verifying 1024-bit RSA SHA-1 and SHA-256 signatures
I agree to license my contributions to each file under the terms given
at the top of each file I changed.
2020-02-04 12:29:55 -06:00
Andrew Tunnell-Jones
31ddaf6864 2040-bit RSA SHA-256 case should pass when 1024-bit support is introduced
I agree to license my contributions to each file under the terms given
at the top of each file I changed.
2020-02-04 12:29:55 -06:00
Andrew Tunnell-Jones
e927b6de98 Generate SHA-1 and SHA-256 1024-bit RSA verify cases
I agree to license my contributions to each file under the terms given
at the top of each file I changed.
2020-02-04 12:29:55 -06:00
Brian Smith
f15828a7a6 Stop disabling legacy_directory_ownership to fix Rust 1.41 beta channel builds. 2019-12-23 18:41:07 -06:00
Brian Smith
7adacd3070 Revert "Add support for random nonce generation to ring::aead."
This reverts commit 88d5aa7fd072d50be716abae4339be8463d665bb. It was a breaking change
in 0.16.8, which wasn't intended. Defaulting the parameter worked for many projects but
apparently not `biscuit` and some others.
2019-08-30 05:46:15 -10:00
Brian Smith
88d5aa7fd0 Add support for random nonce generation to ring::aead. 2019-08-30 05:39:37 -10:00
Brian Smith
20582aa39a Improve labeling in Debug implementation for LessSafeKey. 2019-08-11 18:10:31 -10:00
Brian Smith
fe1a947b59 0.16.7: & -> &dyn in agreement_tests.rs to fix beta/nightly build. 2019-08-11 16:08:00 -10:00
Brian Smith
2fe7ed15d4 Improve usability of ring::agreement.
Implement `Debug` and `algorithm()` accessors.

Add tests for traits.
2019-08-11 14:46:48 -10:00
Brian Smith
6ec6e11ab0 Test HKDF output length error handling. 2019-08-11 14:17:26 -10:00
Brian Smith
524c6af2dc Add seal_in_place_separate_tag and `seal_in_place_append_tag. 2019-07-23 10:25:56 -10:00
Brian Smith
845a0e8b8e Simplify bounds checking in open_within().
I'm not sure we actually need the full generality of `RangeBounds`.
Generalizing this to `RangeBounds` later should be a source-compatible
change if/when we find it useful to do so. Until then, avoid supporting
untested kinds of bounds.
2019-07-17 19:26:14 -10:00
Brian Smith
76f1f76c66 Rename open_in_place to open_overlapping; add new open_in_place. 2019-07-17 19:25:38 -10:00
Brian Smith
ce4953d846 Make aead::open_in_place easier to understand. 2019-07-17 19:25:38 -10:00
Brian Smith
185da62457 Make the aead::seal_in_place API easier to understand. 2019-07-17 19:25:38 -10:00
Brian Smith
8af770d0d3 Remove obsolete TODO in aead_test.rs.
The comment no longer applies since the API was changed to prevent this
type of failure using the type system.
2019-07-17 19:25:38 -10:00
Brian Smith
490f7eeb7f derive Clone and Debug for SystemRandom. 2019-07-16 11:12:08 -10:00
Brian Smith
b791dd6585 Remove deprecated signature::verify API. 2019-07-15 17:52:27 -10:00
Brian Smith
c23d537847 Restore the OpeningKey and SealingKey naming.
Experiments with the `Role` pattern indicate that it might not work as
well as initially hoped. Replace it with the pattern more common in Rust.
2019-07-13 14:50:42 -10:00