connectedhomeip icon indicating copy to clipboard operation
connectedhomeip copied to clipboard

We don't seem to have any unit tests for message MAC (tag)

Open bzbarsky-apple opened this issue 5 years ago • 2 comments

Problem

I just tried changing the function signatures of MessageAuthenticationCode::Encode and MessageAuthenticationCode::Decode, and all our tests still compiled, which means they never call those functions directly.

Proposed Solution

We should probably add some test coverage, unless is covered in some way that was non-obvious to me.

@pan-apple

bzbarsky-apple avatar Feb 08 '21 20:02 bzbarsky-apple

void SecureChannelDecryptTest(nlTestSuite * inSuite, void * inContext) tests the MAC tag to certain extent (i.e. if MAC tag is incorrect, the test will fail). It might be worth adding a standalone unit tests for MessageAuthenticationCode encode/decode. That test will mostly be testing the current memcpy of tag value in the packet buffer.

pan-apple avatar Feb 09 '21 17:02 pan-apple

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

stale[bot] avatar Sep 15 '22 23:09 stale[bot]

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

stale[bot] avatar Mar 22 '23 22:03 stale[bot]

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

stale[bot] avatar Oct 15 '23 07:10 stale[bot]