From 7c7f68933f946bc20ddc5842b7c61d82fd7ebce7 Mon Sep 17 00:00:00 2001 From: simon Date: Mon, 12 Nov 2001 09:19:57 +0000 Subject: [PATCH] Remember to initialise p->nphases to zero in progress report structure. git-svn-id: svn://svn.tartarus.org/sgt/putty@1378 cda61777-01e9-0310-a592-d414129be87e --- puttygen.c | 5 +++++ ssh.h | 11 ++++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/puttygen.c b/puttygen.c index 6d134c43..4ac0fef9 100644 --- a/puttygen.c +++ b/puttygen.c @@ -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 diff --git a/ssh.h b/ssh.h index 0d9613b0..a12aed30 100644 --- a/ssh.h +++ b/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, -- 2.11.0