mirror of
https://github.com/mumble-voip/grumble.git
synced 2025-12-19 21:59:59 -08:00
Fix a bug in the cryptstate implementation
Iterating from 1 to AES_BLOCK_SIZE and not using the value in the loop is probably not correct.
This commit is contained in:
parent
8aa01f9370
commit
4594562304
1 changed files with 4 additions and 4 deletions
|
|
@ -144,8 +144,8 @@ func (cs *CryptState) Decrypt(dst, src []byte) (err os.Error) {
|
||||||
lost = -1
|
lost = -1
|
||||||
cs.DecryptIV[0] = ivbyte
|
cs.DecryptIV[0] = ivbyte
|
||||||
for i := 1; i < AESBlockSize; i++ {
|
for i := 1; i < AESBlockSize; i++ {
|
||||||
cs.DecryptIV[0] -= 1
|
cs.DecryptIV[i] -= 1
|
||||||
if cs.DecryptIV[0] > 0 {
|
if cs.DecryptIV[i] > 0 {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -159,8 +159,8 @@ func (cs *CryptState) Decrypt(dst, src []byte) (err os.Error) {
|
||||||
lost = int(256 - int(cs.DecryptIV[0]) + int(ivbyte) - 1)
|
lost = int(256 - int(cs.DecryptIV[0]) + int(ivbyte) - 1)
|
||||||
cs.DecryptIV[0] = ivbyte
|
cs.DecryptIV[0] = ivbyte
|
||||||
for i := 1; i < AESBlockSize; i++ {
|
for i := 1; i < AESBlockSize; i++ {
|
||||||
cs.DecryptIV[0] += 1
|
cs.DecryptIV[i] += 1
|
||||||
if cs.DecryptIV[0] > 0 {
|
if cs.DecryptIV[i] > 0 {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue