mirror of
https://github.com/thelsing/knx.git
synced 2025-01-21 00:05:43 +01:00
Rename DataSecurity enums; conflict with Wifimanager
This commit is contained in:
parent
eab31e7808
commit
2aecc213ff
@ -25,44 +25,44 @@ build_flags =
|
|||||||
|
|
||||||
|
|
||||||
;--- ESP8266 -----------------------------------------------
|
;--- ESP8266 -----------------------------------------------
|
||||||
#[env:nodemcuv2_ip]
|
[env:nodemcuv2_ip]
|
||||||
#platform = espressif8266
|
platform = espressif8266
|
||||||
#board = nodemcuv2
|
board = nodemcuv2
|
||||||
#framework = arduino
|
framework = arduino
|
||||||
#lib_deps =
|
lib_deps =
|
||||||
# WifiManager@0.15.0
|
WifiManager
|
||||||
# knx
|
knx
|
||||||
|
|
||||||
#build_flags =
|
build_flags =
|
||||||
# -DMASK_VERSION=0x57B0
|
-DMASK_VERSION=0x57B0
|
||||||
# -Wno-unknown-pragmas
|
-Wno-unknown-pragmas
|
||||||
|
|
||||||
#[env:nodemcuv2_tp]
|
[env:nodemcuv2_tp]
|
||||||
#platform = espressif8266
|
platform = espressif8266
|
||||||
#board = nodemcuv2
|
board = nodemcuv2
|
||||||
#framework = arduino
|
framework = arduino
|
||||||
#lib_deps =
|
lib_deps =
|
||||||
# WifiManager@0.15.0
|
WifiManager@0.15.0
|
||||||
# knx
|
knx
|
||||||
|
|
||||||
#build_flags =
|
build_flags =
|
||||||
# -DMASK_VERSION=0x07B0
|
-DMASK_VERSION=0x07B0
|
||||||
# -Wno-unknown-pragmas
|
-Wno-unknown-pragmas
|
||||||
|
|
||||||
;---------------------------------------------------------
|
;---------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
;--- ESP32 -----------------------------------------------
|
;--- ESP32 -----------------------------------------------
|
||||||
#[env:esp32dev_ip]
|
[env:esp32dev_ip]
|
||||||
#platform = espressif32
|
platform = espressif32
|
||||||
#board = esp32dev
|
board = esp32dev
|
||||||
#framework = arduino
|
framework = arduino
|
||||||
#lib_deps =
|
lib_deps =
|
||||||
# knx
|
knx
|
||||||
|
|
||||||
#build_flags =
|
build_flags =
|
||||||
# -DMASK_VERSION=0x57B0
|
-DMASK_VERSION=0x57B0
|
||||||
# -Wno-unknown-pragmas
|
-Wno-unknown-pragmas
|
||||||
|
|
||||||
[env:esp32dev_tp]
|
[env:esp32dev_tp]
|
||||||
platform = espressif32
|
platform = espressif32
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
#include "bits.h"
|
#include "bits.h"
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
const SecurityControl ApplicationLayer::noSecurity {.toolAccess=false, .dataSecurity=DataSecurity::none};
|
const SecurityControl ApplicationLayer::noSecurity {.toolAccess=false, .dataSecurity=DataSecurity::None};
|
||||||
|
|
||||||
ApplicationLayer::ApplicationLayer(BusAccessUnit& bau) : _bau(bau)
|
ApplicationLayer::ApplicationLayer(BusAccessUnit& bau) : _bau(bau)
|
||||||
{
|
{
|
||||||
|
@ -31,7 +31,7 @@ class ApplicationLayer
|
|||||||
void associationTableObject(AssociationTableObject& assocTable);
|
void associationTableObject(AssociationTableObject& assocTable);
|
||||||
|
|
||||||
// from transport layer
|
// from transport layer
|
||||||
// Note: without data secure feature, the application layer is just used with SecurtyControl.dataSecurity = none
|
// Note: without data secure feature, the application layer is just used with SecurtyControl.dataSecurity = None
|
||||||
// hooks that can be implemented by derived class (e.g. SecureApplicationLayer)
|
// hooks that can be implemented by derived class (e.g. SecureApplicationLayer)
|
||||||
|
|
||||||
#pragma region Transport - Layer - Callbacks
|
#pragma region Transport - Layer - Callbacks
|
||||||
|
@ -79,7 +79,7 @@ void BauSystemBDevice::sendNextGroupTelegram()
|
|||||||
// Get security flags from Security Interface Object for this group object
|
// Get security flags from Security Interface Object for this group object
|
||||||
goSecurity.dataSecurity = _secIfObj.getGroupObjectSecurity(asap);
|
goSecurity.dataSecurity = _secIfObj.getGroupObjectSecurity(asap);
|
||||||
#else
|
#else
|
||||||
goSecurity.dataSecurity = DataSecurity::none;
|
goSecurity.dataSecurity = DataSecurity::None;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (flag == WriteRequest && go.transmitEnable())
|
if (flag == WriteRequest && go.transmitEnable())
|
||||||
|
@ -204,9 +204,9 @@ enum ApduType
|
|||||||
|
|
||||||
enum DataSecurity
|
enum DataSecurity
|
||||||
{
|
{
|
||||||
none,
|
None,
|
||||||
auth,
|
Auth,
|
||||||
authConf
|
AuthConf
|
||||||
};
|
};
|
||||||
|
|
||||||
struct SecurityControl
|
struct SecurityControl
|
||||||
|
@ -305,7 +305,7 @@ void SecureApplicationLayer::dataGroupRequest(AckType ack, HopCountType hopType,
|
|||||||
|
|
||||||
println("dataGroupRequest");
|
println("dataGroupRequest");
|
||||||
|
|
||||||
if (secCtrl.dataSecurity != DataSecurity::none)
|
if (secCtrl.dataSecurity != DataSecurity::None)
|
||||||
{
|
{
|
||||||
apdu.frame().sourceAddress(_deviceObj.individualAddress());
|
apdu.frame().sourceAddress(_deviceObj.individualAddress());
|
||||||
apdu.frame().destinationAddress(_addrTab->getGroupAddress(tsap));
|
apdu.frame().destinationAddress(_addrTab->getGroupAddress(tsap));
|
||||||
@ -328,7 +328,7 @@ void SecureApplicationLayer::dataBroadcastRequest(AckType ack, HopCountType hopT
|
|||||||
{
|
{
|
||||||
println("dataBroadcastRequest");
|
println("dataBroadcastRequest");
|
||||||
|
|
||||||
if (secCtrl.dataSecurity != DataSecurity::none)
|
if (secCtrl.dataSecurity != DataSecurity::None)
|
||||||
{
|
{
|
||||||
apdu.frame().sourceAddress(_deviceObj.individualAddress());
|
apdu.frame().sourceAddress(_deviceObj.individualAddress());
|
||||||
apdu.frame().destinationAddress(0x0000);
|
apdu.frame().destinationAddress(0x0000);
|
||||||
@ -352,7 +352,7 @@ void SecureApplicationLayer::dataSystemBroadcastRequest(AckType ack, HopCountTyp
|
|||||||
{
|
{
|
||||||
println("dataSystemBroadcastRequest");
|
println("dataSystemBroadcastRequest");
|
||||||
|
|
||||||
if (secCtrl.dataSecurity != DataSecurity::none)
|
if (secCtrl.dataSecurity != DataSecurity::None)
|
||||||
{
|
{
|
||||||
apdu.frame().sourceAddress(_deviceObj.individualAddress());
|
apdu.frame().sourceAddress(_deviceObj.individualAddress());
|
||||||
apdu.frame().destinationAddress(0x0000);
|
apdu.frame().destinationAddress(0x0000);
|
||||||
@ -376,7 +376,7 @@ void SecureApplicationLayer::dataIndividualRequest(AckType ack, HopCountType hop
|
|||||||
{
|
{
|
||||||
println("dataIndividualRequest");
|
println("dataIndividualRequest");
|
||||||
|
|
||||||
if (secCtrl.dataSecurity != DataSecurity::none)
|
if (secCtrl.dataSecurity != DataSecurity::None)
|
||||||
{
|
{
|
||||||
apdu.frame().sourceAddress(_deviceObj.individualAddress());
|
apdu.frame().sourceAddress(_deviceObj.individualAddress());
|
||||||
apdu.frame().destinationAddress(destination);
|
apdu.frame().destinationAddress(destination);
|
||||||
@ -399,7 +399,7 @@ void SecureApplicationLayer::dataConnectedRequest(uint16_t tsap, Priority priori
|
|||||||
{
|
{
|
||||||
println("dataConnectedRequest");
|
println("dataConnectedRequest");
|
||||||
|
|
||||||
if (secCtrl.dataSecurity != DataSecurity::none)
|
if (secCtrl.dataSecurity != DataSecurity::None)
|
||||||
{
|
{
|
||||||
apdu.frame().sourceAddress(_deviceObj.individualAddress());
|
apdu.frame().sourceAddress(_deviceObj.individualAddress());
|
||||||
apdu.frame().destinationAddress(_transportLayer->getConnectionAddress());
|
apdu.frame().destinationAddress(_transportLayer->getConnectionAddress());
|
||||||
@ -593,7 +593,7 @@ void SecureApplicationLayer::updateLastValidSequence(bool toolAccess, uint16_t r
|
|||||||
|
|
||||||
void SecureApplicationLayer::sendSyncRequest(uint16_t dstAddr, bool dstAddrIsGroupAddr, const SecurityControl &secCtrl, bool systemBcast)
|
void SecureApplicationLayer::sendSyncRequest(uint16_t dstAddr, bool dstAddrIsGroupAddr, const SecurityControl &secCtrl, bool systemBcast)
|
||||||
{
|
{
|
||||||
if (secCtrl.dataSecurity != DataSecurity::authConf)
|
if (secCtrl.dataSecurity != DataSecurity::AuthConf)
|
||||||
{
|
{
|
||||||
println("sync.req is always sent with auth+conf!");
|
println("sync.req is always sent with auth+conf!");
|
||||||
return;
|
return;
|
||||||
@ -655,7 +655,7 @@ void SecureApplicationLayer::sendSyncRequest(uint16_t dstAddr, bool dstAddrIsGro
|
|||||||
|
|
||||||
void SecureApplicationLayer::sendSyncResponse(uint16_t dstAddr, bool dstAddrIsGroupAddr, const SecurityControl &secCtrl, uint64_t remoteNextSeqNum, bool systemBcast)
|
void SecureApplicationLayer::sendSyncResponse(uint16_t dstAddr, bool dstAddrIsGroupAddr, const SecurityControl &secCtrl, uint64_t remoteNextSeqNum, bool systemBcast)
|
||||||
{
|
{
|
||||||
if (secCtrl.dataSecurity != DataSecurity::authConf)
|
if (secCtrl.dataSecurity != DataSecurity::AuthConf)
|
||||||
{
|
{
|
||||||
println("sync.res is always sent with auth+conf!");
|
println("sync.res is always sent with auth+conf!");
|
||||||
return;
|
return;
|
||||||
@ -797,7 +797,7 @@ bool SecureApplicationLayer::decrypt(uint8_t* plainApdu, uint16_t plainApduLengt
|
|||||||
}
|
}
|
||||||
|
|
||||||
secCtrl.toolAccess = toolAccess;
|
secCtrl.toolAccess = toolAccess;
|
||||||
secCtrl.dataSecurity = authOnly ? DataSecurity::auth : DataSecurity::authConf;
|
secCtrl.dataSecurity = authOnly ? DataSecurity::Auth : DataSecurity::AuthConf;
|
||||||
|
|
||||||
bool syncReq = service == kSecureSyncRequest;
|
bool syncReq = service == kSecureSyncRequest;
|
||||||
bool syncRes = service == kSecureSyncResponse;
|
bool syncRes = service == kSecureSyncResponse;
|
||||||
@ -1052,7 +1052,7 @@ bool SecureApplicationLayer::secure(uint8_t* buffer, uint16_t service, uint16_t
|
|||||||
uint8_t* apdu, uint16_t apduLength, const SecurityControl& secCtrl, bool systemBcast)
|
uint8_t* apdu, uint16_t apduLength, const SecurityControl& secCtrl, bool systemBcast)
|
||||||
{
|
{
|
||||||
bool toolAccess = secCtrl.toolAccess;
|
bool toolAccess = secCtrl.toolAccess;
|
||||||
bool confidentiality = secCtrl.dataSecurity == DataSecurity::authConf;
|
bool confidentiality = secCtrl.dataSecurity == DataSecurity::AuthConf;
|
||||||
|
|
||||||
if (toolAccess)
|
if (toolAccess)
|
||||||
{
|
{
|
||||||
|
@ -550,10 +550,10 @@ DataSecurity SecurityInterfaceObject::getGroupObjectSecurity(uint16_t index)
|
|||||||
// write access flags, approved spec. AN158, p.97
|
// write access flags, approved spec. AN158, p.97
|
||||||
bool conf = (data[0] & 2) == 2;
|
bool conf = (data[0] & 2) == 2;
|
||||||
bool auth = (data[0] & 1) == 1;
|
bool auth = (data[0] & 1) == 1;
|
||||||
return conf ? DataSecurity::authConf : auth ? DataSecurity::auth : DataSecurity::none;
|
return conf ? DataSecurity::AuthConf : auth ? DataSecurity::Auth : DataSecurity::None;
|
||||||
}
|
}
|
||||||
|
|
||||||
return DataSecurity::none;
|
return DataSecurity::None;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user