From c679ed24778c997fee72d3613babad8680855882 Mon Sep 17 00:00:00 2001 From: Andre Heinecke Date: Thu, 24 May 2018 13:36:31 +0200 Subject: [PATCH] json: Put signature info before data output * src/gpgme-json.c (op_decrypt): Move info before data. -- This should enable it to first parse signatures before handling very large chunks of data. --- src/gpgme-json.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/gpgme-json.c b/src/gpgme-json.c index 9b7e867a..a755500d 100644 --- a/src/gpgme-json.c +++ b/src/gpgme-json.c @@ -1144,15 +1144,6 @@ op_decrypt (cjson_t request, cjson_t result) if (decrypt_result->is_mime) xjson_AddBoolToObject (result, "mime", 1); - err = make_data_object (result, output, chunksize, "plaintext", -1); - output = NULL; - - if (err) - { - error_object (result, "Plaintext output failed: %s", gpg_strerror (err)); - goto leave; - } - verify_result = gpgme_op_verify_result (ctx); if (verify_result && verify_result->signatures) { @@ -1165,6 +1156,15 @@ op_decrypt (cjson_t request, cjson_t result) goto leave; } + err = make_data_object (result, output, chunksize, "plaintext", -1); + output = NULL; + + if (err) + { + error_object (result, "Plaintext output failed: %s", gpg_strerror (err)); + goto leave; + } + leave: release_context (ctx); gpgme_data_release (input);