Files
AnyPS5/docs/dev/debt/libSceNpAuth.md
T
xXPBSXxandClaude Sonnet 5.5 f8f1a4a193 docs(debt): add call-site evidence for the libSceNpAuth V3 parameter layouts
Three disassembled titles show the parameter layouts and how titles drive
sceNpAuthGetAuthorizationCodeV3 and sceNpAuthGetIdTokenV3 (static reading only).

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-23 05:22:22 +02:00

4.7 KiB

libSceNpAuth technical debt

Unknown function info

  • sceNpAuthAbortRequest, sceNpAuthGetAuthorizationCode, sceNpAuthGetAuthorizationCodeA, sceNpAuthGetAuthorizationCodeV3, sceNpAuthGetIdToken, sceNpAuthGetIdTokenA, sceNpAuthGetIdTokenV3, sceNpAuthPollAsync, sceNpAuthWaitAsync (libSceNpAuth) - request tracking, ORBIS_NP_AUTH_ERROR_REQUEST_NOT_FOUND (0x80550306) on unknown IDs, ORBIS_NP_AUTH_ERROR_INVALID_ID (0x80550307) on non-async or unprocessed requests in Poll/Wait, ORBIS_NP_AUTH_ERROR_INVALID_ARGUMENT (0x80550301) on null arguments, and ORBIS_NP_AUTH_ERROR_ABORTED (0x80550304) follow shadPS4 (PS4); the A calls forward to their V3 counterparts, which in shadPS4 (AuthorizationCode A, V3; IdToken A, V3) call the same helper and differ only in a version flag; async requests defer SCE_NP_ERROR_SIGNED_OUT to Poll/Wait while sync requests fail immediately; PSN is not contacted. Call sites in three disassembled titles (PPSA02225, PPSA15246, PPSA30601; static reading only) show the V3 parameter layouts: the code request parameter is 0x20 bytes (size, a 32-bit value that the titles take from their user object, a pointer to a client-ID-like string, a pointer to a constant string) and the call is (reqId, param, code[128], int* issuerId); the ID token request parameter is 0x28 bytes (size, the same kind of 32-bit value, a pointer to a client-ID-like string, a pointer to a second buffer (256 bytes in one title) and a pointer to a constant string) and the call is (reqId, param, token). The client-ID-like string is 36 characters plus a terminator in one title and a 128-byte buffer in two. In two titles the calls follow sceNpAuthCreateAsyncRequest (whose parameter holds only a size of 0x18) and are polled with sceNpAuthPollAsync (one title once per frame, one in a blocking loop of up to 40 polls 100 ms apart); the third title is a synchronous caller that takes the request ID from an argument-less call. All three call sceNpAuthDeleteRequest once the request has finished or failed (immediately after the call in the synchronous title, after a poll return of 0 in the per-frame title, on every path in the blocking one). The titles treat a poll return of 0 as finished and any negative result as a failure without looking at the specific code; one title, after 40 polls that still return non-zero, treats a return of exactly 1 as a timeout and calls sceNpAuthAbortRequest, and reports 0x80550301 and 0x80550306 from Poll as an invalid result pointer and an unknown request ID. The size fields are not checked here; the console's size checks and the behaviour of the calls on a console are unverified

  • sceNpAuthPollAsync and sceNpAuthWaitAsync (libSceNpAuth) - PS5 abort-before-start behavior is unmeasured. Poll/Wait keep returning ORBIS_NP_AUTH_ERROR_INVALID_ID without changing output after a pre-start abort, including subsequent rejected getter calls, following shadPS4 StartRequest and FindAsyncRequest.

Functional

  • sceNpAuthSetTimeout: native validation and storage are implemented: retry must be nonnegative, the all-zero tuple is invalid, resolve timeout is zero or at least 1000000, and other timeouts are zero or at least 10000000. Invalid arguments precede request lookup. Stored settings currently have no transport to configure because authentication remains offline.

  • sceNpAuthGetAuthorizedAppCode: the five-argument ABI and 40-byte request parameter are recovered. Pointer, size, user, option and request-ID validation replaces the unconditional signed-out result. Valid calls throw because authorization and asynchronous result delivery are not implemented. Client-ID storage is copied as 136 bytes by the firmware; its internal fields and the complete output-code format remain unresolved.