+ static int pwpkt_type;
+
+ /*
+ * Show password prompt, having first obtained it via a TIS
+ * exchange if we're doing TIS authentication.
+ */
+ pwpkt_type = SSH_CMSG_AUTH_PASSWORD;
+ if (pktin.type == SSH_SMSG_FAILURE &&
+ cfg.try_tis_auth &&
+ (supported_auths_mask & (1<<SSH_AUTH_TIS))) {
+ pwpkt_type = SSH_CMSG_AUTH_TIS_RESPONSE;
+ logevent("Requested TIS authentication");
+ s_wrpkt_start(SSH_CMSG_AUTH_TIS, 0);
+ s_wrpkt();
+ do { crReturnV; } while (!ispkt);
+ if (pktin.type != SSH_SMSG_AUTH_TIS_CHALLENGE) {
+ logevent("TIS authentication declined");
+ c_write("TIS authentication refused.\r\n", 29);
+ } else {
+ int challengelen = ((pktin.body[0] << 24) |
+ (pktin.body[1] << 16) |
+ (pktin.body[2] << 8) |
+ (pktin.body[3]));
+ logevent("Received TIS challenge");
+ c_write(pktin.body+4, challengelen);
+ }
+ }
+ if (pwpkt_type == SSH_CMSG_AUTH_PASSWORD)
+ c_write("password: ", 10);
+