mirror of
https://gitlab.com/openconnect/ocserv.git
synced 2026-02-10 16:57:00 +08:00
Several updates to handle URLs requested by the cisco client.
This commit is contained in:
14
src/config.c
14
src/config.c
@@ -30,6 +30,7 @@
|
||||
#include <autoopts/options.h>
|
||||
|
||||
#include <vpn.h>
|
||||
#include <tlslib.h>
|
||||
|
||||
#define DEFAULT_CFG_FILE "/etc/ocserv.conf"
|
||||
|
||||
@@ -146,6 +147,7 @@ unsigned j;
|
||||
READ_STRING("server-key", config->key, 1);
|
||||
READ_STRING("pin-file", config->pin_file, 0);
|
||||
READ_STRING("srk-pin-file", config->srk_pin_file, 0);
|
||||
READ_STRING("user-profile", config->xml_config_file, 0);
|
||||
|
||||
READ_STRING("ca-cert", config->ca, 0);
|
||||
READ_STRING("crl", config->crl, 0);
|
||||
@@ -208,6 +210,7 @@ unsigned j;
|
||||
READ_MULTI_LINE("route", config->network.routes, config->network.routes_size, 0);
|
||||
}
|
||||
|
||||
|
||||
/* sanity checks on config */
|
||||
static void check_cfg( struct cfg_st *config)
|
||||
{
|
||||
@@ -230,6 +233,14 @@ static void check_cfg( struct cfg_st *config)
|
||||
fprintf(stderr, "Banner size is too long\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (config->cert) {
|
||||
config->cert_hash = calc_sha1_hash(config->cert, 1);
|
||||
}
|
||||
|
||||
if (config->xml_config_file) {
|
||||
config->xml_config_hash = calc_sha1_hash(config->xml_config_file, 0);
|
||||
}
|
||||
|
||||
if (config->keepalive == 0)
|
||||
config->keepalive = 3600;
|
||||
@@ -280,6 +291,9 @@ void reload_cfg_file(struct cfg_st* config)
|
||||
{
|
||||
unsigned i;
|
||||
|
||||
DEL(config->xml_config_file);
|
||||
DEL(config->xml_config_hash);
|
||||
DEL(config->cert_hash);
|
||||
DEL(config->banner);
|
||||
DEL(config->name);
|
||||
DEL(config->cert);
|
||||
|
||||
Reference in New Issue
Block a user