Skip to content
Snippets Groups Projects
Commit b1966964 authored by Deucе's avatar Deucе :ok_hand_tone4:
Browse files

Log key/cert creation and deletion.

May help nail down issue with keys.
parent 83d6ae6e
No related branches found
No related tags found
No related merge requests found
Pipeline #5046 passed
......@@ -349,6 +349,7 @@ void free_cfg(scfg_t* cfg)
#if defined(SBBS) && defined(USE_CRYPTLIB)
lock_ssl_cert_write();
if (cfg->tls_certificate != -1) {
lprintf(LOG_INFO, "Freeing TLS private key and certificate %d", cfg->tls_certificate);
cryptDestroyContext(cfg->tls_certificate);
cfg->tls_certificate = -1;
}
......
......@@ -377,6 +377,7 @@ CRYPT_CONTEXT get_ssl_cert(scfg_t *cfg, char **estr, int *level)
return ssl_context;
}
cfg->tls_cert_file_date = fd;
lprintf(LOG_INFO, "Destroying TLS private key and certificate %d", cfg->tls_certificate);
cryptDestroyContext(cfg->tls_certificate);
cfg->tls_certificate = -1;
}
......@@ -440,6 +441,8 @@ CRYPT_CONTEXT get_ssl_cert(scfg_t *cfg, char **estr, int *level)
cryptKeysetClose(ssl_keyset);
cfg->tls_certificate = ssl_context;
if (cfg->tls_certificate != -1)
lprintf(LOG_INFO, "Created TLS private key and certificate %d", cfg->tls_certificate);
unlock_ssl_cert_write();
return ssl_context;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment