From d5f3db4091f077cf5fcd2fc250dadabef5f60451 Mon Sep 17 00:00:00 2001 From: Michael Zillgith Date: Tue, 18 Feb 2025 07:16:03 +0000 Subject: [PATCH] - update GOOSE pub/sub examples --- examples/goose_publisher/goose_publisher_example.c | 3 ++- examples/goose_subscriber/goose_subscriber_example.c | 7 ++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/examples/goose_publisher/goose_publisher_example.c b/examples/goose_publisher/goose_publisher_example.c index 083cfa59..ec89fc90 100644 --- a/examples/goose_publisher/goose_publisher_example.c +++ b/examples/goose_publisher/goose_publisher_example.c @@ -62,7 +62,8 @@ main(int argc, char **argv) L2Security l2Sec = L2Security_create(); - L2Security_addKey(l2Sec, 0x12345678, (uint8_t*)key, 16, MC_SEC_SEC_ALGO_NONE, MC_SEC_SIG_ALGO_HMAC_SHA256_256); + //L2Security_addKey(l2Sec, 0x12345678, (uint8_t*)key, 16, MC_SEC_SEC_ALGO_NONE, MC_SEC_SIG_ALGO_HMAC_SHA256_256); + L2Security_addKey(l2Sec, 0x12345678, (uint8_t*)key, 16, MC_SEC_SEC_ALGO_NONE, MC_SEC_SIG_ALGO_AES_GMAC_128); L2Security_setActiveKey(l2Sec, 1); GoosePublisher_setL2Security(publisher, l2Sec); diff --git a/examples/goose_subscriber/goose_subscriber_example.c b/examples/goose_subscriber/goose_subscriber_example.c index 3edd3db0..ff767206 100644 --- a/examples/goose_subscriber/goose_subscriber_example.c +++ b/examples/goose_subscriber/goose_subscriber_example.c @@ -65,12 +65,13 @@ main(int argc, char** argv) GooseSubscriber_setDstMac(subscriber, dstMac); GooseSubscriber_setAppId(subscriber, 1000); - //char* key = "0123456789ABCDEF"; - char* key = "0123456789ABCDEG"; + char* key = "0123456789ABCDEF"; + //char* key = "0123456789ABCDEG"; L2Security l2Sec = L2Security_create(); - L2Security_addKey(l2Sec, 0x12345678, (uint8_t*)key, 16, MC_SEC_SEC_ALGO_NONE, MC_SEC_SIG_ALGO_HMAC_SHA256_256); + //L2Security_addKey(l2Sec, 0x12345678, (uint8_t*)key, 16, MC_SEC_SEC_ALGO_NONE, MC_SEC_SIG_ALGO_HMAC_SHA256_256); + L2Security_addKey(l2Sec, 0x12345678, (uint8_t*)key, 16, MC_SEC_SEC_ALGO_NONE, MC_SEC_SIG_ALGO_AES_GMAC_128); L2Security_setActiveKey(l2Sec, 1); GooseReceiver_setL2Security(receiver, l2Sec);