Re: 2.2.17.8

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Oct 14, 2000 at 09:28:32AM +0000, Marc Mutz wrote:
> Alexander S A Kjeldaas wrote:
> > 
> > 2.2.17.8 has now been released.  This patch includes some
> > reorganization of the code, but also some important API changes.  Or
> > rather, the interface is now defined :-).  The encrypt/decrypt
> > functions are allowed to sleep, and they have to tackle all
> > input/output sizes.  This is the new interface as defined in crypto.h:
> > 
> <snip>
> 
> This release breaks my blowfish-encrypted filesystem. I don't get any
> error messages from mount, like I did in pre2, besides "wrong
> superblock". There is not even a
> 
> Q> VFS: Can't find an ext2 fs on loop...
> 
> in /var/log/messages, as it usually shows up when you get the passphrase
> wrong. Strange.
> 

It was an unused code-path in loop_gen.c that was triggered by the
changes in 2.2.17.8.  A magic block-size of 0 no longer indicates that
a cipher supports encrypting variable-length blocks.  I think the
following patch should fix the problem:

--- int.2.2.17.8/drivers/block/loop_gen.c       Mon Oct 16 13:57:41 2000
+++ int.2.2.17.x/drivers/block/loop_gen.c       Mon Oct 16 13:54:37 2000
@@ -17,7 +17,6 @@
 { 
        struct cipher_context * cx = (struct cipher_context *) lo->key_data;
        struct cipher_implementation *ci = cx->ci;
-       int bsize = ci->blocksize;
        int (*encdecfunc)(struct cipher_context *cx, const u8 *in, u8 *out, int 
size);
        char *in, *out;
 
@@ -35,20 +34,7 @@
                return -EINVAL;
        }
        cx->iv[0] = real_block;
-       if (bsize) {
-               while (size >= bsize) {
-                       encdecfunc(cx, in, out, bsize);
-                       in += bsize;
-                       out += bsize;
-                       size -= bsize;
-               }
-               if (size != 0) {
-                       return -EINVAL;
-               }
-       } else { /* variable-size cipher */
-               encdecfunc(cx, in, out, size);
-       }
-
+       encdecfunc(cx, in, out, size);
        return 0;
 }


astor

-- 
Alexander Kjeldaas                Mail:  astor@xxxxxxx
finger astor@xxxxxxxxxxxxxxxxx for OpenPGP key.

Linux-crypto:  cryptography in and on the Linux system
Archive:       http://mail.nl.linux.org/linux-crypto/


[Index of Archives]     [Kernel]     [Linux Crypto]     [Gnu Crypto]     [Gnu Classpath]     [Netfilter]     [Bugtraq]
  Powered by Linux