DM: vrpmb: replace assert() with return false

Replace assert() with explicit parameter checking and error handling.

Tracked-On: #3252
Signed-off-by: Qi Yadong <yadong.qi@intel.com>
Acked-by: Zhu Bing <bing.zhu@intel.com>
This commit is contained in:
Qi Yadong 2019-06-13 12:08:47 +08:00 committed by ACRN System Integration
parent 66943be353
commit 8426db9309
1 changed files with 4 additions and 1 deletions

View File

@ -56,7 +56,10 @@ int get_vrpmb_key(uint8_t *out, size_t size)
return 0;
}
assert(size == RPMB_KEY_LEN);
if (size != RPMB_KEY_LEN) {
fprintf(stderr, "%s: Invalid input key size\n", __func__);
return 0;
}
if ( vrkey.initialized == false ) {
for (i = 0; i < DRNG_MAX_RETRIES; i++) {