Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mRemoteNG/PuTTYNG.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Tatham <anakin@pobox.com>2022-09-12 14:55:47 +0300
committerJacob Nevins <jacobn@chiark.greenend.org.uk>2022-09-13 18:21:20 +0300
commit2fbc122e0e3c1528c15f7064b01a61701f1d4da9 (patch)
treefa7524c77dd6b3fbf2160cd139be7e6ad806134e
parent3037244132fc1799a31ef42cbd02a9c3c8a2077c (diff)
windows/window.c: make random_save_seed call unconditional.
The conditionalisation of that call on 'protocol == PROT_SSH' has been around since the beginning of our git history. But in those days, random_save_seed() was unconditional _internally_ - it would always create and write to the seed file regardless of whether the random pool had even been initialised, let alone used. Now random_save_seed() has its own internal condition which prevents it doing anything if the random subsystem was never started up in the first place. So it's better to call it unconditionally from cleanup_exit, and then it'll be able to do its thing whenever needed, without having to second-guess based on the top-level protocol. (In fact, that's what all the other implementations of cleanup_exit() have done all along. On Unix, and in Windows console apps, we do call random_save_seed() unconditionally, and expect it to uncomplainingly do nothing if there's nothing to do.) (cherry picked from commit 260aad5fcac562702a799d945d48ad8b0e26d29c)
-rw-r--r--windows/window.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/windows/window.c b/windows/window.c
index 6a17d54b..70548a5d 100644
--- a/windows/window.c
+++ b/windows/window.c
@@ -1018,9 +1018,7 @@ void cleanup_exit(int code)
DeleteObject(pal);
sk_cleanup();
- if (conf_get_int(conf, CONF_protocol) == PROT_SSH) {
- random_save_seed();
- }
+ random_save_seed();
shutdown_help();
/* Clean up COM. */