643 |
/*log_debug ("key=%s code=%d\r\n", key, code);*/ |
/*log_debug ("key=%s code=%d\r\n", key, code);*/ |
644 |
switch (code) { |
switch (code) { |
645 |
case GPGME_STATUS_ALREADY_SIGNED: |
case GPGME_STATUS_ALREADY_SIGNED: |
646 |
ke->setResultValue (GPG_EDITRES_ALREADY_SIGNED); |
ke->setResult (GPG_EDITRES_ALREADY_SIGNED); |
647 |
break; |
break; |
648 |
case GPGME_STATUS_BAD_PASSPHRASE: |
case GPGME_STATUS_BAD_PASSPHRASE: |
649 |
ke->setResultValue (GPG_EDITRES_BAD_PASSPHRASE); |
ke->setResult (GPG_EDITRES_BAD_PASSPHRASE); |
650 |
break; |
break; |
651 |
} |
} |
652 |
|
|
653 |
if (ke->getResultValue () & GPG_EDITRES_BAD_PASSPHRASE) { |
if (ke->getResult () & GPG_EDITRES_BAD_PASSPHRASE) { |
654 |
/* If the entered passphrase is bad, we supply empty |
/* If the entered passphrase is bad, we supply empty |
655 |
passphrase to abort and send 'quit' as soon as possible. */ |
passphrase to abort and send 'quit' as soon as possible. */ |
656 |
if (!strcmp (key, "passphrase.enter")) |
if (!strcmp (key, "passphrase.enter")) |
754 |
static gpgme_error_t |
static gpgme_error_t |
755 |
map_result (GpgKeyEdit *ke) |
map_result (GpgKeyEdit *ke) |
756 |
{ |
{ |
757 |
if (!ke->getResultValue ()) |
if (!ke->getResult ()) |
758 |
return gpg_error (GPG_ERR_NO_ERROR); |
return gpg_error (GPG_ERR_NO_ERROR); |
759 |
if (ke->getResultValue () & GPG_EDITRES_BAD_PASSPHRASE) |
if (ke->getResult () & GPG_EDITRES_BAD_PASSPHRASE) |
760 |
return gpg_error (GPG_ERR_BAD_PASSPHRASE); |
return gpg_error (GPG_ERR_BAD_PASSPHRASE); |
761 |
return 0; |
return 0; |
762 |
} |
} |