Skip to content

Conversation

@baloo
Copy link
Member

@baloo baloo commented Apr 30, 2025

alternative to #505


for (text, expected) in &tests {
let out = signing_key.sign(text.as_bytes()).to_bytes();
let sig: Signature = signing_key.sign(text.as_bytes());
Copy link
Member

Choose a reason for hiding this comment

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

Is this really still needed?

Copy link
Member Author

@baloo baloo Apr 30, 2025

Choose a reason for hiding this comment

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

error[E0282]: type annotations needed
   --> src/pkcs1v15.rs:461:35
    |
461 |             let out = signing_key.sign(text.as_bytes()).to_bytes();
    |                                   ^^^^
    |
help: try using a fully qualified path to specify the expected types
    |
461 -             let out = signing_key.sign(text.as_bytes()).to_bytes();
461 +             let out = <pkcs1v15::signing_key::SigningKey<CoreWrapper<Sha1Core>> as Signer<S>>::sign(&signing_key, text.as_bytes()).to_bytes();
    |

For more information about this error, try `rustc --explain E0282`.

Without it.

In the end I think #505 creates less changes to the downstream consumer.

Copy link
Member

Choose a reason for hiding this comment

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

I think the blanket impl is legitimately breaking inference for the case there's an explicit Signer impl instead of using the blanket one, which would be a case of RustCrypto/traits#1831

Copy link
Member Author

Choose a reason for hiding this comment

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

agreed

@baloo
Copy link
Member Author

baloo commented May 2, 2025

Closed in favor of #513

@baloo baloo closed this May 2, 2025
@baloo baloo deleted the baloo/signature3/v2 branch May 2, 2025 22:43
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