Fix for bug in OpenSSL's 3DES CFB1 implementation 33/82733/2
authorKrzysztof Jackiewicz <k.jackiewicz@samsung.com>
Fri, 5 Aug 2016 10:08:23 +0000 (12:08 +0200)
committerKrzysztof Jackiewicz <k.jackiewicz@samsung.com>
Fri, 5 Aug 2016 10:20:21 +0000 (12:20 +0200)
commit999b823f8dcc9a8e465a34741e082807492d3ff8
tree868e425750be0cd207a9ac7e501fc8695c304986
parentac7449e73ef8d8db7e35bb923113a160bc93778d
Fix for bug in OpenSSL's 3DES CFB1 implementation

OpenSSL 3DES CFB1 implementation assumes that the size of input data is in
bits. It is indeed possible to use bits instead of bytes by setting an
EVP_CIPHER_CTX flag EVP_CIPH_FLAG_LENGTH_BITS. However, this flag is not being
checked in the implementation. The fix has been already applied to OpenSSL but
not yet released.

This commit causes EVP_CIPH_FLAG_LENGTH_BITS flag to be set always when 3DES
CFB1 is used. It also performes conversion between bit and byte units if
needed. It's a temporary fix and should also work with fixed OpenSSL. Anyway,
as soon as the fix in OpenSSL is released this commit should be reverted.

Change-Id: I97807f0afeecace86adb974e08e6f00fa66f22de
src/encrypt.c