1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-24 16:52:24 +00:00

Remove #ifdef COVERITY.

Turns out that the precautions against winelib builds failing, which I
put in years ago because I was using winelib as a build setup for
Coverity testing, are all obsolete. My Coverity build scripts runs
fine now without any of them.
This commit is contained in:
Simon Tatham 2021-04-10 14:45:24 +01:00
parent 3fbfc6a4ec
commit 3481d16b0f
5 changed files with 6 additions and 41 deletions

View File

@ -25,7 +25,7 @@ enddelegate
# Windows scanner for download).
delegate covscan32wine
in putty do tar xzvf cov-int.tar.gz
in putty/windows do cov-build --dir ../cov-int make -f Makefile.mgw CC=winegcc RC=wrc XFLAGS="-DCOVERITY -DNO_SECUREZEROMEMORY -D_FORCE_SOFTWARE_AES"
in putty/windows do cov-build --dir ../cov-int make -f Makefile.mgw CC=winegcc RC=wrc
in putty do tar czvf cov-int.tar.gz cov-int
return putty/cov-int.tar.gz
enddelegate

View File

@ -23,34 +23,11 @@ bool got_crypt(void)
attempted = true;
crypt = load_system32_dll("crypt32.dll");
successful = crypt &&
#ifdef COVERITY
/* The build toolchain I use with Coverity doesn't know
* about this function, so can't type-check it */
GET_WINDOWS_FUNCTION_NO_TYPECHECK(crypt, CryptProtectMemory)
#else
GET_WINDOWS_FUNCTION(crypt, CryptProtectMemory)
#endif
;
GET_WINDOWS_FUNCTION(crypt, CryptProtectMemory);
}
return successful;
}
#ifdef COVERITY
/*
* The hack I use to build for Coverity scanning, using winegcc and
* Makefile.mgw, didn't provide some defines in wincrypt.h last time I
* looked. Therefore, define them myself here, but enclosed in #ifdef
* COVERITY to ensure I don't make up random nonsense values for any
* real build.
*/
#ifndef CRYPTPROTECTMEMORY_BLOCK_SIZE
#define CRYPTPROTECTMEMORY_BLOCK_SIZE 16
#endif
#ifndef CRYPTPROTECTMEMORY_CROSS_PROCESS
#define CRYPTPROTECTMEMORY_CROSS_PROCESS 1
#endif
#endif
char *capi_obfuscate_string(const char *realname)
{
char *cryptdata;

View File

@ -272,7 +272,7 @@ static SocketPeerInfo *sk_handle_peer_info(Socket *s)
if (!kernel32_module) {
kernel32_module = load_system32_dll("kernel32.dll");
#if (defined _MSC_VER && _MSC_VER < 1900) || defined __MINGW32__ || defined COVERITY
#if (defined _MSC_VER && _MSC_VER < 1900) || defined __MINGW32__
/* For older Visual Studio, and MinGW too (at least as of
* Ubuntu 16.04), this function isn't available in the header
* files to type-check. Ditto the toolchain I use for

View File

@ -157,11 +157,9 @@ void dll_hijacking_protection(void)
if (!kernel32_module) {
kernel32_module = load_system32_dll("kernel32.dll");
#if (defined _MSC_VER && _MSC_VER < 1900) || defined COVERITY
/* For older Visual Studio, and also for the system I
* currently use for Coveritying the Windows code, this
* function isn't available in the header files to
* type-check */
#if (defined _MSC_VER && _MSC_VER < 1900)
/* For older Visual Studio, this function isn't available in
* the header files to type-check */
GET_WINDOWS_FUNCTION_NO_TYPECHECK(
kernel32_module, SetDefaultDllDirectories);
#else

View File

@ -279,21 +279,11 @@ void sk_init(void)
GET_WINDOWS_FUNCTION(winsock_module, WSAStartup);
GET_WINDOWS_FUNCTION(winsock_module, WSACleanup);
GET_WINDOWS_FUNCTION(winsock_module, closesocket);
#ifndef COVERITY
GET_WINDOWS_FUNCTION(winsock_module, ntohl);
GET_WINDOWS_FUNCTION(winsock_module, htonl);
GET_WINDOWS_FUNCTION(winsock_module, htons);
GET_WINDOWS_FUNCTION(winsock_module, ntohs);
GET_WINDOWS_FUNCTION_NO_TYPECHECK(winsock_module, gethostname);
#else
/* The toolchain I use for Windows Coverity builds doesn't know
* the type signatures of these */
GET_WINDOWS_FUNCTION_NO_TYPECHECK(winsock_module, ntohl);
GET_WINDOWS_FUNCTION_NO_TYPECHECK(winsock_module, htonl);
GET_WINDOWS_FUNCTION_NO_TYPECHECK(winsock_module, htons);
GET_WINDOWS_FUNCTION_NO_TYPECHECK(winsock_module, ntohs);
GET_WINDOWS_FUNCTION_NO_TYPECHECK(winsock_module, gethostname);
#endif
GET_WINDOWS_FUNCTION(winsock_module, gethostbyname);
GET_WINDOWS_FUNCTION(winsock_module, getservbyname);
GET_WINDOWS_FUNCTION(winsock_module, inet_addr);