Tighten up CertificateSigningRequestParams.from_der() sig AlgorithmIdentifier params validation

Open
#461 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
rust
Domain
cryptography

Research direction

Start in CertificateSigningRequestParams::from_der() under the x509-parser feature, where SignatureAlgorithm::supports_oid is called on the signature algorithm OID. Read the x509-parser AlgorithmIdentifier parameters handling and the linked PR #459 discussion before deciding how NULL parameters should be enforced. Done means the parameters are checked for algorithms that require NULL and RSA-PSS parameters are handled explicitly, with tests covering both cases.

Written by the indexing model from the issue text.

Description

next-major-release

When building a CertificateSigningRequestParams from CertificateSigningRequestDer with the x509-parser feature enabled we check SignatureAlgorithm::supports_oid(&sig_alg_oid) but this only compares by OID and doesn't consider the x509-parser AlgorithmIdentifier type's parameters. For many algorithms the parameters MUST be NULL and we should enforce that. For RSA-PSS support in particular we'll need to consider the explicit parameters beyond enforcing encoding.

See https://github.com/rustls/rcgen/pull/459#discussion_r4574500586

Dominant language
Rust
Stars
516
Forks
160
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from rustls/rcgen

All issues in rustls/rcgen

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.