diff options
Diffstat (limited to '')
-rw-r--r-- | g10/decrypt-data.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/g10/decrypt-data.c b/g10/decrypt-data.c index e219898ee..4ad47cb8e 100644 --- a/g10/decrypt-data.c +++ b/g10/decrypt-data.c @@ -106,6 +106,23 @@ decrypt_data (ctrl_t ctrl, void *procctx, PKT_encrypted *ed, DEK *dek) write_status_text (STATUS_DECRYPTION_INFO, buf); } + if (opt.show_session_key) + { + char numbuf[25]; + char *hexbuf; + + snprintf (numbuf, sizeof numbuf, "%d:", dek->algo); + hexbuf = bin2hex (dek->key, dek->keylen, NULL); + if (!hexbuf) + { + rc = gpg_error_from_syserror (); + goto leave; + } + log_info ("session key: '%s%s'\n", numbuf, hexbuf); + write_status_strings (STATUS_SESSION_KEY, numbuf, hexbuf, NULL); + xfree (hexbuf); + } + rc = openpgp_cipher_test_algo (dek->algo); if (rc) goto leave; |