RustCrypto / RustCrypto/formats
cms builders: how can I surface signing errors?
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 338
- Forks
- 188
- Avg merge
- 4d 6h
- Merged PRs (30d)
- 15
Description
I'm not sure how I'm supposed to access the underlying error when it gets dropped on line 415:
For my use case, I'm signing remotely using Google KMS, and so there are numerous failure conditions (e.g. web request failed, couldn't deserialize response body, checksum didn't match), but any useful information I put into my errors in my Signer::try_sign impl get dropped by the map_err above
I understand the concerns about leaking secrets and hence the design of signature::Error - no issues there, but even if I'm wanting to provide useful secretless errors I can't because they get swallowed in internal library code
Thus I'd like to understand why the API was designed like this, and if potentially this could be changed in the future. Naturally this limitation can be worked around one way or another, but it's cumbersome to do so
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with cms/src/builder.rs around lines 400-419, especially the map_err call that drops the Signer::try_sign error. Trace how signing errors are represented and determine what API behavior would preserve useful, secretless context without violating signature::Error's design. Done requires a concrete, reviewed approach for exposing or retaining those errors.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- cryptography
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100