summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2018-06-01 01:01:08 +0200
committerWerner Koch <wk@gnupg.org>2018-06-01 01:01:08 +0200
commitdd19cabe81b7bf4177ea2ca741f6eb6cd1cab25e (patch)
treef984b33f451be62f97739132384d322e5056674b
parente2aa38b56a991a0da052acfe7566cc7a146d3bb6 (diff)
downloadgpgme-dd19cabe81b7bf4177ea2ca741f6eb6cd1cab25e.tar.gz
core: New decryption result flag 'legacy_cipher_nomdc'.
* src/gpgme.h.in (_gpgme_op_decrypt_result): Add flag legacy_cipher_nomdc. * src/decrypt.c (parse_status_error): Set this flag. * tests/run-decrypt.c (print_result): print it. (main): Print the result even on error. Signed-off-by: Werner Koch <wk@gnupg.org>
-rw-r--r--NEWS8
-rw-r--r--doc/gpgme.texi17
-rw-r--r--src/decrypt.c7
-rw-r--r--src/gpgme.h.in6
-rw-r--r--tests/run-decrypt.c3
5 files changed, 34 insertions, 7 deletions
diff --git a/NEWS b/NEWS
index 848f4e99..bc1330ad 100644
--- a/NEWS
+++ b/NEWS
@@ -6,9 +6,11 @@ Noteworthy changes in version 1.11.2 (unreleased)
* Interface changes relative to the 1.11.1 release:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- cpp: DecryptionResult::sessionKey NEW.
- cpp: DecryptionResult::symkeyAlgo NEW.
- cpp: Data::rewind NEW.
+ gpgme_decrypt_result_t EXTENDED: New field legacy_cipher_nomdc.
+ cpp: DecryptionResult::sessionKey NEW.
+ cpp: DecryptionResult::symkeyAlgo NEW.
+ cpp: Data::rewind NEW.
+
Noteworthy changes in version 1.11.1 (2018-04-20)
-------------------------------------------------
diff --git a/doc/gpgme.texi b/doc/gpgme.texi
index c745675b..d8771167 100644
--- a/doc/gpgme.texi
+++ b/doc/gpgme.texi
@@ -5368,7 +5368,7 @@ This is a pointer to a structure used to store the result of a
data, you can retrieve the pointer to the result with
@code{gpgme_op_decrypt_result}. As with all result structures, it
this structure shall be considered read-only and an application must
-not allocated such a strucure on its own. The structure contains the
+not allocate such a strucure on its own. The structure contains the
following members:
@table @code
@@ -5378,9 +5378,22 @@ algorithm that is not supported.
@item unsigned int wrong_key_usage : 1
@since{0.9.0}
-
This is true if the key was not used according to its policy.
+@item unsigned int legacy_cipher_nomdc : 1
+@since{1.11.2}
+The message was made by a legacy algorithm without any integrity
+protection. This might be an old but legitimate message.
+
+@item unsigned int is_mime : 1;
+@since{1.11.0}
+The message claims that the content is a MIME object.
+
+@item unsigned int is_de_vs : 1;
+@since{1.10.0}
+The message was encrypted in a VS-NfD compliant way. This is a
+specification in Germany for a restricted communication level.
+
@item gpgme_recipient_t recipients
@since{1.1.0}
diff --git a/src/decrypt.c b/src/decrypt.c
index 7dbc6fd6..f2278d8d 100644
--- a/src/decrypt.c
+++ b/src/decrypt.c
@@ -57,7 +57,7 @@ typedef struct
int any_no_seckey;
/* If the engine emits a DECRYPTION_INFO status and that does not
- * indicate that an integrity proetction mode is active, this flag
+ * indicate that an integrity protection mode is active, this flag
* is set. */
int not_integrity_protected;
@@ -214,6 +214,11 @@ parse_status_error (char *args, op_data_t opd)
break;
}
}
+ else if (!strcmp (field[0], "nomdc_with_legacy_cipher"))
+ {
+ opd->result.legacy_cipher_nomdc = 1;
+ opd->not_integrity_protected = 1;
+ }
free (args2);
diff --git a/src/gpgme.h.in b/src/gpgme.h.in
index 49fafb90..5279f6a2 100644
--- a/src/gpgme.h.in
+++ b/src/gpgme.h.in
@@ -1365,8 +1365,12 @@ struct _gpgme_op_decrypt_result
/* The message claims that the content is a MIME object. */
unsigned int is_mime : 1;
+ /* The message was made by a legacy algorithm without any integrity
+ * protection. This might be an old but legitimate message. */
+ unsigned int legacy_cipher_nomdc : 1;
+
/* Internal to GPGME, do not use. */
- int _unused : 29;
+ int _unused : 28;
gpgme_recipient_t recipients;
diff --git a/tests/run-decrypt.c b/tests/run-decrypt.c
index 69de139c..8ec0cb4f 100644
--- a/tests/run-decrypt.c
+++ b/tests/run-decrypt.c
@@ -55,6 +55,7 @@ print_result (gpgme_decrypt_result_t result)
printf ("Original file name .: %s\n", nonnull(result->file_name));
printf ("Wrong key usage ....: %s\n", result->wrong_key_usage? "yes":"no");
+ printf ("Legacy w/o MDC ... .: %s\n", result->legacy_cipher_nomdc?"yes":"no");
printf ("Compliance de-vs ...: %s\n", result->is_de_vs? "yes":"no");
printf ("MIME flag ..........: %s\n", result->is_mime? "yes":"no");
printf ("Unsupported algo ...: %s\n", nonnull(result->unsupported_algorithm));
@@ -267,6 +268,8 @@ main (int argc, char **argv)
if (err)
{
fprintf (stderr, PGM ": decrypt failed: %s\n", gpgme_strerror (err));
+ if (result)
+ print_result (result);
exit (1);
}
if (result)