simon-git: putty (pre-0.78): Jacob Nevins

Commits to Tartarus hosted VCS tartarus-commits at lists.tartarus.org
Tue Sep 13 16:22:59 BST 2022


TL;DR:
  2fbc122e windows/window.c: make random_save_seed call unconditional.

Repository:     https://git.tartarus.org/simon/putty.git
On the web:     https://git.tartarus.org/?p=simon/putty.git
Branch updated: pre-0.78
Committer:      Jacob Nevins <jacobn at chiark.greenend.org.uk>
Date:           2022-09-13 16:22:59

commit 2fbc122e0e3c1528c15f7064b01a61701f1d4da9
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=2fbc122e0e3c1528c15f7064b01a61701f1d4da9;hp=3037244132fc1799a31ef42cbd02a9c3c8a2077c
Author: Simon Tatham <anakin at pobox.com>
Date:   Mon Sep 12 12:55:47 2022 +0100

    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)

 windows/window.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)



More information about the tartarus-commits mailing list