From: drh <> Date: Wed, 20 May 2026 20:03:07 +0000 (+0000) Subject: Improved entropy collection on Windows. X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=37e253208f9f2c934c94f647fb708e529300b184;p=thirdparty%2Fsqlite.git Improved entropy collection on Windows. FossilOrigin-Name: b734b76af3f732e0db8a002781bae57aa7a01c4a7f5151605144a6aeef993a21 --- diff --git a/manifest b/manifest index 8e0f7cb106..e990a8b810 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Fix\sa\sbug\scausing\sthe\ssession\smodule\sto\sdereference\sa\sNULL\spointer\swhen\sapplying\sa\scorrupt\schangeset. -D 2026-05-20T15:06:34.678 +C Improved\sentropy\scollection\son\sWindows. +D 2026-05-20T20:03:07.680 F .fossil-settings/binary-glob 61195414528fb3ea9693577e1980230d78a1f8b0a54c78cf1b9b24d0a409ed6a x F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea @@ -722,7 +722,7 @@ F src/os_common.h 6c0eb8dd40ef3e12fe585a13e709710267a258e2c8dd1c40b1948a1d14582e F src/os_kv.c e7d96727db5b67e39d590a68cc61c86daf4c093c36c011a09ebfb521182ec28d F src/os_setup.h 8efc64eda6a6c2f221387eefc2e7e45fd5a3d5c8337a7a83519ba4fbd2957ae2 F src/os_unix.c a07dce662f6c4e18098f6faa9f7ec7cf311f56ee9151bed2aad4dcd55852c9e2 -F src/os_win.c 40d27b5172a1c717e4a425d91481c816f6cd8d896ea8ff76cc97762e15c63726 +F src/os_win.c beae6892a5301541b932e8ada4c34dc871d96d4d98a28051382f32138501b1b9 F src/os_win.h c06ccc3a090cf54202ea58981c298817f3309d4c9e4d52ad0a02927346493721 F src/pager.c fbec9063ea139dfa5d94ce540671752b89f8e8dc38f8a1f614bab1aa04a2dd40 F src/pager.h 6137149346e6c8a3ddc1eeb40aee46381e9bc8b0fcc6dda8a1efde993c2275b8 @@ -2205,8 +2205,8 @@ F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee F tool/warnings.sh a554d13f6e5cf3760f041b87939e3d616ec6961859c3245e8ef701d1eafc2ca2 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f F tool/winmain.c 00c8fb88e365c9017db14c73d3c78af62194d9644feaf60e220ab0f411f3604c -P c19bacca13f699953bbf50afb867035a94080b8a48111cf3d87bced880a3e620 -R 43c5e4df42aec59712218bda1894b5cd -U dan -Z 79c02272bbab5a6ffd70a5205b553513 +P e807d4e3798efd532b3d78d1dfe513ed4fbd3cb793dd0ae5c30cae6031422b10 +R 9fb073d54839cd983592ba47e66f2d2d +U drh +Z 4a00ae97dd5144a5bfbae9a91a5cf0c5 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 968df81406..4c0f3fb733 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -e807d4e3798efd532b3d78d1dfe513ed4fbd3cb793dd0ae5c30cae6031422b10 +b734b76af3f732e0db8a002781bae57aa7a01c4a7f5151605144a6aeef993a21 diff --git a/src/os_win.c b/src/os_win.c index b0d1e128b9..6cd563d245 100644 --- a/src/os_win.c +++ b/src/os_win.c @@ -5044,20 +5044,20 @@ static int winRandomness(sqlite3_vfs *pVfs, int nBuf, char *zBuf){ { FILETIME x; osGetSystemTimeAsFileTime(&x); - xorMemory(&e, (unsigned char*)&x, sizeof(FILETIME)); + xorMemory(&e, (unsigned char*)&x, sizeof(x)); } { DWORD pid = osGetCurrentProcessId(); - xorMemory(&e, (unsigned char*)&pid, sizeof(DWORD)); + xorMemory(&e, (unsigned char*)&pid, sizeof(pid)); } { ULONGLONG cnt = osGetTickCount64(); - xorMemory(&e, (unsigned char*)&cnt, sizeof(DWORD)); + xorMemory(&e, (unsigned char*)&cnt, sizeof(cnt)); } { LARGE_INTEGER i; osQueryPerformanceCounter(&i); - xorMemory(&e, (unsigned char*)&i, sizeof(LARGE_INTEGER)); + xorMemory(&e, (unsigned char*)&i, sizeof(i)); } #if SQLITE_WIN32_USE_UUID #ifdef SQLITE_UWP @@ -5065,12 +5065,12 @@ static int winRandomness(sqlite3_vfs *pVfs, int nBuf, char *zBuf){ #endif { UUID id; - memset(&id, 0, sizeof(UUID)); + memset(&id, 0, sizeof(id)); osUuidCreate(&id); - xorMemory(&e, (unsigned char*)&id, sizeof(UUID)); + xorMemory(&e, (unsigned char*)&id, sizeof(id)); memset(&id, 0, sizeof(UUID)); osUuidCreateSequential(&id); - xorMemory(&e, (unsigned char*)&id, sizeof(UUID)); + xorMemory(&e, (unsigned char*)&id, sizeof(id)); } #endif /* SQLITE_WIN32_USE_UUID */ return e.nXor>nBuf ? nBuf : e.nXor;