Ejemplo n.º 1
0
int tlsp_set_method(modparam_t type, void *in)
{
	str name;
	str val;
	int method;

	if (split_param_val((char*)in, &name, &val) < 0)
		return -1;

	if (!name.s && set_up_default_doms() < 0)
		return -1;

	if (strcasecmp(val.s, "SSLV23")==0 || strcasecmp(val.s, "TLSany")==0 )
		method = TLS_USE_SSLv23;
	else if (strcasecmp(val.s, "TLSV1")==0 )
		method = TLS_USE_TLSv1;
	else if (strcasecmp(val.s, "TLSV1_2")==0 )
		method = TLS_USE_TLSv1_2;
	else {
		LM_ERR("unsupported method [%s]\n",val.s);
		return -1;
	}

	set_domain_attr(name, method, method);

	return 1;
}
Ejemplo n.º 2
0
int tlsp_set_eccurve(modparam_t type, void *in)
{
	str id;
	str val;

	split_param_val( (char*)in, &id, &val);

	set_domain_attr( id, tls_ec_curve, val.s);
	return 1;
}
Ejemplo n.º 3
0
int tlsp_set_dhparams(modparam_t type, void *in)
{
	str id;
	str val;

	split_param_val( (char*)in, &id, &val);

	set_domain_attr( id, tmp_dh_file, val.s);
	return 1;
}
Ejemplo n.º 4
0
int tlsp_set_cplist(modparam_t type, void *in)
{
	str id;
	str val;

	split_param_val( (char*)in, &id, &val);

	set_domain_attr( id, ciphers_list, val.s);
	return 1;
}
Ejemplo n.º 5
0
int tlsp_set_cadir(modparam_t type, void *in)
{
	str id;
	str val;

	split_param_val( (char*)in, &id, &val);

	set_domain_attr( id, ca_directory, val.s);
	return 1;
}
Ejemplo n.º 6
0
int tlsp_set_certificate(modparam_t type, void *in)
{
	str id;
	str val;

	split_param_val( (char*)in, &id, &val);

	set_domain_attr( id, cert_file, val.s);
	return 1;
}
Ejemplo n.º 7
0
int tlsp_set_eccurve(modparam_t type, void *in)
{
	str name;
	str val;

	if (split_param_val((char*)in, &name, &val) < 0)
		return -1;

	if (!name.s && set_up_default_doms() < 0)
		return -1;

	set_domain_attr(name, tls_ec_curve, val.s);
	return 1;
}
Ejemplo n.º 8
0
int tlsp_set_cplist(modparam_t type, void *in)
{
	str name;
	str val;

	if (split_param_val((char*)in, &name, &val) < 0)
		return -1;

	if (!name.s && set_up_default_doms() < 0)
		return -1;

	set_domain_attr(name, ciphers_list, val.s);
	return 1;
}
Ejemplo n.º 9
0
int tlsp_set_crl_check(modparam_t type, void *in)
{
       str id;
       str val;
       unsigned int check;

       split_param_val( (char*)in, &id, &val);

       if (str2int( &val, &check)!=0) {
               LM_ERR("option is not a number [%s]\n",val.s);
               return -1;
       }

       set_domain_attr( id, crl_check_all, check);
       return 1;
}
Ejemplo n.º 10
0
int tlsp_set_require(modparam_t type, void *in)
{
	str id;
	str val;
	unsigned int req;

	split_param_val( (char*)in, &id, &val);

	if (str2int( &val, &req)!=0) {
		LM_ERR("option is not a number [%s]\n",val.s);
		return -1;
	}

	set_domain_attr( id, require_client_cert, req);
	return 1;
}
Ejemplo n.º 11
0
int tlsp_set_verify(modparam_t type, void *in)
{
	str id;
	str val;
	unsigned int verify;

	split_param_val( (char*)in, &id, &val);

	if (str2int( &val, &verify)!=0) {
		LM_ERR("option is not a number [%s]\n",val.s);
		return -1;
	}

	set_domain_attr( id, verify_cert, verify);
	return 1;
}
Ejemplo n.º 12
0
int tlsp_set_crl_check(modparam_t type, void *in)
{
	str name;
	str val;
	unsigned int check;

	if (split_param_val((char*)in, &name, &val) < 0)
		return -1;

	if (!name.s && set_up_default_doms() < 0)
		return -1;

	if (str2int(&val, &check)!=0) {
		LM_ERR("option is not a number [%s]\n",val.s);
		return -1;
	}

	set_domain_attr(name, crl_check_all, check);
	return 1;
}
Ejemplo n.º 13
0
int tlsp_set_require(modparam_t type, void *in)
{
	str name;
	str val;
	unsigned int req;

	if (split_param_val((char*)in, &name, &val) < 0)
		return -1;

	if (!name.s && set_up_default_doms() < 0)
		return -1;

	if (str2int(&val, &req)!=0) {
		LM_ERR("option is not a number [%s]\n",val.s);
		return -1;
	}
	
	set_domain_attr(name, require_client_cert, req);
	return 1;
}
Ejemplo n.º 14
0
int tlsp_set_method(modparam_t type, void *in)
{
	str id;
	str val;
	int method;

	split_param_val( (char*)in, &id, &val);

	if ( strcasecmp( val.s, "SSLV23")==0 || strcasecmp( val.s, "TLSany")==0 )
		method = TLS_USE_SSLv23;
	else if ( strcasecmp( val.s, "TLSV1")==0 )
		method = TLS_USE_TLSv1;
	else if ( strcasecmp( val.s, "TLSV1_2")==0 )
		method = TLS_USE_TLSv1_2;
	else {
		LM_ERR("unsupported method [%s]\n",val.s);
		return -1;
	}

	set_domain_attr( id, method, method);
	return 1;
}