1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-07-01 03:22:48 -05:00

Seat method to set the current trust status.

In terminal-based GUI applications, this is passed through to
term_set_trust_status, to toggle whether lines are prefixed with the
new trust sigil. In console applications, the function returns false,
indicating to the backend that it should employ some other technique
for spoofing protection.
This commit is contained in:
Simon Tatham
2019-03-10 14:42:11 +00:00
parent 9c367eba4c
commit 76d8d363be
20 changed files with 105 additions and 12 deletions

View File

@ -279,6 +279,11 @@ int console_confirm_weak_cached_hostkey(
}
}
bool console_set_trust_status(Seat *seat, bool trusted)
{
return false;
}
/*
* Ask whether to wipe a session log file before writing to it.
* Returns 2 for wipe, 1 for append, 0 for cancel (don't log).

View File

@ -339,6 +339,7 @@ static void win_seat_notify_remote_exit(Seat *seat);
static void win_seat_connection_fatal(Seat *seat, const char *msg);
static void win_seat_update_specials_menu(Seat *seat);
static void win_seat_set_busy_status(Seat *seat, BusyStatus status);
static bool win_seat_set_trust_status(Seat *seat, bool trusted);
static const SeatVtable win_seat_vt = {
win_seat_output,
@ -358,6 +359,7 @@ static const SeatVtable win_seat_vt = {
nullseat_get_windowid,
win_seat_get_window_pixel_size,
win_seat_stripctrl_new,
win_seat_set_trust_status,
};
static Seat win_seat_impl = { &win_seat_vt };
Seat *const win_seat = &win_seat_impl;
@ -5824,3 +5826,9 @@ void agent_schedule_callback(void (*callback)(void *, void *, int),
c->len = len;
PostMessage(hwnd, WM_AGENT_CALLBACK, 0, (LPARAM)c);
}
static bool win_seat_set_trust_status(Seat *seat, bool trusted)
{
term_set_trust_status(term, trusted);
return true;
}

View File

@ -106,6 +106,7 @@ static const SeatVtable plink_seat_vt = {
nullseat_get_windowid,
nullseat_get_window_pixel_size,
console_stripctrl_new,
console_set_trust_status,
};
static Seat plink_seat[1] = {{ &plink_seat_vt }};

View File

@ -201,6 +201,9 @@ static const char *serial_init(Seat *seat, Backend **backend_handle,
const char *err;
char *serline;
/* No local authentication phase in this protocol */
seat_set_trust_status(seat, false);
serial = snew(Serial);
serial->port = INVALID_HANDLE_VALUE;
serial->out = serial->in = NULL;