aws / aws/s2n-tls

Make Public/Private Key Sanity Checking Optional

Open
#752 0 comments 2 reactions 0 assignees View on GitHub
priority/medium s2n-core size/medium type/breaking_change type/performance
Dominant language
C
Stars
4.8k
Forks
802
Avg merge
5d 22h
Merged PRs (30d)
33

Description

**Problem:**
Attempting to create many `s2n_config`'s that each contain a single unique Certificate can be slow. One of the sources of slowness is some of s2n's sanity checking of the keys loaded from the Certificate PEM. These checks are unnecessary if the Certificates have already been checked for validity previously.

**Proposed Solution:**
Allow users of s2n's Public API to specify whether sanity checks should be enabled or disabled. Either by adding a `sanity_check` arguement to `s2n_config_add_cert_chain_and_key()`, or by adding a new `s2n_config_sanity_check()` API, or some other API change.

Specifically calls to the following should probably be made optional:
- [ ] `RSA_check_key()`
- [ ] `EC_KEY_check_key()`
- [ ] `s2n_pkey_match()`

Contributor guide

Open the contributing guide

Research direction

Start by reading the public s2n_config_add_cert_chain_and_key() API and tracing its calls to RSA_check_key(), EC_KEY_check_key(), and s2n_pkey_match(). Done means users can control whether these sanity checks run through a documented public API, with behavior verified for both enabled and disabled checks.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
cryptography, security
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.