diff --git a/tls/conn.go b/tls/conn.go index c09ec320..1589b9c4 100644 --- a/tls/conn.go +++ b/tls/conn.go @@ -947,28 +947,8 @@ func (c *Conn) Write(b []byte) (int, error) { return 0, alertInternalError } - // SSL 3.0 and TLS 1.0 are susceptible to a chosen-plaintext - // attack when using block mode ciphers due to predictable IVs. - // This can be prevented by splitting each Application Data - // record into two records, effectively randomizing the IV. - // - // http://www.openssl.org/~bodo/tls-cbc.txt - // https://bugzilla.mozilla.org/show_bug.cgi?id=665814 - // http://www.imperialviolet.org/2012/01/15/beastfollowup.html - - var m int - if len(b) > 1 && c.vers <= VersionTLS10 { - if _, ok := c.out.cipher.(cipher.BlockMode); ok { - n, err := c.writeRecord(recordTypeApplicationData, b[:1]) - if err != nil { - return n, c.out.setErrorLocked(err) - } - m, b = 1, b[1:] - } - } - n, err := c.writeRecord(recordTypeApplicationData, b) - return n + m, c.out.setErrorLocked(err) + return n, c.out.setErrorLocked(err) } // Read can be made to time out and return a net.Error with Timeout() == true