Revamp SSH authentication code so that user interaction is more
[u/mdw/putty] / unix / gtkwin.c
index f969b04..6193a04 100644 (file)
@@ -189,6 +189,22 @@ int from_backend(void *frontend, int is_stderr, const char *data, int len)
     return term_data(inst->term, is_stderr, data, len);
 }
 
+int from_backend_untrusted(void *frontend, const char *data, int len)
+{
+    struct gui_data *inst = (struct gui_data *)frontend;
+    return term_data_untrusted(inst->term, data, len);
+}
+
+int get_userpass_input(prompts_t *p, unsigned char *in, int inlen)
+{
+    struct gui_data *inst = (struct gui_data *)p->frontend;
+    int ret;
+    ret = cmdline_get_passwd_input(p, in, inlen);
+    if (ret == -1)
+       ret = term_get_userpass_input(inst->term, p, in, inlen);
+    return ret;
+}
+
 void logevent(void *frontend, const char *string)
 {
     struct gui_data *inst = (struct gui_data *)frontend;
@@ -1407,12 +1423,12 @@ void palette_reset(void *frontend)
     for (i = 0; i < NEXTCOLOURS; i++) {
        if (i < 216) {
            int r = i / 36, g = (i / 6) % 6, b = i % 6;
-           inst->cols[i+16].red = r * 0x3333;
-           inst->cols[i+16].green = g * 0x3333;
-           inst->cols[i+16].blue = b * 0x3333;
+           inst->cols[i+16].red = r ? r * 0x2828 + 0x3737 : 0;
+           inst->cols[i+16].green = g ? g * 0x2828 + 0x3737 : 0;
+           inst->cols[i+16].blue = b ? b + 0x2828 + 0x3737 : 0;
        } else {
            int shade = i - 216;
-           shade = (shade + 1) * 0xFFFF / (NEXTCOLOURS - 216 + 1);
+           shade = shade * 0x0a0a + 0x0808;
            inst->cols[i+16].red = inst->cols[i+16].green =
                inst->cols[i+16].blue = shade;
        }