Store current TLS certificate fingerpint in memory for reconnect

This commit is contained in:
James Booth
2015-11-09 20:57:26 +00:00
parent b3737b225f
commit 4cbfb88814
4 changed files with 47 additions and 0 deletions

View File

@@ -718,10 +718,17 @@ int
sv_ev_certfail(const char *const errormsg, const char *const certname, const char *const certfp,
const char *const notbefore, const char *const notafter)
{
// check profanity trusted certs
if (tlscerts_exists(certfp)) {
return 1;
}
// check current cert
char *current_fp = tlscerts_get_current();
if (current_fp && g_strcmp0(current_fp, certfp) == 0) {
return 1;
}
char *domain = NULL;
char *org = NULL;
char *email = NULL;
@@ -780,6 +787,7 @@ sv_ev_certfail(const char *const errormsg, const char *const certname, const cha
}
if (g_strcmp0(cmd, "/tls allow") == 0) {
tlscerts_set_current(certfp);
free(cmd);
free(domain);
free(org);