Tagging the 0.74.2.3 release of the kitty project.

This commit is contained in:
cyd01
2020-09-26 22:54:48 +02:00
parent cb833b241a
commit 659bc96519
15 changed files with 150 additions and 69 deletions
+7 -27
View File
@@ -25,12 +25,12 @@
#define SAVEMODE_DIR 2
#endif
extern char FileExtension[15] ;
extern char PassKey[1024] ;
extern int cryptstring( char * st, const char * key ) ;
extern int decryptstring( char * st, const char * key ) ;
int cryptpassword( int mode, char * password, const char * host, const char * termtype ) ;
int decryptpassword( int mode, char * password, const char * host, const char * termtype ) ;
int get_param( const char * val ) ;
void MASKPASS( char * password ) ;
int GetBackgroundImageFlag(void) ;
int GetCryptSaltFlag() ;
#endif
/* The cipher order given here is the default order. */
@@ -910,16 +910,11 @@ void save_open_settings(settings_w *sesskey, Conf *conf)
write_setting_b(sesskey, "SaveWindowPos", conf_get_bool(conf, CONF_save_windowpos) ); /* BKG */
write_setting_b(sesskey, "ForegroundOnBell", conf_get_bool(conf, CONF_foreground_on_bell) );
if( (strlen(conf_get_str(conf, CONF_host))+strlen(conf_get_str(conf, CONF_termtype))) < 1000 ) {
sprintf( PassKey, "%s%sKiTTY", conf_get_str(conf, CONF_host), conf_get_str(conf, CONF_termtype) ) ;
} else {
strcpy( PassKey, "" ) ;
}
char pst[4096] ;
#ifndef MOD_NOPASSWORD
char pst[4096] ;
strcpy( pst, conf_get_str(conf, CONF_password ) );
MASKPASS(pst);
cryptstring( pst, PassKey ) ;
cryptpassword( GetCryptSaltFlag(), pst, conf_get_str(conf, CONF_host), conf_get_str(conf, CONF_termtype) ) ;
write_setting_s(sesskey, "Password", pst);
memset(pst,0,strlen(pst));
#endif
@@ -1575,27 +1570,12 @@ void load_open_settings(settings_r *sesskey, Conf *conf)
gppb(sesskey, "SaveWindowPos", false, conf, CONF_save_windowpos ); /* BKG */
gppb(sesskey, "ForegroundOnBell", false, conf, CONF_foreground_on_bell );
#ifndef MOD_NOPASSWORD
if( strlen(conf_get_str(conf, CONF_host))>0 ) {
if( (strlen(conf_get_str(conf, CONF_host))+strlen(conf_get_str(conf, CONF_termtype))) < 1000 ) {
sprintf( PassKey, "%s%sKiTTY", conf_get_str(conf, CONF_host), conf_get_str(conf, CONF_termtype) ) ;
} else {
strcpy( PassKey, "" ) ;
}
gpps(sesskey, "Password", "", conf, CONF_password );
} else {
if( strlen(conf_get_str(conf, CONF_termtype)) < 1000 ) {
sprintf( PassKey, "%sKiTTY", conf_get_str(conf, CONF_termtype) ) ;
} else {
strcpy( PassKey, "" ) ;
}
gpps(sesskey, "Password", "", conf, CONF_password );
}
gpps(sesskey, "Password", "", conf, CONF_password );
if( strlen(conf_get_str(conf, CONF_password))>0 ) {
char pst[4096] ;
if( strlen(conf_get_str(conf, CONF_password))<=4095 ) { strcpy( pst, conf_get_str(conf, CONF_password) ) ; }
else { memcpy( pst, conf_get_str( conf, CONF_password ), 4095 ) ; pst[4095]='\0'; }
decryptstring( pst, PassKey ) ;
decryptpassword( GetCryptSaltFlag(), pst, conf_get_str(conf, CONF_host), conf_get_str(conf, CONF_termtype) ) ;
if( strlen( pst ) > 0 ) {
FILE *fp ;
if( ( fp = fopen( "kitty.password", "r") ) != NULL ) { // Affichage en clair du password dans le fichier kitty.password si celui-ci existe
-4
View File
@@ -258,11 +258,7 @@ void prng_add_entropy(prng *pr, unsigned source_id, ptrlen data)
prngdebug("prng_add_entropy source=%u size=%"SIZEu" -> collector %zi\n",
source_id, data.len, index);
#ifdef MOD_PERSO
if( (data.len>0)&&(data.ptr!=NULL) ) put_datapl(pi->collectors[index], data);
#else
put_datapl(pi->collectors[index], data);
#endif
if (index == 0)
pi->until_reseed = (pi->until_reseed < data.len ? 0 :
+7
View File
@@ -7,6 +7,10 @@
#include "storage.h"
#include <assert.h>
#ifdef MOD_PERSO
int GetRandomActiveFlag() ;
#endif
/* Collect environmental noise every 5 minutes */
#define NOISE_REGULAR_INTERVAL (5*60*TICKSPERSEC)
@@ -37,6 +41,9 @@ static unsigned long next_noise_collection;
void random_add_noise(NoiseSourceId source, const void *noise, int length)
{
#ifdef MOD_PERSO
if( !GetRandomActiveFlag() ) { return ; }
#endif
if (!random_active)
return;
+1 -1
View File
@@ -1,5 +1,5 @@
#define RELEASE 0.74
#define TEXTVER "Release 0.74"
#define SSHVER "-Release-0.74"
#define BINARY_VERSION 0,74,2,2
#define BINARY_VERSION 0,74,2,3
#define SOURCE_COMMIT "unavailable"
+1 -1
View File
@@ -1994,7 +1994,7 @@ kitty: putty.exe
mv putty.exe kitty.exe
cleanall: clean FORCE
rm -f *.o *.exe *.res.o *.map *.bak ../*.bak ../../*.bak kitty.log ../*.o kitty.dll
rm -f *.o *.exe *.res.o *.map *.dmp *.bak ../*.bak ../../*.bak kitty.log ../*.o kitty.dll
version:
expr `cat version_minor.txt|tr -d '\r\n '` + 1 > version_minor.txt
+1 -1
View File
@@ -1 +1 @@
2
3
+1
View File
@@ -0,0 +1 @@
0.74.2.3
+13 -3
View File
@@ -946,8 +946,7 @@ void RenewPassword( Conf *conf ) {
if( GetSessionField( conf_get_str(conf,CONF_sessionname), conf_get_str(conf,CONF_folder), "Password", buffer ) ) {
GetSessionField( conf_get_str(conf,CONF_sessionname), conf_get_str(conf,CONF_folder), "HostName", host );
GetSessionField( conf_get_str(conf,CONF_sessionname), conf_get_str(conf,CONF_folder), "TerminalType", termtype );
sprintf( PassKey, "%s%sKiTTY", host, termtype ) ;
decryptstring(buffer, PassKey ) ;
decryptpassword( GetCryptSaltFlag(), buffer, host, termtype ) ;
MASKPASS(buffer);
conf_set_str(conf,CONF_password,buffer) ;
memset(buffer,0,strlen(buffer) );
@@ -2537,6 +2536,10 @@ function wcl {
echo "Copied to Windows clipboard" 1>&2
}
*/
/* Lance WinSCP dans le répertoire courant
winscp() { printf "\033]0;__ws:"`pwd`"\007" ; printf "\033]0;__ti\007" ; }
winscp() { echo -ne "\033];__ws:${PWD}\007" ; }
*/
/* Lance WinSCP sur un user et un host dans un répertoire donnés
wt() { printf "\033]0;__wt:"$(hostname)":"${USER}":"`pwd`"\007" ; printf "\033]0;__ti\007" ; }
*/
@@ -5158,6 +5161,7 @@ void LoadParameters( void ) {
if( ReadParameter( INIT_SECTION, "configdir", buffer ) ) {
if( strlen( buffer ) > 0 ) { if( existdirectory(buffer) ) SetConfigDirectory( buffer ) ; }
}
if( ReadParameter( INIT_SECTION, "cryptsalt", buffer ) ) { SetCryptSaltFlag( atoi(buffer) ) ; }
if( ReadParameter( INIT_SECTION, "ctrltab", buffer ) ) { if( !stricmp( buffer, "NO" ) ) SetCtrlTabFlag( 0 ) ; }
#ifdef MOD_HYPERLINK
#ifndef MOD_NOHYPERLINK
@@ -5291,7 +5295,13 @@ void LoadParameters( void ) {
if( readINI( KittyIniFile, "ConfigBox", "defaultsettings", buffer ) ) {
if( !stricmp( buffer, "NO" ) ) DefaultSettingsFlag = 0 ;
}
// Param RandomActiveFlag défini dans kitty_commun.c
// Pour gérer le bug sur certaines machines: https://github.com/cyd01/KiTTY/issues/113
if( readINI( KittyIniFile, "Debug", "randomactive", buffer ) ) {
if( !stricmp( buffer, "NO" ) ) SetRandomActiveFlag( 0 ) ;
if( !stricmp( buffer, "YES" ) ) SetRandomActiveFlag( 1 ) ;
}
if( readINI( KittyIniFile, "Print", "height", buffer ) ) {
PrintCharSize = atoi( buffer ) ;
+10
View File
@@ -89,6 +89,16 @@ int BackgroundImageFlag = 0 ;
int GetBackgroundImageFlag(void) { return BackgroundImageFlag ; }
void SetBackgroundImageFlag( const int flag ) { BackgroundImageFlag = flag ; }
// Pour supprimer le salt dans la cryptography: issue: https://github.com/cyd01/KiTTY/issues/113
int RandomActiveFlag = 0 ;
int GetRandomActiveFlag() { return RandomActiveFlag ; }
void SetRandomActiveFlag( const int flag ) { RandomActiveFlag = flag ; }
// Pour supprimer le sel dans le cryptage du mot de passe
int CryptSaltFlag = 0 ;
int GetCryptSaltFlag() { return CryptSaltFlag ; }
void SetCryptSaltFlag( int flag ) { CryptSaltFlag = flag ; }
// Répertoire de sauvegarde de la configuration (savemode=dir)
char * ConfigDirectory = NULL ;
+9
View File
@@ -45,6 +45,15 @@ void SetScrumbleKeyFlag( const int flag ) ;
int GetBackgroundImageFlag(void) ;
void SetBackgroundImageFlag( const int flag ) ;
// Pour supprimer le salt dans la cryptography: issue:https://github.com/cyd01/KiTTY/issues/113
// extern int RandomActiveFlag ;
int GetRandomActiveFlag() ;
void SetRandomActiveFlag( const int flag ) ;
// Pour supprimer le sel dans le cryptage du mot de passe
int GetCryptSaltFlag() ;
void SetCryptSaltFlag( int flag ) ;
#ifdef MOD_ADB
// Flag pour inhiber le support d'ADB
int GetADBFlag(void) ;
+36 -2
View File
@@ -1,7 +1,9 @@
#include "kitty_crypt.h"
char PassKey[1024] ="" ;
int cryptstring( char * st, const char * key ) { return bcrypt_string_base64( st, st, strlen( st ), key, 0 ) ; }
int cryptstring( char * st, const char * key ) {
return bcrypt_string_base64( st, st, strlen( st ), key, 0 ) ;
}
int decryptstring( char * st, const char * key ) {
if( strlen(st)==0 ) { return 0 ; }
int res = buncrypt_string_base64( st, st, strlen( st ), key ) ;
@@ -9,6 +11,38 @@ int decryptstring( char * st, const char * key ) {
return res ;
}
void dopasskey( int mode, char * passkey, const char * host, const char * termtype ) {
if( mode > 0 ) {
strcpy( passkey, "KiTTY" ) ;
} else {
if( strlen(host)>0 ) {
if( (strlen(host)+strlen(termtype)) < 1000 ) {
sprintf( passkey, "%s%sKiTTY", host, termtype ) ;
} else {
strcpy( passkey, "" ) ;
}
} else {
if( strlen(termtype) < 1000 ) {
sprintf( passkey, "%sKiTTY", termtype ) ;
} else {
strcpy( passkey, "" ) ;
}
}
}
}
int cryptpassword( int mode, char * password, const char * host, const char * termtype ) {
char PassKey[1024] = "" ;
dopasskey( mode, PassKey, host, termtype ) ;
return cryptstring( password, PassKey ) ;
}
int decryptpassword( int mode, char * password, const char * host, const char * termtype ) {
char PassKey[1024] = "" ;
dopasskey( mode, PassKey, host, termtype ) ;
return decryptstring( password, PassKey ) ;
}
//static char MASKKEY[128] = MASTER_PASSWORD ;
static char MASKKEY[128] = "¤¥©ª³¼½¾" ;
+2 -2
View File
@@ -3,10 +3,10 @@
#include "nbcrypt.h"
extern char PassKey[1024] ;
int cryptstring( char * st, const char * key ) ;
int decryptstring( char * st, const char * key ) ;
int cryptpassword( int mode, char * password, const char * host, const char * termtype ) ;
int decryptpassword( int mode, char * password, const char * host, const char * termtype ) ;
// Procedure de management de la passphrase
int GetUserPassSSHNoSave(void) ;
+4 -1
View File
@@ -77,6 +77,9 @@ conf=yes
; Usually it the same directory where kitty.exe is
;configdir=
; cryptsalt: set salt mode for password encryption
;cryptsalt=0
; CtHelperPath: the full path to the cthelper.exe binary (Wrapper for Cygwin feature)
;CtHelperPath=
@@ -134,7 +137,7 @@ paste=no
; ReconnectDelay: the delay before trying to reconnect automatically (in seconds)
ReconnectDelay=5
; sav: path to the save file of the KiTTY registry
; sav: path to the save file of the KiTTY registry. In most case it is located here %APPDATA%/KiTTY/kitty.sav
;
; savemode: specify the save mode for sessions settings
+51 -2
View File
@@ -5,6 +5,7 @@ void WriteCountUpAndPath(void) ;
void SaveDumpPortableConfig( FILE * fp ) ;
int GetAutoStoreSSHKeyFlag(void) ;
int GetUserPassSSHNoSave(void) ;
int GetCryptSaltFlag() ;
// Buffer contenant du texte a ecrire au besoin dans le fichier kitty.dmp
static char * DebugText = NULL ;
@@ -74,8 +75,48 @@ void PrintProcessNameAndID( DWORD processID, FILE * fp ) {
// Print the process name and identifier.
fprintf( fp, TEXT("%05u %u \t%s\n"), (unsigned int)processID, (unsigned int)SizeOfImage, szProcessName ) ;
CloseHandle( hProcess );
}
void PrintOSInfo( FILE * fp ) {
DWORD dwVersion = 0;
DWORD dwMajorVersion = 0;
DWORD dwMinorVersion = 0;
DWORD dwBuild = 0;
dwVersion = GetVersion();
// Get the Windows version.
dwMajorVersion = (DWORD)(LOBYTE(LOWORD(dwVersion)));
dwMinorVersion = (DWORD)(HIBYTE(LOWORD(dwVersion)));
// Get the build number.
if (dwVersion < 0x80000000)
dwBuild = (DWORD)(HIWORD(dwVersion));
fprintf( fp, "Version is %d.%d (%d)\n", dwMajorVersion, dwMinorVersion, dwBuild ) ;
}
void PrintSystemInfo( FILE * fp ) {
// https://docs.microsoft.com/en-us/windows/win32/api/sysinfoapi/ns-sysinfoapi-system_info
SYSTEM_INFO si;
GetSystemInfo( &si );
fprintf( fp, "wProcessorArchitecture=%d ",si.wProcessorArchitecture ) ;
switch(si.wProcessorArchitecture) {
case PROCESSOR_ARCHITECTURE_ARM: fprintf(fp,"(PROCESSOR_ARCHITECTURE_ARM: ARM)\n") ; break ;
// case PROCESSOR_ARCHITECTURE_ARM64: fprintf(fp,"(PROCESSOR_ARCHITECTURE_ARM64: ARM64)\n") ; break ;
case PROCESSOR_ARCHITECTURE_AMD64: fprintf(fp,"(PROCESSOR_ARCHITECTURE_AMD64: x64 (AMD or Intel))\n") ; break ;
case PROCESSOR_ARCHITECTURE_IA64: fprintf(fp,"(PROCESSOR_ARCHITECTURE_IA64: Intel Itanium-based)\n") ; break ;
case PROCESSOR_ARCHITECTURE_INTEL: fprintf(fp,"(PROCESSOR_ARCHITECTURE_INTEL: x86)\n") ; break ;
case PROCESSOR_ARCHITECTURE_UNKNOWN: fprintf(fp,"(PROCESSOR_ARCHITECTURE_UNKNOWN: unknown)\n") ; break ;
}
fprintf( fp, "wProcessorLevel=%d\n",si.wProcessorLevel ) ;
fprintf( fp, "wProcessorRevision=%d\n",si.wProcessorRevision ) ;
fprintf( fp, "dwNumberOfProcessors=%d\n",si.dwNumberOfProcessors ) ;
}
void PrintWindowSettings( FILE * fp ) {
int ret ;
RECT r ;
@@ -634,6 +675,8 @@ void SaveDumpConfig( FILE *fp, Conf * conf ) {
fprintf( fp, "WinHeight=%d\nWinrolFlag=%d\nAutoSendToTray=%d\nNoKittyFileFlag=%d\nConfigBoxHeight=%d\nConfigBoxWindowHeight=%d\nConfigBoxNoExitFlag=%d\nUserPassSSHNoSave=%d\nPuttyFlag=%d\n",WinHeight,WinrolFlag,AutoSendToTray,NoKittyFileFlag,ConfigBoxHeight,ConfigBoxWindowHeight,ConfigBoxNoExitFlag,GetUserPassSSHNoSave(),PuttyFlag);
fprintf( fp,"BackgroundImageFlag=%d\n",GetBackgroundImageFlag() );
fprintf( fp,"RandomActiveFlag=%d\n",GetRandomActiveFlag() );
fprintf( fp,"CryptSaltFlag=%d\n",GetCryptSaltFlag() );
#ifdef MOD_RECONNECT
fprintf( fp,"AutoreconnectFlag=%d\nReconnectDelay=%d\n",AutoreconnectFlag,ReconnectDelay );
#endif
@@ -819,8 +862,14 @@ void SaveDumpFile( char * filename ) {
}
fflush( fpout ) ;
fputs( "\n@@@ SystemInfos @@@\n\n", fpout ) ;
PrintSystemInfo( fpout ) ; fflush( fpout ) ;
fputs( "\n@@@ OSInfos @@@\n\n", fpout ) ;
PrintOSInfo( fpout ) ; fflush( fpout ) ;
fputs( "\n@@@ WindowSettings @@@\n\n", fpout ) ;
PrintWindowSettings( fpout ) ;
PrintWindowSettings( fpout ) ; fflush( fpout ) ;
fputs( "\n@@@ RunningProcess @@@\n\n", fpout ) ;
PrintAllProcess( fpout ) ; fflush( fpout ) ;
+7 -25
View File
@@ -33,6 +33,8 @@ SUPPRIMER les sauvegarde/chargement du paramètre folder
Remarque: ce fichier kitty_settings.c est inclus à la toute fin du fichier SETTINGS.C
****/
/* Fonctions prototypes */
int cryptstring( char * st, const char * key ) ;
int decryptstring( char * st, const char * key ) ;
void write_setting_b_forced(void *handle, const char *key, bool value) ;
void write_setting_i_forced(void *handle, const char *key, int value) ;
@@ -415,16 +417,11 @@ void save_open_settings_forced(char *filename, Conf *conf) {
write_setting_b_forced(sesskey, "SaveWindowPos", conf_get_bool(conf, CONF_save_windowpos) ); /* BKG */
write_setting_b_forced(sesskey, "ForegroundOnBell", conf_get_bool(conf, CONF_foreground_on_bell) );
if( (strlen(conf_get_str(conf, CONF_host))+strlen(conf_get_str(conf, CONF_termtype))) < 1000 ) {
sprintf( PassKey, "%s%sKiTTY", conf_get_str(conf, CONF_host), conf_get_str(conf, CONF_termtype) ) ;
} else {
strcpy( PassKey, "" ) ;
}
char pst[4096] ;
#ifndef MOD_NOPASSWORD
char pst[4096] ;
strcpy( pst, conf_get_str(conf, CONF_password ) );
MASKPASS(pst);
cryptstring( pst, PassKey ) ;
cryptpassword( GetCryptSaltFlag(), pst, conf_get_str(conf, CONF_host), conf_get_str(conf, CONF_termtype) ) ;
write_setting_s_forced(sesskey, "Password", pst);
memset(pst,0,strlen(pst));
#endif
@@ -1048,27 +1045,12 @@ void load_open_settings_forced(char *filename, Conf *conf) {
gppb_forced(sesskey, "SaveWindowPos", false, conf, CONF_save_windowpos ); /* BKG */
gppb_forced(sesskey, "ForegroundOnBell", false, conf, CONF_foreground_on_bell );
#ifndef MOD_NOPASSWORD
if( strlen(conf_get_str(conf, CONF_host))>0 ) {
if( (strlen(conf_get_str(conf, CONF_host))+strlen(conf_get_str(conf, CONF_termtype))) < 1000 ) {
sprintf( PassKey, "%s%sKiTTY", conf_get_str(conf, CONF_host), conf_get_str(conf, CONF_termtype) ) ;
} else {
strcpy( PassKey, "" ) ;
}
gpps_forced(sesskey, "Password", "", conf, CONF_password );
} else {
if( strlen(conf_get_str(conf, CONF_termtype)) < 1000 ) {
sprintf( PassKey, "%sKiTTY", conf_get_str(conf, CONF_termtype) ) ;
} else {
strcpy( PassKey, "" ) ;
}
gpps_forced(sesskey, "Password", "", conf, CONF_password );
}
gpps_forced(sesskey, "Password", "", conf, CONF_password ) ;
if( strlen(conf_get_str(conf, CONF_password))>0 ) {
char pst[4096] ;
if( strlen(conf_get_str(conf, CONF_password))<=4095 ) { strcpy( pst, conf_get_str(conf, CONF_password) ) ; }
else { memcpy( pst, conf_get_str( conf, CONF_password ), 4095 ) ; pst[4095]='\0'; }
decryptstring( pst, PassKey ) ;
else { memcpy( pst, conf_get_str( conf, CONF_password ), 4095 ) ; pst[4095] = '\0' ; }
decryptpassword( GetCryptSaltFlag(), pst, conf_get_str(conf, CONF_host), conf_get_str(conf, CONF_termtype) ) ;
if( strlen( pst ) > 0 ) {
FILE *fp ;
if( ( fp = fopen( "kitty.password", "r") ) != NULL ) { // Affichage en clair du password dans le fichier kitty.password si celui-ci existe