openssl/crypto/dh
David Benjamin 7966101e20 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)
2017-09-26 14:48:51 +02:00
..
build.info Make DH_METHOD opaque 2016-04-09 10:10:55 +01:00
dh192.pem Import of old SSLeay release: SSLeay 0.8.1b 1998-12-21 10:52:47 +00:00
dh512.pem Import of old SSLeay release: SSLeay 0.8.1b 1998-12-21 10:52:47 +00:00
dh1024.pem Import of old SSLeay release: SSLeay 0.8.1b 1998-12-21 10:52:47 +00:00
dh2048.pem Import of old SSLeay release: SSLeay 0.8.1b 1998-12-21 10:52:47 +00:00
dh4096.pem Import of old SSLeay release: SSLeay 0.8.1b 1998-12-21 10:52:47 +00:00
dh_ameth.c Constify private key decode. 2016-08-17 12:01:29 +01:00
dh_asn1.c ASN.1: adapt our use of INTxx et al by making them explicitely embedded 2017-04-13 10:23:31 +02:00
dh_check.c Change to check last return value of BN_CTX_get 2017-06-26 15:40:16 +02:00
dh_depr.c Copyright consolidation 05/10 2016-05-17 15:38:09 -04:00
dh_err.c make error tables const and separate header file 2017-06-07 15:12:03 -04:00
dh_gen.c Change to check last return value of BN_CTX_get 2017-06-26 15:40:16 +02:00
dh_kdf.c Use "" not <> on e_os.h include 2017-08-22 11:07:56 -04:00
dh_key.c Add RAND_priv_bytes() for private keys 2017-08-03 10:45:17 -04:00
dh_lib.c Allow DH_set0_key with only private key. 2017-09-26 14:48:51 +02:00
dh_locl.h Act on deprecation of LONG and ZLONG, step 2 2017-04-10 12:11:00 +02:00
dh_meth.c Raise an error on memory alloc failure. 2016-11-16 20:54:53 -05:00
dh_pmeth.c Copyright consolidation 05/10 2016-05-17 15:38:09 -04:00
dh_prn.c Copyright consolidation 05/10 2016-05-17 15:38:09 -04:00
dh_rfc5114.c Copyright consolidation 05/10 2016-05-17 15:38:09 -04:00