Add warning when community and encryption keys match

This commit is contained in:
emanuele-f 2019-06-22 15:46:46 +02:00
parent 65c81612ca
commit 32f757922c

3
edge.c
View File

@ -649,6 +649,9 @@ int main(int argc, char* argv[]) {
if(tuntap_open(&tuntap, ec.tuntap_dev_name, ec.ip_mode, ec.ip_addr, ec.netmask, ec.device_mac, ec.mtu) < 0)
return(-1);
if(conf.encrypt_key && !strcmp((char*)conf.community_name, conf.encrypt_key))
traceEvent(TRACE_WARNING, "Community and encryption key must differ, otherwise security will be compromised");
if((eee = edge_init(&tuntap, &conf, &rc)) == NULL) {
traceEvent(TRACE_ERROR, "Failed in edge_init");
exit(1);