mirror of
https://github.com/raphaeIl/Novaria.git
synced 2025-12-14 07:24:48 +01:00
test ike crypto works, new protos from pb
This commit is contained in:
@@ -9,6 +9,7 @@ using Novaria.Common.Utils;
|
||||
using System.IO;
|
||||
using System.Numerics;
|
||||
using System.Security.Cryptography;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
|
||||
namespace Novaria.SDKServer.Controllers.Api
|
||||
{
|
||||
@@ -53,26 +54,35 @@ namespace Novaria.SDKServer.Controllers.Api
|
||||
[HttpOptions] // Ike
|
||||
public IActionResult OptionsRequest()
|
||||
{
|
||||
Log.Information("Received Gateway Ike Options Request, Payload: ");
|
||||
|
||||
// store key which is used in AeadTool
|
||||
using var memoryStream = new MemoryStream();
|
||||
Request.Body.CopyTo(memoryStream); // Copy request body to MemoryStream
|
||||
byte[] rawBytes = memoryStream.ToArray(); // Get raw bytes from MemoryStream
|
||||
|
||||
// Set response headers
|
||||
Response.Headers.Add("Date", DateTime.UtcNow.ToString("R"));
|
||||
Response.Headers.Add("Content-Length", "251");
|
||||
Response.Headers.Add("Connection", "keep-alive");
|
||||
Utils.PrintByteArray(rawBytes);
|
||||
//byte[] msgId = BitConverter.GetBytes(msg.msgId);
|
||||
|
||||
// Set cookies
|
||||
Response.Headers.Append("Set-Cookie", "acw_tc=cb6df452e3196d1ec00d2fcdf7726b25ed2accbaa45e1066701a61d2da90b384;path=/;HttpOnly;Max-Age=1800");
|
||||
Response.Headers.Append("Set-Cookie", "SERVERID=eef797ff9d3671d413582d7dc2f39f29|1736422941|1736422941;Path=/");
|
||||
Response.Headers.Append("Set-Cookie", "SERVERCORSID=eef797ff9d3671d413582d7dc2f39f29|1736422941|1736422941;Path=/;SameSite=None;Secure");
|
||||
|
||||
// Set binary content as the response body
|
||||
string filePath = "E:\\documents\\Decompiling\\Extracted\\NOVA\\Novaria\\Novaria.SDKServer\\options_response"; // Replace with the actual file path
|
||||
byte[] fileBytes = System.IO.File.ReadAllBytes(filePath);
|
||||
//// Set response headers
|
||||
//Response.Headers.Add("Date", DateTime.UtcNow.ToString("R"));
|
||||
//Response.Headers.Add("Content-Length", "251");
|
||||
//Response.Headers.Add("Connection", "keep-alive");
|
||||
|
||||
// Write bytes directly to response body
|
||||
Response.Body.WriteAsync(fileBytes, 0, fileBytes.Length);
|
||||
//// Set cookies
|
||||
//Response.Headers.Append("Set-Cookie", "acw_tc=cb6df452e3196d1ec00d2fcdf7726b25ed2accbaa45e1066701a61d2da90b384;path=/;HttpOnly;Max-Age=1800");
|
||||
//Response.Headers.Append("Set-Cookie", "SERVERID=eef797ff9d3671d413582d7dc2f39f29|1736422941|1736422941;Path=/");
|
||||
//Response.Headers.Append("Set-Cookie", "SERVERCORSID=eef797ff9d3671d413582d7dc2f39f29|1736422941|1736422941;Path=/;SameSite=None;Secure");
|
||||
|
||||
// Return no content since the body is written manually
|
||||
//// Set binary content as the response body
|
||||
//string filePath = "E:\\documents\\Decompiling\\Extracted\\NOVA\\Novaria\\Novaria.SDKServer\\options_response"; // Replace with the actual file path
|
||||
//byte[] fileBytes = System.IO.File.ReadAllBytes(filePath);
|
||||
|
||||
//// Write bytes directly to response body
|
||||
//Response.Body.WriteAsync(fileBytes, 0, fileBytes.Length);
|
||||
|
||||
//// Return no content since the body is written manually
|
||||
return new EmptyResult();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user