vitasdk
Documentation of the vitasdk

Exports for User. More...

Data Structures

struct  SceMediaIdType01
 
struct  SceSblGcAuthMgrGetMediaIdType01Opt
 
struct  ScePcactActivationKeyData
 
struct  ScePcactActivationData
 
struct  ScePcactChallenge
 PC activation challenge packet. More...
 
struct  ScePcactGetChallengeOpt
 
struct  SceSblGcAuthMgrPkgVryInfo
 

Enumerations

enum  ScePcactMode { SCE_PCACT_MODE_0 = 0 , SCE_PCACT_MODE_1 = 1 , SCE_PCACT_MODE_2 = 2 }
 PC activation challenge modes. More...
 

Functions

 VITASDK_BUILD_ASSERT_EQ (0x20, SceMediaIdType01)
 
 VITASDK_BUILD_ASSERT_EQ (0x8, SceSblGcAuthMgrGetMediaIdType01Opt)
 
 VITASDK_BUILD_ASSERT_EQ (1, ScePcactMode)
 
 VITASDK_BUILD_ASSERT_EQ (0x50, ScePcactActivationKeyData)
 
 VITASDK_BUILD_ASSERT_EQ (0x1090, ScePcactActivationData)
 
 VITASDK_BUILD_ASSERT_EQ (0x80, ScePcactChallenge)
 
 VITASDK_BUILD_ASSERT_EQ (0x10, ScePcactGetChallengeOpt)
 
 VITASDK_BUILD_ASSERT_EQ (0x10, SceSblGcAuthMgrPkgVryInfo)
 
int _sceSblGcAuthMgrGetMediaIdType01 (SceMediaIdType01 *media_id, const SceSblGcAuthMgrGetMediaIdType01Opt *opt)
 Get the type-01 game-card media ID.
 
int _sceSblGcAuthMgrPcactActivation (const ScePcactActivationData *activation_data, SceSize activation_data_size)
 Validate and install PC activation data.
 
int _sceSblGcAuthMgrPcactGetChallenge (SceUInt32 mode, const SceUInt8 *e_password, ScePcactChallenge *challenge, const ScePcactGetChallengeOpt *opt)
 Create a PC activation challenge.
 
int _sceSblGcAuthMgrPkgVry (const SceUInt8 *hash, const SceUInt8 *signature, const SceSblGcAuthMgrPkgVryInfo *info)
 Verify a package ECDSA-160 signature.
 

Variables

SceUInt8 SceMediaIdType01::data [0x20]
 Opaque output produced by secure command 0x23.
 
SceSize SceSblGcAuthMgrGetMediaIdType01Opt::media_id_size
 Number of result bytes to copy; maximum 0x20.
 
SceUInt32 SceSblGcAuthMgrGetMediaIdType01Opt::reserved
 Ignored on FW 3.60.
 
SceUInt16 ScePcactActivationKeyData::magic
 Must be set to 0x0211.
 
ScePcactMode ScePcactActivationKeyData::mode
 Must match the mode of the saved challenge state.
 
SceUInt8 ScePcactActivationKeyData::reserved [0xD]
 Must be set to zero.
 
SceUInt8 ScePcactActivationKeyData::protected_data [0x30]
 Protected data bound to the saved challenge state.
 
SceUInt8 ScePcactActivationKeyData::verification_tag [0x10]
 Tag verified before the protected data is accepted.
 
ScePcactActivationKeyData ScePcactActivationData::key_data
 Envelope verified against the saved challenge state.
 
SceUInt8 ScePcactActivationData::activation_data [0x1040]
 Activation payload passed to NPDRM after verification.
 
SceUInt8 ScePcactChallenge::packet_type
 Set to 0x11.
 
SceUInt8 ScePcactChallenge::phase
 Set to 1.
 
ScePcactMode ScePcactChallenge::mode
 Requested challenge mode.
 
SceUInt8 ScePcactChallenge::reserved [0xD]
 Set to zero.
 
SceUInt8 ScePcactChallenge::protected_data [0x60]
 Protected challenge data.
 
SceUInt8 ScePcactChallenge::authentication_tag [0x10]
 Packet authentication tag.
 
SceSize ScePcactGetChallengeOpt::epassword_size
 Number of password bytes copied; use 0x20.
 
SceSize ScePcactGetChallengeOpt::challenge_size
 Number of result bytes copied; maximum 0x80.
 
SceUInt32 ScePcactGetChallengeOpt::reserved [2]
 Ignored on FW 3.60.
 
SceSize SceSblGcAuthMgrPkgVryInfo::hash_size
 Number of hash bytes copied; use 0x14.
 
SceSize SceSblGcAuthMgrPkgVryInfo::sig_size
 Number of signature bytes copied; use 0x28.
 
SceUInt64 SceSblGcAuthMgrPkgVryInfo::reserved
 Ignored on FW 3.60.
 

Detailed Description

Exports for User.


Using this library in your project

Include the header file in your project:


Link the library to the executable:

SceSblGcAuthMgr_stub




