Skip to content

Commit

Permalink
[dev.boringcrypto] all: merge master into dev.boringcrypto
Browse files Browse the repository at this point in the history
Conflicts due to randutil.MaybeReadByte (kept at the top for patch
maintainability and consistency):
	src/crypto/ecdsa/ecdsa.go
	src/crypto/rsa/pkcs1v15.go
	src/crypto/rsa/rsa.go

Change-Id: I03a2de541e68a1bbdc48590ad7c01fbffbbf4a2b
  • Loading branch information
FiloSottile committed Jun 8, 2018
2 parents 18db93d + 289ab30 commit a4b7722
Show file tree
Hide file tree
Showing 495 changed files with 8,462 additions and 2,549 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ BSD-style license found in the LICENSE file.
Official binary distributions are available at https://golang.org/dl/.

After downloading a binary release, visit https://golang.org/doc/install
or load doc/install.html in your web browser for installation
or load [doc/install.html](./doc/install.html) in your web browser for installation
instructions.

#### Install From Source

If a binary distribution is not available for your combination of
operating system and architecture, visit
https://golang.org/doc/install/source or load doc/install-source.html
https://golang.org/doc/install/source or load [doc/install-source.html](./doc/install-source.html)
in your web browser for source installation instructions.

### Contributing
Expand Down
18 changes: 18 additions & 0 deletions doc/devel/release.html
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,15 @@ <h3 id="go1.10.minor">Minor revisions</h3>
1.10.2 milestone</a> on our issue tracker for details.
</p>

<p>
go1.10.3 (released 2018/06/05) includes fixes to the go command, and the
<code>crypto/tls</code>, <code>crypto/x509</code>, and <code>strings</code> packages.
In particular, it adds <a href="https://go.googlesource.com/go/+/d4e21288e444d3ffd30d1a0737f15ea3fc3b8ad9">
minimal support to the go command for the vgo transition</a>.
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.10.3">Go
1.10.3 milestone</a> on our issue tracker for details.
</p>

<h2 id="go1.9">go1.9 (released 2017/08/24)</h2>

<p>
Expand Down Expand Up @@ -101,6 +110,15 @@ <h3 id="go1.9.minor">Minor revisions</h3>
1.9.6 milestone</a> on our issue tracker for details.
</p>

<p>
go1.9.7 (released 2018/06/05) includes fixes to the go command, and the
<code>crypto/x509</code>, and <code>strings</code> packages.
In particular, it adds <a href="https://go.googlesource.com/go/+/d4e21288e444d3ffd30d1a0737f15ea3fc3b8ad9">
minimal support to the go command for the vgo transition</a>.
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.9.7">Go
1.9.7 milestone</a> on our issue tracker for details.
</p>


<h2 id="go1.8">go1.8 (released 2017/02/16)</h2>

Expand Down
2 changes: 1 addition & 1 deletion misc/cgo/life/main.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// cmpout -tags=use_go_run
// run -tags=use_go_run

// Copyright 2010 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
Expand Down
2 changes: 1 addition & 1 deletion misc/cgo/stdio/chain.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// cmpout -tags=use_go_run
// run -tags=use_go_run

// Copyright 2009 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
Expand Down
2 changes: 1 addition & 1 deletion misc/cgo/stdio/fib.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// cmpout -tags=use_go_run
// run -tags=use_go_run

// Copyright 2009 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
Expand Down
2 changes: 1 addition & 1 deletion misc/cgo/stdio/hello.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// cmpout -tags=use_go_run
// run -tags=use_go_run

// Copyright 2009 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
Expand Down
7 changes: 6 additions & 1 deletion misc/wasm/wasm_exec.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@

