Merge pull request #12667 from boomer41/fix-devicekey

Add check for return code in DeviceKey to avoid injecting invalid ROT
pull/12684/head
Martin Kojtal 2020-03-23 19:59:10 +01:00 committed by GitHub
commit ae0ec86d59
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -269,7 +269,10 @@ int DeviceKey::generate_root_of_trust()
mbedtls_entropy_free(entropy);
delete entropy;
ret = device_inject_root_of_trust(key_buff, actual_size);
if (ret == DEVICEKEY_SUCCESS) {
ret = device_inject_root_of_trust(key_buff, actual_size);
}
#endif
return ret;