LordTitiKaka LordTitiKaka - 3 months ago 29
C++ Question

openssl lib - is it possible to set ClientHello random number form outside

I'm new to

openssl
lib and trying to extend
openssl
API.

I would like to create ClientHello as custom as possible so to see how my server reacts to it .

My question is : How can I set the
Random
section in
ClientHello
from the outside
enter image description here

overriding openssl lib settings

Answer

There is no interface for this. It is just using RAND_pseudo_bytes to generate the random bytes. But you might try to modify the source code to add your own hooks, probably ssl23_client_hello in ssl/s23_clnt.c.

EDIT: with the large code overhaul done with OpenSSL 1.1.0 the relevant code can be found in ssl/statem/statem_clnt.c function tls_construct_client_hello and it is using ssl_fill_hello_random (ssl/s3_lib.c) to generate the bytes which then calls RAND_bytes.