Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fpgainfo: Remove the sdm hash and cancel keys from CMC fpgainfo security #3099

Merged
merged 5 commits into from
Feb 13, 2024

Conversation

anandaravuri
Copy link
Contributor

The CMC platform does not support SDM PR and SR key hashes/cancel keys; therefore, remove them from the CMC board module
Update the security key enumeration and read sysfs attribute logic into table format.

Copy link
Contributor

@pcolberg pcolberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @anandaravuri! Can this be split into two separate commits?

  1. The CMC platform does not support SDM PR and SR key hashes/cancel keys; therefore, remove them from the CMC board module
  2. Update the security key enumeration and read sysfs attribute logic into table format.

@coveralls
Copy link

coveralls commented Feb 12, 2024

Pull Request Test Coverage Report for Build 7879099070

Details

  • -21 of 21 (0.0%) changed or added relevant lines in 1 file are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage increased (+0.2%) to 64.661%

Changes Missing Coverage Covered Lines Changed/Added Lines %
libraries/libboard/board_cmc/board_cmc.c 0 21 0.0%
Files with Coverage Reduction New Missed Lines %
libraries/libboard/board_cmc/board_cmc.c 1 0.0%
Totals Coverage Status
Change from base Build 7846970785: 0.2%
Covered Lines: 15809
Relevant Lines: 24449

💛 - Coveralls

The CMC platform does not support SDM PR and SR key hashes/cancel keys; therefore, remove them from the CMC board module

Signed-off-by: anandaravuri <[email protected]>
The CMC platform does not support SDM PR and SR key hashes/cancel keys; therefore, remove them from the CMC board module

Signed-off-by: anandaravuri <[email protected]>
…e logic into table format.

Signed-off-by: anandaravuri <[email protected]>

typedef struct fpga_sec_key {
char name[FPGA_VAR_BUF_LEN];
char sysfs[FPGA_VAR_BUF_LEN];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be better to define as follows:
const char *name;
const char sysfs;

You don't need or want to specify an string size here.


#define SEC_ARRAY_MAX_SIZE 7

fpga_sec_key sec_key_data[SEC_ARRAY_MAX_SIZE] =
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't specify size of array. Add a null entry at the end.

},
{.name = "User flash update counter",
.sysfs = "*flash_count"
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can end the array with {} to create a empty entry.

printf("%-32s : %s\n", "FIM root entry hash", "None");
resval = res;
}
for (i = 0; i < SEC_ARRAY_MAX_SIZE; i++)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for (p = sec_key_data; p->name; p++)

@fpgamatt
Copy link
Contributor

Hi Ananda,

Please squash/fix the 5 commits such that there are only two commits as Peter requested.

The first commit removes the unsupported #defines and code using them.

The second commit should be turning the linear code into a table and a for loop.

Copy link
Contributor

@pcolberg pcolberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please squash/fix the 5 commits such that there are only two commits as Peter requested.

The first commit removes the unsupported #defines and code using them.

The second commit should be turning the linear code into a table and a for loop.

Please never mind, squashing this PR to a single commit is fine. I had misread the description initially as two relatively independent changes, but removing the old without adding the new code breaks the entire functionality of print_sec_info().

@anandaravuri anandaravuri merged commit 974571d into master Feb 13, 2024
27 checks passed
@anandaravuri anandaravuri deleted the aravuri/fix_fpgainfo_cmc branch February 13, 2024 00:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants