From: Andreas Reichel <[email protected]> set_uservar_global missed crc32 calculation so that all environments were rendered invalid.
Signed-off-by: Andreas Reichel <[email protected]> --- env/env_api_fat.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/env/env_api_fat.c b/env/env_api_fat.c index 0351330..a2e4700 100644 --- a/env/env_api_fat.c +++ b/env/env_api_fat.c @@ -341,6 +341,9 @@ int bgenv_set_uservar_global(char *key, uint64_t type, void *data, " #%d: (%s)\n", i, strerror(-r)); ret = r; } + uint32_t sum = crc32(0, (Bytef *)env->data, + sizeof(BG_ENVDATA) - sizeof(env->data->crc32)); + env->data->crc32 = sum; if (!bgenv_write(env)) { ret = -EIO; VERBOSE(stderr, "bgenv_set_uservar_global: Could not " -- 2.15.0 -- You received this message because you are subscribed to the Google Groups "EFI Boot Guard" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/efibootguard-dev/20171116135213.15423-4-andreas.reichel.ext%40siemens.com. For more options, visit https://groups.google.com/d/optout.
