Make sure output also has correct size

This commit is contained in:
eater 2019-08-11 15:45:29 +02:00
parent 297df740ad
commit 0edd785659
Signed by: eater
GPG key ID: 656785D50BE51C0A

View file

@ -112,9 +112,9 @@ func EncryptAndSign(v Message, key *rsa.PrivateKey, pub *rsa.PublicKey, signatur
return err
}
encBody := make([]byte, len(body))
enc := cipher2.NewCBCEncrypter(cipher, iv)
body = append(body, Pad(body)...)
encBody := make([]byte, len(body))
enc.CryptBlocks(encBody, body)
writer.Write([]byte(hex.EncodeToString(encBody)))