Support type7 encoded CAK key for macsec in config_db#2892
Support type7 encoded CAK key for macsec in config_db#2892prsunny merged 4 commits intosonic-net:masterfrom
Conversation
|
@judyjoseph , please attached the needed MSFT ADO number to this PR |
|
@judyjoseph , Is there any dependency in the order of the PRs you mentioned where one needs to go in first before other? |
|
@prsunny @lguohan Could you review this PR, this is a change to get macsec wpa_supplicant to accept type7 encoded strings and prevent keys to be stored in plain text in config_db. I have added the test results and the MACSEC_PROFILE in config_db in PR comments. We have a PR in sonic-buildimage also sonic-net/sonic-buildimage#16388, to accept this format and length. |
|
Can you please plan to add a unit test for this? |
Sure Prince, is it ok I add this in a follow on PR |
|
@yxieca , @StormLiangMS , Please help approve this for the requested branches. |
* Add decode type 7 alogorithm and use it to decode the encoded key from config_db * Remove the Error log added earlier for debugging * Add check for 66 bytes or 130 bytes encoded string based on cipher suite
…d format (#16388) * Change the CAK key length check in config plugin, macsec test profile changes * Fix the format in add_profile api The changes needed in various macsec unit tests and config plugin when we move to accept the type 7 encoded key format for macsec. This goes along with PR : sonic-net/sonic-swss#2892 raised earlier.
…d format (sonic-net#16388) * Change the CAK key length check in config plugin, macsec test profile changes * Fix the format in add_profile api The changes needed in various macsec unit tests and config plugin when we move to accept the type 7 encoded key format for macsec. This goes along with PR : sonic-net/sonic-swss#2892 raised earlier.
…d format (sonic-net#16388) * Change the CAK key length check in config plugin, macsec test profile changes * Fix the format in add_profile api The changes needed in various macsec unit tests and config plugin when we move to accept the type 7 encoded key format for macsec. This goes along with PR : sonic-net/sonic-swss#2892 raised earlier.
…d format (sonic-net#16388) * Change the CAK key length check in config plugin, macsec test profile changes * Fix the format in add_profile api The changes needed in various macsec unit tests and config plugin when we move to accept the type 7 encoded key format for macsec. This goes along with PR : sonic-net/sonic-swss#2892 raised earlier.
…d format (sonic-net#16388) * Change the CAK key length check in config plugin, macsec test profile changes * Fix the format in add_profile api The changes needed in various macsec unit tests and config plugin when we move to accept the type 7 encoded key format for macsec. This goes along with PR : sonic-net/sonic-swss#2892 raised earlier.
* Add decode type 7 alogorithm and use it to decode the encoded key from config_db * Remove the Error log added earlier for debugging * Add check for 66 bytes or 130 bytes encoded string based on cipher suite
…d format (#16388) (#16626) * Change the CAK key length check in config plugin, macsec test profile changes * Fix the format in add_profile api The changes needed in various macsec unit tests and config plugin when we move to accept the type 7 encoded key format for macsec. This goes along with PR : sonic-net/sonic-swss#2892 raised earlier. Co-authored-by: judyjoseph <53951155+judyjoseph@users.noreply.github.com>
|
@shyam77git @mlok-nokia @kenneth-arista f.y.i With this PR (along with sonic-net/sonic-buildimage#16388) -- please note that there will be a change in the way we input the macsec CAK keys either via configuration command, or via the config_db Currently the CAK key is given in plain text as input, it will change to type7 encoded format. Please refer to sonic-mgmt PR (sonic-net/sonic-mgmt#9873) for various macsec_profiles. This is currently merged in 202205 branch, we plan to merge this in master as well- thanks. |
This reverts commit a0eb0d0.
|
@judyjoseph this PR will cause PR test failure when do the submodule advance, could you help to fix the PR test failure? |
* Add decode type 7 alogorithm and use it to decode the encoded key from config_db * Remove the Error log added earlier for debugging * Add check for 66 bytes or 130 bytes encoded string based on cipher suite
* Add decode type 7 alogorithm and use it to decode the encoded key from config_db * Remove the Error log added earlier for debugging * Add check for 66 bytes or 130 bytes encoded string based on cipher suite
What I did
Support type7 encoded CAK key for macsec in config_db
MSFT ADO : 25046448
Why I did it
The external store has the macsec CAK keys stored in type7 format. Hence the automation tools retrieve these keys and stores in config_db in type7 format.
This need to be decoded to text format for wpa_supplicant to consume.
How I verified it
Verified with type7 encoded CAK keys, macsec sessions should come up
MACSEC_PROFILE (earlier format where CAK is in text)
MACSEC_PROFILE (NEW format: where CAK is in type 7 encoded)
Even with CLI, we need to enter the CAK in type 7 encoded format
Testing with CLI