]> asedeno.scripts.mit.edu Git - PuTTY.git/commitdiff
Remember to initialise p->nphases to zero in progress report structure.
authorSimon Tatham <anakin@pobox.com>
Mon, 12 Nov 2001 09:19:57 +0000 (09:19 +0000)
committerSimon Tatham <anakin@pobox.com>
Mon, 12 Nov 2001 09:19:57 +0000 (09:19 +0000)
[originally from svn r1378]

puttygen.c
ssh.h

index 6d134c43f17e8398603b564cbfe9fcdcfc31da49..4ac0fef9c7853610c12e5d1488759894c8608f97 100644 (file)
@@ -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 0d9613b03e4f76f60bc1e54a531e432e28d4509e..a12aed30a0c4d03befab8dec015b918ba283a311 100644 (file)
--- 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,