summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Lidén Borell <samuel@kodafritt.se>2015-06-20 21:09:19 (GMT)
committerSamuel Lidén Borell <samuel@kodafritt.se>2015-06-20 21:09:19 (GMT)
commit0cbb5ec0949033fa7bdd4b2afe72d70c478042dc (patch)
treef89ad7ebc750d379b0098d0ec86e00866a3485cf
parent84ac4a40f30708f421d48ad4ccbed8d2b995b003 (diff)
downloadfishlim-0cbb5ec0949033fa7bdd4b2afe72d70c478042dc.zip
fishlim-0cbb5ec0949033fa7bdd4b2afe72d70c478042dc.tar.gz
fishlim-0cbb5ec0949033fa7bdd4b2afe72d70c478042dc.tar.bz2
Fix CBC decryption failure with long messages
-rw-r--r--fish.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fish.c b/fish.c
index b73fa78..74a1f36 100644
--- a/fish.c
+++ b/fish.c
@@ -128,6 +128,7 @@ char *fish_decrypt_cbc(const char *key, size_t keylen, const char *data) {
// Decode BASE64
b64 = BIO_new(BIO_f_base64());
if (!b64) goto err;
+ BIO_set_flags(b64, BIO_FLAGS_BASE64_NO_NL);
BIO *bmem = BIO_new(BIO_s_mem());
if (!bmem) goto err;
BIO *bio = BIO_push(b64, bmem);
@@ -143,7 +144,7 @@ char *fish_decrypt_cbc(const char *key, size_t keylen, const char *data) {
outlen -= 8;
outlen &= ~7;
- // Decrypt using CBC
+ // Decrypt in CBC mode
decrypted = malloc(outlen+1);
if (!decrypted) goto err;
if (outlen) {