Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Unable to build certificate with P384 from version 0.3.0

Aperta
#2,403 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
48/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
rust

Direzione di ricerca

Inizia con la chiamata che fallisce in src/test_ca.rs:307 e confrontala con i vincoli di compilazione mostrati in x509-cert-0.3.0/src/builder.rs. Traccia le implementazioni del trait P384 SigningKey a cui si fa riferimento nell’output del compilatore, quindi verifica che la costruzione di un certificato con questo signer venga compilata e abbia esito positivo.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

A number of type/trait changes have occured with 0.3.0. Notably, this has broken certificate building with ECDSA P384 Signing keys.

Consider:

let int_cert = builder
        .build::<_, DerSignature>(&root_signing_key)
        .expect("failed to build intermediate CA certificate");

Where root_signing_key is of the type SigningKey<NistP384>

This yields the following errors:

error[E0277]: the trait bound `&ecdsa::SigningKey<NistP384>: ecdsa::signature::Signer<ecdsa::der::Signature<NistP384>>` is not satisfied
   --> src/test_ca.rs:307:18
    |
307 |         .build::<_, DerSignature>(&root_signing_key)
    |          -----   ^ the trait `ecdsa::signature::Signer<ecdsa::der::Signature<NistP384>>` is not implemented for `&ecdsa::SigningKey<NistP384>`
    |          |
    |          required by a bound introduced by this call
    |
help: `ecdsa::SigningKey<C>` implements trait `ecdsa::signature::Signer<S>`
   --> /Users/william/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/ecdsa-0.17.0/src/signing.rs:180:1
    |
180 | / impl<C> Signer<Signature<C>> for SigningKey<C>
181 | | where
182 | |     C: EcdsaCurve + CurveArithmetic + DigestAlgorithm,
183 | |     Scalar<C>: Invert<Output = CtOption<Scalar<C>>>,
    | |____________________________________________________^ `ecdsa::signature::Signer<ecdsa::Signature<C>>`
...
282 | / impl<C> Signer<SignatureWithOid<C>> for SigningKey<C>
283 | | where
284 | |     C: EcdsaCurve + CurveArithmetic + DigestAlgorithm,
285 | |     C::Digest: AssociatedOid,
286 | |     Scalar<C>: Invert<Output = CtOption<Scalar<C>>>,
    | |____________________________________________________^ `ecdsa::signature::Signer<SignatureWithOid<C>>`
...
321 | / impl<C> Signer<der::Signature<C>> for SigningKey<C>
322 | | where
323 | |     C: EcdsaCurve + CurveArithmetic + DigestAlgorithm,
324 | |     Scalar<C>: Invert<Output = CtOption<Scalar<C>>>,
325 | |     der::MaxSize<C>: ArraySize,
326 | |     <FieldBytesSize<C> as Add>::Output: Add<der::MaxOverhead> + ArraySize,
    | |__________________________________________________________________________^ `ecdsa::signature::Signer<ecdsa::der::Signature<C>>`
    |
   ::: /Users/william/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/ecdsa-0.17.0/src/recovery.rs:283:1
    |
283 | / impl<C> Signer<(Signature<C>, RecoveryId)> for SigningKey<C>
284 | | where
285 | |     C: EcdsaCurve + CurveArithmetic + DigestAlgorithm,
286 | |     Scalar<C>: Invert<Output = CtOption<Scalar<C>>>,
    | |____________________________________________________^ `ecdsa::signature::Signer<(ecdsa::Signature<C>, RecoveryId)>`
note: required by a bound in `build`
   --> /Users/william/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/x509-cert-0.3.0/src/builder.rs:291:12
    |
289 |     fn build<S, Signature>(mut self, signer: &S) -> Result<Self::Output>
    |        ----- required by a bound in this associated function
290 |     where
291 |         S: Signer<Signature>,
    |            ^^^^^^^^^^^^^^^^^ required by this bound in `Builder::build`

error[E0277]: the trait bound `&ecdsa::SigningKey<NistP384>: Keypair` is not satisfied
   --> src/test_ca.rs:307:18
    |
307 |         .build::<_, DerSignature>(&root_signing_key)
    |          -----   ^ the trait `KeypairRef` is not implemented for `&ecdsa::SigningKey<NistP384>`
    |          |
    |          required by a bound introduced by this call
    |
help: the trait `KeypairRef` is implemented for `ecdsa::SigningKey<C>`
   --> /Users/william/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/ecdsa-0.17.0/src/signing.rs:568:1
    |
568 | / impl<C> KeypairRef for SigningKey<C>
569 | | where
570 | |     C: EcdsaCurve + CurveArithmetic,
571 | |     Scalar<C>: Invert<Output = CtOption<Scalar<C>>>,
    | |____________________________________________________^
    = note: required for `&ecdsa::SigningKey<NistP384>` to implement `Keypair`
note: required by a bound in `build`
   --> /Users/william/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/x509-cert-0.3.0/src/builder.rs:292:12
    |
289 |     fn build<S, Signature>(mut self, signer: &S) -> Result<Self::Output>
    |        ----- required by a bound in this associated function
...
292 |         S: Keypair + DynSignatureAlgorithmIdentifier,
    |            ^^^^^^^ required by this bound in `Builder::build`

error[E0277]: the trait bound `&ecdsa::SigningKey<NistP384>: DynSignatureAlgorithmIdentifier` is not satisfied
   --> src/test_ca.rs:307:18
    |
307 |         .build::<_, DerSignature>(&root_signing_key)
    |          -----   ^ the trait `SignatureAlgorithmIdentifier` is not implemented for `&ecdsa::SigningKey<NistP384>`
    |          |
    |          required by a bound introduced by this call
    |
help: the trait `SignatureAlgorithmIdentifier` is implemented for `ecdsa::SigningKey<C>`

The causes P385 certificate signers to fail to compile. Given the complexity of the types and traits involved I haven't been able to resolve this for a few hours :(

My assumption is that there are either missing traits or something silly that is being missed here.

Lingua principale
Rust
Stelle
338
Fork
188
Merge medio
4g 6h
PR unite (30g)
15

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di RustCrypto/formats

Tutte le issue di RustCrypto/formats

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.