╭──────────╮ │← previous│ ╰──────────╯ ╭ changed ─────────────────╮ │src/serve_ssh_protocol.zig│ ╰──────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────╮ │1588 defer accept.deinit(allocator); │ │1589 try accept.append(allocator, SSH_MSG_SERVICE_ACCEPT); │ │1590 try writeStringField(&accept, allocator, "ssh-userauth"); │ │1572 - try conn.sc_cipher.writePacket(conn.io, conn.writer, accept.items);│ │1591 + try conn.writePacket(accept.items); │ │1592 } │ │1593 │ │1594 // step 2: USERAUTH loop until SUCCESS. accept any ed25519 key whose │ ╰─────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────╮ │1646 try pk_ok.append(allocator, SSH_MSG_USERAUTH_PK_OK); │ │1647 try writeStringField(&pk_ok, allocator, algo); │ │1648 try writeStringField(&pk_ok, allocator, pubkey_blob); │ │1630 - try conn.sc_cipher.writePacket(conn.io, conn.writer, pk_ok.items);│ │1649 + try conn.writePacket(pk_ok.items); │ │1650 continue; │ │1651 } │ │1652 │ ╰────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1671 continue; │ │1672 } │ │1673 │ │1655 - try conn.sc_cipher.writePacket(conn.io, conn.writer, &[_]u8{SSH_MSG_USERAUTH_SUCCESS});│ │1674 + try conn.writePacket(&[_]u8{SSH_MSG_USERAUTH_SUCCESS}); │ │1675 return formatFingerprint(pubkey_blob); │ │1676 } │ │1677 } │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────╮ │1682 try buf.append(conn.allocator, SSH_MSG_USERAUTH_FAILURE); │ │1683 try writeNameList(&buf, conn.allocator, &.{"publickey"}); // allowed methods│ │1684 try buf.append(conn.allocator, 0); // partial_success = false │ │1666 - try conn.sc_cipher.writePacket(conn.io, conn.writer, buf.items); │ │1685 + try conn.writePacket(buf.items); │ │1686 } │ │1687 │ │1688 /// append the canonical publickey-signed-data bytes (RFC 4252 §7) to `buf`. │ ╰──────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1808 const ch = if (channel) |*c| c else continue; │ │1809 const start_request = try handleChannelRequest(conn, ch, packet, &pending_exec);│ │1810 if (start_request) |request| { │ │1811 + // any key authenticates, so the deadline holds until here │ │1812 + if (conn.idle) |idle| idle.session_started.store(true, .release); │ │1813 var sess = SessionCtx{ │ │1814 .conn = conn, │ │1815 .channel = ch, │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1868 defer conn.allocator.free(name); │ │1869 const want_reply = (try r.takeByte()) != 0; │ │1870 if (want_reply) { │ │1850 - try conn.sc_cipher.writePacket(conn.io, conn.writer, &[_]u8{SSH_MSG_REQUEST_FAILURE});│ │1871 + try conn.writePacket(&[_]u8{SSH_MSG_REQUEST_FAILURE}); │ │1872 } │ │1873 } │ │1874 │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────╮ │1909 try writeU32(&reply, allocator, local_id); │ │1910 try writeU32(&reply, allocator, initial_recv_window); │ │1911 try writeU32(&reply, allocator, max_packet_size); │ │1891 - try conn.sc_cipher.writePacket(conn.io, conn.writer, reply.items);│ │1912 + try conn.writePacket(reply.items); │ │1913 │ │1914 return .{ │ │1915 .local_id = local_id, │ ╰────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────╮ │1937 try writeU32(&reply, allocator, reason); │ │1938 try writeStringField(&reply, allocator, description); │ │1939 try writeStringField(&reply, allocator, ""); // language tag │ │1919 - try conn.sc_cipher.writePacket(conn.io, conn.writer, reply.items); │ │1940 + try conn.writePacket(reply.items); │ │1941 } │ │1942 │ │1943 /// returns the session request if this one triggered it, else null. an exec│ ╰──────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────╮ │2010 var packet: [5]u8 = undefined; │ │2011 packet[0] = msg_type; │ │2012 std.mem.writeInt(u32, packet[1..5], ch.remote_id, .big); │ │1992 - try conn.sc_cipher.writePacket(conn.io, conn.writer, &packet);│ │2013 + try conn.writePacket(&packet); │ │2014 } │ │2015 │ │2016 fn handleWindowAdjust(ch: *Channel, packet: []const u8) !void { │ ╰────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────╮ │2075 try adj.append(conn.allocator, SSH_MSG_CHANNEL_WINDOW_ADJUST); │ │2076 try writeU32(&adj, conn.allocator, ch.remote_id); │ │2077 try writeU32(&adj, conn.allocator, add); │ │2057 - try conn.sc_cipher.writePacket(conn.io, conn.writer, adj.items); │ │2078 + try conn.writePacket(adj.items); │ │2079 } │ │2080 │ │2081 pub fn writeU32(buf: *std.ArrayList(u8), allocator: std.mem.Allocator, value: u32) !void {│ ╰────────────────────────────────────────────────────────────────────────────────────────────────╯