-
Notifications
You must be signed in to change notification settings - Fork 143
Open
Labels
refactorShould not affect functionalityShould not affect functionality
Description
At line 103, the values of ff_key1_length and ff_key2_length are both guaranteed to be 256, and as such the check is redundant.
libspdm/library/spdm_crypt_lib/fips/libspdm_selftest_ffdh.c
Lines 84 to 109 in 23a4624
| if (!result || ff_key1_length != 256) { | |
| LIBSPDM_DEBUG((LIBSPDM_DEBUG_INFO, "FFDH compute key failed \n")); | |
| libspdm_dh_free(dh1); | |
| libspdm_dh_free(dh2); | |
| result = false; | |
| goto update; | |
| } | |
| result = libspdm_dh_compute_key(dh2, ff_public_key1, ff_public_key1_length, | |
| ff_key2, &ff_key2_length); | |
| if (!result || ff_key2_length != 256) { | |
| LIBSPDM_DEBUG((LIBSPDM_DEBUG_INFO, "FFDH compute key failed \n")); | |
| libspdm_dh_free(dh1); | |
| libspdm_dh_free(dh2); | |
| result = false; | |
| goto update; | |
| } | |
| /*self_test*/ | |
| if (ff_key1_length != ff_key2_length) { | |
| LIBSPDM_DEBUG((LIBSPDM_DEBUG_INFO, "FFDH self_test failed \n")); | |
| libspdm_dh_free(dh1); | |
| libspdm_dh_free(dh2); | |
| result = false; | |
| goto update; | |
| } |
Reactions are currently unavailable
Metadata
Metadata
Labels
refactorShould not affect functionalityShould not affect functionality