NS services: Difference between revisions

Line 1,794: Line 1,794:


This extracts data from the input array for hashing with SHA256, with validation being done when handling each entry.
This extracts data from the input array for hashing with SHA256, with validation being done when handling each entry.
==== Cmd2019 ====
Takes a type-0x15 input buffer containing a [[#SystemDeliveryInfo]], a type-0x5 input buffer containing an array of [[#ApplicationDeliveryInfo]], a type-0x5 input buffer containing an array of [[#ApplicationDeliveryInfo]], returns an output u8 bool.
This calls a func for validating the [[#SystemDeliveryInfo]] from the type-0x15 buffer, returning the Result on failure.
Then a func is called with the output bool and the input arrays, returning the Result on failure.
* The first array count must be 1. The second array count when non-zero, must be 1.
If the output bool is set after calling the above, it then calls a func with the output bool, the second [[#ApplicationDeliveryInfo]] buffer, and the [[#SystemDeliveryInfo]] from the type-0x15 buffer. This func does the following:
* When the SystemDeliveryInfoPlatform from the input [[#SystemDeliveryInfo]] matches the [[System_Settings|sys-setting]], it does the following:
** Uses [[Shared_Database_services|pl:s]] RequestApplicationFunctionAuthorizationByApplicationId with the [[#ApplicationDeliveryInfo]] ApplicationId/ApplicationVersion and ApplicationFunctionAuthorizationId=0x5, handling the Result on failure.
* When the SystemDeliveryInfoPlatform fields from the input [[#SystemDeliveryInfo]]/[[#ApplicationDeliveryInfo]] (u8 [[#ApplicationDeliveryInfo]] +0x20) match, write 1 to the output bool and return 0. Otherwise:
** When the [[#SystemDeliveryInfo]] SystemDeliveryInfoPlatform is 0x1 (Ounce): *output = u8 [[#ApplicationDeliveryInfo]] +0x20 == 0 && u8 [[#ApplicationDeliveryInfo]] +0x21 == 0;
** When the [[#SystemDeliveryInfo]] SystemDeliveryInfoPlatform is 0x0 (NX): write 0 to the output bool and return 0.
** Otherwise, Abort.


==== GetApplicationRightsOnClient ====
==== GetApplicationRightsOnClient ====