Skip to content
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

ecdsa: fixup unnecessary qualification warnings #824

Merged
merged 1 commit into from
May 17, 2024

Conversation

baloo
Copy link
Member

@baloo baloo commented May 17, 2024

rust 1.78 introduced new unnecessary qualification warnings.

@@ -419,9 +419,9 @@ where
AffinePoint<C>: FromEncodedPoint<C> + ToEncodedPoint<C>,
FieldBytesSize<C>: sec1::ModulusSize,
{
type Error = pkcs8::spki::Error;
type Error = spki::Error;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Weird... spki doesn't seem to be in scope?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is interesting.

This is an (optional) direct dependency. It is still in scope most of the time but not for this specific set of features:

cargo +stable build  -p ecdsa --features pkcs8,verifying --no-default-features
   Compiling ecdsa v0.17.0-pre.5 (/home/arthur_gautier/work/dev/signatures/ecdsa)
error[E0433]: failed to resolve: use of undeclared crate or module `spki`
   --> ecdsa/src/verifying.rs:422:18
    |
422 |     type Error = spki::Error;
    |                  ^^^^ use of undeclared crate or module `spki`
    |
help: consider importing this crate
    |
3   + use crate::verifying::pkcs8::spki;
    |

error[E0433]: failed to resolve: use of undeclared crate or module `spki`
   --> ecdsa/src/verifying.rs:424:62
    |
424 |     fn try_from(spki: pkcs8::SubjectPublicKeyInfoRef<'_>) -> spki::Result<Self> {
    |                                                              ^^^^ use of undeclared crate or module `spki`
    |
help: consider importing this crate
    |
3   + use crate::verifying::pkcs8::spki;
    |

For more information about this error, try `rustc --explain E0433`.
error: could not compile `ecdsa` (lib) due to 2 previous errors

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps you can unconditionally import it when the pkcs8 feature is enabled from pkcs8::spki?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That would also have been an option.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW I was suggesting the same thing you actually did.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<

I've read it too fast and I thought you meant:

$ git diff
diff --git a/ecdsa/Cargo.toml b/ecdsa/Cargo.toml
index 2ccbfd8..3d93622 100644
--- a/ecdsa/Cargo.toml
+++ b/ecdsa/Cargo.toml
@@ -41,7 +41,7 @@ arithmetic = ["elliptic-curve/arithmetic"]
 dev = ["arithmetic", "digest", "elliptic-curve/dev", "hazmat"]
 digest = ["dep:digest", "signature/digest"]
 hazmat = []
-pkcs8 = ["digest", "elliptic-curve/pkcs8", "der"]
+pkcs8 = ["digest", "elliptic-curve/pkcs8", "der", "dep:spki"]
 pem = ["elliptic-curve/pem", "pkcs8"]
 serde = ["elliptic-curve/serde", "serdect"]
 signing = ["arithmetic", "digest", "hazmat", "rfc6979"]

@tarcieri tarcieri merged commit 6544071 into RustCrypto:master May 17, 2024
8 checks passed
@baloo baloo deleted the baloo/ecdsa/rust-1.78 branch May 17, 2024 16:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants