[fix] ReadAsync Magic Number
This commit is contained in:
18
.idea/.idea.Abyss/.idea/workspace.xml
generated
18
.idea/.idea.Abyss/.idea/workspace.xml
generated
@@ -10,16 +10,8 @@
|
|||||||
</component>
|
</component>
|
||||||
<component name="ChangeListManager">
|
<component name="ChangeListManager">
|
||||||
<list default="true" id="bf317275-3039-49bb-a475-725a800a0cce" name="Changes" comment="">
|
<list default="true" id="bf317275-3039-49bb-a475-725a800a0cce" name="Changes" comment="">
|
||||||
<change afterPath="$PROJECT_DIR$/Abyss/Components/Services/AbyssService.cs" afterDir="false" />
|
|
||||||
<change afterPath="$PROJECT_DIR$/Abyss/Components/Tools/AbyssStream.cs" afterDir="false" />
|
|
||||||
<change afterPath="$PROJECT_DIR$/Abyss/Components/Tools/HttpHelper.cs" afterDir="false" />
|
|
||||||
<change afterPath="$PROJECT_DIR$/Abyss/Components/Tools/HttpReader.cs" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/.idea/.idea.Abyss/.idea/dataSources.local.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/.idea.Abyss/.idea/dataSources.local.xml" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/.idea/.idea.Abyss/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/.idea.Abyss/.idea/workspace.xml" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/.idea/.idea.Abyss/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/.idea.Abyss/.idea/workspace.xml" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/Abyss.sln.DotSettings.user" beforeDir="false" afterPath="$PROJECT_DIR$/Abyss.sln.DotSettings.user" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/Abyss/Components/Services/UserService.cs" beforeDir="false" afterPath="$PROJECT_DIR$/Abyss/Components/Services/UserService.cs" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/Abyss/Components/Services/ConfigureService.cs" beforeDir="false" afterPath="$PROJECT_DIR$/Abyss/Components/Services/ConfigureService.cs" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/Abyss/Program.cs" beforeDir="false" afterPath="$PROJECT_DIR$/Abyss/Program.cs" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/Abyss/Properties/launchSettings.json" beforeDir="false" afterPath="$PROJECT_DIR$/Abyss/Properties/launchSettings.json" afterDir="false" />
|
|
||||||
</list>
|
</list>
|
||||||
<option name="SHOW_DIALOG" value="false" />
|
<option name="SHOW_DIALOG" value="false" />
|
||||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||||
@@ -93,7 +85,7 @@
|
|||||||
"RunOnceActivity.TerminalTabsStorage.copyFrom.TerminalArrangementManager.252": "true",
|
"RunOnceActivity.TerminalTabsStorage.copyFrom.TerminalArrangementManager.252": "true",
|
||||||
"RunOnceActivity.git.unshallow": "true",
|
"RunOnceActivity.git.unshallow": "true",
|
||||||
"XThreadsFramesViewSplitterKey": "0.30266345",
|
"XThreadsFramesViewSplitterKey": "0.30266345",
|
||||||
"git-widget-placeholder": "main",
|
"git-widget-placeholder": "dev-abyss",
|
||||||
"last_opened_file_path": "/storage/Images/31/summary.json",
|
"last_opened_file_path": "/storage/Images/31/summary.json",
|
||||||
"node.js.detected.package.eslint": "true",
|
"node.js.detected.package.eslint": "true",
|
||||||
"node.js.detected.package.tslint": "true",
|
"node.js.detected.package.tslint": "true",
|
||||||
@@ -104,7 +96,7 @@
|
|||||||
"vue.rearranger.settings.migration": "true"
|
"vue.rearranger.settings.migration": "true"
|
||||||
}
|
}
|
||||||
}</component>
|
}</component>
|
||||||
<component name="RunManager" selected=".NET Launch Settings Profile.Abyss: http">
|
<component name="RunManager" selected="Publish to folder.Publish Abyss to folder">
|
||||||
<configuration name="Publish Abyss to folder x86" type="DotNetFolderPublish" factoryName="Publish to folder">
|
<configuration name="Publish Abyss to folder x86" type="DotNetFolderPublish" factoryName="Publish to folder">
|
||||||
<riderPublish configuration="Release" platform="Any CPU" produce_single_file="true" ready_to_run="true" self_contained="true" target_folder="/opt/security/https/server" target_framework="net9.0" uuid_high="3690631506471504162" uuid_low="-4858628519588143325">
|
<riderPublish configuration="Release" platform="Any CPU" produce_single_file="true" ready_to_run="true" self_contained="true" target_folder="/opt/security/https/server" target_framework="net9.0" uuid_high="3690631506471504162" uuid_low="-4858628519588143325">
|
||||||
<runtimes>
|
<runtimes>
|
||||||
@@ -206,7 +198,9 @@
|
|||||||
<workItem from="1757653914660" duration="1923000" />
|
<workItem from="1757653914660" duration="1923000" />
|
||||||
<workItem from="1757680205207" duration="3000" />
|
<workItem from="1757680205207" duration="3000" />
|
||||||
<workItem from="1757684000965" duration="2511000" />
|
<workItem from="1757684000965" duration="2511000" />
|
||||||
<workItem from="1757687641035" duration="908000" />
|
<workItem from="1757687641035" duration="2969000" />
|
||||||
|
<workItem from="1757693751836" duration="667000" />
|
||||||
|
<workItem from="1757694833696" duration="11000" />
|
||||||
</task>
|
</task>
|
||||||
<servers />
|
<servers />
|
||||||
</component>
|
</component>
|
||||||
|
|||||||
@@ -116,7 +116,7 @@ public class UserService
|
|||||||
{
|
{
|
||||||
if (_cache.TryGetValue(token, out string? userAndIp))
|
if (_cache.TryGetValue(token, out string? userAndIp))
|
||||||
{
|
{
|
||||||
if (ip != userAndIp?.Split('@')[1])
|
if (ip != userAndIp?.Split('@')[1] && ip != "127.0.0.1")
|
||||||
{
|
{
|
||||||
_logger.LogError($"Token used from another Host: {token}");
|
_logger.LogError($"Token used from another Host: {token}");
|
||||||
Destroy(token);
|
Destroy(token);
|
||||||
|
|||||||
@@ -236,7 +236,7 @@ namespace Abyss.Components.Tools
|
|||||||
await ReadExactFromBaseAsync(header, 0, 4, cancellationToken).ConfigureAwait(false);
|
await ReadExactFromBaseAsync(header, 0, 4, cancellationToken).ConfigureAwait(false);
|
||||||
|
|
||||||
var payloadLen = (int)BinaryPrimitives.ReadUInt32BigEndian(header);
|
var payloadLen = (int)BinaryPrimitives.ReadUInt32BigEndian(header);
|
||||||
if (payloadLen > 64 * 1024) throw new InvalidDataException("payload too big");
|
if (payloadLen > MaxPlaintextFrame) throw new InvalidDataException("payload too big");
|
||||||
if (payloadLen < AeadTagLen) throw new InvalidDataException("payload too small");
|
if (payloadLen < AeadTagLen) throw new InvalidDataException("payload too small");
|
||||||
|
|
||||||
var payload = new byte[payloadLen];
|
var payload = new byte[payloadLen];
|
||||||
|
|||||||
Reference in New Issue
Block a user