Files
MarcandCopilot 8f2ed32d56 Use a 4-byte KeyNonce in the reference PubSub sample
The reference PubSub sample's demo keys used a 12-byte KeyNonce. Since
#4573 the AES-CTR counter block follows OPC 10000-14 Table 157
(KeyNonce[4] || MessageNonce[8] || BlockCounter[4]), so with the sample's
keys the publisher built a 20-byte nonce, AesCtrTransform rejected it
("AES-CTR nonce must be exactly 12 bytes"), and every secured NetworkMessage
was dropped ("UADP security wrap failed"). The udp-uadp first exchange in
docs/PubSub.md received no DataSets on master and in 2.0.0.

The sample now sizes its KeyNonce with AesCtrNonceLayout.KeyNonceLength.

Regression test:
PubSubAotTests.SamplePublisherDeliversSecuredDataSetToSampleSubscriberAsync
starts the sample publisher and subscriber with the
sample keys over unicast loopback and waits for a DataSet. It timed out
before the fix and passes after it (3/3 runs); the PubSubAotTests class
passes 8/8 (JIT). The documented exchange, run verbatim, delivers DataSets
again with the documented unsecured-announcement warning once.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-10-09 12:20:53 +02:00
..