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.
This commit is contained in:
Andre Heinecke 2018-05-24 13:36:31 +02:00
parent a6cd3a1197
commit c679ed2477
No known key found for this signature in database
GPG Key ID: 2978E9D40CBABA5C

View File

@ -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);