Hi,
--------- Server Random ----------
The server random value is sent during the ServerHello message of the SSL/TLS handshake. This is later used to calculate the master secret.
wolfSSL exposes the following two functions when compiled with OPENSSL_EXTRA defined:
<wolfssl/ssl.h>
void wolfSSL_KeepArrays(WOLFSSL* ssl);
void wolfSSL_FreeArrays(WOLFSSL* ssl);
int wolfSSL_get_keys(WOLFSSL*,unsigned char** ms, unsigned int* msLen,
unsigned char** sr, unsigned int* srLen,
unsigned char** cr, unsigned int* crLen);
wolfSSL_get_keys() will give your application access to the master secret (ms), server random (sr), and client random (cr). The pointers you pass in will point to those values held by wolfSSL internally. The sizes of each are returned through msLen, srLen, and crLen. This function must be called after the handshake completes.
Before the handshake starts, you need to call wolfSSL_KeepArrays() so these arrays remain available after the handshake finishes. Your application can free the arrays by calling wolfSSL_FreeArrays(), or wait for the WOLFSSL object to be freed.
---------- umich.edu ----------
For connecting to "umich.edu", this server only supports static RSA cipher suites. By default, wolfSSL has static RSA cipher suites disabled by default. You can enable them at compile time by defining WOLFSSL_STATIC_RSA. Adding that to your ./configure would be:
./configure --enable-tlsx --enable-supportedcurves --disable-fastmath C_EXTRA_FLAGS="-DWOLFSSL_STATIC_RSA"
After this, the example client will connect successfully to "umich.edu" using the attached root CA certificate:
./examples/client/client -h umich.edu -p 443 -v 1 -A addtrustexternalcaroot.crt
To determine the cipher suites and protocol version supported by "umich.edu", I used the "ssl-enum-ciphers" script provided by the nmap tool:
nmap --script ssl-enum-ciphers -p 443 umich.edu
Best Regards,
Chris