563 |
{ |
{ |
564 |
int step = *r_step; |
int step = *r_step; |
565 |
|
|
566 |
|
/* If the isuser already signed the key, send an empty |
567 |
|
string and jump to quit. */ |
568 |
|
if (ctx->getResult () & GPG_EDITRES_ALREADY_SIGNED |
569 |
|
&& *r_step != -1 && *r_step != 4) { |
570 |
|
*r_step = step = -1; |
571 |
|
return ""; |
572 |
|
} |
573 |
|
if (*r_step == -1) { |
574 |
|
*r_step = step = 4; |
575 |
|
return ""; /* empty value to abort. */ |
576 |
|
} |
577 |
if (step == 0 && !strcmp (key, "keyedit.prompt")) { |
if (step == 0 && !strcmp (key, "keyedit.prompt")) { |
578 |
*r_step = step = 1; |
*r_step = step = 1; |
579 |
return "addrevoker"; |
return "addrevoker"; |
580 |
} |
} |
581 |
if (step == 1 && !strcmp (key, "keyedit.add_revoker")) { |
if (step == 1 && !strcmp (key, "keyedit.add_revoker")) { |
582 |
*r_step = step = 2; |
*r_step = step = 2; |
|
/* XXX: handle already-signed. */ |
|
583 |
return ctx->name; |
return ctx->name; |
584 |
} |
} |
585 |
if (step == 2 && !strcmp (key, "keyedit.add_revoker.okay")) { |
if (step == 2 && !strcmp (key, "keyedit.add_revoker.okay")) { |
771 |
static gpgme_error_t |
static gpgme_error_t |
772 |
map_result (GpgKeyEdit *ke) |
map_result (GpgKeyEdit *ke) |
773 |
{ |
{ |
774 |
|
/* XXX Sometimes ALREADY_SIGNED indicates an failure. */ |
775 |
if (!ke->getResult ()) |
if (!ke->getResult ()) |
776 |
return gpg_error (GPG_ERR_NO_ERROR); |
return gpg_error (GPG_ERR_NO_ERROR); |
777 |
if (ke->getResult () & GPG_EDITRES_BAD_PASSPHRASE) |
if (ke->getResult () & GPG_EDITRES_BAD_PASSPHRASE) |