Return SPI out of range error from sa_create - #547
Hashim1999164 wants to merge 2 commits into
Conversation
The out of range branch only printed under DEBUG and left status at CRYPTO_LIB_SUCCESS, so SA Create looked successful to the ground segment when no SA was created. Set CRYPTO_LIB_ERR_SPI_INDEX_OOB the same way the other SA helpers do. Closes nasa#545
|
heads up, i still need to send in the CryptoLib individual CLA pdf to the emails in the readme. will get that over. the code change itself is just the SPI OOB status return |
sylvesterkaczmarek
left a comment
There was a problem hiding this comment.
This changes a previously silent success into the intended SPI-out-of-range error, but there is no regression test in the PR and the two test-plan boxes are still unchecked. Please add a test that sends spi >= NUM_SA and asserts CRYPTO_LIB_ERR_SPI_INDEX_OOB, plus a valid-SPI case to keep the success path covered.
|
@sylvesterkaczmarek fair point. added a unit test in ut_tc_process that hits spi >= NUM_SA for the oob error and a valid spi=1 create for the success path. checkboxes updated too |
|
yo the CLA for this one is that pdf form in docs/CryptoLib_Indv_CLA.pdf that has to get emailed to gsfc-softwarerequest@mail.nasa.gov with Justin.R.Morris@nasa.gov cc'd. i cant finish that part from here since it needs the signed pdf mailed. code side + the regression test are already on the branch tho |
sylvesterkaczmarek
left a comment
There was a problem hiding this comment.
Rechecked a283264. sa_create now returns CRYPTO_LIB_ERR_SPI_INDEX_OOB when spi >= NUM_SA, and the new regression exercises that exact boundary plus a valid spi=1 success path. That resolves the missing-test concern I raised.
Summary
sa_create treated an out of range SPI as success. The else branch only printed under DEBUG and never set status, so it returned CRYPTO_LIB_SUCCESS even though no SA was created.
This sets CRYPTO_LIB_ERR_SPI_INDEX_OOB on that path, matching the other SA helpers in the same file.
Closes #545
Test plan