This commit is contained in:
Max Goedjen
2025-09-06 15:24:23 -07:00
parent 30bb29d153
commit 11074999ad
4 changed files with 29 additions and 6 deletions

View File

@@ -35,6 +35,13 @@ class AppDelegate: NSObject, NSApplicationDelegate {
logger.debug("SecretAgent finished launching")
Task {
let inputParser = try XPCAgentInputParser()
Task {
try? await Task.sleep(for: .seconds(1))
var len = (5 as UInt32).littleEndian
var raw = SSHAgent.Request.requestIdentities.protocolID
let data = Data(bytes: &len, count: MemoryLayout<UInt32>.size) + Data(bytes: &raw, count: MemoryLayout<UInt8>.size)
print(try? await inputParser.parse(data: data))
}
for await session in socketController.sessions {
Task {
do {

View File

@@ -4,13 +4,15 @@ import SecretAgentKit
public final class XPCAgentInputParser: SSHAgentInputParserProtocol {
private let session: XPCSession
private let queue = DispatchQueue(label: "com.maxgoedjen.Secretive.AgentRequestParser", qos: .userInteractive)
public init() throws {
if #available(macOS 26.0, *) {
session = try XPCSession(xpcService: "com.maxgoedjen.Secretive.AgentRequestParser", requirement: .isFromSameTeam())
session = try XPCSession(xpcService: "com.maxgoedjen.Secretive.AgentRequestParser", targetQueue: queue, options: .inactive, requirement: .isFromSameTeam())
} else {
session = try XPCSession(xpcService: "com.maxgoedjen.Secretive.AgentRequestParser")
session = try XPCSession(xpcService: "com.maxgoedjen.Secretive.AgentRequestParser", targetQueue: queue, options: .inactive)
}
try session.activate()
}
public func parse(data: Data) async throws -> SSHAgent.Request {