Skip to content

Conversation

@gojimmypi
Copy link
Contributor

Improve detection at compile time for which user_settings.h file is being referenced.

Also adds some minor code formatting cleanup, some MSVC-specific changes.

Builds on the changes in #624

Copy link
Member

@danielinux danielinux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, except a few minor things. I did not check the changes affecting win32.

@gojimmypi gojimmypi force-pushed the pr-improve-user-settings-detect branch from 1167316 to 2875939 Compare November 12, 2025 16:20
@gojimmypi gojimmypi force-pushed the pr-improve-user-settings-detect branch from 2875939 to dfa6c7e Compare November 12, 2025 17:35
@gojimmypi gojimmypi requested a review from danielinux November 12, 2025 17:50
@gojimmypi gojimmypi assigned danielinux and unassigned gojimmypi Nov 12, 2025
#endif

#include "wolfboot/wolfboot.h"

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this section, do not touch otp-keystore-gen tool, as discussed. No mixing user_settings.h is happening here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, I previously misunderstood; I thought it was only the primer: otp-keystore-primer.c to leave alone.

I'll also leave alone otp-keystore-gen.c

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll close #634 that is only related to otp.


/* Some SHA checks */
#if !defined(WOLFBOOT_SHA_DIGEST_SIZE) || (WOLFBOOT_SHA_DIGEST_SIZE <= 0)
# error "WOLFBOOT_SHA_DIGEST_SIZE must be defined"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is actually redundant. The check is performed in wolfboot.h . See error at wolfboot.h:225

#endif
#endif /* optional user settings check */

/* Some debug options. See docs. */
Copy link
Member

@danielinux danielinux Nov 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These should be proper options via tools/config.mk, parsed in the tools makefile

/* Must also define DEBUG_WOLFSSL in user_settings.h */
//#define DEBUG_SIGNTOOL
/* Must also define DEBUG_WOLFSSL in /tools/keytools/user_settings.h */
/* #define DEBUG_SIGNTOOL */
Copy link
Member

@danielinux danielinux Nov 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be a proper options via tools/config.mk, parsed via tools/keytools/Makefile. You can have a separate "config" in your IDE magic perhaps for first run, while Makefile users can add DEBUG_SIGNTOOL=1 in .config

user_settings.h is not meant for being modified.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants