The "block length" for CFB mode was incorrectly coded as 1 all the time. It
authorDr. Stephen Henson <steve@openssl.org>
Mon, 15 Feb 2010 19:40:30 +0000 (19:40 +0000)
committerDr. Stephen Henson <steve@openssl.org>
Mon, 15 Feb 2010 19:40:30 +0000 (19:40 +0000)
should be the number of feedback bits expressed in bytes. For CFB1 mode set
this to 1 by rounding up to the nearest multiple of 8.

crypto/evp/evp_locl.h

index 292d74c188081f83ac63d3cd4fc15be42f83e512..22f67d418cd3baeab3c55c2b5db3e70b2926a13a 100644 (file)
@@ -155,9 +155,9 @@ BLOCK_CIPHER_def1(cname, cbc, cbc, CBC, kstruct, nid, block_size, key_len, \
 #define BLOCK_CIPHER_def_cfb(cname, kstruct, nid, key_len, \
                             iv_len, cbits, flags, init_key, cleanup, \
                             set_asn1, get_asn1, ctrl) \
 #define BLOCK_CIPHER_def_cfb(cname, kstruct, nid, key_len, \
                             iv_len, cbits, flags, init_key, cleanup, \
                             set_asn1, get_asn1, ctrl) \
-BLOCK_CIPHER_def1(cname, cfb##cbits, cfb##cbits, CFB, kstruct, nid, 1, \
-                 key_len, iv_len, flags, init_key, cleanup, set_asn1, \
-                 get_asn1, ctrl)
+BLOCK_CIPHER_def1(cname, cfb##cbits, cfb##cbits, CFB, kstruct, nid, \
+                       (cbits + 7)/8, key_len, iv_len, \
+               flags, init_key, cleanup, set_asn1, get_asn1, ctrl)
 
 #define BLOCK_CIPHER_def_ofb(cname, kstruct, nid, key_len, \
                             iv_len, cbits, flags, init_key, cleanup, \
 
 #define BLOCK_CIPHER_def_ofb(cname, kstruct, nid, key_len, \
                             iv_len, cbits, flags, init_key, cleanup, \