mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
crypto/...: more fixes for bug 2841
1) Remove the Reset() member in crypto/aes and crypto/des (and document the change). 2) Turn several empty error structures into vars. Any remaining error structures are either non-empty, or will probably become so in the future. 3) Implement SetWriteDeadline for TLS sockets. At the moment, the TLS status cannot be reused after a Write error, which is probably fine for most uses. 4) Make crypto/aes and crypto/des return a cipher.Block. R=rsc, r CC=golang-dev https://golang.org/cl/5625045
This commit is contained in:
parent
a52fb458df
commit
cdd7e02583
17 changed files with 232 additions and 487 deletions
|
|
@ -12,6 +12,7 @@ package rand
|
|||
import (
|
||||
"bufio"
|
||||
"crypto/aes"
|
||||
"crypto/cipher"
|
||||
"io"
|
||||
"os"
|
||||
"sync"
|
||||
|
|
@ -66,7 +67,7 @@ func newReader(entropy io.Reader) io.Reader {
|
|||
type reader struct {
|
||||
mu sync.Mutex
|
||||
budget int // number of bytes that can be generated
|
||||
cipher *aes.Cipher
|
||||
cipher cipher.Block
|
||||
entropy io.Reader
|
||||
time, seed, dst, key [aes.BlockSize]byte
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue