vitasdk
Documentation of the vitasdk
post_ss_mgr.h
Go to the documentation of this file.
1
6#ifndef _PSP2KERN_POST_SS_MGR_H_
7#define _PSP2KERN_POST_SS_MGR_H_
8
11#include <psp2kern/types.h>
12
13#ifdef __cplusplus
14extern "C" {
15#endif
16
26VITASDK_BUILD_ASSERT_EQ(0x50, SceSblSealedKey); // size is from FW 3.60
27
36VITASDK_BUILD_ASSERT_EQ(0x60, SceSblKeystone); // size is from FW 3.60
37
46VITASDK_BUILD_ASSERT_EQ(0x40, SceSblDebugKeystone); // size is from FW 3.60
47
61VITASDK_BUILD_ASSERT_EQ(0x2A0, SceSblCloudDataKeyRing); // size is from FW 3.60
62
67VITASDK_BUILD_ASSERT_EQ(0x104, SceSblCloudDataRsaValue); // size is from FW 3.60
68
74
75typedef struct SceSblRsaDataParam {
76 void *data;
77 unsigned int size;
80
82 const void *n;
83 const void *k;
86
92 void *p;
93 void *q;
94 void *dp;
95 void *dq;
96 void *qp;
99
110
123
136
143
150
160int ksceSblCoredumpGetHmacKey(SceUInt32 key_id, SceSize key_size, void *key);
161
171int ksceSblCoredumpGetAesKey(SceUInt32 key_id, SceSize key_size, void *key);
172
181
191
201
214
224
234
244
253
264
271
286int ksceSblFwLoaderLoad(int e_phnum, void *destination, SceSize max_size, SceSize *loaded_size);
287
299int ksceSblFwLoaderLock(const char *path, int reserved);
300
307
316
324
335int ksceSblLicMgrActivateDevkit(const char *afv_path);
336
347int ksceSblLicMgrGetExpireDate(int *expire_date, SceBool read_from_nvs);
348
357
369
381
388
397
409
418
427
439int ksceSblSpsfoMgrOpen(const char *path, SceSblSpsfoContext *context);
440
451
466int ksceSblSpsfoMgrVerify(SceSblSpsfoContext *context, void **payload, SceSize *payload_size);
467
477
492
495
503
511
519
528
536
544
552
561
571
579
580#define ksceSblPostSsMgrActivate ksceSblLicMgrActivateDevkit
581#define ksceSblPostSsMgrGetExpireDate ksceSblLicMgrGetExpireDate
582#define _ksceSblPostSsMgrExecutePmSmF00dCommand ksceSblPmMgrSetSdModeOff
583#define ksceSblPostSsMgrExecutePmSmF00dCommand ksceSblPmMgrSetProductMode
584#define ksceSblPostSsMgrExecutePmSmF00dCommand8 ksceSblPmMgrGetProductModeFromNVS
585#define ksceSblPostSsMgrExecutePmSmSdF00dCommand ksceSblPmMgrAuthEtoI
586#define ksceSblPostSsMgrSetCpRtc ksceSblRtcMgrSetCpRtcPhysical
587#define ksceSblPostSsMgrInitializeSpfsoCtx ksceSblSpsfoMgrOpen
588#define ksceSblPostSsMgrReleaseSpfsoCtx ksceSblSpsfoMgrClose
589#define ksceSblPostSsMgrVerifySpfsoCtx ksceSblSpsfoMgrVerify
590#define ksceSblUtMgrExecuteUtokenSmCommand1 ksceSblUtMgrVerifyAndStoreUtoken
591#define ksceSblUtMgrGetTrilithiumBuffer ksceSblUtMgrGetSelfAuthInfo
592#define ksceSblUtMgrHasPSMTestFlag ksceSblUtMgrHasFlag1
593#define ksceSblUtMgrHasSystemDataFilePlayReadyFlag ksceSblUtMgrHasFlag8
594
595#ifdef __cplusplus
596}
597#endif
598
599#endif /* _PSP2KERN_POST_SS_MGR_H_ */
#define VITASDK_BUILD_ASSERT_EQ(__size__, __name__)
Definition build_utils.h:13
uint16_t version
Definition kbl.h:0
SceUID pid
Definition debug.h:1
SceSize size
Definition lsdb.h:11
SceInt32 type
Must be 100 when passed to sceLsdbReplaceTheme on FW 3.60.
Definition lsdb.h:2
SceUInt32 reserved
Ignored on FW 3.60.
Definition lsdb.h:2
SceUInt32 key
FNV-1a hash of the AppInfo key.
Definition lsdb.h:0
SceUInt8 iv[0x10]
Definition post_ss_mgr.h:43
unsigned int size
Data size in bytes.
Definition post_ss_mgr.h:77
char magic[8]
Magic value "CloudBU" followed by a NUL byte.
Definition post_ss_mgr.h:49
int ksceSblLicMgrActivateDevkit(const char *afv_path)
Activate a development kit from an activation file.
int ksceSblPmMgrSetProductMode(SceBool enable)
Enter or leave manufacturing mode through the PM secure module.
int ksceSblRtcMgrSetCpRtcPhysical(int rtc)
Set the 32-bit CP physical RTC value.
int ksceSblSsMgrCloudDataGetEncDecCryptHandle(SceSblCloudDataKeyRing *key_ring)
Get the cloud-data encryption and decryption key ring.
int ksceSblLicMgrGetExpireDate(int *expire_date, SceBool read_from_nvs)
Get the cached activation expiration time or refresh it from NVS.
int ksceSblPmMgrSetSdModeOff(SceUInt32 reserved)
Disable SD mode through the PM secure module.
const void * n
Pointer to the RSA modulus.
Definition post_ss_mgr.h:82
int ksceSblRSA2048CreateSignature(SceSblRsaDataParam *rsa_signature, SceSblRsaDataParam *hash, SceSblRsaPrivateKeyParam *private_key, int type)
Create an RSA-2048 signature.
SceUInt16 version
Supported values are 0 and 1.
Definition post_ss_mgr.h:31
int ksceSblLicMgrGetLicenseStatus(void)
Get the cached license state.
SceUInt8 passcode_digest[0x20]
Definition post_ss_mgr.h:33
SceBool ksceSblUtMgrIsAllowProgramDebug(SceUInt64 program_authority_id)
Check whether a program authority ID is in the Utoken debug whitelist.
SceUInt16 version
Set to 0 when encrypted and ignored when decrypted.
Definition post_ss_mgr.h:41
int ksceSblUtMgrResetUtokenFile(void)
Overwrite and remove the stored Utoken file.
int ksceSblUtMgrHasStoreFlag(void)
Check whether Utoken flag bit 4 enables Store-mode policy.
int ksceSblUtMgrHasFlag8(void)
Get Utoken flag bit 8.
int ksceSblRtcMgrGetCpRtcPhysical(int *rtc)
Get the 32-bit CP physical RTC value.
int ksceSblCoredumpGetAesKey(SceUInt32 key_id, SceSize key_size, void *key)
Get a coredump AES-128 key.
char magic[8]
Must be "keystone".
Definition post_ss_mgr.h:29
int ksceSblUtMgrHasNpTestFlag(void)
Check whether NP-test policy is enabled.
void * q
Pointer to the 0x80-byte RSA prime q.
Definition post_ss_mgr.h:93
SceUInt32 version
Supported values are 0 and 1.
Definition post_ss_mgr.h:50
SceUInt32 words[0x40]
Zero-padded little-endian 32-bit words.
Definition post_ss_mgr.h:64
int ksceSblPmMgrAuthEtoI(void)
Perform the EtoI jig-authentication exchange through pm_sm_sd.self.
SceUInt8 opaque_header_data[4]
Copied unchanged; not interpreted by the FW 3.60 implementation or known importer.
Definition post_ss_mgr.h:51
SceUInt8 dq[0x80]
d mod (q - 1).
Definition post_ss_mgr.h:56
int ksceSblPmMgrGetProductModeFromNVS(SceUInt8 *product_mode)
Read the raw product-mode byte from NVS through the PM secure module.
int ksceSblUtMgrVerifyAndStoreUtoken(const SceUtoken *utoken, SceSize size)
Verify an encrypted Utoken and write it to storage.
int ksceSblPostSsMgrEncryptSealedkey(SceSblSealedKey *sealed_key)
Create a sealed-key blob containing a newly generated secret.
int ksceSblSpsfoMgrOpen(const char *path, SceSblSpsfoContext *context)
Open an SPSFO file in a mapped memory block.
int ksceSblPostSsMgrDecryptSealedkey(const SceSblSealedKey *sealed_key, SceUInt8 *secret)
Authenticate a sealed-key blob and decrypt its secret.
SceSblRsaHashType
Hash algorithms accepted by the RSA PKCS #1 v1.5 helpers.
Definition post_ss_mgr.h:101
SceUInt16 type
Must be 2.
Definition post_ss_mgr.h:30
int ksceSblLicMgrGetActivationKey(SceSblActivationKey *key)
Get the activation key.
SceUInt8 major_version
Set to 2 when generated; legacy values 0 and 1 are also accepted.
Definition post_ss_mgr.h:19
int ksceSblCoredumpKeyStoreInitialize(void)
Initialize the coredump key store.
void * data
Data buffer.
Definition post_ss_mgr.h:76
int ksceSblRtcMgrGetCpRtcLogical(int *rtc)
Get the 32-bit CP logical RTC value.
SceSize size
Number of significant source bytes, up to 0x100.
Definition post_ss_mgr.h:65
int unk_0x00
Definition post_ss_mgr.h:88
int ksceSblUtMgrHasFlag9(void)
Get Utoken flag bit 9.
SceUInt8 reserved[0x14]
Included in the keystone HMAC.
Definition post_ss_mgr.h:32
SceUInt8 encrypted_secret[0x20]
Definition post_ss_mgr.h:44
void * qp
q^-1 mod p.
Definition post_ss_mgr.h:96
int ksceSblUtMgrGetSelfAuthInfo(SceUtokenSelfAuthInfo *self_auth_info)
Get the Utoken type-11 self-authorization override.
SceUInt8 hmac[0x20]
Definition post_ss_mgr.h:24
void * p
Pointer to the 0x80-byte RSA prime p.
Definition post_ss_mgr.h:92
int ksceSblUtMgrHasFlag6(void)
Get Utoken flag bit 6.
int ksceSblUtMgrHasComTestFlag(void)
Check whether the initialized Utoken contains a COM-test PAID.
int unk_0x0C
Definition post_ss_mgr.h:91
int ksceSblPostSsMgrVerifyKeystoneWithPasscode(const SceSblKeystone *keystone, const SceUInt8 *passcode)
Verify a keystone using a passcode.
SceUInt8 reserved[6]
Set to 0 by ksceSblPostSsMgrEncryptSealedkey.
Definition post_ss_mgr.h:21
void * dp
d mod (p - 1).
Definition post_ss_mgr.h:94
int ksceSblPostSsMgrDebugDecryptKeystone(const SceSblDebugKeystone *keystone, SceUInt8 *secret)
Validate the header and decrypt a debug keystone.
int ksceSblCoredumpGetHmacKey(SceUInt32 key_id, SceSize key_size, void *key)
Get a coredump HMAC-SHA-256 key.
int ksceSblPostSsMgrDebugEncryptKeystone(const SceUInt8 *secret, SceSblDebugKeystone *keystone)
Encrypt a secret into a debug keystone.
const void * k
Pointer to the RSA exponent.
Definition post_ss_mgr.h:83
int unk_0x08
Definition post_ss_mgr.h:90
int ksceSblRSA2048VerifySignature(SceSblRsaDataParam *rsa_signature, SceSblRsaDataParam *hash, SceSblRsaPublicKeyParam *public_key, int type)
Verify an RSA-2048 signature.
SceUInt8 dp[0x80]
d mod (p - 1).
Definition post_ss_mgr.h:55
SceBool ksceSblUtMgrIsAllowComTest(SceUID pid)
Check whether a process is allowed to use COM test mode.
int ksceSblFwLoaderLock(const char *path, int reserved)
Lock and authenticate a firmware image.
int ksceSblSsMgrCloudDataStop(void)
Securely clear the cloud-data encryption and signing key rings.
int ksceSblSsMgrCloudDataGetSignCryptHandle(SceUInt32 mode, SceUInt32 index, SceSblCloudDataSignCryptHandle *handle)
Get one cloud-data RSA signing handle.
SceUInt8 qp[0x80]
q^-1 mod p.
Definition post_ss_mgr.h:57
SceUInt8 reserved[4]
Set to 0 when encrypted and ignored when decrypted.
Definition post_ss_mgr.h:42
SceUInt8 opaque_trailer_data[0x10]
Copied unchanged; not interpreted by the FW 3.60 implementation or known importer.
Definition post_ss_mgr.h:58
int ksceSblRtcMgrSetCpRtcLogical(int rtc)
Set the CP logical RTC.
int ksceSblFwLoaderLoad(int e_phnum, void *destination, SceSize max_size, SceSize *loaded_size)
Load an authenticated firmware image.
SceUInt16 type
Must be 1.
Definition post_ss_mgr.h:40
SceSblCloudDataRsaValue modulus
Definition post_ss_mgr.h:70
void * dq
d mod (q - 1).
Definition post_ss_mgr.h:95
SceUInt8 encrypted_key[0x10]
Definition post_ss_mgr.h:23
SceUInt8 iv[0x10]
Definition post_ss_mgr.h:22
int ksceSblPostSsMgrVerifyKeystone(const SceSblKeystone *keystone, int version)
Verify a keystone without a passcode.
SceUInt8 p[0x80]
RSA prime p.
Definition post_ss_mgr.h:53
int ksceSblCoredumpKeyStoreFinalize(void)
Securely clear and finalize the coredump key store.
int ksceSblUtMgrHasFlag7(void)
Get Utoken flag bit 7.
int ksceSblPostSsMgrGenerateAppKey(const SceSblAppKey *input, SceSblAppKey *output)
Transform an application key using the portability key.
SceUInt8 q[0x80]
RSA prime q.
Definition post_ss_mgr.h:54
int ksceSblSpsfoMgrClose(SceSblSpsfoContext *context)
Close an SPSFO context and release its mapped memory block.
int ksceSblSpsfoMgrVerify(SceSblSpsfoContext *context, void **payload, SceSize *payload_size)
Verify an opened SPSFO file.
SceSblCloudDataRsaValue exponent
Definition post_ss_mgr.h:71
char magic[8]
Must be "keystone".
Definition post_ss_mgr.h:39
SceUInt8 keystone_digest[0x20]
Definition post_ss_mgr.h:34
int ksceSblUtMgrHasFlag1(void)
Get Utoken flag bit 1.
int ksceSblFwLoaderUnlock(void)
Release the firmware-loader lock and discard the saved path.
int unk_0x04
Definition post_ss_mgr.h:89
char magic[8]
Must be "pfsSKKey".
Definition post_ss_mgr.h:18
SceUInt8 minor_version
Must be 0 for the supported versions.
Definition post_ss_mgr.h:20
@ SCE_SBL_RSA_HASH_TYPE_SHA224
Definition post_ss_mgr.h:108
@ SCE_SBL_RSA_HASH_TYPE_SHA384
Definition post_ss_mgr.h:106
@ SCE_SBL_RSA_HASH_TYPE_MD5
Definition post_ss_mgr.h:103
@ SCE_SBL_RSA_HASH_TYPE_SHA256
Definition post_ss_mgr.h:105
@ SCE_SBL_RSA_HASH_TYPE_MD2
Definition post_ss_mgr.h:102
@ SCE_SBL_RSA_HASH_TYPE_SHA512
Definition post_ss_mgr.h:107
@ SCE_SBL_RSA_HASH_TYPE_SHA1
Definition post_ss_mgr.h:104
Definition sblpostssmgr.h:30
Definition sblpostssmgr.h:47
Definition post_ss_mgr.h:48
Definition post_ss_mgr.h:63
Definition post_ss_mgr.h:69
Definition post_ss_mgr.h:38
Definition post_ss_mgr.h:28
Definition post_ss_mgr.h:75
Definition post_ss_mgr.h:87
Definition post_ss_mgr.h:81
Definition post_ss_mgr.h:17
An SPSFO file mapped by ksceSblSpsfoMgrOpen.
Definition sblpostssmgr.h:37
Definition sblpostssmgr.h:53
Complete SELF authorization override stored in Utoken segment type 11.
Definition sblpostssmgr.h:59
int SceBool
Definition types.h:59
unsigned int SceSize
Definition types.h:56
uint16_t SceUInt16
Definition types.h:42
int SceUID
UIDs are used to describe many different kernel objects.
Definition types.h:90
uint64_t SceUInt64
Definition types.h:51
uint32_t SceUInt32
Definition types.h:45
uint8_t SceUInt8
Definition types.h:36