mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-07-12 08:43:53 -05:00
New vtable API for keygen progress reporting.
The old API was one of those horrible things I used to do when I was young and foolish, in which you have just one function, and indicate which of lots of things it's doing by passing in flags. It was crying out to be replaced with a vtable. While I'm at it, I've reworked the code on the Windows side that decides what to do with the progress bar, so that it's based on actually justifiable estimates of probability rather than magic integer constants. Since computers are generally faster now than they were at the start of this project, I've also decided there's no longer any point in making the fixed final part of RSA key generation bother to report progress at all. So the progress bars are now only for the variable part, i.e. the actual prime generations.
This commit is contained in:
@ -70,8 +70,6 @@ static const struct PacketProtocolLayerVtable ssh1_login_server_vtable = {
|
||||
NULL /* no layer names in SSH-1 */,
|
||||
};
|
||||
|
||||
static void no_progress(void *param, int action, int phase, int iprogress) {}
|
||||
|
||||
PacketProtocolLayer *ssh1_login_server_new(
|
||||
PacketProtocolLayer *successor_layer, RSAKey *hostkey,
|
||||
AuthPolicy *authpolicy, const SshServerConfig *ssc)
|
||||
@ -142,7 +140,9 @@ static void ssh1_login_server_process_queue(PacketProtocolLayer *ppl)
|
||||
if (server_key_bits < 512)
|
||||
server_key_bits = s->hostkey->bytes + 256;
|
||||
s->servkey = snew(RSAKey);
|
||||
rsa_generate(s->servkey, server_key_bits, no_progress, NULL);
|
||||
ProgressReceiver null_progress;
|
||||
null_progress.vt = &null_progress_vt;
|
||||
rsa_generate(s->servkey, server_key_bits, &null_progress);
|
||||
s->servkey->comment = NULL;
|
||||
s->servkey_generated_here = true;
|
||||
}
|
||||
|
Reference in New Issue
Block a user