I am trying work with DLMS_AUTHENTICATION_HIGH_GMAC
Got a coredump , see below
(gdb) p block->c3 >> 24
$1 = 1099511627708
AES is 255 array, so it crashed.
I've tried to change code to r0 ^= Shift((AES[block->c3 >> 24 ) & 0xFF], 8);
but then server side return InvalidConnection.
(gdb) r
Starting program: /home/micgur01/work/cleanDLMS/Gurux.DLMS.cpp/GuruxDLMSClientExample/bin/gurux.dlms.client.bin
InitializeConnection
Program received signal SIGSEGV, Segmentation fault.
0x000000000043d730 in CGXCipher::EncryptBlock (
settings=settings@entry=0x7fffffffd920, block=block@entry=0x7fffffffcc50)
at src/GXCipher.cpp:562
562 r0 ^= Shift(AES[block->c3 >> 24], 8);
(gdb) bt
#0 0x000000000043d730 in CGXCipher::EncryptBlock (
settings=settings@entry=0x7fffffffd920, block=block@entry=0x7fffffffcc50)
at src/GXCipher.cpp:562
#1 0x000000000043dc16 in CGXCipher::ProcessBlock (settings=0x7fffffffd920,
input=0x7fffffffd9a0, inOffset=0, output=0x7fffffffd9a0, outOffset=0,
block=0x7fffffffcc50) at src/GXCipher.cpp:186
#2 0x000000000043e3ba in CGXCipher::Init (settings=0x7fffffffd920, aad=...,
iv=..., frameCounter=0, systemTitle=..., bufBlock=..., block=...)
at src/GXCipher.cpp:738
#3 0x000000000043ea8d in CGXCipher::Encrypt (this=this@entry=0x7fffffffd920,
security=security@entry=DLMS_SECURITY_AUTHENTICATION,
type=type@entry=DLMS_COUNT_TYPE_TAG, frameCounter=frameCounter@entry=0,
tag=tag@entry=0 '\000', systemTitle=..., plainText=..., encrypted=...)
at src/GXCipher.cpp:931
#4 0x000000000044c8ca in CGXSecure::Secure (settings=...,
cipher=0x7fffffffd920, ic=ic@entry=0, data=..., secret=..., reply=...)
at src/GXSecure.cpp:129
#5 0x000000000041661c in CGXDLMSClient::GetApplicationAssociationRequest (
this=0x7fffffffd520, packets=std::vector of length 0, capacity 2)
at src/GXDLMSClient.cpp:740
#6 0x000000000040596d in CGXCommunication::InitializeConnection (
this=0x7fffffffd430) at src/communication.cpp:688
#7 0x00000000004095cc in CGXCommunication::ReadAll (this=0x7fffffffd430)
---Type <return> to continue, or q <return> to quit---
By the way, only DLMS_AUTHENTICATION_LOW is working
others can not connect at all, and DLMS_AUTHENTICATION_HIGH_GMAC results coredump.
Could you please help?
Maybe need more settings to change, rather then authentication option?
Gurux.DLMS.cpp example as is, yep CGXDLMSSecureClient
CGXDLMSSecureClient cl(useLogicalNameReferencing, clientAddress, serverAddress, authentication, password, interfaceType);
Just check it on raspberry pi3 , Ubuntu Mate 32bit ( both client and server).
It looks ok, using GMAC - no coredump, print all info
Looks like 32/64 bit problem
it still problematic using server and client with different architecture, one 32 and other 64.
By the way , other HLS did not even start any object prints.
support HLS Authentication for C++
Hi,
Yes it's supported.
BR,
Mikko
support HLS Authentication for C++ for server side
Hi
Where is the relevant code? How to enable HLS at server side
for example HLS 5 - Galois Message Authentication Code (GMAC)
support HLS Authentication for C++ for server side
Hi,
You don't need to do anything. Client decides what authentication level is used.
Get latest version.
BR,
Mikko
support HLS Authentication for C++ for server side
Hello Mikko Kurunsaari,
Using the latest version from today
I am trying work with DLMS_AUTHENTICATION_HIGH_GMAC
Got a coredump , see below
(gdb) p block->c3 >> 24
$1 = 1099511627708
AES is 255 array, so it crashed.
I've tried to change code to r0 ^= Shift((AES[block->c3 >> 24 ) & 0xFF], 8);
but then server side return InvalidConnection.
(gdb) r
Starting program: /home/micgur01/work/cleanDLMS/Gurux.DLMS.cpp/GuruxDLMSClientExample/bin/gurux.dlms.client.bin
InitializeConnection
Program received signal SIGSEGV, Segmentation fault.
0x000000000043d730 in CGXCipher::EncryptBlock (
settings=settings@entry=0x7fffffffd920, block=block@entry=0x7fffffffcc50)
at src/GXCipher.cpp:562
562 r0 ^= Shift(AES[block->c3 >> 24], 8);
(gdb) bt
#0 0x000000000043d730 in CGXCipher::EncryptBlock (
settings=settings@entry=0x7fffffffd920, block=block@entry=0x7fffffffcc50)
at src/GXCipher.cpp:562
#1 0x000000000043dc16 in CGXCipher::ProcessBlock (settings=0x7fffffffd920,
input=0x7fffffffd9a0, inOffset=0, output=0x7fffffffd9a0, outOffset=0,
block=0x7fffffffcc50) at src/GXCipher.cpp:186
#2 0x000000000043e3ba in CGXCipher::Init (settings=0x7fffffffd920, aad=...,
iv=..., frameCounter=0, systemTitle=..., bufBlock=..., block=...)
at src/GXCipher.cpp:738
#3 0x000000000043ea8d in CGXCipher::Encrypt (this=this@entry=0x7fffffffd920,
security=security@entry=DLMS_SECURITY_AUTHENTICATION,
type=type@entry=DLMS_COUNT_TYPE_TAG, frameCounter=frameCounter@entry=0,
tag=tag@entry=0 '\000', systemTitle=..., plainText=..., encrypted=...)
at src/GXCipher.cpp:931
#4 0x000000000044c8ca in CGXSecure::Secure (settings=...,
cipher=0x7fffffffd920, ic=ic@entry=0, data=..., secret=..., reply=...)
at src/GXSecure.cpp:129
#5 0x000000000041661c in CGXDLMSClient::GetApplicationAssociationRequest (
this=0x7fffffffd520, packets=std::vector of length 0, capacity 2)
at src/GXDLMSClient.cpp:740
#6 0x000000000040596d in CGXCommunication::InitializeConnection (
this=0x7fffffffd430) at src/communication.cpp:688
#7 0x00000000004095cc in CGXCommunication::ReadAll (this=0x7fffffffd430)
---Type <return> to continue, or q <return> to quit---
By the way, only DLMS_AUTHENTICATION_LOW is working
others can not connect at all, and DLMS_AUTHENTICATION_HIGH_GMAC results coredump.
Could you please help?
Maybe need more settings to change, rather then authentication option?
Thanks,
Michael
support HLS Authentication for C++ for server side
Hi,
Are you using GXDLMSSecureClient? What OS you are using?
BR,
Mikko
support HLS Authentication for C++ for server side
Hi
Gurux.DLMS.cpp example as is, yep CGXDLMSSecureClient
CGXDLMSSecureClient cl(useLogicalNameReferencing, clientAddress, serverAddress, authentication, password, interfaceType);
Linux Ubuntu(64 bit)
BR,
Michael
support HLS Authentication for C++ for server side
Hi
Just check it on raspberry pi3 , Ubuntu Mate 32bit ( both client and server).
It looks ok, using GMAC - no coredump, print all info
Looks like 32/64 bit problem
it still problematic using server and client with different architecture, one 32 and other 64.
By the way , other HLS did not even start any object prints.
Thanks,
Michael
support HLS Authentication for C++ for server side
Hi,
We run test using Fedora 64bit. I'll ask to install 64 bit Ubuntu and we'll try with that.
I'll let you know as soon as I have something.
BR,
Mikko
I've just experienced the
I've just experienced the same problem on Ubuntu 14.04 LTS 64 bits, g++ 4.8.4. Is there any solution for that?
Ubuntu 14.04 LTS 64
Hi,
Do you have the latest version from Github? This should be fixed a long time ago.
BR,
Mikko
Ubuntu 14.04 LTS 64
I use the version downloaded from the master branch on October 16th this year.
Regards,
KW