-
Notifications
You must be signed in to change notification settings - Fork 559
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
Allow dumping TSEC keys to sd card #44
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the PR.
Please check the comments on the code. They rectify some undefined behavior, have a more complete logic (for all possible cases) and lessen the compiled binary's size.
(I've made this review by eye and haven't compiled it to test it, so if you see anything strange tell me.)
EDIT:
And if it's possible, please squash the new changes into one commit.
ipl/main.c
Outdated
@@ -665,31 +665,52 @@ void print_tsec_key() | |||
{ | |||
EPRINTFARGS("Could not identify package1 version\nto read TSEC firmware (= '%s').", | |||
(char *)pkg1 + 0x10); | |||
|
|||
gfx_puts(&gfx_con, "\nPress any key...\n"); | |||
btn_wait(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove these 2.
Press any key is not needed anymore.
btn_wait is going to be used elsewhere.
ipl/main.c
Outdated
} | ||
else | ||
EPRINTFARGS("ERROR %X", res); | ||
gfx_putc(&gfx_con, '\n'); | ||
} | ||
|
||
free(pkg1); | ||
sdmmc_storage_end(&storage); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove these 2.
They create undefined behavior when these 2 and the 2 at out
label run.
gfx_puts(&gfx_con, "\nDone!\n"); | ||
sd_unmount(); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
else
goto out;
ipl/main.c
Outdated
gfx_puts(&gfx_con, "\nDone!\n"); | ||
sd_unmount(); | ||
} | ||
} | ||
|
||
out:; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Create a label out_wait:;
above label out
and add btn_wait()
below it.
ipl/main.c
Outdated
@@ -665,31 +665,52 @@ void print_tsec_key() | |||
{ | |||
EPRINTFARGS("Could not identify package1 version\nto read TSEC firmware (= '%s').", | |||
(char *)pkg1 + 0x10); | |||
|
|||
gfx_puts(&gfx_con, "\nPress any key...\n"); | |||
btn_wait(); | |||
goto out; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change to goto out_wait
Thank you for the comments, the requested changes have been made. Plus an additional change of moving |
Thank you! (Btw, |
Nice :D |
* Allow dumping tsec keys to sd card
It would be useful if we could dump the TSEC keys just like the fuses and kfuses