aboutsummaryrefslogtreecommitdiffstats
path: root/g10/sign.c
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/sign.c
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/sign.c')
-rw-r--r--g10/sign.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/g10/sign.c b/g10/sign.c
index f0bf9b671..9ef032e74 100644
--- a/g10/sign.c
+++ b/g10/sign.c
@@ -1728,7 +1728,18 @@ sign_symencrypt_file (ctrl_t ctrl, const char *fname, strlist_t locusr)
/* Write the symmetric key packet */
/* (current filters: armor)*/
{
- PKT_symkey_enc *enc = xmalloc_clear( sizeof *enc );
+ PKT_symkey_enc *enc = xmalloc_clear (sizeof *enc);
+
+ /* FIXME: seskeylen is 0, thus we directly encrypt the session key:
+ *
+ * ...then the S2K algorithm applied to the passphrase produces
+ * the session key for decrypting the file, using the symmetric
+ * cipher algorithm from the Symmetric-Key Encrypted Session Key
+ * packet.
+ *
+ * The problem is that this does not allow us to add additional
+ * encrypted session keys.
+ */
enc->version = cfx.dek->use_aead ? 5 : 4;
enc->cipher_algo = cfx.dek->algo;