Skip to content

Conversation

@gojimmypi
Copy link
Contributor

Adds a new --no-overwrite option to the tools/keytools/keygen app.

This can be handy during CMake builds, for instance like this:

    add_custom_command(
        OUTPUT ${KEYSTORE} ${WOLFBOOT_SIGNING_PRIVATE_KEY}
        COMMAND "${KEYGEN_TOOL}" ${KEYTOOL_OPTIONS}
                --no-overwrite
                -g ${WOLFBOOT_SIGNING_PRIVATE_KEY}
                -keystoreDir ${CMAKE_CURRENT_BINARY_DIR}
        DEPENDS ${KEYGEN_TOOL}
        WORKING_DIRECTORY ${WOLFBOOT_ROOT}
        COMMENT "Generating keystore.c and signing private key"
        VERBATIM
    )

Otherwise, at least on Windows, the resulting spawned app will quietly await a response as a hidden process, typically keeping files locked, unable to build again, forcing a reboot if task manager won't terminate the process.

Reminder the regular if(EXIST ... is a configure-time check, not build-time. See docs.

Although a custom command could be used in this cmake example, it will be handy for other automation processes outside of cmake to have the "yes, I know the keystore might already exist, so don't prompt, and don't overwrite it" option.

@gojimmypi gojimmypi self-assigned this Nov 9, 2025
@gojimmypi gojimmypi assigned wolfSSL-Bot and danielinux and unassigned gojimmypi Nov 10, 2025
@gojimmypi gojimmypi requested a review from danielinux November 12, 2025 17:58
@dgarske dgarske assigned gojimmypi and unassigned danielinux Nov 12, 2025
@gojimmypi gojimmypi force-pushed the pr-keygen-no-overwrite branch from 88645ee to 0d66e57 Compare November 13, 2025 01:33
@gojimmypi gojimmypi requested a review from dgarske November 13, 2025 02:02
@gojimmypi gojimmypi assigned dgarske and unassigned gojimmypi Nov 13, 2025
@dgarske dgarske removed the request for review from wolfSSL-Bot November 13, 2025 16:58
@dgarske dgarske assigned danielinux and unassigned dgarske Nov 13, 2025
@danielinux danielinux merged commit d513adc into wolfSSL:master Nov 13, 2025
220 checks passed
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