Skip to content

Add config.rejectCurves and prevent generating keys using blacklisted algos#1395

Merged
larabr merged 4 commits intoopenpgpjs:masterfrom
larabr:config-reject-curves
Aug 19, 2021
Merged

Add config.rejectCurves and prevent generating keys using blacklisted algos#1395
larabr merged 4 commits intoopenpgpjs:masterfrom
larabr:config-reject-curves

Conversation

@larabr
Copy link
Copy Markdown
Collaborator

@larabr larabr commented Aug 6, 2021

Breaking changes:

  • throw error on key generation if the requested public key algorithm is included in config.rejectPublicKeyAlgorithms;
  • add config.rejectCurves to blacklist a set of ECC curves, to prevent keys using those curves from being generated, or being used to encrypt/decrypt/sign/verify messages.
    By default, config.rejectCurves includes the brainpool curves (brainpoolP256r1, brainpoolP384r1, brainpoolP512r1) and the Bitcoin curve (secp256k1). This is because it's unclear whether these curves will be standardised, and we prefer to blacklist them already, rather than introduce a breaking change after release.

@larabr larabr force-pushed the config-reject-curves branch from efb2c04 to df2a069 Compare August 6, 2021 18:25
Comment thread src/openpgp.js Outdated
@larabr larabr requested a review from twiss August 19, 2021 13:58
Comment thread src/config/config.js Outdated
Comment thread src/config/config.js Outdated
Comment thread src/openpgp.js Outdated
@larabr larabr force-pushed the config-reject-curves branch from 38b9faf to 28f035a Compare August 19, 2021 15:17
@larabr larabr merged commit 3fa778a into openpgpjs:master Aug 19, 2021
larabr added a commit that referenced this pull request Dec 1, 2021
Breaking change:
when generating new subkeys through `key.addSubkey()`, we now check
`config.rejectCurves` and prevent adding subkeys using the corresponding
curves.
By default, `config.rejectCurves` includes the brainpool curves
(`brainpoolP256r1`, `brainpoolP384r1`, `brainpoolP512r1`) and the Bitcoin curve
(`secp256k1`).

This is a follow up to #1395 , which introduced the same check to
`openpgp.generateKey`.
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