Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for ecdsa keys disabled #1590

Closed
rushglen opened this issue Feb 2, 2023 · 1 comment
Closed

Support for ecdsa keys disabled #1590

rushglen opened this issue Feb 2, 2023 · 1 comment

Comments

@rushglen
Copy link

rushglen commented Feb 2, 2023

  • OpenPGP.js version: 5.5.0
  • Node.js node-v16.13.1-x64
    (Also tried openpgp5.0.1 using Windows 11 (same results))

I am getting an error using these ECC types:
Summary: Support for ecdsa keys using curve brainpoolP256r1,'brainpoolP384r1','brainpoolP512r1','secp256k1' is disabled

ie if I tried to use brainpoolP256r1 I would get the error : Support for ecdsa keys using curve brainpoolP256r1 is disabled.

`options = {
type: 'ecc',
curve: curveName,
userIDs: userIDs,
passphrase: passphrase,
}

const keys = await openpgp.generateKey(options);
`

These curves work:
['curve25519','ed25519','p256','p384','p521']
Is this a bug?

Error: Error generating keypair: Support for ecdsa keys using curve brainpoolP256r1 is disabled.
at ec (D:\node\node_modules\openpgp\dist\node\openpgp.min.js:2:314252)
at D:\node\node_modules\openpgp\dist\node\openpgp.min.js:16:137932
at Array.forEach ()
at exports.generateKey (D:\node\node_modules\openpgp\dist\node\openpgp.min.js:16:137906)
at async keygen (D:\node\server\generateKeys.js:37:15)
at async D:\node\server\index.js:439:23

@twiss
Copy link
Member

twiss commented Feb 3, 2023

Hey 👋 It's not really a bug in the sense that it was intentional, because these curves weren't in the specification; however, the Brainpool curves have now been added to the crypto refresh draft, so we'll enable them by default in the next release (#1563). The secp256k1 curve will remain disabled by default, as it's not specified for use with OpenPGP anywhere.

You can enable curves by doing something like

openpgp.config.rejectCurves.delete(openpgp.enums.curve.brainpoolP256r1);

Or, you can pass a rejectCurves set to the config of one specific function call; for example, if you want to enable all of them, you can pass:

options = {
  config: {
    rejectCurves: new Set()
  },
  ...
}

@openpgpjs openpgpjs locked and limited conversation to collaborators Feb 3, 2023
@twiss twiss converted this issue into discussion #1591 Feb 3, 2023

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants