-
Notifications
You must be signed in to change notification settings - Fork 146
Fix back-end for keyvaults, minor delta trailing escape, TPM seal/unseal size, elf digest timing #725
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Fix back-end for keyvaults, minor delta trailing escape, TPM seal/unseal size, elf digest timing #725
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
616cb9a
Updated .gitignore to include more unit tests
danielinux f94d9d2
fix option unlock wait condition
danielinux 3e706be
fix store delete_object header offset
danielinux 73b5ad4
fix store sbrk heap bounds handling
danielinux 7631649
fix tpm seal auth size validation
danielinux b250d78
fix tpm unseal auth size validation
danielinux 953c9be
fix delta trailing escape margin handling
danielinux d3c47d1
fix elf image digest comparison timing
danielinux ea3e1db
Added missing object in trustzone builds
danielinux 0d56a02
Fix Cmake build: added src/store_sbrk.c and fixed target dependencies
danielinux 2768ae6
Addressed copilot's comments
danielinux 1fdb3b3
Fixed more copilot findings
danielinux e52beab
Addressed reviewer's comment
danielinux File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| /* store_sbrk.c | ||
| * | ||
| * Copyright (C) 2025 wolfSSL Inc. | ||
| * | ||
| * This file is part of wolfBoot. | ||
| * | ||
| * wolfBoot is free software; you can redistribute it and/or modify | ||
| * it under the terms of the GNU General Public License as published by | ||
| * the Free Software Foundation; either version 3 of the License, or | ||
| * (at your option) any later version. | ||
| * | ||
| * wolfBoot is distributed in the hope that it will be useful, | ||
| * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| * GNU General Public License for more details. | ||
| * | ||
| * You should have received a copy of the GNU General Public License | ||
| * along with this program; if not, write to the Free Software | ||
| * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA | ||
| */ | ||
|
|
||
| #include <stddef.h> | ||
| #include <limits.h> | ||
|
|
||
| #include "store_sbrk.h" | ||
|
|
||
danielinux marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| void *wolfboot_store_sbrk(unsigned int incr, uint8_t **heap, | ||
| uint8_t *heap_base, uint32_t heap_size) | ||
| { | ||
| uint8_t *heap_limit = heap_base + heap_size; | ||
| void *old_heap = *heap; | ||
danielinux marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| if ((incr & 3U) != 0U) { | ||
| if (incr > (UINT_MAX - 3U)) | ||
| return (void *)-1; | ||
| incr = (incr + 3U) & ~3U; | ||
| } | ||
|
|
||
| if (*heap == NULL) { | ||
| *heap = heap_base; | ||
| old_heap = *heap; | ||
| } | ||
|
|
||
danielinux marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| if ((uint32_t)(heap_limit - *heap) < incr) | ||
| return (void *)-1; | ||
|
|
||
| *heap += incr; | ||
|
|
||
| return old_heap; | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| /* store_sbrk.h | ||
| * | ||
| * Copyright (C) 2025 wolfSSL Inc. | ||
| * | ||
| * This file is part of wolfBoot. | ||
| * | ||
| * wolfBoot is free software; you can redistribute it and/or modify | ||
| * it under the terms of the GNU General Public License as published by | ||
| * the Free Software Foundation; either version 3 of the License, or | ||
| * (at your option) any later version. | ||
| * | ||
| * wolfBoot is distributed in the hope that it will be useful, | ||
| * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| * GNU General Public License for more details. | ||
| * | ||
| * You should have received a copy of the GNU General Public License | ||
| * along with this program; if not, write to the Free Software | ||
| * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA | ||
| */ | ||
|
|
||
| #ifndef WOLFBOOT_STORE_SBRK_H | ||
| #define WOLFBOOT_STORE_SBRK_H | ||
|
|
||
danielinux marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| #include <stdint.h> | ||
|
|
||
| void *wolfboot_store_sbrk(unsigned int incr, uint8_t **heap, | ||
| uint8_t *heap_base, uint32_t heap_size); | ||
|
|
||
| #endif | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.