From 7d777a0e592c2bdef33cbbcefda2b1c076f9e7e8 Mon Sep 17 00:00:00 2001 From: Mat M Date: Thu, 22 Feb 2018 23:18:18 -0500 Subject: [PATCH] package2: Fix loop index in decrypt_and_validate_header (#31) --- exosphere/package2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exosphere/package2.c b/exosphere/package2.c index 338629e69..879db93dc 100644 --- a/exosphere/package2.c +++ b/exosphere/package2.c @@ -301,7 +301,7 @@ uint32_t decrypt_and_validate_header(package2_header_t *header) { uint32_t mkey_rev; /* Try to decrypt for all possible master keys. */ - for (mkey_rev = 0; i < MASTERKEY_REVISION_MAX; i++) { + for (mkey_rev = 0; mkey_rev < MASTERKEY_REVISION_MAX; mkey_rev++) { package2_crypt_ctr(mkey_rev, &metadata, sizeof(package2_meta_t), &header->metadata, sizeof(package2_meta_t), header->metadata.ctr, sizeof(header->metadata.ctr)); /* Copy the ctr (which stores information) into the decrypted metadata. */ memcpy(metadata.ctr, header->metadata.ctr, sizeof(header->metadata.ctr));