Merge pull request #19815 from hrydgard/ticket-max-username-len

sceNpAuthGetTicket: Truncate the username at 16 chars
This commit is contained in:
Henrik Rydgård 2025-01-05 22:36:01 +01:00 committed by GitHub
commit 4d0b649acb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -409,7 +409,7 @@ int sceNpAuthGetTicket(u32 requestId, u32 bufferAddr, u32 length)
ofs += writeTicketU64Param(buf + ofs, PARAM_TYPE_DATE, now);
ofs += writeTicketU64Param(buf + ofs, PARAM_TYPE_DATE, now + 10 * 60 * 1000); // now + 10 minutes, expired time?
ofs += writeTicketU64Param(buf + ofs, PARAM_TYPE_LONG, 0x592e71c546e86859); // seems to be consistent, 8-bytes password hash may be? or related to entitlement? or console id?
ofs += writeTicketStringParam(buf + ofs, PARAM_TYPE_STRING, npOnlineId.c_str(), 32); // username
ofs += writeTicketStringParam(buf + ofs, PARAM_TYPE_STRING, npOnlineId.c_str(), 16); // username
ofs += writeTicketParam(buf + ofs, PARAM_TYPE_STRING_ASCII, npCountryCode, 4); // SceNpCountryCode ? ie. "fr" + 00 02
ofs += writeTicketStringParam(buf + ofs, PARAM_TYPE_STRING, npRegionCode, 4); // 2-char code? related to country/lang code? ie. "c9" + 00 00
ofs += writeTicketParam(buf + ofs, PARAM_TYPE_STRING_ASCII, npServiceId.c_str(), 24);