From a6836690e2851d555f431c0d1f6e50ad1fa80045 Mon Sep 17 00:00:00 2001 From: maschinist Date: Sat, 25 Aug 2018 17:22:12 +0200 Subject: [PATCH] Simple tests for AuthKey option added --- DAPNETGateway.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/DAPNETGateway.cpp b/DAPNETGateway.cpp index bc0c6e0..04af617 100644 --- a/DAPNETGateway.cpp +++ b/DAPNETGateway.cpp @@ -220,6 +220,13 @@ int CDAPNETGateway::run() unsigned int dapnetPort = m_conf.getDAPNETPort(); std::string dapnetAuthKey = m_conf.getDAPNETAuthKey(); + if (dapnetAuthKey.length() == 0 || dapnetAuthKey == "TOPSECRET") { + ::LogError("AuthKey not set or invalid"); + ::LogFinalise(); + + return 1; + } + m_dapnetNetwork = new CDAPNETNetwork(dapnetAddress, dapnetPort, callsign, dapnetAuthKey, VERSION, debug); ret = m_dapnetNetwork->open(); if (!ret) {