-
-
Notifications
You must be signed in to change notification settings - Fork 73
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
Added more ES functions pt.2 #193
base: master
Are you sure you want to change the base?
Conversation
libogc/es.c
Outdated
@@ -570,6 +631,12 @@ s32 ES_DiVerifyWithTicketView(const signed_blob *certificates, u32 certificates_ | |||
if (!hashes) | |||
return ES_ENOMEM; | |||
|
|||
// ES_DiVerifyWithTicketView must fetch the system's certificate store for the ticket. It also does not check the size. It does check the pointer though. | |||
if (!certificates) { |
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.
what is this for? why give it a pointer to MEM1? (0x00000020 = physical address of 0x80000020)
doesn't it need the certificates ?
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.
Not really. DiVerifyWithTicketView combines the provided certificate store with the system's certificate store (in the wrong order imo!) and then calls ES_DiVerify
Now let's say I want to identify as the System menu. Or, in general, a title that's actually installed to the host.
There's no point in me packing TMD certificates/reading the certificate store myself, because ES is going to read the system certificate store, and of course, the system is going to have the certificates that signed a title installed to it.
Let's wind up to the beginning of the function.
It checks if the certificates pointer is 0, the ticket view pointer is 0, the TMD or it's size is 0, the output keyhandle is set to 0, or the hashes pointer is 0.
But not the certificates size. So we can set that to 0 because we don't need to provide any certificates. But we need to set the certificates pointer to something that is not 0. So I set it to 32. IOS appears to be totally chill with it
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.
hahaha.
nice.
i personally think this is an oversight of broadcom, and it probably wants certificates to be given.
so i think libogc would need to check for the ptr to not be null, that would the cause the caller to still abuse the ios mistake, but libogc would be more inline with ios' code
And fixed up some prototypes. I forgot to change the header when undoing most of the formatting lol