DLMS High-Level Security (HLS 5 / GMAC) AARQ Association Rejection (Result: 0x01)
-
Scenario
When establishing an Application Association using High-Level Security Suite 0 (AES-GCM-128 / HLS 5 with GMAC authentication), the meter rejects the association during the AARQ/AARE handshake, returning
Association-Result: 0x01(rejected-permanent).AARQ APDU Hex Dump
60 36 A1 09 06 07 60 85 74 05 08 01 03 A6 0A 04 08 47 55 52 55 58 31 32 33 BE 10 04 0E 01 00 00 00 06 5F 1F 04 00 00 7E 1FHandshake Parameters
- Application Context Name:
2.16.756.5.8.1.3(Logical Name referencing with Ciphering) - Calling Authentication Value:
GURUX123(8-byte Client System Title) - Security Mechanism Name:
2.16.756.5.8.2.5(Mechanism ID 5 - GMAC)
Root Cause Diagnostics
- System Title Length: The calling system title must be exactly 8 bytes.
- Invocation Counter / Frame Counter Mismatch: When the client creates the GMAC authentication tag, the client's Invocation Counter must be strictly greater than the last stored counter in the meter's
Security Setupobject (0.0.43.0.0.255). - If the meter was rebooted or if multiple clients share the same System Title, the invocation counter on the client will fall behind, triggering instant rejection for replay attack prevention.
- Application Context Name:
-
To resolve the invocation counter desynchronization:
- Pre-read the Frame Counter: Before initiating HLS 5 authentication, establish a Public Client association (Client Address
0x10, No Security) and read the meter's current Invocation Counter from0.0.43.0.0.255, Attribute 2. - Increment & Store: Set the client's local counter to
meter_counter + 1before sending the High-Level Security AARQ. - Unique System Titles: Never share the same 8-byte System Title across multiple gateway worker threads or client instances.
- Pre-read the Frame Counter: Before initiating HLS 5 authentication, establish a Public Client association (Client Address
-
We implemented an automated counter synchronization step in our HES driver before sending the AARQ. This completely eliminated
Association-Result: 0x01across our production meters. -
Confirmed! Reading the Invocation Counter beforehand and incrementing locally solved the issue. Also note that for HLS 7 (ECDSA), the ephemeral public key exchange must strictly follow the P-256 / SHA-256 curve parameters in Green Book 10th Edition.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login