aboutsummaryrefslogtreecommitdiffstats
path: root/src/decrypt.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/decrypt.c')
-rw-r--r--src/decrypt.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/decrypt.c b/src/decrypt.c
index e5d2f7c7..c6030eef 100644
--- a/src/decrypt.c
+++ b/src/decrypt.c
@@ -44,7 +44,10 @@ typedef struct
int okay;
- /* A flag telling that the a decryption failed and two optional error
+ /* Indicates that list only mode is active. */
+ int list_only;
+
+ /* A flag telling that the decryption failed and two optional error
* codes to further specify the failure for public key decryption and
* symmetric decryption. */
int failed;
@@ -419,7 +422,7 @@ _gpgme_decrypt_status_handler (void *priv, gpgme_status_code_t code,
/* Generic decryption failed error code. */
return gpg_error (GPG_ERR_DECRYPT_FAILED);
}
- else if (!opd->okay)
+ else if (!opd->okay && !opd->list_only)
{
/* No data was found. */
return gpg_error (GPG_ERR_NO_DATA);
@@ -540,7 +543,8 @@ decrypt_status_handler (void *priv, gpgme_status_code_t code, char *args)
gpgme_error_t
-_gpgme_op_decrypt_init_result (gpgme_ctx_t ctx, gpgme_data_t plaintext)
+_gpgme_op_decrypt_init_result (gpgme_ctx_t ctx, gpgme_data_t plaintext,
+ gpgme_decrypt_flags_t flags)
{
gpgme_error_t err;
void *hook;
@@ -552,6 +556,7 @@ _gpgme_op_decrypt_init_result (gpgme_ctx_t ctx, gpgme_data_t plaintext)
if (err)
return err;
+ opd->list_only = !!(flags & GPGME_DECRYPT_LISTONLY);
opd->last_recipient_p = &opd->result.recipients;
opd->plaintext_dserial = _gpgme_data_get_dserial (plaintext);
return 0;
@@ -571,7 +576,7 @@ _gpgme_decrypt_start (gpgme_ctx_t ctx, int synchronous,
if (err)
return err;
- err = _gpgme_op_decrypt_init_result (ctx, plain);
+ err = _gpgme_op_decrypt_init_result (ctx, plain, flags);
if (err)
return err;