Allow "none" for Cipher and Digest again.
This commit is contained in:
parent
3d41e7d712
commit
51bddfd4dd
2 changed files with 20 additions and 8 deletions
|
@ -747,7 +747,9 @@ static bool setup_myself(void) {
|
||||||
if(!get_config_string(lookup_config(config_tree, "Cipher"), &cipher))
|
if(!get_config_string(lookup_config(config_tree, "Cipher"), &cipher))
|
||||||
cipher = xstrdup("blowfish");
|
cipher = xstrdup("blowfish");
|
||||||
|
|
||||||
if(!(myself->incipher = cipher_open_by_name(cipher))) {
|
if(!strcasecmp(cipher, "none")) {
|
||||||
|
myself->incipher = NULL;
|
||||||
|
} else if(!(myself->incipher = cipher_open_by_name(cipher))) {
|
||||||
logger(DEBUG_ALWAYS, LOG_ERR, "Unrecognized cipher type!");
|
logger(DEBUG_ALWAYS, LOG_ERR, "Unrecognized cipher type!");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -769,7 +771,9 @@ static bool setup_myself(void) {
|
||||||
if(!get_config_string(lookup_config(config_tree, "Digest"), &digest))
|
if(!get_config_string(lookup_config(config_tree, "Digest"), &digest))
|
||||||
digest = xstrdup("sha1");
|
digest = xstrdup("sha1");
|
||||||
|
|
||||||
if(!(myself->indigest = digest_open_by_name(digest, maclength))) {
|
if(!strcasecmp(digest, "none")) {
|
||||||
|
myself->indigest = NULL;
|
||||||
|
} else if(!(myself->indigest = digest_open_by_name(digest, maclength))) {
|
||||||
logger(DEBUG_ALWAYS, LOG_ERR, "Unrecognized digest type!");
|
logger(DEBUG_ALWAYS, LOG_ERR, "Unrecognized digest type!");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -395,15 +395,23 @@ bool ans_key_h(connection_t *c, const char *request) {
|
||||||
|
|
||||||
/* Check and lookup cipher and digest algorithms */
|
/* Check and lookup cipher and digest algorithms */
|
||||||
|
|
||||||
|
if(cipher) {
|
||||||
if(!(from->outcipher = cipher_open_by_nid(cipher))) {
|
if(!(from->outcipher = cipher_open_by_nid(cipher))) {
|
||||||
logger(DEBUG_ALWAYS, LOG_ERR, "Node %s (%s) uses unknown cipher!", from->name, from->hostname);
|
logger(DEBUG_ALWAYS, LOG_ERR, "Node %s (%s) uses unknown cipher!", from->name, from->hostname);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
from->outcipher = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(digest) {
|
||||||
if(!(from->outdigest = digest_open_by_nid(digest, maclength))) {
|
if(!(from->outdigest = digest_open_by_nid(digest, maclength))) {
|
||||||
logger(DEBUG_ALWAYS, LOG_ERR, "Node %s (%s) uses unknown digest!", from->name, from->hostname);
|
logger(DEBUG_ALWAYS, LOG_ERR, "Node %s (%s) uses unknown digest!", from->name, from->hostname);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
from->outdigest = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
if(maclength != digest_length(from->outdigest)) {
|
if(maclength != digest_length(from->outdigest)) {
|
||||||
logger(DEBUG_ALWAYS, LOG_ERR, "Node %s (%s) uses bogus MAC length!", from->name, from->hostname);
|
logger(DEBUG_ALWAYS, LOG_ERR, "Node %s (%s) uses bogus MAC length!", from->name, from->hostname);
|
||||||
|
|
Loading…
Reference in a new issue