Re: [PATCH 11/12: eCryptfs] Keystore

Michael Halcrow
2005-11-04T00:12:25Z

On Thu, Nov 03, 2005 at 06:59:42PM -0500, James Morris wrote:
> On Wed, 2 Nov 2005, Phillip Hellewell wrote:
>
> > + password_s_ptr = &auth_tok->token.password;
> > + if (password_s_ptr->session_key_encryption_key_set) {
> > + ecryptfs_printk(1, KERN_NOTICE, "Session key encryption key "
> > + "set; skipping key generation\n");
> > + goto session_key_encryption_key_set;
> > + }
> > + session_key_encryption_key_set:
> > + ecryptfs_printk(1, KERN_NOTICE, "Session key encryption key (size [%d])"
> > + ":\n", password_s_ptr->session_key_encryption_key_size);
>
> Spurious goto?

Yes, that was an artifact caused from the deletion of a block of code
that we decided to postpone for a future release of eCryptfs
(in-kernel session key encryption key generation, to be exact...).

> > +out:
> > + if (tfm)
> > + crypto_free_tfm(tfm);
> > + return rc;
>
> Just call crypto_free_tfm() unconditionally.

Yes, and it looks like the check for the failure condition on tfm
alloc did not get make it into this release either:

+ tfm = crypto_alloc_tfm(crypt_stats->cipher, 0);
+ crypto_cipher_setkey(tfm, password_s_ptr->session_key_encryption_key,
+ password_s_ptr->session_key_encryption_key_size);

We'll be sure that those fixes are included in the next round of
updates.

Thanks,
Mike