|
|
@@ -113,12 +113,26 @@ static uint64_t time_now() { |
|
|
|
return ts.tv_sec * 1000000000 + ts.tv_nsec; |
|
|
|
} |
|
|
|
|
|
|
|
// Starts counting time after key has been generated on client side |
|
|
|
typedef void(*ngx_default_info_cb_t)(const SSL *ssl, int type, int value); |
|
|
|
static void chained_cb(const SSL *ssl, int type, int value) { |
|
|
|
if (!ssl) { |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
//printf("CHAINED > \n"); |
|
|
|
ngx_default_info_cb_t cb = |
|
|
|
SSL_CTX_get_ex_data( |
|
|
|
SSL_get_SSL_CTX(ssl), SSL_DEF_CB); |
|
|
|
|
|
|
|
if (cb) { |
|
|
|
cb(ssl,type,value); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
static void after_keygen_handshake_time(const SSL *ssl, int type, int value) { |
|
|
|
|
|
|
|
static const char* ss_exp = "send_server_hello"; |
|
|
|
// OZAPTF: should be static |
|
|
|
const size_t ss_exp_len = strlen(ss_exp); |
|
|
|
static const size_t ss_exp_len = 17; |
|
|
|
|
|
|
|
switch (type) { |
|
|
|
case SSL_CB_ACCEPT_LOOP: { |
|
|
@@ -181,6 +195,9 @@ static SSL_CTX* setup_server_ctx(const char* cert_name) { |
|
|
|
|
|
|
|
} |
|
|
|
SSL_CTX_set_info_callback(ctx, after_keygen_handshake_time); |
|
|
|
ngx_default_info_cb_t cb = SSL_CTX_get_info_callback(ctx); |
|
|
|
SSL_CTX_set_ex_data(ctx, SSL_DEF_CB, (void*)cb); |
|
|
|
SSL_CTX_set_info_callback(ctx, chained_cb); |
|
|
|
return ctx; |
|
|
|
} |
|
|
|
|
|
|
|