X-Git-Url: https://git.proxmox.com/?p=vncterm.git;a=blobdiff_plain;f=vncterm.c;h=3ca00ba17bb6c3c5999ab45ffa1769db2c1f8f07;hp=0614e4b2df9531d169f2d90cfc6d636ae1654bb8;hb=bdbcef679d80c86f68208520368d709ef21d406e;hpb=b26ab9ab5a50f91381a2d8b8fe99c896a053a343 diff --git a/vncterm.c b/vncterm.c index 0614e4b..3ca00ba 100644 --- a/vncterm.c +++ b/vncterm.c @@ -494,42 +494,10 @@ rfbVncAuthVencrypt(rfbClientPtr cl) return; } - /* optimize for speed */ - static const int cipher_priority_performance[] = { - GNUTLS_CIPHER_ARCFOUR_128, - GNUTLS_CIPHER_AES_128_CBC, - GNUTLS_CIPHER_3DES_CBC, 0 - }; - - if ((ret = gnutls_cipher_set_priority(sd->session, cipher_priority_performance)) < 0) { - rfbLog("gnutls_cipher_set_priority failed: %s\n", gnutls_strerror(ret)); - sd->session = NULL; - rfbCloseClient(cl); - return; - } - - static const int kx_anon[] = {GNUTLS_KX_ANON_DH, 0}; - static const int kx_x509[] = {GNUTLS_KX_DHE_DSS, GNUTLS_KX_RSA, GNUTLS_KX_DHE_RSA, GNUTLS_KX_SRP, 0}; - if ((ret = gnutls_kx_set_priority(sd->session, use_x509 ? kx_x509 : kx_anon)) < 0) { - rfbLog("gnutls_kx_set_priority failed: %s\n", gnutls_strerror(ret)); - sd->session = NULL; - rfbCloseClient(cl); - return; - } - - static const int cert_type_priority[] = { GNUTLS_CRT_X509, 0 }; - if ((ret = gnutls_certificate_type_set_priority(sd->session, cert_type_priority)) < 0) { - rfbLog("gnutls_certificate_type_set_priority failed: %s\n", - gnutls_strerror(ret)); - sd->session = NULL; - rfbCloseClient(cl); - return; - } - - static const int protocol_priority[]= { GNUTLS_TLS1_1, GNUTLS_TLS1_0, GNUTLS_SSL3, 0 }; - if ((ret = gnutls_protocol_set_priority(sd->session, protocol_priority)) < 0) { - rfbLog("gnutls_protocol_set_priority failed: %s\n", - gnutls_strerror(ret)); + static const char *priority_str_x509 = "NORMAL"; + static const char *priority_str_anon = "NORMAL:+ANON-ECDH:+ANON-DH"; + if ((ret = gnutls_priority_set_direct(sd->session, use_x509 ? priority_str_x509 : priority_str_anon, NULL)) < 0) { + rfbLog("gnutls_priority_set_direct failed: %s\n", gnutls_strerror(ret)); sd->session = NULL; rfbCloseClient(cl); return; @@ -1386,6 +1354,7 @@ vncterm_putchar (vncTerm *vt, unicode ch) } break; } else if (ch == ';') { + vt->esc_has_par = 1; vt->esc_count++; break; } else { @@ -1821,7 +1790,11 @@ vncterm_puts (vncTerm *vt, const char *buf, int len) vt->utf_char = (vt->utf_char << 6) | (c & 0x3f); vt->utf_count--; if (vt->utf_count == 0) { - tc = vt->utf_char; + if (vt->utf_char <= USHRT_MAX) { + tc = vt->utf_char; + } else { + tc = 0; + } } else { continue; }