mirror of
git://git.gnupg.org/gnupg.git
synced 2024-12-23 10:29:58 +01:00
gpg: Very minor cleanup in decrypt_data.
* g10/decrypt-data.c (decrypt_data): Show also the aead algo with --show-session-key. Remove meanwhile superfluous NULL-ptr test.
This commit is contained in:
parent
e92812a475
commit
5b24c41ba7
@ -284,7 +284,10 @@ decrypt_data (ctrl_t ctrl, void *procctx, PKT_encrypted *ed, DEK *dek,
|
|||||||
char numbuf[25];
|
char numbuf[25];
|
||||||
char *hexbuf;
|
char *hexbuf;
|
||||||
|
|
||||||
snprintf (numbuf, sizeof numbuf, "%d:", dek->algo);
|
if (ed->aead_algo)
|
||||||
|
snprintf (numbuf, sizeof numbuf, "%d.%u:", dek->algo, ed->aead_algo);
|
||||||
|
else
|
||||||
|
snprintf (numbuf, sizeof numbuf, "%d:", dek->algo);
|
||||||
hexbuf = bin2hex (dek->key, dek->keylen, NULL);
|
hexbuf = bin2hex (dek->key, dek->keylen, NULL);
|
||||||
if (!hexbuf)
|
if (!hexbuf)
|
||||||
{
|
{
|
||||||
@ -486,6 +489,7 @@ decrypt_data (ctrl_t ctrl, void *procctx, PKT_encrypted *ed, DEK *dek,
|
|||||||
{
|
{
|
||||||
char *filename = NULL;
|
char *filename = NULL;
|
||||||
estream_t fp;
|
estream_t fp;
|
||||||
|
|
||||||
rc = get_output_file ("", 0, ed->buf, &filename, &fp);
|
rc = get_output_file ("", 0, ed->buf, &filename, &fp);
|
||||||
if (! rc)
|
if (! rc)
|
||||||
{
|
{
|
||||||
@ -509,8 +513,7 @@ decrypt_data (ctrl_t ctrl, void *procctx, PKT_encrypted *ed, DEK *dek,
|
|||||||
filename, gpg_strerror (rc));
|
filename, gpg_strerror (rc));
|
||||||
|
|
||||||
iobuf_close (output);
|
iobuf_close (output);
|
||||||
if (afx)
|
release_armor_context (afx);
|
||||||
release_armor_context (afx);
|
|
||||||
}
|
}
|
||||||
xfree (filename);
|
xfree (filename);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user