aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2026-04-23 14:29:53 +0200
committerWerner Koch <[email protected]>2026-04-23 14:29:53 +0200
commit63f18298d3f5c5f7551301b1e183890c503c644a (patch)
tree6f66b01d41bc7679272ac673e551cfef10d7357c /tests
parentindent: Align a debug output. (diff)
downloadgpgme-63f18298d3f5c5f7551301b1e183890c503c644a.tar.gz
gpgme-63f18298d3f5c5f7551301b1e183890c503c644a.zip
New decryption flag GPGME_DECRYPT_SESSION_HASH.
* src/gpgme.h.in (_gpgme_op_decrypt_result): Add field session_hash. (gpgme_decrypt_flags_t): Add flag GPGME_DECRYPT_SESSION_HASH. (gpgme_status_code_t): Add flags GPGME_STATUS_SESSION_HASH. * src/status-table.c (status_table): Add "SESSION_HASH". * src/decrypt.c (release_op_data): Free new field. (_gpgme_decrypt_status_handler): Handle new status code. * src/engine-gpg.c (gpg_decrypt): Implement GPGME_DECRYPT_SESSION_HASH. * tests/run-decrypt.c (print_result): Print session_hash. (main): Add option --show-session-hash.
Diffstat (limited to 'tests')
-rw-r--r--tests/run-decrypt.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/run-decrypt.c b/tests/run-decrypt.c
index cbde49dc..aa02a3de 100644
--- a/tests/run-decrypt.c
+++ b/tests/run-decrypt.c
@@ -62,6 +62,7 @@ print_result (gpgme_decrypt_result_t result)
printf ("MIME flag ..........: %s\n", result->is_mime? "yes":"no");
printf ("Unsupported algo ...: %s\n", nonnull(result->unsupported_algorithm));
printf ("Session key ........: %s\n", nonnull (result->session_key));
+ printf ("Session hash .......: %s\n", nonnull (result->session_hash));
printf ("Symmetric algorithm : %s\n", result->symkey_algo);
for (recp = result->recipients; recp && recp->next; recp = recp->next)
@@ -84,6 +85,7 @@ show_usage (int ex)
" --status print status lines from the backend\n"
" --openpgp use the OpenPGP protocol (default)\n"
" --cms use the CMS protocol\n"
+ " --show-session-hash show the session key hash\n"
" --export-session-key show the session key\n"
" --override-session-key STRING use STRING as session key\n"
" --request-origin STRING use STRING as request origin\n"
@@ -164,6 +166,11 @@ main (int argc, char **argv)
protocol = GPGME_PROTOCOL_CMS;
argc--; argv++;
}
+ else if (!strcmp (*argv, "--show-session-hash"))
+ {
+ flags |= GPGME_DECRYPT_SESSION_HASH;
+ argc--; argv++;
+ }
else if (!strcmp (*argv, "--export-session-key"))
{
export_session_key = 1;