Commit 08e2b7a
fix(secure-boot): take the verification key from the keystore
eos_image_verify_signature() referenced two symbols that do not exist
anywhere in the repository:
extern int eos_keystore_get_compiled_key(const uint8_t **key, size_t *len);
extern const uint8_t ebldr_default_pubkey[32];
The first was declared and never called. The second was assigned straight to
pub_key, and is defined in no translation unit, so any build that links the
signature path failed:
image_verify.c:(.text+0x404): undefined reference to `ebldr_default_pubkey'
That is why -DEBLDR_BUILD_TESTS=ON did not link.
Beyond not linking, reaching for a raw key symbol bypassed the keystore
entirely — and the keystore is where the security properties live. Its
init() prefers OTP-provisioned keys over the compiled-in one, reads the
revocation flags, picks the first valid non-revoked slot, and seeds the
monotonic security version. get_active_key() then refuses to hand back a slot
that is invalid or revoked. None of that was running: a revoked key would
still have verified images.
Now calls eos_keystore_init() followed by eos_keystore_get_active_key(),
returning EOS_ERR_KEY if either fails, so an unprovisioned or fully revoked
keystore cannot verify anything. The existing dual verification for
fault-injection resistance is unchanged.
With tests enabled the tree now builds with 0 errors and all 11 ctest cases
pass.
Note for deployment, unchanged by this commit: with EBLDR_PRODUCTION_KEY
unset, keystore.c falls back to default_dev_key, which is the RFC 8032 test
vector public key — its private half is public. That fallback is clearly
commented in keystore.c, but it means a default build trusts a key anyone can
sign with. Production builds must define EBLDR_PRODUCTION_KEY and provide
ebldr_production_key, or provision OTP.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>1 parent 519f5d7 commit 08e2b7a
1 file changed
Lines changed: 13 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
| |||
130 | 131 | | |
131 | 132 | | |
132 | 133 | | |
133 | | - | |
134 | | - | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
135 | 141 | | |
136 | 142 | | |
137 | 143 | | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
142 | 149 | | |
143 | 150 | | |
144 | 151 | | |
| |||
0 commit comments