From: Oliver Kurth Date: Tue, 26 May 2020 22:32:58 +0000 (-0700) Subject: Backout previous changes to common source files. X-Git-Tag: stable-11.2.0~195 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a99fcf43fbef64cc36473750a441cb2f6265a1dd;p=thirdparty%2Fopen-vm-tools.git Backout previous changes to common source files. --- diff --git a/open-vm-tools/lib/include/random.h b/open-vm-tools/lib/include/random.h index 406520646..b96c1a6e9 100644 --- a/open-vm-tools/lib/include/random.h +++ b/open-vm-tools/lib/include/random.h @@ -45,13 +45,6 @@ extern "C" { Bool Random_Crypto(size_t size, void *buffer); -/* - * The next call to Random_Crypto will fail after this function is called. - * This function does nothing in a release build. - */ - -void Random_CryptoFail(void); - /* * Research grade Mersenne Twister random number generator. * diff --git a/open-vm-tools/lib/misc/random.c b/open-vm-tools/lib/misc/random.c index 9f11c1d45..7946fae35 100644 --- a/open-vm-tools/lib/misc/random.c +++ b/open-vm-tools/lib/misc/random.c @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 1998-2020 VMware, Inc. All rights reserved. + * Copyright (C) 1998-2017 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -44,10 +44,6 @@ #include "random.h" #include "util.h" -#if !defined(VMX86_RELEASE) -#include "vm_atomic.h" -#endif - #if defined(_WIN32) #if !defined(VM_WIN_UWP) @@ -186,18 +182,10 @@ RandomBytesPosix(const char *name, // IN: *----------------------------------------------------------------------------- */ -static Atomic_uint32 forceFail; - Bool Random_Crypto(size_t size, // IN: void *buffer) // OUT: { -#if !defined(VMX86_RELEASE) - if (Atomic_ReadIfEqualWrite32(&forceFail, 1, 0) == 1) { - return FALSE; - } -#endif - #if defined(_WIN32) return RandomBytesWin32(size, buffer); #else @@ -211,34 +199,6 @@ Random_Crypto(size_t size, // IN: } -/* - *----------------------------------------------------------------------------- - * - * Random_CryptoFail -- - * - * This function will cause the next call to Random_Crypto to fail. - * - * NOTE: This function does nothing in a release build. - * - * Results: - * TRUE success - * FALSE failure - * - * Side effects: - * None - * - *----------------------------------------------------------------------------- - */ - -void -Random_CryptoFail(void) -{ -#if !defined(VMX86_RELEASE) - Atomic_Write32(&forceFail, 1); -#endif -} - - /* *-----------------------------------------------------------------------------