/[winpt]/trunk/Src/wptKeygenDlg.cpp
ViewVC logotype

Diff of /trunk/Src/wptKeygenDlg.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 23 by twoaday, Fri Sep 30 10:10:16 2005 UTC revision 32 by twoaday, Mon Oct 24 08:03:48 2005 UTC
# Line 114  gpg_genkey_params (int keytype, int bits Line 114  gpg_genkey_params (int keytype, int bits
114          return NULL;          return NULL;
115            
116      if( comment && *comment ) {      if( comment && *comment ) {
117          size = strlen( key_params_with_comment )          size = strlen (key_params_with_comment)
118              + 16              + 16
119              + strlen( user )              + strlen( user )
120              + addsize              + addsize
# Line 316  backup_keyrings (HWND dlg) Line 316  backup_keyrings (HWND dlg)
316          }          }
317      }      }
318      free_if_alloc( path );      free_if_alloc( path );
319  } /* ask_for_backup */  }
320    
321    
322  /* Fill in all valid GPG algorithms. */  /* Fill in all valid GPG algorithms. */
# Line 345  keygen_check_date (SYSTEMTIME *st) Line 345  keygen_check_date (SYSTEMTIME *st)
345  {        {      
346      SYSTEMTIME t;      SYSTEMTIME t;
347                    
348      GetSystemTime( &t );      GetSystemTime (&t);
349      if( st->wYear > t.wYear || st->wMonth > t.wMonth )      if (st->wYear > t.wYear || st->wMonth > t.wMonth)
350          return 1;          return 1;
351      else if( st->wYear < t.wYear || st->wMonth < t.wMonth || st->wDay < t.wDay)      else if (st->wYear < t.wYear || st->wMonth < t.wMonth || st->wDay < t.wDay)
352          return 0;                return 0;      
353      return 1;      return 1;
354  } /* keygen_check_date */  }
355    
356    
357  /* Dialog box procedure for key generation. */  /* Dialog box procedure for key generation. */
# Line 383  keygen_dlg_proc (HWND dlg, UINT msg, WPA Line 383  keygen_dlg_proc (HWND dlg, UINT msg, WPA
383          SetDlgItemText( dlg, IDC_KEYGEN_NAMEINF, _("&Real name") );          SetDlgItemText( dlg, IDC_KEYGEN_NAMEINF, _("&Real name") );
384          SetDlgItemText( dlg, IDC_KEYGEN_COMMINF, _("&Comment (optional)") );          SetDlgItemText( dlg, IDC_KEYGEN_COMMINF, _("&Comment (optional)") );
385          SetDlgItemText( dlg, IDC_KEYGEN_EMAILINF, _("Email &address") );          SetDlgItemText( dlg, IDC_KEYGEN_EMAILINF, _("Email &address") );
386          SetDlgItemText( dlg, IDC_KEYGEN_EXPINF, _("Key &expiration") );          SetDlgItemText( dlg, IDC_KEYGEN_EXPINF, _("&Expire date"));
387          SetDlgItemText( dlg, IDC_KEYGEN_PWDINF, _("&Passphrase") );          SetDlgItemText( dlg, IDC_KEYGEN_PWDINF, _("&Passphrase") );
388          SetDlgItemText( dlg, IDC_KEYGEN_REPWDINF, _("&Repeat passphrase") );          SetDlgItemText( dlg, IDC_KEYGEN_REPWDINF, _("&Repeat passphrase") );
389          SetDlgItemText( dlg, IDC_KEYGEN_KEYTYPEINF, _("Key &type") );          SetDlgItemText( dlg, IDC_KEYGEN_KEYTYPEINF, _("Key &type") );
390          SetDlgItemText (dlg, IDC_KEYGEN_CLEAR, _("&Never"));          SetDlgItemText (dlg, IDC_KEYGEN_EXPNEVER, _("&Never"));
391          SetDlgItemText (dlg, IDC_KEYGEN_HIDEPWD, _("&Hide Typing"));          SetDlgItemText (dlg, IDC_KEYGEN_HIDEPWD, _("&Hide Typing"));
392      #endif      #endif
393          SetDlgItemInt( dlg, IDC_KEYGEN_SUBKEYBITS, 2048, FALSE );          SetDlgItemInt( dlg, IDC_KEYGEN_SUBKEYBITS, 2048, FALSE );
# Line 493  keygen_dlg_proc (HWND dlg, UINT msg, WPA Line 493  keygen_dlg_proc (HWND dlg, UINT msg, WPA
493              if( strcmp( pwd, pwd2 ) ) {              if( strcmp( pwd, pwd2 ) ) {
494                  msg_box( dlg,  _("Passphrases are NOT identical!" ),                  msg_box( dlg,  _("Passphrases are NOT identical!" ),
495                           _("Key Generation"), MB_ERR );                           _("Key Generation"), MB_ERR );
496                  memset( pwd, 0, sizeof pwd );                  wipememory (pwd, sizeof (pwd));
497                  memset( pwd2, 0, sizeof pwd2 );                  wipememory (pwd2, sizeof (pwd2));
498                  return FALSE;                  return FALSE;
499              }              }
500              if( is_8bit_string( pwd ) ) {              if( is_8bit_string( pwd ) ) {
501                  msg_box( dlg, _("The passphrase contains 8-bit characters.\n"                  msg_box( dlg, _("The passphrase contains 8-bit characters.\n"
502                                  "It is not suggested to use charset specific characters."),                                  "It is not suggested to use charset specific characters."),
503                           _("Key Generation"), MB_ERR );                           _("Key Generation"), MB_ERR );
504                  memset( pwd, 0, sizeof pwd );                  wipememory (pwd, sizeof (pwd));
505                  memset( pwd2, 0, sizeof pwd2 );                  wipememory (pwd2, sizeof (pwd2));
506                  SetDlgItemText( dlg, IDC_KEYGEN_PASSPHRASE, "" );                  SetDlgItemText( dlg, IDC_KEYGEN_PASSPHRASE, "" );
507                  SetDlgItemText( dlg, IDC_KEYGEN_PWDCHECK, "" );                  SetDlgItemText( dlg, IDC_KEYGEN_PWDCHECK, "" );
508                  return FALSE;                  return FALSE;
# Line 528  keygen_dlg_proc (HWND dlg, UINT msg, WPA Line 528  keygen_dlg_proc (HWND dlg, UINT msg, WPA
528              }              }
529              keygen_cb_dlg_create( );              keygen_cb_dlg_create( );
530              err = gpg_genkey (p, keygen_cb, &fpr);              err = gpg_genkey (p, keygen_cb, &fpr);
531              memset( pwd, 0, sizeof pwd );              wipememory (pwd, sizeof (pwd));    
532              memset( pwd2, 0, sizeof pwd2 );              wipememory (pwd2, sizeof (pwd2));
533              if( p ) {              if( p ) {
534                  memset( p, 0, strlen( p ) ); /* burn the passphrase! */                  wipememory (p, strlen (p));  /* burn the passphrase! */
535                  free( p );                  free (p);
536              }              }
537              keygen_cb_dlg_destroy( );              keygen_cb_dlg_destroy ();
538              keygen_cb( NULL, NULL, 0, 0, 0 ); /* flush */              keygen_cb (NULL, NULL, 0, 0, 0); /* flush */
539              if( err ) {              if( err ) {
540                  if (fpr)                  if (fpr)
541                      free (fpr);                      free (fpr);
# Line 566  keygen_dlg_proc (HWND dlg, UINT msg, WPA Line 566  keygen_dlg_proc (HWND dlg, UINT msg, WPA
566      }      }
567            
568      return FALSE;      return FALSE;
569  } /* keygen_dlg_proc */  }
570    
571    
572  BOOL CALLBACK  BOOL CALLBACK
# Line 592  keygen_wizard_dlg_proc (HWND dlg, UINT m Line 592  keygen_wizard_dlg_proc (HWND dlg, UINT m
592          SetDlgItemText (dlg, IDC_KEYWIZARD_TITLEINF, _("Name and E-Mail Assignment"));          SetDlgItemText (dlg, IDC_KEYWIZARD_TITLEINF, _("Name and E-Mail Assignment"));
593          SetDlgItemText (dlg, IDC_KEYWIZARD_TEXT1INF, _("Every key pair must have a name associated with it. The name and\nemail address let your correspondents that your public key they are\nusing belongs to us."));          SetDlgItemText (dlg, IDC_KEYWIZARD_TEXT1INF, _("Every key pair must have a name associated with it. The name and\nemail address let your correspondents that your public key they are\nusing belongs to us."));
594          SetDlgItemText (dlg, IDC_KEYWIZARD_TEXT2INF, _("By accosiating an email address with your key pair, you will enable WinPT to assist your correspondents in selecting the correct public\nkey when communicating with you."));          SetDlgItemText (dlg, IDC_KEYWIZARD_TEXT2INF, _("By accosiating an email address with your key pair, you will enable WinPT to assist your correspondents in selecting the correct public\nkey when communicating with you."));
595            SetWindowText (dlg, _("Key Generation Wizard"));
596          SetForegroundWindow (dlg);          SetForegroundWindow (dlg);
597          center_window (dlg, NULL);          center_window (dlg, NULL);
598          break;          break;

Legend:
Removed from v.23  
changed lines
  Added in v.32

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26