mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-01-10 01:48:00 +00:00
Remember to initialise p->nphases to zero in progress report structure.
[originally from svn r1378]
This commit is contained in:
parent
818176c66f
commit
5f096142a7
@ -44,6 +44,9 @@ static void progress_update(void *param, int action, int phase, int iprogress)
|
||||
if (action < PROGFN_READY && p->nphases < phase)
|
||||
p->nphases = phase;
|
||||
switch (action) {
|
||||
case PROGFN_INITIALISE:
|
||||
p->nphases = 0;
|
||||
break;
|
||||
case PROGFN_LIN_PHASE:
|
||||
p->phases[phase-1].exponential = 0;
|
||||
p->phases[phase-1].mult = p->phases[phase].total / progress;
|
||||
@ -302,6 +305,8 @@ static DWORD WINAPI generate_rsa_key_thread(void *param)
|
||||
struct progress prog;
|
||||
prog.progbar = params->progressbar;
|
||||
|
||||
progress_update(&prog, PROGFN_INITIALISE, 0, 0);
|
||||
|
||||
if (params->is_dsa)
|
||||
dsa_generate(params->dsskey, params->keysize, progress_update, &prog);
|
||||
else
|
||||
|
11
ssh.h
11
ssh.h
@ -301,11 +301,12 @@ void aes256_decrypt_pubkey(unsigned char *key, unsigned char *blk,
|
||||
/*
|
||||
* For progress updates in the key generation utility.
|
||||
*/
|
||||
#define PROGFN_LIN_PHASE 1
|
||||
#define PROGFN_EXP_PHASE 2
|
||||
#define PROGFN_PHASE_EXTENT 3
|
||||
#define PROGFN_READY 4
|
||||
#define PROGFN_PROGRESS 5
|
||||
#define PROGFN_INITIALISE 1
|
||||
#define PROGFN_LIN_PHASE 2
|
||||
#define PROGFN_EXP_PHASE 3
|
||||
#define PROGFN_PHASE_EXTENT 4
|
||||
#define PROGFN_READY 5
|
||||
#define PROGFN_PROGRESS 6
|
||||
typedef void (*progfn_t) (void *param, int action, int phase, int progress);
|
||||
|
||||
int rsa_generate(struct RSAKey *key, int bits, progfn_t pfn,
|
||||
|
Loading…
Reference in New Issue
Block a user