Skip to content

[BUG] Cmake/rimage: cannot change default key used by rimage #1238

Description

@plbossart

Describe the bug

To work on specific Intel boards, I need to change the private key used for signature. hardcoding the new path doesn't work with CMakeLists.txt, the default is always selected.

Ideally we'd want an environment variable to be able to override this default to use an out-of-tree key instead of maintaining CMake changes.

To Reproduce

diff --git a/src/arch/xtensa/CMakeLists.txt b/src/arch/xtensa/CMakeLists.txt
index 6a43aeb3..2c5374b9 100644
--- a/src/arch/xtensa/CMakeLists.txt
+++ b/src/arch/xtensa/CMakeLists.txt
@@ -295,7 +295,7 @@ if(MEU_PATH)
                set(MEU_OFFSET 1088)
        endif()
 
-       set(otc_private_key ${PROJECT_SOURCE_DIR}/rimage/keys/otc_private_key.pem)
+       set(otc_private_key ${PROJECT_SOURCE_DIR}/rimage/keys/debug/private_key.pem)
 
        add_custom_target(
                run_rimage

Expected behavior

The new key is used for signature

Impact

Can't figure out how to sign the stupid firmware.

Environment

v1.3-rc1

Activity

  1. added
    bugSomething isn't working as expected
    on Apr 8, 2019
  2. xiulipan commented on Apr 9, 2019

    @xiulipan
    Contributor

    @plbossart
    That is interesting. As far as I know if you would like to change the key used. The best way is to change the cmd of the rimage call but not something inside the CMake. But that would be a good feature to let rimage to accept costume key with some ENV or CMake option.

    I will check that.

  3. self-assigned this
    on Apr 9, 2019
  4. jajanusz commented on Apr 9, 2019

    @jajanusz
    Contributor

    Ofc ability to change key should be added long time ago, I'm suprised it took so long for someone to complain about it.

    @xiulipan adds it in #1239, however we are not going to support anything via environment variables, because it's too easy to make a mess with them

  5. jajanusz commented on Apr 9, 2019

    @jajanusz
    Contributor

    @plbossart BTW I guess your changes didn't work because you changed key for build with MEU when you just build FW without MEU and use only rimage. I cannot be sure beacause there are no reproduction steps, just proposed solution(?).

  6. wenqingfu commented on Apr 16, 2019

    @wenqingfu

    fixed by #1248?

  7. jajanusz commented on Apr 16, 2019

    @jajanusz
    Contributor

    fixed by #1248?

    Yes, thanks, for noticing

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't working as expected

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions