aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorIngo Klöcker <[email protected]>2026-04-21 10:46:17 +0200
committerIngo Klöcker <[email protected]>2026-04-21 12:29:16 +0200
commit2100e1fbdfeb9ecda00787032a8256938a113dde (patch)
tree6eadb1804d0395e1fc2a0a979ee31153811c1a1b /src
parentdoc: Fix argument type of gpgme_set_sender (diff)
downloadgpgme-2100e1fbdfeb9ecda00787032a8256938a113dde.tar.gz
gpgme-2100e1fbdfeb9ecda00787032a8256938a113dde.zip
Add flag fields is_de_vs and beta_compliance to encryption results
* src/encrypt.c (_gpgme_encrypt_status_handler): Handle the compliance status line. * src/gpgme.h.in (struct _gpgme_op_encrypt_result): Add fields is_de_vs and beta_compliance. (gpgme_status_code_t): Add status code for the encryption compliance status line. * src/status-table.c (status_table): Add encryption compliance status line. * tests/run-encrypt.c (print_encrypt_result): Print compliance. -- This allows checking whether the encrypt operation is in compliance with the VS-NfD criteria. GnuPG-bug-id: 6702
Diffstat (limited to 'src')
-rw-r--r--src/encrypt.c5
-rw-r--r--src/gpgme.h.in13
-rw-r--r--src/status-table.c1
3 files changed, 18 insertions, 1 deletions
diff --git a/src/encrypt.c b/src/encrypt.c
index 24132fda..ad8d4054 100644
--- a/src/encrypt.c
+++ b/src/encrypt.c
@@ -30,6 +30,7 @@
#include "debug.h"
#include "context.h"
#include "ops.h"
+#include "util.h"
typedef struct
@@ -173,6 +174,10 @@ _gpgme_encrypt_status_handler (void *priv, gpgme_status_code_t code,
opd->success_seen = 1;
break;
+ case GPGME_STATUS_ENCRYPTION_COMPLIANCE_MODE:
+ PARSE_COMPLIANCE_FLAGS (args, &opd->result);
+ break;
+
default:
break;
}
diff --git a/src/gpgme.h.in b/src/gpgme.h.in
index d5f65caa..063948f2 100644
--- a/src/gpgme.h.in
+++ b/src/gpgme.h.in
@@ -1379,6 +1379,16 @@ struct _gpgme_op_encrypt_result
{
/* The list of invalid recipients. */
gpgme_invalid_key_t invalid_recipients;
+
+ /* True if the message was encrypted in compliance to the de-vs
+ * mode. */
+ unsigned int is_de_vs : 1;
+
+ /* The compliance mode (is_de_vs) has not yet been approved. */
+ unsigned int beta_compliance : 1;
+
+ /* Internal to GPGME, do not use. */
+ int _unused : 30;
};
typedef struct _gpgme_op_encrypt_result *gpgme_encrypt_result_t;
@@ -2716,7 +2726,8 @@ typedef enum
GPGME_STATUS_NOTATION_FLAGS = 98,
GPGME_STATUS_DECRYPTION_COMPLIANCE_MODE = 99,
GPGME_STATUS_VERIFICATION_COMPLIANCE_MODE = 100,
- GPGME_STATUS_CANCELED_BY_USER = 101
+ GPGME_STATUS_CANCELED_BY_USER = 101,
+ GPGME_STATUS_ENCRYPTION_COMPLIANCE_MODE = 102
}
gpgme_status_code_t;
diff --git a/src/status-table.c b/src/status-table.c
index 6ec73ab1..6b2e3396 100644
--- a/src/status-table.c
+++ b/src/status-table.c
@@ -58,6 +58,7 @@ static struct status_table_s status_table[] =
{ "DECRYPTION_OKAY", GPGME_STATUS_DECRYPTION_OKAY },
{ "DELETE_PROBLEM", GPGME_STATUS_DELETE_PROBLEM },
{ "DECRYPTION_COMPLIANCE_MODE", GPGME_STATUS_DECRYPTION_COMPLIANCE_MODE },
+ { "ENCRYPTION_COMPLIANCE_MODE", GPGME_STATUS_ENCRYPTION_COMPLIANCE_MODE },
{ "ENC_TO", GPGME_STATUS_ENC_TO },
{ "END_DECRYPTION", GPGME_STATUS_END_DECRYPTION },
{ "END_ENCRYPTION", GPGME_STATUS_END_ENCRYPTION },