Skip to content
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

Reset keystore.der #244

Closed
Thisora opened this issue Oct 19, 2022 · 4 comments
Closed

Reset keystore.der #244

Thisora opened this issue Oct 19, 2022 · 4 comments

Comments

@Thisora
Copy link

Thisora commented Oct 19, 2022

Hi !
I finally got this working and was able to boot.
I tested Wolfboot and i tried to generate new keys (make keysclean make keys). I was not able to boot anymore. I found with debugger that the authenticity check fail right there:

static int keyslot_id_by_sha(const uint8_t *hint)
{
    int id = 0;
    for (id = 0; id < keystore_num_pubkeys(); id++)
    {
        key_hash(id, digest);
        if (memcmp(digest, hint, WOLFBOOT_SHA_DIGEST_SIZE) == 0)
            return id;
    }
    return -1;
}

Because the digest kept the old value (before i regenerate the keystore). Probably i missed something but i can't find anything in documentation.

I really don't know why but i had to modify a lot of Makefile to get working with RP2040. I made a fork if you want add hal/ld for rp2040 but won't work without the stage2 bootloader of pico-sdk. Feel free to contact me if you want more infos.

@danielinux
Copy link
Member

Yes, this is a mismatch between the keys compiled in and the one used to sign the image.

Have you rebuilt wolfboot after updating the keys? keystore.der and src/keystore.c are updated when new keys are generated, which requires to rebuild wolfboot and sign your image again using the new private key.

@Thisora
Copy link
Author

Thisora commented Oct 19, 2022

Yes i did make clean make and still have same problem.

@Thisora
Copy link
Author

Thisora commented Oct 19, 2022

Ok my bad i problem with my flash system which caused to not update image. That's why i had previous digest 🥺.
Thank you for support !

@Thisora Thisora closed this as completed Oct 19, 2022
@danielinux
Copy link
Member

Alright! Glad it's solved.

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

No branches or pull requests

2 participants