aienux
Aienux, the AienOS kernel: boot, scheduling, IPC and capability boundaries. Pre-alpha; host, emulator and physical evidence are labelled separately.
Brought by drakestapleton
aienux / native / kernel / x86 / tests / boot_verify_keys.c
| 1 | /* boot_verify_keys.c -- the owner key table memory_x86.c reads (its extern |
| 2 | * ck_slot_loader_keys / ck_slot_loader_nkeys), held here so boot_verify_test.c |
| 3 | * can change it between runs. A separate file: memory_x86.c declares both const. */ |
| 4 | #include <stdint.h> |
| 5 | #include <string.h> |
| 6 | |
| 7 | uint8_t ck_slot_loader_keys[4][32]; |
| 8 | unsigned ck_slot_loader_nkeys; |
| 9 | |
| 10 | void bv_set_keys(const uint8_t (*keys)[32], unsigned n) |
| 11 | { |
| 12 | memset(ck_slot_loader_keys, 0, sizeof ck_slot_loader_keys); |
| 13 | for (unsigned i = 0; i < n && i < 4; i++) |
| 14 | memcpy(ck_slot_loader_keys[i], keys[i], 32); |
| 15 | ck_slot_loader_nkeys = n; |
| 16 | } |