Merge branch 'master' into ctrl-shift-alt-support-for-function-and-small-keypad-keys

This commit is contained in:
Cyd
2020-03-12 22:01:46 +01:00
committed by GitHub
15 changed files with 171 additions and 18 deletions
+33
View File
@@ -0,0 +1,33 @@
clang
%c -std=c11
-D__WINE__
-DMOD_PERSO
-DMOD_STARTBUTTON
-DMOD_SAVEDUMP
-DMOD_DISABLEALTGR
-DMOD_KEYMAPPING
-DMOD_PUTTYX
-DMOD_PORTKNOCKING
-DMOD_HYPERLINK
-DMOD_PRINTCLIP
-DMOD_LAUNCHER
-DMOD_RECONNECT
-DMOD_WTS
-DMOD_TUTTY
-DMOD_RUTTY
-DMOD_ADB
-DMOD_BACKGROUNDIMAGE
-I0.73_My_PuTTY/
-I.
-I0.73_My_PuTTY/charset/
-I0.73_My_PuTTY/windows/
-I0.73_My_PuTTY/unix/
-I0.73_My_PuTTY/mac/
-I0.73_My_PuTTY/macosx/
-Ibase64/
-Ibcrypt/
-Imd5/
-Iregex/
-Iurl/
-Iwincrypt/
-Irutty/
+3
View File
@@ -0,0 +1,3 @@
*.o
*.map
*.exe
+4
View File
@@ -12,6 +12,10 @@
#include "sshcr.h"
#include "ssh2connection.h"
#ifdef MOD_RECONNECT
int GetAutoreconnectFlag( void ) ;
#endif
static void ssh2_connection_free(PacketProtocolLayer *);
static void ssh2_connection_process_queue(PacketProtocolLayer *);
static bool ssh2_connection_get_specials(
+12 -1
View File
@@ -865,7 +865,9 @@ static void ssh2_userauth_process_queue(PacketProtocolLayer *ppl)
continue; /* process this new message */
}
ppl_logevent("Offer of public key accepted");
#ifdef MOD_RECONNECT
is_backend_first_connected = 0 ;
#endif
/*
* Actually attempt a serious authentication using
* the key.
@@ -890,11 +892,13 @@ static void ssh2_userauth_process_queue(PacketProtocolLayer *ppl)
s->publickey_comment),
false);
#ifdef MOD_PERSO
//if( GetAutoreconnectFlag() && (strlen(ManagePassPhrase(NULL))>0) ) {
if( strlen(ManagePassPhrase(NULL))>0 ) {
char *p = ManagePassPhrase(NULL) ;
bufchain bc;
bufchain_init(&bc);
bufchain_add(&bc, p, strlen(p));
bufchain_add(&bc, "\n", 1);
s->userpass_ret = seat_get_userpass_input( s->ppl.seat, s->cur_prompt, &bc );
logevent(NULL,"Test passphrase");
ManagePassPhrase("");
@@ -938,8 +942,12 @@ static void ssh2_userauth_process_queue(PacketProtocolLayer *ppl)
* Try decrypting the key.
*/
key = ssh2_load_userkey(s->keyfile, passphrase, &error);
if (passphrase) {
/* burn the evidence */
#ifdef MOD_PERSO
if(strlen(passphrase)>0) { ManagePassPhrase(passphrase); }
#endif
smemclr(passphrase, strlen(passphrase));
sfree(passphrase);
}
@@ -956,6 +964,9 @@ static void ssh2_userauth_process_queue(PacketProtocolLayer *ppl)
s->suppress_wait_for_response_packet = true;
break; /* try something else */
}
#ifdef MOD_PERSO
ManagePassPhrase("");
#endif
} else {
/* FIXME: if we ever support variable signature
* flags, this is somewhere they'll need to be
+14 -1
View File
@@ -3338,6 +3338,7 @@ unsigned long term_translate(
return c;
}
extern int cursor_type;
/*
* Remove everything currently in `inbuf' and stick it up on the
* in-memory display. There's a big state machine in here to
@@ -3887,6 +3888,18 @@ static void term_out(Terminal *term)
if (term->esc_nargs < ARGS_MAX)
term->esc_args[term->esc_nargs++] = ARG_DEFAULT;
term->termstate = SEEN_CSI;
} else if (c == 'q') {
// cursor shape type (DECSCUSR)
int cursor_shape = def(term->esc_args[0], 1);
// set cursor_type from shape (cursor_type: 0=block, 1=underline, 2=beam)
cursor_type = (cursor_shape - 1) >> 1;
// set term->blink_cur from shape (odd numbers indicate blinking in DECSCUSR)
if (term->blink_cur != cursor_shape & 1)
{
term->blink_cur = cursor_shape & 1;
term_reset_cblink(term);
}
term->termstate = TOPLEVEL;
} else if (c < '@') {
if (term->esc_query)
term->esc_query = -1;
@@ -4244,7 +4257,7 @@ static void term_out(Terminal *term)
compatibility2(OTHER, VT220);
term->curr_attr &= ~(ATTR_BOLD | ATTR_DIM);
break;
#ifdef PERSPORT
#ifdef MOD_PERSO
case 23: /* disable italics */
compatibility(ANSI);
term->curr_attr &= ~ATTR_ITALIC;
+1 -1
View File
@@ -1,5 +1,5 @@
#define RELEASE 0.73
#define TEXTVER "Release 0.73"
#define SSHVER "-Release-0.73"
#define BINARY_VERSION 0,73,2,4
#define BINARY_VERSION 0,73,2,5
#define SOURCE_COMMIT "unavailable"
+2 -2
View File
@@ -848,7 +848,7 @@ putty.res.o: ../windows/putty.rc ../windows/rcstuff.h ../windows/winhelp.rc2 \
../windows/win_res.h ../windows/putty.ico \
../windows/puttycfg.ico ../windows/version.rc2 ../version.h \
../licence.h \
../../blocnote/notepad.rc
../../blocnote/notepad.rc ../windows/kitty.mft
$(RC) $(RCFL) $(RCFLAGS) ../windows/putty.rc -o putty.res.o -DMOD_INTEGRATED_AGENT -DMOD_INTEGRATED_KEYGEN
puttygen.res.o: ../windows/puttygen.rc ../windows/rcstuff.h \
@@ -2132,7 +2132,7 @@ cross:
make -e TOOLPATH=/usr/bin/i686-w64-mingw32- -f MAKEFILE.MINGW putty.exe plink.exe pscp.exe psftp.exe pageant.exe puttygen.exe
make -e TOOLPATH=/usr/bin/i686-w64-mingw32- -f MAKEFILE.MINGW portable
cp putty.exe putty_nocompress.exe
upx --best --compress-icons=2 --compress-exports=0 putty.exe putty_portable.exe putty_nocompress.exe
upx --best --compress-icons=2 --compress-exports=0 putty.exe putty_portable.exe
mv putty.exe /builds/kitty.exe
mv putty_portable.exe /builds/kitty_portable.exe
mv putty_nocompress.exe /builds/kitty_nocompress.exe
+45
View File
@@ -0,0 +1,45 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!-- Do not attempt to do anything clever with this file, as some versions of
Windows are very sensitive to the exact format.
Hence, some facts below are fibs. -->
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity
version="0.0.0.0"
processorArchitecture="*"
name="KiTTY"
type="win32" />
<description>A network client and terminal emulator</description>
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<!-- Windows 10 -->
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
<!-- Windows 8.1 -->
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
<!-- Windows 8 -->
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
<!-- Windows 7 -->
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
<!-- Windows Vista -->
<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/>
</application>
</compatibility>
<dependency>
<dependentAssembly>
<!-- Load Common Controls 6 instead of 5 to get WinXP native-
looking controls in the client area. -->
<assemblyIdentity type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
publicKeyToken="6595b64144ccf1df"
language="*"
processorArchitecture="*"/>
</dependentAssembly>
</dependency>
<!-- Declare us to be "DPI-aware". -->
<asmv3:application xmlns:asmv3="urn:schemas-microsoft-com:asm.v3">
<asmv3:windowsSettings
xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">
<dpiAware>true</dpiAware>
</asmv3:windowsSettings>
</asmv3:application>
</assembly>
+6
View File
@@ -6,6 +6,12 @@
#include "winhelp.rc2"
#include "win_res.rc2"
#ifdef MOD_PERSO
#ifndef NO_MANIFESTS
1 RT_MANIFEST "kitty.mft"
#endif /* NO_MANIFESTS */
#else
#ifndef NO_MANIFESTS
1 RT_MANIFEST "putty.mft"
#endif /* NO_MANIFESTS */
#endif
+1 -1
View File
@@ -1 +1 @@
4
5
+40 -8
View File
@@ -539,13 +539,17 @@ static void start_backend(void)
conf_get_bool(conf, CONF_tcp_nodelay),
conf_get_bool(conf, CONF_tcp_keepalives));
if (error) {
#ifdef MOD_RECONNECT
char *str = dupprintf("%s Error", appname);
char *msg = dupprintf("Unable to open connection to\n%s\n%s",
conf_dest(conf), error);
MessageBox(NULL, msg, str, MB_ICONERROR | MB_OK);
if( GetAutoreconnectFlag() && conf_get_int(conf,CONF_failure_reconnect) && is_backend_first_connected ) {
lp_eventlog(default_logpolicy, msg) ;
} else {
MessageBox(NULL, msg, str, MB_ICONERROR | MB_OK);
}
sfree(str);
sfree(msg);
#ifdef MOD_RECONNECT
if( GetAutoreconnectFlag() && conf_get_int(conf,CONF_failure_reconnect) && is_backend_first_connected ) {
SetConnBreakIcon() ;
SetSSHConnected(0) ;
@@ -556,6 +560,13 @@ static void start_backend(void)
return ;
}
else
#else
char *str = dupprintf("%s Error", appname);
char *msg = dupprintf("Unable to open connection to\n%s\n%s",
conf_dest(conf), error);
MessageBox(NULL, msg, str, MB_ICONERROR | MB_OK);
sfree(str);
sfree(msg);
#endif
exit(0);
}
@@ -644,6 +655,7 @@ static void close_session(void *ignored_context)
void RestartSession( void ) {
win_seat_connection_fatal( win_seat, "User request session restart..." ) ;
PostMessage(hwnd,WM_KEYDOWN,VK_RETURN ,0) ;
is_backend_first_connected = 0 ;
PostMessage(hwnd,WM_KEYUP,VK_RETURN ,1) ;
}
#endif
@@ -872,6 +884,9 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show)
debug_flag = 1 ;
} else if( !strcmp(p, "-fullscreen") ) {
conf_set_int( conf, CONF_fullscreen, 1 ) ;
} else if( !strcmp(p, "-funky") ) {
i++;
conf_set_int( conf, CONF_funky_type, atoi(argv[1]) ) ;
} else if( !strcmp(p, "-initdelay") ) {
i++ ;
init_delay = (int)(1000*atof( argv[i] )) ;
@@ -932,7 +947,13 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show)
} else if( !strcmp(p, "-notrans") ) {
SetTransparencyFlag( 0 ) ;
conf_set_int(conf,CONF_transparencynumber, -1) ;
#ifdef MOD_SAVEDUMP
#ifdef MOD_RECONNECT
} else if( !strcmp(p, "-autorecnt") ) {
SetAutoreconnectFlag(1) ;
conf_set_int(conf,CONF_wakeup_reconnect, 1) ;
conf_set_int(conf,CONF_failure_reconnect, 1) ;
#endif
#ifdef MOD_SAVEDUMP
} else if( !strcmp(p, "-savedump") ) {
SaveDump() ;
return 0;
@@ -6571,7 +6592,6 @@ if( !get_param("PUTTY") && conf_get_int(conf, CONF_disablealtgr) ) {
default:
break;
}
if (!(term->funky_type == FUNKY_XTERM && !term->vt52_mode) || fkey == 0) {
*p++ = '\033';
}
@@ -6595,7 +6615,6 @@ if( !get_param("PUTTY") && conf_get_int(conf, CONF_disablealtgr) ) {
SendMessage(hwnd, WM_VSCROLL, SB_BOTTOM, 0);
return 0;
}
if (wParam == VK_PRIOR && shift_state == 2) {
SendMessage(hwnd, WM_VSCROLL, SB_LINEUP, 0);
return 0;
@@ -6683,12 +6702,20 @@ if( !get_param("PUTTY") && conf_get_int(conf, CONF_disablealtgr) ) {
return 0;
}
if (wParam == VK_BACK && shift_state <= 1) { /* Backspace of Shift Backspace */
#ifdef MOD_KEYMAPPING
if (wParam == VK_BACK && shift_state <= 1) { /* Backspace or Shift Backspace */
#else
if (wParam == VK_BACK && shift_state == 0) { /* Backspace */
#endif
*p++ = (conf_get_bool(conf, CONF_bksp_is_delete) ? 0x7F : 0x08);
*p++ = 0;
return -2;
}
#ifdef MOD_KEYMAPPING
if (wParam == VK_BACK) { /* Ctrl Backspace or Ctrl+Shift Backspace */
#else
if (wParam == VK_BACK && shift_state == 1) { /* Shift Backspace */
#endif
/* We do the opposite of what is configured */
*p++ = (conf_get_bool(conf, CONF_bksp_is_delete) ? 0x08 : 0x7F);
*p++ = 0;
@@ -6841,7 +6868,12 @@ if( !get_param("PUTTY") && conf_get_int(conf, CONF_disablealtgr) ) {
case VK_PRIOR: sk_key = SKK_PGUP; goto small_keypad_key;
case VK_NEXT: sk_key = SKK_PGDN; goto small_keypad_key;
small_keypad_key:
p += format_small_keypad_key((char *)p, term, sk_key, shift_state, left_alt);
#ifndef MOD_KEYMAPPING
/* These keys don't generate terminal input with Ctrl */
if (shift_state & 2)
break;
#endif
p += format_small_keypad_key((char *)p, term, sk_key);
return p - output;
char xkey;
@@ -7108,7 +7140,7 @@ static void wintw_set_title(TermWin *tw, const char *title_in) {
if( (title[0]=='_')&&(title[1]=='_') ) { // Mode commande a distance
if( ManageLocalCmd( MainHwnd, title+2 ) ) { free(title); return ; }
}
}
if( !GetTitleBarFlag() ) { set_title_internal( tw, title ) ; free(title) ; return ; }
+1 -1
View File
@@ -1306,7 +1306,7 @@ void CreateDefaultIniFile( void ) {
#endif
#endif
writeINI( KittyIniFile, INIT_SECTION, "#uploaddir", "." ) ;
writeINI( KittyIniFile, INIT_SECTION, "#UserPassSSHNoSave", "no" ) ;
writeINI( KittyIniFile, INIT_SECTION, "#userpasssshnosave", "no" ) ;
writeINI( KittyIniFile, INIT_SECTION, "#WinSCPPath", "" ) ;
writeINI( KittyIniFile, INIT_SECTION, "#WinSCPProtocol", "sftp" ) ;
#ifdef MOD_ZMODEM
+4 -1
View File
@@ -57,7 +57,10 @@ static char PassPhrase[256] = "" ;
// Procedure de management de la passphrase
char * ManagePassPhrase( const char * st ) {
if( st != NULL ) strcpy( PassPhrase, st ) ;
if( !GetUserPassSSHNoSave() && (st != NULL) ) {
strcpy( PassPhrase, st ) ;
}
if( GetUserPassSSHNoSave() ) { return "" ; }
return PassPhrase ;
}
+1
View File
@@ -12,6 +12,7 @@ int decryptstring( char * st, const char * key ) ;
int GenerePrivateKey( const char * filename ) ;
// Procedure de management de la passphrase
int GetUserPassSSHNoSave(void) ;
char * ManagePassPhrase( const char * st ) ;
#endif
+4 -2
View File
@@ -9,18 +9,20 @@ void SetTransparency( HWND hwnd, int value ) {
// Numéro de version de l'OS
void GetOSInfo( char * version ) {
void GetOSInfo( char * version ) { // ==> Deprecated with version >= Windows 8.1
OSVERSIONINFO osvi;
ZeroMemory(&osvi, sizeof(OSVERSIONINFO));
osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
GetVersionEx(&osvi);
sprintf( version, "%ld.%ld %ld %ld %s %dx%d", osvi.dwMajorVersion, osvi.dwMinorVersion, osvi.dwBuildNumber, osvi.dwPlatformId, osvi.szCSDVersion, GetSystemMetrics(SM_CXSCREEN), GetSystemMetrics(SM_CYSCREEN) ) ;
}
}
/*
http://msdn.microsoft.com/en-us/library/windows/desktop/ms724832%28v=vs.85%29.aspx
Operating system Version number
Windows 10 Insider Preview 10.0*
Windows Server Technical Preview 10.0*
Windows Server 2019 10.0*
Windows Server 2016 10.0*
Windows 8.1 6.3*
Windows Server 2012 R2 6.3*
Windows 8 6.2