diff options
author | David Benjamin <davidben@google.com> | 2017-09-18 11:58:24 -0400 |
---|---|---|
committer | Bernd Edlinger <bernd.edlinger@hotmail.de> | 2017-09-26 14:48:51 +0200 |
commit | 7966101e20abdcf1da4815dc41e47f52cce02f0f (patch) | |
tree | b17cffacd29ab9c2e28f11b74515b0fb81d5a158 /doc | |
parent | b50951d36c329b07e1c92d41cc02c9085fb567d7 (diff) |
Allow DH_set0_key with only private key.
The pub_key field for DH isn't actually used in DH_compute_key at all.
(Note the peer public key is passed in as as BIGNUM.) It's mostly there
so the caller may extract it from DH_generate_key. It doesn't
particularly need to be present if filling in a DH from external
parameters.
The check in DH_set0_key conflicts with adding OpenSSL 1.1.0 to Node.
Their public API is a thin wrapper over the old OpenSSL one:
https://nodejs.org/api/crypto.html#crypto_class_diffiehellman
They have separate setPrivateKey and setPublicKey methods, so the public
key may be set last or not at all. In 1.0.2, either worked fine since
operations on DH objects generally didn't use the public key. (Like
with OpenSSL, Node's setPublicKey method is also largely a no-op, but so
it goes.) In 1.1.0, DH_set0_key prevents create a private-key-only DH
object.
Reviewed-by: Andy Polyakov <appro@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
(Merged from https://github.com/openssl/openssl/pull/4384)
Diffstat (limited to 'doc')
-rw-r--r-- | doc/man3/DH_get0_pqg.pod | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/doc/man3/DH_get0_pqg.pod b/doc/man3/DH_get0_pqg.pod index 7dd875b64f..ec476a7d62 100644 --- a/doc/man3/DH_get0_pqg.pod +++ b/doc/man3/DH_get0_pqg.pod @@ -48,13 +48,11 @@ been set yet, although if the private key has been set then the public key must be. The values point to the internal representation of the public key and private key values. This memory should not be freed directly. -The public and private key values can be set using DH_set0_key(). The public -key must be non-NULL the first time this function is called on a given DH -object. The private key may be NULL. On subsequent calls, either may be NULL, -which means the corresponding DH field is left untouched. As for DH_set0_pqg() -this function transfers the memory management of the key values to the DH -object, and therefore they should not be freed directly after this function has -been called. +The public and private key values can be set using DH_set0_key(). Either +parameter may be NULL, which means the corresponding DH field is left +untouched. As with DH_set0_pqg() this function transfers the memory management +of the key values to the DH object, and therefore they should not be freed +directly after this function has been called. DH_set_flags() sets the flags in the B<flags> parameter on the DH object. Multiple flags can be passed in one go (bitwise ORed together). Any flags that |