[openssl-commits] [openssl] master update
Rich Salz
rsalz at openssl.org
Thu Jun 23 14:04:39 UTC 2016
The branch master has been updated
via fe2d149119063ec3c89fd6db9af8a6970e3e6032 (commit)
from 615dd78b72a822b31ad17623afcf1293bfee3570 (commit)
- Log -----------------------------------------------------------------
commit fe2d149119063ec3c89fd6db9af8a6970e3e6032
Author: Rich Salz <rsalz at openssl.org>
Date: Thu Jun 23 10:03:50 2016 -0400
RT2867: des_ede3_cfb1 ignored "size in bits" flag
Code and tests by Steve.
Reviewed-by: Dr. Stephen Henson <steve at openssl.org>
Reviewed-by: Rich Salz <rsalz at openssl.org>
-----------------------------------------------------------------------
Summary of changes:
crypto/evp/e_des3.c | 2 ++
test/evptests.txt | 19 +++++++++++++++++++
2 files changed, 21 insertions(+)
diff --git a/crypto/evp/e_des3.c b/crypto/evp/e_des3.c
index e21c045..a842913 100644
--- a/crypto/evp/e_des3.c
+++ b/crypto/evp/e_des3.c
@@ -164,6 +164,8 @@ static int des_ede3_cfb1_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
size_t n;
unsigned char c[1], d[1];
+ if (!EVP_CIPHER_CTX_test_flags(ctx, EVP_CIPH_FLAG_LENGTH_BITS))
+ inl *= 8;
for (n = 0; n < inl; ++n) {
c[0] = (in[n / 8] & (1 << (7 - n % 8))) ? 0x80 : 0;
DES_ede3_cfb_encrypt(c, d, 1, 1,
diff --git a/test/evptests.txt b/test/evptests.txt
index c0e906d..a66a152 100644
--- a/test/evptests.txt
+++ b/test/evptests.txt
@@ -201,6 +201,25 @@ Input = "aaaaaaaaaa"
Count = 100000
Output = 0C99005BEB57EFF50A7CF005560DDF5D29057FD86B20BFD62DECA0F1CCEA4AF51FC15490EDDC47AF32BB2B66C34FF9AD8C6008AD677F77126953B226E4ED8B01
+# DES EDE3 CFB1
+# echo -n "Hello World" |
+# apps/openssl enc -des-ede3-cfb1 \
+# -K 000102030405060708090A0B0C0D0E0F1011121314151617 -iv 0001020304050607 |
+# xxd -ps -u
+
+Cipher = DES-EDE3-CFB1
+Key = 000102030405060708090A0B0C0D0E0F1011121314151617
+IV = 0001020304050607
+Plaintext = "Hello World"
+Ciphertext = 3CF55D656E9C0664513358
+
+Cipher = DES-EDE3-CFB1
+Key = 000102030405060708090A0B0C0D0E0F1011121314151617
+IV = 0001020304050607
+Operation = DECRYPT
+Plaintext = "Hello World"
+Ciphertext = 3CF55D656E9C0664513358
+
# AES 128 ECB tests (from FIPS-197 test vectors, encrypt)
Cipher = AES-128-ECB
More information about the openssl-commits
mailing list