File tree Expand file tree Collapse file tree 1 file changed +4
-12
lines changed Expand file tree Collapse file tree 1 file changed +4
-12
lines changed Original file line number Diff line number Diff line change @@ -334,15 +334,10 @@ void switch_world(struct acrn_vcpu *vcpu, int next_world)
334
334
arch -> cur_context = next_world ;
335
335
}
336
336
337
- static int32_t get_max_svn_index (void )
337
+ static inline uint32_t get_max_svn_index (void )
338
338
{
339
339
uint32_t i , max_svn_idx = 0U ;
340
340
341
- if ((g_key_info .num_seeds == 0U ) ||
342
- (g_key_info .num_seeds > BOOTLOADER_SEED_MAX_ENTRIES )) {
343
- return -1 ;
344
- }
345
-
346
341
for (i = 1U ; i < g_key_info .num_seeds ; i ++ ) {
347
342
if (g_key_info .dseed_list [i ].cse_svn >
348
343
g_key_info .dseed_list [i - 1 ].cse_svn ) {
@@ -358,17 +353,14 @@ static bool derive_aek(uint8_t *attkb_key)
358
353
const int8_t salt [] = "Attestation Keybox Encryption Key" ;
359
354
const uint8_t * ikm ;
360
355
uint32_t ikm_len ;
361
- int32_t max_svn_idx ;
356
+ uint32_t max_svn_idx ;
362
357
363
- if (!attkb_key ) {
358
+ if ((!attkb_key ) || (g_key_info .num_seeds == 0U ) ||
359
+ (g_key_info .num_seeds > BOOTLOADER_SEED_MAX_ENTRIES )) {
364
360
return false;
365
361
}
366
362
367
363
max_svn_idx = get_max_svn_index ();
368
- if (max_svn_idx < 0 ) {
369
- return false;
370
- }
371
-
372
364
ikm = g_key_info .dseed_list [max_svn_idx ].seed ;
373
365
/* only the low 32 bits of seed are valid */
374
366
ikm_len = 32 ;
You can’t perform that action at this time.
0 commit comments