According to that piece of documentation: https://wiki.openssl.org/index.php/Diffie_Hellman#Using_the_Low_Level_APIs
Using the Low level API's for Diffie Hellman (need to perform a group Key agreement).
For simplicity I need to provide fixed values for Diffie Hellman p
and g
values for now I use the function DH_generate_parameters_ex
but any solution using these options may add a communication overhead and there are fixed values for p
and g
for Diffie Hellman offering good security.
So using the approach convention over configuration, how I can set fixed values especially the ones specified in this RFC to openssl low-level api fore diffie hellman instyead of generating ones on the fly?
PS I use the OpenSSL version 1.0.2g.
The (outer) primes for the RFC3526 and RFC2409 groups are builtin, per this man page (should also be on your system under those names if 1.1.0+) -- they are actually in the code back to before 1.0.0 but without the
BN_
prefix (though in thebn.h
header) and previously undocumented. (In 1.1.0+ the old names are additionally #define'd if compatibility is set.)AFAICS you must add the generator yourself, something like:
Note RFC5114 modp parameters are available prebuilt in
DH*
form but only in 1.1.0+.