mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2025-06-07 17:07:15 +00:00
Fix JWT Claims and Socket Flag Handling to Improve Just Dance® Server Connection
See merge request ryubing/ryujinx!38
This commit is contained in:
parent
f14d65b543
commit
1d923ba7b0
@ -5,6 +5,7 @@ using Ryujinx.HLE.HOS.Kernel.Threading;
|
|||||||
using Ryujinx.HLE.HOS.Services.Account.Acc.AsyncContext;
|
using Ryujinx.HLE.HOS.Services.Account.Acc.AsyncContext;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Security.Claims;
|
||||||
using System.Security.Cryptography;
|
using System.Security.Cryptography;
|
||||||
using System.Security.Principal;
|
using System.Security.Principal;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
@ -38,7 +39,7 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc.AccountService
|
|||||||
|
|
||||||
RsaSecurityKey secKey = new(parameters);
|
RsaSecurityKey secKey = new(parameters);
|
||||||
|
|
||||||
SigningCredentials credentials = new(secKey, "RS256");
|
SigningCredentials credentials = new(secKey, SecurityAlgorithms.RsaSha256);
|
||||||
|
|
||||||
credentials.Key.KeyId = parameters.ToString();
|
credentials.Key.KeyId = parameters.ToString();
|
||||||
|
|
||||||
@ -49,11 +50,11 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc.AccountService
|
|||||||
RandomNumberGenerator.Fill(deviceId);
|
RandomNumberGenerator.Fill(deviceId);
|
||||||
|
|
||||||
byte[] deviceAccountId = new byte[0x10];
|
byte[] deviceAccountId = new byte[0x10];
|
||||||
RandomNumberGenerator.Fill(deviceId);
|
RandomNumberGenerator.Fill(deviceAccountId);
|
||||||
|
|
||||||
SecurityTokenDescriptor descriptor = new()
|
SecurityTokenDescriptor descriptor = new()
|
||||||
{
|
{
|
||||||
Subject = new GenericIdentity(Convert.ToHexString(rawUserId).ToLower()),
|
Subject = new ClaimsIdentity([new Claim(JwtRegisteredClaimNames.Sub, Convert.ToHexString(rawUserId).ToLower())]),
|
||||||
SigningCredentials = credentials,
|
SigningCredentials = credentials,
|
||||||
Audience = "ed9e2f05d286f7b8",
|
Audience = "ed9e2f05d286f7b8",
|
||||||
Issuer = "https://e0d67c509fb203858ebcb2fe3f88c2aa.baas.nintendo.com",
|
Issuer = "https://e0d67c509fb203858ebcb2fe3f88c2aa.baas.nintendo.com",
|
||||||
|
@ -876,13 +876,15 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd
|
|||||||
{
|
{
|
||||||
errno = LinuxError.SUCCESS;
|
errno = LinuxError.SUCCESS;
|
||||||
|
|
||||||
|
// F_GETFL
|
||||||
if (cmd == 0x3)
|
if (cmd == 0x3)
|
||||||
{
|
{
|
||||||
result = !socket.Blocking ? 0x800 : 0;
|
result = !socket.Blocking ? 0x800 : 0;
|
||||||
}
|
}
|
||||||
else if (cmd == 0x4 && arg == 0x800)
|
// F_SETFL
|
||||||
|
else if (cmd == 0x4)
|
||||||
{
|
{
|
||||||
socket.Blocking = false;
|
socket.Blocking = (arg & 0x800) != 0;
|
||||||
result = 0;
|
result = 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user