aboutsummaryrefslogtreecommitdiffstats
path: root/g10/packet.h
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2025-09-26 14:27:13 +0000
committerWerner Koch <[email protected]>2025-09-26 14:27:13 +0000
commita966c2ce90802f2fa953b04e69fdc529d61b6f53 (patch)
tree7a8a1da0919d8abd3049d6d9f15ca8aeac300dba /g10/packet.h
parentgpg: Rename a struct and some variables for clarity. (diff)
downloadgnupg-a966c2ce90802f2fa953b04e69fdc529d61b6f53.tar.gz
gnupg-a966c2ce90802f2fa953b04e69fdc529d61b6f53.zip
gpg: Revamp structure of PKT_symkey_enc.
* g10/packet.h (PKT_symkey_enc): Allocate the session key so that we have a fixed length for this struct. * g10/free-packet.c (free_symkey_enc): Adjust for this change * g10/parse-packet.c (parse_symkeyenc): Ditto. * g10/encrypt.c (encrypt_simple, write_symkey_enc): Ditto.
Diffstat (limited to 'g10/packet.h')
-rw-r--r--g10/packet.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/g10/packet.h b/g10/packet.h
index 8b4c3d9c2..60446a417 100644
--- a/g10/packet.h
+++ b/g10/packet.h
@@ -147,9 +147,9 @@ typedef struct {
S2K function on the password is the session key. See RFC 4880,
Section 5.3.) */
byte seskeylen;
- /* The session key as encrypted by the S2K specifier. For AEAD this
- * includes the nonce and the authentication tag. */
- byte seskey[1];
+ /* The malloced session key as encrypted by the S2K specifier. For
+ * AEAD this includes the nonce and the authentication tag. */
+ byte *seskey;
} PKT_symkey_enc;
/* A public-key encrypted session key packet as defined in RFC 4880,
@@ -177,7 +177,7 @@ typedef struct {
struct seskey_enc_list
{
struct seskey_enc_list *next;
- int result;
+ int result; /* The error code decrypting the session key. */
int u_sym; /* Use the sym member. */
union {
PKT_pubkey_enc pub;