projects
/
platform
/
upstream
/
libav.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0cc9a64
)
blowfish: Fix CBC decryption with dst==src
author
Martin Storsjö
<martin@martin.st>
Mon, 1 Oct 2012 21:04:38 +0000
(
00:04
+0300)
committer
Martin Storsjö
<martin@martin.st>
Wed, 3 Oct 2012 13:05:23 +0000
(16:05 +0300)
Signed-off-by: Martin Storsjö <martin@martin.st>
libavutil/blowfish.c
patch
|
blob
|
history
diff --git
a/libavutil/blowfish.c
b/libavutil/blowfish.c
index 35c546a898fc5cd8c428da438ce1aa5db5698168..604c0be8214d82b6b5d90e679d3650c8cdc4f0aa 100644
(file)
--- a/
libavutil/blowfish.c
+++ b/
libavutil/blowfish.c
@@
-388,15
+388,15
@@
void av_blowfish_crypt(AVBlowfish *ctx, uint8_t *dst, const uint8_t *src,
av_blowfish_crypt_ecb(ctx, &v0, &v1, decrypt);
- AV_WB32(dst, v0);
- AV_WB32(dst + 4, v1);
-
if (iv) {
- for (i = 0; i < 8; i++)
-
dst[i] = dst[i] ^ iv[i]
;
+ v0 ^= AV_RB32(iv);
+
v1 ^= AV_RB32(iv + 4)
;
memcpy(iv, src, 8);
}
+ AV_WB32(dst, v0);
+ AV_WB32(dst + 4, v1);
+
src += 8;
dst += 8;
}