-
Notifications
You must be signed in to change notification settings - Fork 121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement Arbitrary for Certificate #761
Conversation
As a gut reaction, this is a surprisingly invasive change |
@stormshield-guillaumed you can bump the clippy rustc version, although it might need some code changes |
After a quick check, the Also, I saw that the |
I checked and |
FWIW we're looking at bumping MSRV to 1.65 in #797 |
This bumps the |
@@ -23,6 +23,7 @@ use crate::asn1::ObjectIdentifier; | |||
/// Nevertheless, this crate defines an `ANY` type as it remains a familiar | |||
/// and useful concept which is still extensively used in things like | |||
/// PKI-related RFCs. | |||
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] | |
#[cfg_attr( | |
feature = "arbitrary", | |
derive(arbitrary::Arbitrary), | |
allow(clippy::integer_arithmetic) | |
)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried this and a few other places for the allow
but none suppresses the warning. I don't know how to put attributes on derive generated code and adding the allow
to the module seems a bit extreme (suppressing more than wanted).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess the issue is it's annotating the struct and not the associated impl
blocks.
You can add it at to the module if it's gated on feature = "arbitrary"
@@ -202,6 +203,7 @@ impl<'a> TryFrom<&'a [u8]> for AnyRef<'a> { | |||
/// backing data. | |||
#[cfg(feature = "alloc")] | |||
#[cfg_attr(docsrs, doc(cfg(feature = "alloc")))] | |||
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] | |
#[cfg_attr( | |
feature = "arbitrary", | |
derive(arbitrary::Arbitrary), | |
allow(clippy::integer_arithmetic) | |
)] |
The only remaining errors are on the minimal version check, but I already specify |
It looks like a bug in
This needs to be fixed on the
|
I opened an issue on If you'd like to get the build passing now you can temporarily disable the check in the crates that are failing, although I'd ask you do that in a separate PR/commit so it's easy to revert when the issue does get fixed. |
@stormshield-guillaumed can you either PR b4ac2a6 separately or squash all of the commits down to two, one which adds the |
Thanks! |
Backport release which includes changes from #761, which add optional support for the `arbitrary` crate as a feature
Add an optional dependency on the arbitrary crate to implement Arbitrary for Certificate. This allows to generate arbitrary certificates for fuzzing.