This commit is contained in:
Max Goedjen 2021-12-21 21:21:58 -08:00
parent e880e32ce9
commit 27943bb48a
No known key found for this signature in database
GPG Key ID: E58C21DD77B9B8E8
1 changed files with 1 additions and 1 deletions

View File

@ -24,7 +24,7 @@ extension Agent {
public func handle(reader: FileHandleReader, writer: FileHandleWriter) {
Logger().debug("Agent handling new data")
let data = Data(reader.availableData)
guard data.count > 5 else { return }
guard data.count > 4 else { return }
let requestTypeInt = data[4]
guard let requestType = SSHAgent.RequestType(rawValue: requestTypeInt) else {
writer.write(OpenSSHKeyWriter().lengthAndData(of: SSHAgent.ResponseType.agentFailure.data))