The patch titled ecryptfs: packet and key management update for variable key size has been removed from the -mm tree. Its filename is ecryptfs-packet-and-key-management-update-for-variable-key-size.patch This patch was dropped because it was folded into ecryptfs-fs-makefile-and-fs-kconfig.patch ------------------------------------------------------ Subject: ecryptfs: packet and key management update for variable key size From: Mike Halcrow <mhalcrow@xxxxxxxxxx> Modify packet and session key management code to support different key sizes. Signed-off-by: Michael Halcrow <mhalcrow@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxx> --- fs/ecryptfs/keystore.c | 21 +++++++++++---------- 1 files changed, 11 insertions(+), 10 deletions(-) diff -puN fs/ecryptfs/keystore.c~ecryptfs-packet-and-key-management-update-for-variable-key-size fs/ecryptfs/keystore.c --- 25/fs/ecryptfs/keystore.c~ecryptfs-packet-and-key-management-update-for-variable-key-size Tue Jun 20 17:37:31 2006 +++ 25-akpm/fs/ecryptfs/keystore.c Tue Jun 20 17:37:31 2006 @@ -530,8 +530,6 @@ static int decrypt_session_key(struct ec memcpy(crypt_stat->key, auth_tok->session_key.decrypted_key, auth_tok->session_key.decrypted_key_size); ECRYPTFS_SET_FLAG(crypt_stat->flags, ECRYPTFS_KEY_VALID); - crypt_stat->key_size_bits = - auth_tok->session_key.decrypted_key_size * 8; ecryptfs_printk(KERN_DEBUG, "Decrypted session key:\n"); if (ecryptfs_verbosity > 0) ecryptfs_dump_hex(crypt_stat->key, @@ -810,11 +808,10 @@ write_tag_3_packet(char *dest, int max, BUG(); ecryptfs_from_hex((*key_rec).sig, auth_tok->token.password.signature, ECRYPTFS_SIG_SIZE); - (*key_rec).enc_key_size_bits = crypt_stat->key_size_bits; encrypted_session_key_valid = 0; for (i = 0; i < (crypt_stat->key_size_bits / 8); i++) encrypted_session_key_valid |= - auth_tok->session_key.encrypted_key[i]; + auth_tok->session_key.encrypted_key[i]; if (encrypted_session_key_valid) { memcpy((*key_rec).enc_key, auth_tok->session_key.encrypted_key, @@ -824,6 +821,13 @@ write_tag_3_packet(char *dest, int max, if (auth_tok->session_key.encrypted_key_size == 0) auth_tok->session_key.encrypted_key_size = (crypt_stat->key_size_bits / 8); + if (crypt_stat->key_size_bits == 192 + && strcmp("aes", crypt_stat->cipher) == 0) { + memset((crypt_stat->key + 24), 0, 8); + auth_tok->session_key.encrypted_key_size = 32; + } + (*key_rec).enc_key_size_bits = + auth_tok->session_key.encrypted_key_size << 3; if (ECRYPTFS_CHECK_FLAG(auth_tok->token.password.flags, ECRYPTFS_SESSION_KEY_ENCRYPTION_KEY_SET)) { ecryptfs_printk(KERN_DEBUG, "Using previously generated " @@ -839,14 +843,11 @@ write_tag_3_packet(char *dest, int max, ecryptfs_dump_hex(session_key_encryption_key, 16); } if (unlikely(ecryptfs_verbosity > 0)) { - ecryptfs_printk(KERN_DEBUG, "Session key encryption key:" - "\n"); + ecryptfs_printk(KERN_DEBUG, "Session key encryption key:\n"); ecryptfs_dump_hex(session_key_encryption_key, 16); } - /* Encrypt the key with the key encryption key */ - /* Set up the scatterlists */ rc = virt_to_scatterlist(crypt_stat->key, - crypt_stat->key_size_bits / 8, src_sg, 2); + (*key_rec).enc_key_size_bits / 8, src_sg, 2); if (!rc) { ecryptfs_printk(KERN_ERR, "Error generating scatterlist " "for crypt_stat session key\n"); @@ -879,7 +880,7 @@ write_tag_3_packet(char *dest, int max, ecryptfs_printk(KERN_DEBUG, "Encrypting [%d] bytes of the key\n", crypt_stat->key_size_bits / 8); crypto_cipher_encrypt(tfm, dest_sg, src_sg, - (crypt_stat->key_size_bits / 8)); + (*key_rec).enc_key_size_bits / 8); ecryptfs_printk(KERN_DEBUG, "This should be the encrypted key:\n"); if (ecryptfs_verbosity > 0) ecryptfs_dump_hex((*key_rec).enc_key, _ Patches currently in -mm which might be from mhalcrow@xxxxxxxxxx are origin.patch ecryptfs-fs-makefile-and-fs-kconfig.patch ecryptfs-packet-and-key-management-update-for-variable-key-size.patch ecryptfs-add-ecryptfs_-prefix-to-mount-options-key-size-parameter.patch ecryptfs-set-the-key-size-from-the-default-for-the-mount.patch ecryptfs-check-for-weak-keys.patch ecryptfs-add-define-values-for-cipher-codes-from-rfc2440-openpgp.patch ecryptfs-convert-bits-to-bytes.patch ecryptfs-more-elegant-aes-key-size-manipulation.patch ecryptfs-more-intelligent-use-of-tfm-objects.patch ecryptfs-remove-debugging-cruft.patch ecryptfs-get_sb_dev-fix.patch ecryptfs-validate-minimum-header-extent-size.patch ecryptfs-validate-body-size.patch ecryptfs-validate-packet-length-prior-to-parsing-add-comments.patch ecryptfs-use-the-passed-in-max-value-as-the-upper-bound.patch ecryptfs-change-the-maximum-size-check-when-writing-header.patch ecryptfs-print-the-actual-option-that-is-problematic.patch ecryptfs-add-a-maintainers-entry.patch ecryptfs-partial-signed-integer-to-size_t-conversion-updated-ii.patch ecryptfs-graceful-handling-of-mount-error.patch ecryptfs-fix-printk-format-warnings.patch ecryptfs-associate-vfsmount-with-dentry-rather-than-superblock.patch ecryptfs-mntput-lower-mount-on-umount_begin.patch vfs-make-filldir_t-and-struct-kstat-deal-in-64-bit-inode-numbers-ecryptfs.patch make-kmem_cache_destroy-return-void-ecryptfs.patch ecryptfs-inode-numbering-fixes.patch ecryptfs-versioning-fixes.patch ecryptfs-versioning-fixes-tidy.patch ecryptfs-grab-lock-on-lower_page-in-ecryptfs_sync_page.patch ecryptfs-enable-plaintext-passthrough.patch - To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html