Added support for trustchain key strength checking to rightauth option

This commit is contained in:
Martin Willi
2011-01-07 15:51:35 +01:00
parent 6367de28ad
commit 44e513a320
2 changed files with 20 additions and 4 deletions
+13 -2
View File
@@ -445,11 +445,22 @@ static auth_cfg_t *build_auth_cfg(private_stroke_config_t *this,
/* authentication metod (class, actually) */
if (streq(auth, "pubkey") ||
streq(auth, "rsasig") || streq(auth, "rsa") ||
streq(auth, "ecdsasig") || streq(auth, "ecdsa"))
strneq(auth, "rsa", strlen("rsa")) ||
strneq(auth, "ecdsa", strlen("ecdsa")))
{
u_int strength;
cfg->add(cfg, AUTH_RULE_AUTH_CLASS, AUTH_CLASS_PUBKEY);
build_crl_policy(cfg, local, msg->add_conn.crl_policy);
if (sscanf(auth, "rsa-%d", &strength) == 1)
{
cfg->add(cfg, AUTH_RULE_RSA_STRENGTH, (uintptr_t)strength);
}
if (sscanf(auth, "ecdsa-%d", &strength) == 1)
{
cfg->add(cfg, AUTH_RULE_ECDSA_STRENGTH, (uintptr_t)strength);
}
}
else if (streq(auth, "psk") || streq(auth, "secret"))
{