global.Go = class {
constructor() {
this.argv = [];
this.argv = ["js"];
this.env = {};
this.exit = (code) => {
if (code !== 0) {
Expand Down Expand Up @@ -143,6 +143,11 @@
mem().setInt32(sp + 16, (msec % 1000) * 1000000, true);
},

// func getRandomData(r []byte)
"runtime.getRandomData": (sp) => {
crypto.getRandomValues(loadSlice(sp + 8));
},

// func boolVal(value bool) Value
"syscall/js.boolVal": (sp) => {
storeValue(sp + 16, mem().getUint8(sp + 8) !== 0);
Expand Down
2 changes: 1 addition & 1 deletion src/archive/tar/format.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ const (
// application can only parse GNU formatted archives.
//
// Reference:
// http://www.gnu.org/software/tar/manual/html_node/Standard.html
// https://www.gnu.org/software/tar/manual/html_node/Standard.html
FormatGNU

// Schily's tar format, which is incompatible with USTAR.
Expand Down
4 changes: 2 additions & 2 deletions src/archive/zip/struct.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ func timeZone(offset time.Duration) *time.Location {

// msDosTimeToTime converts an MS-DOS date and time into a time.Time.
// The resolution is 2s.
// See: http://msdn.microsoft.com/en-us/library/ms724247(v=VS.85).aspx
// See: https://msdn.microsoft.com/en-us/library/ms724247(v=VS.85).aspx
func msDosTimeToTime(dosDate, dosTime uint16) time.Time {
return time.Date(
// date bits 0-4: day of month; 5-8: month; 9-15: years since 1980
Expand All @@ -222,7 +222,7 @@ func msDosTimeToTime(dosDate, dosTime uint16) time.Time {

// timeToMsDosTime converts a time.Time to an MS-DOS date and time.
// The resolution is 2s.
// See: http://msdn.microsoft.com/en-us/library/ms724274(v=VS.85).aspx
// See: https://msdn.microsoft.com/en-us/library/ms724274(v=VS.85).aspx
func timeToMsDosTime(t time.Time) (fDate uint16, fTime uint16) {
fDate = uint16(t.Day() + int(t.Month())<<5 + (t.Year()-1980)<<9)
fTime = uint16(t.Second()/2 + t.Minute()<<5 + t.Hour()<<11)
Expand Down
2 changes: 1 addition & 1 deletion src/archive/zip/writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ func (w *Writer) SetComment(comment string) error {
}

// Close finishes writing the zip file by writing the central directory.
// It does not (and cannot) close the underlying writer.
// It does not close the underlying writer.
func (w *Writer) Close() error {
if w.last != nil && !w.last.closed {
if err := w.last.close(); err != nil {
Expand Down
1 change: 1 addition & 0 deletions src/bytes/buffer.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ func (b *Buffer) ReadFrom(r io.Reader) (n int64, err error) {
b.lastRead = opInvalid
for {
i := b.grow(MinRead)
b.buf = b.buf[:i]
m, e := r.Read(b.buf[i:cap(b.buf)])
if m < 0 {
panic(errNegativeRead)
Expand Down
33 changes: 33 additions & 0 deletions src/bytes/buffer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,39 @@ func TestReadFrom(t *testing.T) {
}
}

type panicReader struct{ panic bool }

func (r panicReader) Read(p []byte) (int, error) {
if r.panic {
panic(nil)
}
return 0, io.EOF
}

// Make sure that an empty Buffer remains empty when
// it is "grown" before a Read that panics
func TestReadFromPanicReader(t *testing.T) {

// First verify non-panic behaviour
var buf Buffer
i, err := buf.ReadFrom(panicReader{})
if err != nil {
t.Fatal(err)
}
if i != 0 {
t.Fatalf("unexpected return from bytes.ReadFrom (1): got: %d, want %d", i, 0)
}
check(t, "TestReadFromPanicReader (1)", &buf, "")

// Confirm that when Reader panics, the emtpy buffer remains empty
var buf2 Buffer
defer func() {
recover()
check(t, "TestReadFromPanicReader (2)", &buf2, "")
}()
buf2.ReadFrom(panicReader{panic: true})
}

func TestReadFromNegativeReader(t *testing.T) {
var b Buffer
defer func() {
Expand Down
Loading

0 comments on commit a4b7722

Please sign in to comment.