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

Diff of /trunk/Src/wptCardEdit.cpp

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

revision 48 by werner, Mon Oct 31 21:14:11 2005 UTC revision 69 by twoaday, Sat Nov 5 12:28:12 2005 UTC
# Line 130  statuscard_colon_handler (gpg_card_t car Line 130  statuscard_colon_handler (gpg_card_t car
130          CARD_Fpr,          CARD_Fpr,
131          CARD_FprTime          CARD_FprTime
132      };      };
133      enum rectype_t rectype;          enum rectype_t rectype = (rectype_t)0;
134      char *p, *pend;      char *p, *pend;
135      int field = 0;      int field = 0;
136    
# Line 292  statuscard_colon_handler (gpg_card_t car Line 292  statuscard_colon_handler (gpg_card_t car
292              if (!card->fpr_created_str[field-2])              if (!card->fpr_created_str[field-2])
293                  return gpg_error (GPG_ERR_ENOMEM);                  return gpg_error (GPG_ERR_ENOMEM);
294              break;              break;
295                
296            default:
297                break;
298          }          }
299      }      }
300      return 0;      return 0;
# Line 375  GpgCardEdit::~GpgCardEdit (void) Line 377  GpgCardEdit::~GpgCardEdit (void)
377    
378  /* Set the user PIN for the object to @pin. */  /* Set the user PIN for the object to @pin. */
379  void  void
380  GpgCardEdit::setPIN (const char *pin)  GpgCardEdit::setPIN (const char *_pin)
381  {  {
382      this->pin = pin;      this->pin = _pin;
383  }  }
384    
385  /* Set the admin PIN for the object to @admin_pin. */  /* Set the admin PIN for the object to @admin_pin. */
386  void  void
387  GpgCardEdit::setAdminPIN (const char *admin_pin)  GpgCardEdit::setAdminPIN (const char *_admin_pin)
388  {  {
389      this->admin_pin = admin_pin;      this->admin_pin = _admin_pin;
390  }  }
391    
392    
393  /* Set the new user PIN for the object to @new_pin. */  /* Set the new user PIN for the object to @new_pin. */
394  void  void
395  GpgCardEdit::setNewPIN (const char *new_pin)  GpgCardEdit::setNewPIN (const char *_new_pin)
396  {  {
397      this->pin_new = new_pin;      this->pin_new = _new_pin;
398  }  }
399    
400    
401  /* Set the passphrase needed when generating a key to @pass. */  /* Set the passphrase needed when generating a key to @pass. */
402  void  void
403  GpgCardEdit::setKeygenPassphrase (const char *pass)  GpgCardEdit::setKeygenPassphrase (const char *_pass)
404  {  {
405      this->keygen.pass = pass;      this->keygen.pass = _pass;
406  }  }
407    
408    
# Line 516  GpgCardEdit::genKey (int flags, const ch Line 518  GpgCardEdit::genKey (int flags, const ch
518  /* Change the pin from @pin to @pin_new.  /* Change the pin from @pin to @pin_new.
519     Return value: 0 on success. */     Return value: 0 on success. */
520  gpgme_error_t  gpgme_error_t
521  GpgCardEdit::changePIN (int type)  GpgCardEdit::changePIN (int _type)
522  {  {
523      gpgme_error_t err;      gpgme_error_t err;
524    
525      if (!this->pin_new)      if (!this->pin_new)
526          return gpg_error (GPG_ERR_INV_ARG);          return gpg_error (GPG_ERR_INV_ARG);
527    
528      if (!type) {      if (!_type) {
529          if (this->pin && this->pin_new)          if (this->pin && this->pin_new)
530              this->type = GPG_EDITCARD_CHUPIN;              this->type = GPG_EDITCARD_CHUPIN;
531          else if (this->pin && this->admin_pin)          else if (this->pin && this->admin_pin)
# Line 532  GpgCardEdit::changePIN (int type) Line 534  GpgCardEdit::changePIN (int type)
534              this->type = GPG_EDITCARD_UNBPIN;              this->type = GPG_EDITCARD_UNBPIN;
535      }      }
536      else      else
537          this->type = type;          this->type = _type;
538      /* check if the user provided the needed PIN. */      /* check if the user provided the needed PIN. */
539      if ((this->type == GPG_EDITCARD_CHUPIN && !this->pin) ||      if ((this->type == GPG_EDITCARD_CHUPIN && !this->pin) ||
540          (this->type == GPG_EDITCARD_CHAPIN && !this->admin_pin))          (this->type == GPG_EDITCARD_CHAPIN && !this->admin_pin))
# Line 560  GpgCardEdit::updateName (const char *giv Line 562  GpgCardEdit::updateName (const char *giv
562  }  }
563            
564  gpgme_error_t  gpgme_error_t
565  GpgCardEdit::updateURL (const char *url)  GpgCardEdit::updateURL (const char *_url)
566  {  {
567      gpgme_error_t err;      gpgme_error_t err;
568    
# Line 568  GpgCardEdit::updateURL (const char *url) Line 570  GpgCardEdit::updateURL (const char *url)
570          return gpg_error (GPG_ERR_INV_OBJ);          return gpg_error (GPG_ERR_INV_OBJ);
571    
572      type = GPG_EDITCARD_KEYURL;      type = GPG_EDITCARD_KEYURL;
573      this->edit.keyurl = url;      this->edit.keyurl = _url;
574    
575      err = gpg_card_edit (ctx, this);      err = gpg_card_edit (ctx, this);
576      return err;      return err;
# Line 626  GpgCardEdit::updateLanguage (const char Line 628  GpgCardEdit::updateLanguage (const char
628  gpgme_error_t  gpgme_error_t
629  GpgCardEdit::fetchKey (void)  GpgCardEdit::fetchKey (void)
630  {  {
     gpgme_error_t err = 0;  
   
631      if (!this->pin)      if (!this->pin)
632          return gpg_error (GPG_ERR_INV_OBJ);          return gpg_error (GPG_ERR_INV_OBJ);
633    

Legend:
Removed from v.48  
changed lines
  Added in v.69

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26