diff options
author | venaas <venaas> | 2008-07-17 17:17:47 +0000 |
---|---|---|
committer | venaas <venaas@e88ac4ed-0b26-0410-9574-a7f39faa03bf> | 2008-07-17 17:17:47 +0000 |
commit | 210f1edda60830fcde0963954e1643f8f92fbda9 (patch) | |
tree | 1f411ec72429b2ff094a8caff3a615672ee23b3b | |
parent | 2aa5af0d3ab2c664bf4ea6c4bfa90a5245e44d8c (diff) |
added crlcheck config option, default off
git-svn-id: https://svn.testnett.uninett.no/radsecproxy/trunk@305 e88ac4ed-0b26-0410-9574-a7f39faa03bf
-rw-r--r-- | radsecproxy.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/radsecproxy.c b/radsecproxy.c index 91cafcf..7f1ab32 100644 --- a/radsecproxy.c +++ b/radsecproxy.c @@ -2747,7 +2747,7 @@ int tlslistener() { return 0; } -void tlsadd(char *value, char *cacertfile, char *cacertpath, char *certfile, char *certkeyfile, char *certkeypwd) { +void tlsadd(char *value, char *cacertfile, char *cacertpath, char *certfile, char *certkeyfile, char *certkeypwd, uint8_t crlcheck) { struct tls *new; SSL_CTX *ctx; STACK_OF(X509_NAME) *calist; @@ -2816,8 +2816,10 @@ void tlsadd(char *value, char *cacertfile, char *cacertpath, char *certfile, cha SSL_CTX_set_verify(ctx, SSL_VERIFY_PEER | SSL_VERIFY_FAIL_IF_NO_PEER_CERT, verify_cb); SSL_CTX_set_verify_depth(ctx, MAX_CERT_DEPTH + 1); - x509_s = SSL_CTX_get_cert_store(ctx); - X509_STORE_set_flags(x509_s, X509_V_FLAG_CRL_CHECK | X509_V_FLAG_CRL_CHECK_ALL); + if (crlcheck) { + x509_s = SSL_CTX_get_cert_store(ctx); + X509_STORE_set_flags(x509_s, X509_V_FLAG_CRL_CHECK | X509_V_FLAG_CRL_CHECK_ALL); + } new = malloc(sizeof(struct tls)); if (!new || !list_push(tlsconfs, new)) @@ -3640,6 +3642,7 @@ int confrealm_cb(struct gconffile **cf, void *arg, char *block, char *opt, char int conftls_cb(struct gconffile **cf, void *arg, char *block, char *opt, char *val) { char *cacertfile = NULL, *cacertpath = NULL, *certfile = NULL, *certkeyfile = NULL, *certkeypwd = NULL; + uint8_t crlcheck = 0; debug(DBG_DBG, "conftls_cb called for %s", block); @@ -3649,11 +3652,12 @@ int conftls_cb(struct gconffile **cf, void *arg, char *block, char *opt, char *v "CertificateFile", CONF_STR, &certfile, "CertificateKeyFile", CONF_STR, &certkeyfile, "CertificateKeyPassword", CONF_STR, &certkeypwd, + "CRLCheck", CONF_BLN, &crlcheck, NULL )) debugx(1, DBG_ERR, "configuration error"); - tlsadd(val, cacertfile, cacertpath, certfile, certkeyfile, certkeypwd); + tlsadd(val, cacertfile, cacertpath, certfile, certkeyfile, certkeypwd, crlcheck); free(cacertfile); free(cacertpath); free(certfile); |