SceSblPostSsMgr

module_start
Calls 2 subroutines:
 * init_qaftoken
 * init_utoken

init utoken
Reads tm0:utoken.dat.

Calls utoken_sm.self service 2 to decrypt SceUtoken buffer. The output is a 0x58 bytes buffer.

sceSblSpsfoMgrVerifyForDriver
Derived from _vshSblAuthMgrVerifySpsfo.

sceSblLicMgrGetExpireDateForDriver
Get activation data expire date.

If sceSblAIMgrIsToolDVT1ForDriver, 30/10/2011 8:00:00.

If sceSblAIMgrIsToolRev4ForDriver or TEST, expire_date = 0xFFFFFFFF.

If sceSblAIMgrIsToolDVT2ForDriver, 30/6/2012 8:00:00.

If sceSblAIMgrIsDEXForDriver and product_sub_code = 0xA, 0xB or 0xC, 31/3/2012 14:59:00.

sceSblPmMgrSetProductModeForDriver
Executes pm_sm.self commands 2, 3, 4, 5, 6, 7, 8, 9, 0xA.


 * If enable = 0, it calls pm_set(5). The console exits Manufacturing Mode.
 * If enable = 1, it calls pm_set(4). That console enters Manufacturing Mode.

sceSblPmMgrSetSdModeOffForDriver
Executes pm_sm.self commands 2, 3, 4, 5, 6, 7, 8, 9, 0xA.

If productMode != 0 (normal mode), it calls pm_set(7, use_new_ernie_protocol).

sceSblPmMgrGetProductModeFromNVSForDriver
Executes pm_sm.self command 1.

sceSblPmMgrAuthEtoIForDriver
Returns jig_auth(12). Returns an integer on success.

jig_auth:
 * On 0.990: executes pm_sm_sd.self commands 3 (gen_req_hello), 4 (gen_challenge), 5 (check_response), 6 (gen_req_result), 7 (check_result).
 * On 1.03-3.60: executes pm_sm_sd.self commands 9, 0xA.

sceSblPostSsMgrDecryptSealedkeyForDriver
is 0x50 bytes of data from sealedkey

This function:

verifies pfsSKKey header

decrypts aes_key(pfsSKKey__EncKey) and hmac_key(pfsSKKey__Secret) using sceSblSsEncryptWithPortabilityForDriver

verifies hmac256 value in

decrypts  into

sceSblPostSsMgrEncryptSealedkeyForDriver
is 0x50 bytes of data like in sealedkey

This function:

writes pfsSKKey header

decrypts aes_key(pfsSKKey__EncKey) and hmac_key(pfsSKKey__Secret) using sceSblSsEncryptWithPortabilityForDriver

randomly generates 0x10 bytes of IV with sceSblRngPseudoRandomNumberForDriver

randomly generates 0x10 bytes of secret with sceSblRngPseudoRandomNumberForDriver

encrypts the secret into

calculates hmac256 value into

sceSblPostSsMgrVerifyKeystoneForDriver
This function verifies magic in the header and HMAC of the keystone file.

sceSblPostSsMgrVerifyKeystoneWithPasscodeForDriver
This function calls sceSblPostSsMgrVerifyKeystoneForDriver. Then also verifies HMAC of passcode.

sceSblPostSsMgrGenerateAppKeyForDriver
This name was derived from SceVshBridge.

sceSblUtMgrIsAllowComTestForDriver
Temp name was sceSblUtMgrIsUtokenProgramForDriver.

pseudo-code:

sceSblUtMgrUpdateUtokenForDriver
Executes utoken_sm command 1 to verify buffer, then writes the 0x800 bytes buffer to tm0:utoken/utoken.dat.

sceSblUtMgrResetUtokenFileForDriver
Writes blank 0x800 bytes to tm0:utoken/utoken.dat or removes it.

Exported to usermode by sceSblUtMgrResetUtokenFile.

sceSblUtMgrHasComTestFlagForDriver
Derived from vshSblUtMgrHasComTestFlag.

sceSblUtMgrHasStoreFlagForDriver
Derived from vshSblUtMgrHasStoreFlag.

sceSblUtMgrHasNpTestFlagForDriver
Derived from vshSblUtMgrHasNpTestFlag.

sceSblRtcMgrSetCpRtcForDriver
Set RTC in DevKit CP.

SceSblPostSsMgrForDriver_D8A2D465
Related to Activation file.

Returns true if a1 and a2 are identical to some values in memory.

SceSblPostSsMgrForDriver_2C463AF1
Used just before SceSblPostSsMgrForDriver_CB5436BD.

SceSblPostSsMgrForDriver_CB5436BD
Transforms? coredump key.

sceSblRSA2048CreateSignatureForDriver
This is a guessed name.

Creates a RSA 2048 signature.

Used in SceAppMgr.

sceSblRSA2048VerifySignatureForDriver
This is a guessed name.

Verfies a RSA 2048 signature.

sceSblSsMgrCloudDataGetEncDecCryptHandleForDriver
This is a guessed name.

Gets the entire Cloud Data Key Ring.

Used in SceAppMgr.

sceSblSsMgrCloudDataGetSignCryptHandleForDriver
This is a guessed name.

Used in SceAppMgr and SceAppMgr.

sceSblSsMgrCloudDataStopForDriver
This is a guessed name.

Clears Cloud Data Key Ring.

Used in SceAppMgr, SceAppMgr and SceAppMgr.

SceZlibForDriver
This library was moved from SceSysmem on FW 1.800.071.

SceSblFwLoaderForDriver
This library was moved from SceSblFwLoader since System Software version 1.800.071.

sceSblPmMgrSetProductModeOffForUser
Calls sceSblPmMgrSetProductModeForDriver(0).

sceSblPmMgrGetProductModeForUser
Returns 0 on success.

Gets KBL Param using sceKernelSysrootGetKblParamForKernel.

result = ((int *)(pKblParam->boot_type_indicator_1) >> 2) & 1; // manufacturing mode flag

sceSblPmMgrGetProductModeFromNVS
Calls sceSblPmMgrGetProductModeFromNVSForDriver.

sceSblPmMgrAuthEtoI
Calls sceSblPmMgrAuthEtoIForDriver.

Returns an integer on success.

sceSblPmMgrGetCurrentMode
Returns 0 on success.

Gets KBL Param using sceKernelSysrootGetKblParamForKernel.

result = ((int *)(pKblParam->boot_type_indicator_1) >> 2) & 1; // manufacturing mode flag

sceSblRtcMgrGetCpSerialId
Calls sceDeci4pCpupGetCpSerialIdForDriver.

SceSblLicMgr
Functions related to afv file.

sceSblLicMgrActivateFromFs
Activates from ux0:/data/activate/.

sceSblLicMgrGetUsageTimeLimit
Uses sceSblSsMgrGetQAFlagsForKernel.

sceSblUtMgrUpdateUtoken
Calls sceSblUtMgrUpdateUtokenForDriver(buf, 0x800);.

sceSblUtMgrResetUtokenFile
Calls sceSblUtMgrResetUtokenFileForDriver.

sceSblUtMgrGetCurrentSecureTick
Calls sceRtcGetCurrentSecureTickForDriver then uses sceKernelMemcpyKernelToUserForDriver.