mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-06-25 23:13:26 +00:00
hv: trusty: fix get_max_svn_index return type inconsistent
Function return type should consistent. Tracked-On: #861 Signed-off-by: Li, Fei1 <fei1.li@intel.com>
This commit is contained in:
parent
c200c98405
commit
042c393526
@ -334,15 +334,10 @@ void switch_world(struct acrn_vcpu *vcpu, int next_world)
|
|||||||
arch->cur_context = next_world;
|
arch->cur_context = next_world;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int32_t get_max_svn_index(void)
|
static inline uint32_t get_max_svn_index(void)
|
||||||
{
|
{
|
||||||
uint32_t i, max_svn_idx = 0U;
|
uint32_t i, max_svn_idx = 0U;
|
||||||
|
|
||||||
if ((g_key_info.num_seeds == 0U) ||
|
|
||||||
(g_key_info.num_seeds > BOOTLOADER_SEED_MAX_ENTRIES)) {
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (i = 1U; i < g_key_info.num_seeds; i++) {
|
for (i = 1U; i < g_key_info.num_seeds; i++) {
|
||||||
if (g_key_info.dseed_list[i].cse_svn >
|
if (g_key_info.dseed_list[i].cse_svn >
|
||||||
g_key_info.dseed_list[i-1].cse_svn) {
|
g_key_info.dseed_list[i-1].cse_svn) {
|
||||||
@ -358,17 +353,14 @@ static bool derive_aek(uint8_t *attkb_key)
|
|||||||
const int8_t salt[] = "Attestation Keybox Encryption Key";
|
const int8_t salt[] = "Attestation Keybox Encryption Key";
|
||||||
const uint8_t *ikm;
|
const uint8_t *ikm;
|
||||||
uint32_t ikm_len;
|
uint32_t ikm_len;
|
||||||
int32_t max_svn_idx;
|
uint32_t max_svn_idx;
|
||||||
|
|
||||||
if (!attkb_key) {
|
if ((!attkb_key) || (g_key_info.num_seeds == 0U) ||
|
||||||
|
(g_key_info.num_seeds > BOOTLOADER_SEED_MAX_ENTRIES)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
max_svn_idx = get_max_svn_index();
|
max_svn_idx = get_max_svn_index();
|
||||||
if (max_svn_idx < 0) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
ikm = g_key_info.dseed_list[max_svn_idx].seed;
|
ikm = g_key_info.dseed_list[max_svn_idx].seed;
|
||||||
/* only the low 32 bits of seed are valid */
|
/* only the low 32 bits of seed are valid */
|
||||||
ikm_len = 32;
|
ikm_len = 32;
|
||||||
|
Loading…
Reference in New Issue
Block a user