Data Structure Documentation

◆ SceMediaIdType01

struct SceMediaIdType01
Data Fields
SceUInt8 data[0x20] Opaque output produced by secure command 0x23.

◆ SceSblGcAuthMgrGetMediaIdType01Opt

struct SceSblGcAuthMgrGetMediaIdType01Opt
Data Fields
SceSize media_id_size Number of result bytes to copy; maximum 0x20.
SceUInt32 reserved Ignored on FW 3.60.

◆ ScePcactActivationKeyData

struct ScePcactActivationKeyData
Data Fields
SceUInt16 magic Must be set to 0x0211.
ScePcactMode mode Must match the mode of the saved challenge state.
SceUInt8 reserved[0xD] Must be set to zero.
SceUInt8 protected_data[0x30] Protected data bound to the saved challenge state.
SceUInt8 verification_tag[0x10] Tag verified before the protected data is accepted.

◆ ScePcactActivationData

struct ScePcactActivationData
Data Fields
ScePcactActivationKeyData key_data Envelope verified against the saved challenge state.
SceUInt8 activation_data[0x1040] Activation payload passed to NPDRM after verification.

◆ ScePcactChallenge

struct ScePcactChallenge

PC activation challenge packet.

Data Fields
SceUInt8 packet_type Set to 0x11.
SceUInt8 phase Set to 1.
ScePcactMode mode Requested challenge mode.
SceUInt8 reserved[0xD] Set to zero.
SceUInt8 protected_data[0x60] Protected challenge data.
SceUInt8 authentication_tag[0x10] Packet authentication tag.

◆ ScePcactGetChallengeOpt

struct ScePcactGetChallengeOpt
Data Fields
SceSize epassword_size Number of password bytes copied; use 0x20.
SceSize challenge_size Number of result bytes copied; maximum 0x80.
SceUInt32 reserved[2] Ignored on FW 3.60.

◆ SceSblGcAuthMgrPkgVryInfo

struct SceSblGcAuthMgrPkgVryInfo
Data Fields
SceSize hash_size Number of hash bytes copied; use 0x14.
SceSize sig_size Number of signature bytes copied; use 0x28.
SceUInt64 reserved Ignored on FW 3.60.

Enumeration Type Documentation

◆ ScePcactMode

PC activation challenge modes.

Enumerator
SCE_PCACT_MODE_0 

Requires the previous challenge to have expired.

SCE_PCACT_MODE_1 

Requires activation data to be absent and records a new expiration.

SCE_PCACT_MODE_2 

Bypasses the previous challenge expiration check.

Function Documentation

◆ VITASDK_BUILD_ASSERT_EQ() [1/8]

VITASDK_BUILD_ASSERT_EQ ( 0x20  ,
SceMediaIdType01   
)

◆ VITASDK_BUILD_ASSERT_EQ() [2/8]

VITASDK_BUILD_ASSERT_EQ ( 0x8  ,
SceSblGcAuthMgrGetMediaIdType01Opt   
)

◆ VITASDK_BUILD_ASSERT_EQ() [3/8]

VITASDK_BUILD_ASSERT_EQ ( 1  ,
ScePcactMode   
)

◆ VITASDK_BUILD_ASSERT_EQ() [4/8]

VITASDK_BUILD_ASSERT_EQ ( 0x50  ,
ScePcactActivationKeyData   
)

◆ VITASDK_BUILD_ASSERT_EQ() [5/8]

VITASDK_BUILD_ASSERT_EQ ( 0x1090  ,
ScePcactActivationData   
)

◆ VITASDK_BUILD_ASSERT_EQ() [6/8]

VITASDK_BUILD_ASSERT_EQ ( 0x80  ,
ScePcactChallenge   
)

◆ VITASDK_BUILD_ASSERT_EQ() [7/8]

VITASDK_BUILD_ASSERT_EQ ( 0x10  ,
ScePcactGetChallengeOpt   
)

◆ VITASDK_BUILD_ASSERT_EQ() [8/8]

VITASDK_BUILD_ASSERT_EQ ( 0x10  ,
SceSblGcAuthMgrPkgVryInfo   
)

◆ _sceSblGcAuthMgrGetMediaIdType01()

int _sceSblGcAuthMgrGetMediaIdType01 ( SceMediaIdType01 *  media_id,
const SceSblGcAuthMgrGetMediaIdType01Opt *  opt 
)

Get the type-01 game-card media ID.

Both pointers must be non-NULL. FW 3.60 always obtains the complete 0x20-byte value internally and copies its first opt->media_id_size bytes.

Parameters
[out]media_id- Media-ID output.
[in]opt- Required output size.
Returns
0 on success; 0x808A0700 for an invalid output or secure-command failure; 0x808A0701 for a semaphore failure; 0x808A0703 when no validated game-card context exists; or another negative copy error.

◆ _sceSblGcAuthMgrPcactActivation()

int _sceSblGcAuthMgrPcactActivation ( const ScePcactActivationData *  activation_data,
SceSize  activation_data_size 
)

