diff options
author | Tobias Nießen <tniessen@tnie.de> | 2019-01-26 13:28:55 +0100 |
---|---|---|
committer | Tobias Nießen <tniessen@tnie.de> | 2019-03-05 16:32:19 +0100 |
commit | fe7162915e2a9de85bb550d8d50679832e46983e (patch) | |
tree | d0639862a806e942fec9ab925935eabf91c29cd8 /src/node_crypto.cc | |
parent | 84ebaaa339ffc67cbada5b2ae59061c26efd39ce (diff) | |
download | android-node-v8-fe7162915e2a9de85bb550d8d50679832e46983e.tar.gz android-node-v8-fe7162915e2a9de85bb550d8d50679832e46983e.tar.bz2 android-node-v8-fe7162915e2a9de85bb550d8d50679832e46983e.zip |
crypto: allow deriving public from private keys
This change allows passing private key objects to
crypto.createPublicKey, resulting in a key object that represents a
valid public key for the given private key. The returned public key
object can be used and exported safely without revealing information
about the private key.
PR-URL: https://github.com/nodejs/node/pull/26278
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Diffstat (limited to 'src/node_crypto.cc')
-rw-r--r-- | src/node_crypto.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/node_crypto.cc b/src/node_crypto.cc index 624079a3d4..086216009c 100644 --- a/src/node_crypto.cc +++ b/src/node_crypto.cc @@ -3409,7 +3409,7 @@ void KeyObject::Init(const FunctionCallbackInfo<Value>& args) { CHECK_EQ(args.Length(), 3); offset = 0; - pkey = GetPublicOrPrivateKeyFromJs(args, &offset, false); + pkey = GetPublicOrPrivateKeyFromJs(args, &offset, true); if (!pkey) return; key->InitPublic(pkey); |