aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2018-08-27 09:42:27 +0000
committerWerner Koch <[email protected]>2018-08-27 09:43:02 +0000
commit53c5b9a265d33f2cc54f489375a929602338aee8 (patch)
treee218cf299f6593d890d55fd61d13914e6615b151
parentdoc: Add warning that FILE_NAME is not part of the signed data. (diff)
downloadgpgme-53c5b9a265d33f2cc54f489375a929602338aee8.tar.gz
gpgme-53c5b9a265d33f2cc54f489375a929602338aee8.zip
json: Do not put FILE_NAME into the verify result.
* src/gpgme-json.c (verify_result_to_json): Remove "file_name". -- Having the file name in the verify result may lead developers to assume that the file name is covered by the signature. This is not the case and can easily be checked by hex-editing a signed message. We better don't output it at all. The same is true for the is_mime flag but that is anyway only an advisory and I can't see damage from a faulty one. Note that we keep file_name in gpgme's output for ABI stability and because some tools want to display meta information even if they are subject to tampering. This is similar to the non-encrypted subject in mails. Signed-off-by: Werner Koch <[email protected]>
-rw-r--r--src/gpgme-json.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/gpgme-json.c b/src/gpgme-json.c
index 93582699..8812024c 100644
--- a/src/gpgme-json.c
+++ b/src/gpgme-json.c
@@ -1138,7 +1138,6 @@ verify_result_to_json (gpgme_verify_result_t verify_result)
{
cjson_t result = xjson_CreateObject ();
- xjson_AddStringToObject0 (result, "file_name", verify_result->file_name);
xjson_AddBoolToObject (result, "is_mime", verify_result->is_mime);
if (verify_result->signatures)
@@ -2107,8 +2106,8 @@ static const char hlp_verify[] =
"data: The verified data. This may be base64 encoded.\n"
"base64: Boolean indicating whether data is base64 encoded.\n"
"info: An object with verification information (gpgme_verify_result_t).\n"
- " file_name: Optional string of the plaintext file name.\n"
" is_mime: Boolean that is true if the messages claims it is MIME.\n"
+ " Note that this flag is not covered by the signature.)\n"
" signatures: Array of signatures\n"
" summary: Object containing summary information.\n"
" Boolean values: (Check gpgme_sigsum_t doc for meaning)\n"