Validate and install PC activation data.

The envelope must match the currently saved challenge state. On success the 0x1040-byte payload is passed to NPDRM before this function returns. The input buffer is not used after this function returns. After any activation attempt with the correct size, FW 3.60 clears its saved challenge state even when envelope verification or NPDRM installation fails.

Parameters
[in]activation_data- Required complete activation object.
[in]activation_data_size- Must equal 0x1090.
Returns
0 on success, or a negative validation, cryptographic, copy, or NPDRM error.

◆ _sceSblGcAuthMgrPcactGetChallenge()

int _sceSblGcAuthMgrPcactGetChallenge ( SceUInt32  mode,
const SceUInt8 *  e_password,
ScePcactChallenge *  challenge,
const ScePcactGetChallengeOpt *  opt 
)

Create a PC activation challenge.

All pointers must be non-NULL. The function uses a complete 0x20-byte password block and generates a complete challenge internally; opt only controls how many bytes are copied from or to the caller's buffers.

Parameters
[in]mode- One of ScePcactMode.
[in]e_password- Required 0x20-byte password block.
[out]challenge- Challenge output.
[in]opt- Required copy sizes.
Returns
0 on success; 0x808A0380 for an invalid pointer or mode; 0x808A0383 when mode 1 finds existing activation data; 0x808A0384 when mode 0 is used before challenge expiration; or another negative RTC, cryptographic, or copy error.

◆ _sceSblGcAuthMgrPkgVry()

int _sceSblGcAuthMgrPkgVry ( const SceUInt8 *  hash,
const SceUInt8 *  signature,
const SceSblGcAuthMgrPkgVryInfo *  info 
)

Verify a package ECDSA-160 signature.

The hash and signature pointers must be non-NULL. FW 3.60 uses a complete 0x14-byte hash and 0x28-byte signature. Do not use smaller copy sizes for verification: they leave the remaining bytes unspecified.

Parameters
[in]hash- SHA-1 digest.
[in]signature- Raw ECDSA-160 signature.
[in]info- Required copy sizes.
Returns
0 when valid; 0x808A0008 for a semaphore failure; 0x808A000C for invalid input or a rejected signature; or another negative copy error.

Variable Documentation

◆ data

SceUInt8 SceMediaIdType01::data[0x20]

Opaque output produced by secure command 0x23.

◆ media_id_size

SceSize SceSblGcAuthMgrGetMediaIdType01Opt::media_id_size

Number of result bytes to copy; maximum 0x20.

◆ reserved [1/5]

SceUInt32 SceSblGcAuthMgrGetMediaIdType01Opt::reserved

Ignored on FW 3.60.

◆ magic

SceUInt16 ScePcactActivationKeyData::magic

Must be set to 0x0211.

◆ mode [1/2]

ScePcactMode ScePcactActivationKeyData::mode

Must match the mode of the saved challenge state.

◆ reserved [2/5]

SceUInt8 ScePcactActivationKeyData::reserved[0xD]

Must be set to zero.

◆ protected_data [1/2]

SceUInt8 ScePcactActivationKeyData::protected_data[0x30]

Protected data bound to the saved challenge state.

◆ verification_tag

SceUInt8 ScePcactActivationKeyData::verification_tag[0x10]

Tag verified before the protected data is accepted.

◆ key_data

ScePcactActivationKeyData ScePcactActivationData::key_data

Envelope verified against the saved challenge state.

◆ activation_data

SceUInt8 ScePcactActivationData::activation_data[0x1040]

Activation payload passed to NPDRM after verification.

◆ packet_type

SceUInt8 ScePcactChallenge::packet_type

Set to 0x11.

◆ phase

SceUInt8 ScePcactChallenge::phase

Set to 1.

◆ mode [2/2]

ScePcactMode ScePcactChallenge::mode

Requested challenge mode.

◆ reserved [3/5]

SceUInt8 ScePcactChallenge::reserved[0xD]

Set to zero.

◆ protected_data [2/2]

SceUInt8 ScePcactChallenge::protected_data[0x60]

Protected challenge data.

◆ authentication_tag

SceUInt8 ScePcactChallenge::authentication_tag[0x10]

Packet authentication tag.

◆ epassword_size

SceSize ScePcactGetChallengeOpt::epassword_size

Number of password bytes copied; use 0x20.

◆ challenge_size

SceSize ScePcactGetChallengeOpt::challenge_size

Number of result bytes copied; maximum 0x80.

◆ reserved [4/5]

SceUInt32 ScePcactGetChallengeOpt::reserved[2]

Ignored on FW 3.60.

◆ hash_size

SceSize SceSblGcAuthMgrPkgVryInfo::hash_size

Number of hash bytes copied; use 0x14.

◆ sig_size

SceSize SceSblGcAuthMgrPkgVryInfo::sig_size

Number of signature bytes copied; use 0x28.

◆ reserved [5/5]

SceUInt64 SceSblGcAuthMgrPkgVryInfo::reserved

Ignored on FW 3.60.