]> Cypherpunks.ru repositories - gostls13.git/log
gostls13.git
3 years ago[release-branch.go1.15-security] go1.15.1 go1.15.1
Dmitri Shuralyov [Tue, 1 Sep 2020 12:58:41 +0000 (08:58 -0400)]
[release-branch.go1.15-security] go1.15.1

Change-Id: I4103c524ce46d50215af5097460e514609b513c6
Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/835373
Reviewed-by: Filippo Valsorda <valsorda@google.com>
3 years ago[release-branch.go1.15-security] net/http/cgi,net/http/fcgi: add Content-Type detection
Roberto Clapis [Wed, 26 Aug 2020 06:53:03 +0000 (08:53 +0200)]
[release-branch.go1.15-security] net/http/cgi,net/http/fcgi: add Content-Type detection

This CL ensures that responses served via CGI and FastCGI
have a Content-Type header based on the content of the
response if not explicitly set by handlers.

If the implementers of the handler did not explicitly
specify a Content-Type both CGI implementations would default
to "text/html", potentially causing cross-site scripting.

Thanks to RedTeam Pentesting GmbH for reporting this.

Fixes CVE-2020-24553

Change-Id: I82cfc396309b5ab2e8d6e9a87eda8ea7e3799473
Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/823217
Reviewed-by: Russ Cox <rsc@google.com>
(cherry picked from commit 23d675d07fdc56aafd67c0a0b63d5b7e14708ff0)
Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/835311
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
3 years ago[release-branch.go1.15] go1.15 go1.15
Andrew Bonventre [Tue, 11 Aug 2020 18:06:24 +0000 (14:06 -0400)]
[release-branch.go1.15] go1.15

Change-Id: Id2262ff66e750e798ebe7ecfcc13d2653cb85b71
Reviewed-on: https://go-review.googlesource.com/c/go/+/247905
Run-TryBot: Andrew Bonventre <andybons@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

3 years ago[release-branch.go1.15] all: merge master into release-branch.go1.15
Andrew [Tue, 11 Aug 2020 15:03:03 +0000 (11:03 -0400)]
[release-branch.go1.15] all: merge master into release-branch.go1.15

5c7748dc9d doc/go1.15: encoding/json's CL 191783 was reverted
5ff5b3c557 doc/go1.15: remove draft notice
5ae1d62ee3 CONTRIBUTORS: update for the Go 1.15 release
7ad776dda5 doc/go1.15: document crypto/tls permanent error
a93a4c1780 runtime: make nanotime1 reentrant

Updates #40697

Change-Id: Ie39896ee6304544cc9e9c1938bdf176f1dcf8766
Reviewed-on: https://go-review.googlesource.com/c/go/+/247900
Run-TryBot: Andrew Bonventre <andybons@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Carlos Amedee <carlos@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

3 years ago[release-branch.go1.15] go1.15rc2 go1.15rc2
Alexander Rakoczy [Thu, 6 Aug 2020 20:23:54 +0000 (16:23 -0400)]
[release-branch.go1.15] go1.15rc2

Change-Id: I2fe55c3f0328291b7d602cfae83d3f0b72cee14c
Reviewed-on: https://go-review.googlesource.com/c/go/+/247238
Run-TryBot: Alexander Rakoczy <alex@golang.org>
Reviewed-by: Carlos Amedee <carlos@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

3 years ago[release-branch.go1.15] all: merge master into release-branch.go1.15
Alexander Rakoczy [Thu, 6 Aug 2020 19:22:07 +0000 (15:22 -0400)]
[release-branch.go1.15] all: merge master into release-branch.go1.15

ba9e108899 cmd: update golang.org/x/xerrors
027d7241ce encoding/binary: read at most MaxVarintLen64 bytes in ReadUvarint
6f08e89ec3 cmd/go: fix error stacks when there are scanner errors
f235275097 net/http: fix cancelation of requests with a readTrackingBody wrapper
f92337422e runtime/race: fix ppc64le build
e49b2308a5 runtime/race: rebuild some .syso files to remove getauxval dependency
10523c0efb doc/go1.15: fix a few trivial inconsistencies
7388956b76 cmd/cgo: fix mangling of enum and union types
b56791cdea runtime: validate candidate searchAddr in pageAlloc.find
10374e2435 testing: fix quotation marks
7f86080476 cmd/compile: don't addLocalInductiveFacts if there is no direct edge from if block to phi block
54e75e8f9d crypto/ed25519: remove s390x KDSA implementation
6b4dcf19fa runtime: hold sched.lock over globrunqputbatch in runqputbatch
85afa2eb19 runtime: ensure startm new M is consistently visible to checkdead
c4fed25553 cmd/compile: add floating point load+op operations to addressing modes pass
19a932ceb8 cmd/link: don't mark shared library symbols reachable unconditionally
8696ae82c9 syscall: use correct file descriptor in dup2 fallback path
9591515f51 runtime, sync: add copyright headers to new files
074f2d800f doc/go1.15: surface the crypto/x509 CommonName deprecation note

Change-Id: I0bfcff1fc2de723960909d9dda718fee6abc2912

3 years agocmd: update golang.org/x/xerrors
Alexander Rakoczy [Thu, 6 Aug 2020 18:57:38 +0000 (14:57 -0400)]
cmd: update golang.org/x/xerrors

This pulls in CL 247217.

Fixes #40573

Change-Id: I89eeebb5da9a4668adc6b5c5155651e5da421d59
Reviewed-on: https://go-review.googlesource.com/c/go/+/247186
Run-TryBot: Alexander Rakoczy <alex@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

3 years agoencoding/binary: read at most MaxVarintLen64 bytes in ReadUvarint
Katie Hockman [Tue, 4 Aug 2020 15:45:32 +0000 (11:45 -0400)]
encoding/binary: read at most MaxVarintLen64 bytes in ReadUvarint

This CL ensures that ReadUvarint consumes only a limited
amount of input (instead of an unbounded amount).

On some inputs, ReadUvarint could read an arbitrary number
of bytes before deciding to return an overflow error.
After this CL, ReadUvarint returns that same overflow
error sooner, after reading at most MaxVarintLen64 bytes.

Fix authored by Robert Griesemer and Filippo Valsorda.

Thanks to Diederik Loerakker, Jonny Rhea, Raúl Kripalani,
and Preston Van Loon for reporting this.

Fixes #40618
Fixes CVE-2020-16845

Change-Id: Ie0cb15972f14c38b7cf7af84c45c4ce54909bb8f
Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/812099
Reviewed-by: Filippo Valsorda <valsorda@google.com>
Reviewed-on: https://go-review.googlesource.com/c/go/+/247120
Run-TryBot: Katie Hockman <katie@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Alexander Rakoczy <alex@golang.org>
3 years agocmd/go: fix error stacks when there are scanner errors
Michael Matloob [Tue, 4 Aug 2020 17:24:37 +0000 (13:24 -0400)]
cmd/go: fix error stacks when there are scanner errors

After golang.org/cl/228784 setLoadPackageDataError tries to decide whether an
error is caused by an imported package or an importing package by examining the
error itself to decide. Ideally, the errors themselves would belong to a
specific interface or some other property to make it unambiguous that they
were import errors. Since they don't, setLoadPackageDataError just checked
for nogoerrors and classified all other errors as import errors. But
it missed scanner errors which are also "caused" by the imported
package.

Fixes #40544

Change-Id: I39159bfdc286bee73697decd07b8aa9451f2db06
Reviewed-on: https://go-review.googlesource.com/c/go/+/246717
Run-TryBot: Michael Matloob <matloob@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
3 years agonet/http: fix cancelation of requests with a readTrackingBody wrapper
Damien Neil [Tue, 28 Jul 2020 19:49:52 +0000 (12:49 -0700)]
net/http: fix cancelation of requests with a readTrackingBody wrapper

Use the original *Request in the reqCanceler map, not the transient
wrapper created to handle body rewinding.

Change the key of reqCanceler to a struct{*Request}, to make it more
difficult to accidentally use the wrong request as the key.

Fixes #40453.

Change-Id: I4e61ee9ff2c794fb4c920a3a66c9a0458693d757
Reviewed-on: https://go-review.googlesource.com/c/go/+/245357
Run-TryBot: Damien Neil <dneil@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
3 years agoruntime/race: fix ppc64le build
Keith Randall [Sat, 1 Aug 2020 19:55:47 +0000 (12:55 -0700)]
runtime/race: fix ppc64le build

The .syso test also fails for ppc64le. Not sure why. For now, just
disable the test for that architecture. The test really only needs to
run on a single builder of any arch.

Change-Id: I346cdc01ada09d43c4c504fbc30be806f59d5422
Reviewed-on: https://go-review.googlesource.com/c/go/+/246358
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
3 years agoruntime/race: rebuild some .syso files to remove getauxval dependency
Keith Randall [Fri, 31 Jul 2020 20:56:18 +0000 (13:56 -0700)]
runtime/race: rebuild some .syso files to remove getauxval dependency

We can't depend on getauxval because it only exists in glibc >= 2.16.
Tsan has been updated to avoid that dependency
(https://reviews.llvm.org/D84859). This CL rebuilds the affected
.syso files, and adds a test to make sure we don't regress.

Fixes #37485

Change-Id: I891f54d28ec0d7da50a8df1adadc76dd6e7ab3e0
Reviewed-on: https://go-review.googlesource.com/c/go/+/246258
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Dmitry Vyukov <dvyukov@google.com>
3 years agodoc/go1.15: fix a few trivial inconsistencies
Toshihiro Shiino [Fri, 31 Jul 2020 03:02:55 +0000 (03:02 +0000)]
doc/go1.15: fix a few trivial inconsistencies

For #37419

Change-Id: I8ede539df5d5344aeb44ba1a7e2383363d92157f
Reviewed-on: https://go-review.googlesource.com/c/go/+/245977
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

3 years agocmd/cgo: fix mangling of enum and union types
Matthew Dempsky [Fri, 31 Jul 2020 01:35:00 +0000 (18:35 -0700)]
cmd/cgo: fix mangling of enum and union types

Consider this test package:

    package p

    // enum E { E0 };
    // union U { long x; };
    // void f(enum E e, union U* up) {}
    import "C"

    func f() {
     C.f(C.enum_E(C.E0), (*C.union_U)(nil))
    }

In Go 1.14, cgo translated this to (omitting irrelevant details):

    type _Ctype_union_U [8]byte

    func f() {
     _Cfunc_f(uint32(_Ciconst_E0), (*[8]byte)(nil))
    }

    func _Cfunc_f(p0 uint32, p1 *[8]byte) (r1 _Ctype_void) { ... }

Notably, _Ctype_union_U was declared as a defined type, but uses were
being rewritten into uses of the underlying type, which matched how
_Cfunc_f was declared.

After CL 230037, cgo started consistently rewriting "C.foo" type
expressions as "_Ctype_foo", which caused it to start emitting:

    type _Ctype_enum_E uint32
    type _Ctype_union_U [8]byte

    func f() {
     _Cfunc_f(_Ctype_enum_E(_Ciconst_E0), (*_Ctype_union_U)(nil))
    }

    // _Cfunc_f unchanged

Of course, this fails to type-check because _Ctype_enum_E and
_Ctype_union_U are defined types.

This CL changes cgo to emit:

    type _Ctype_enum_E = uint32
    type _Ctype_union_U = [8]byte

    // f unchanged since CL 230037
    // _Cfunc_f still unchanged

It would probably be better to fix this in (*typeConv).loadType so
that cgo generated code uses the _Ctype_foo aliases too. But as it
wouldn't have any effect on actual compilation, it's not worth the
risk of touching it at this point in the release cycle.

Updates #39537.
Fixes #40494.

Change-Id: I88269660b40aeda80a9a9433777601a781b48ac0
Reviewed-on: https://go-review.googlesource.com/c/go/+/246057
Reviewed-by: Ian Lance Taylor <iant@golang.org>
3 years agoruntime: validate candidate searchAddr in pageAlloc.find
Michael Anthony Knyszek [Mon, 13 Jul 2020 19:51:50 +0000 (19:51 +0000)]
runtime: validate candidate searchAddr in pageAlloc.find

Currently pageAlloc.find attempts to find a better estimate for the
first free page in the heap, even if the space its looking for isn't
necessarily going to be the first free page in the heap (e.g. if npages
>= 2). However, in doing so it has the potential to return a searchAddr
candidate that doesn't actually correspond to mapped memory, but this
candidate might still be adopted. As a result, pageAlloc.alloc's fast
path may look at unmapped summary memory and segfault. This case is rare
on most operating systems since the heap is kept fairly contiguous, so
the chance that the candidate searchAddr discovered is unmapped is
fairly low. Even so, this is totally possible and outside the user's
control when it happens (in fact, it's likely to happen consistently for
a given user on a given system).

Fix this problem by ensuring that our candidate always points to mapped
memory. We do this by looking at mheap's arenas structure first. If it
turns out our candidate doesn't correspond to mapped memory, then we
look at inUse to round up the searchAddr to the next mapped address.

While we're here, clean up some documentation related to searchAddr.

Fixes #40191.

Change-Id: I759efec78987e4a8fde466ae45aabbaa3d9d4214
Reviewed-on: https://go-review.googlesource.com/c/go/+/242680
Run-TryBot: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Austin Clements <austin@google.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

3 years agotesting: fix quotation marks
Katie Hockman [Tue, 28 Jul 2020 16:24:06 +0000 (12:24 -0400)]
testing: fix quotation marks

Change-Id: I4b816e26718ef5521afba2b200a6333373b09c58
Reviewed-on: https://go-review.googlesource.com/c/go/+/245136
Run-TryBot: Katie Hockman <katie@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
3 years agocmd/compile: don't addLocalInductiveFacts if there is no direct edge from if block...
Cholerae Hu [Fri, 24 Jul 2020 03:00:36 +0000 (11:00 +0800)]
cmd/compile: don't addLocalInductiveFacts if there is no direct edge from if block to phi block

Currently in addLocalInductiveFacts, we only check whether
direct edge from if block to phi block exists. If not, the
following logic will treat the phi block as the first successor,
which is wrong.

This patch makes prove pass more conservative, so we disable
some cases in test/prove.go. We will do some optimization in
the following CL and enable these cases then.

Fixes #40367.

Change-Id: I27cf0248f3a82312a6f7dabe11c79a1a34cf5412
Reviewed-on: https://go-review.googlesource.com/c/go/+/244579
Reviewed-by: Zach Jones <zachj1@gmail.com>
Reviewed-by: Keith Randall <khr@golang.org>
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

3 years agocrypto/ed25519: remove s390x KDSA implementation
Michael Munday [Wed, 29 Jul 2020 13:02:56 +0000 (14:02 +0100)]
crypto/ed25519: remove s390x KDSA implementation

This reverts CL 202578 and CL 230677 which added an optimization
to use KDSA when available on s390x.

Inconsistencies have been found between the two implementations
in their handling of certain edge cases. Since the Go 1.15 release
is extremely soon it seems prudent to remove this optimization
for now and revisit it in a future release.

Fixes #40475.

Change-Id: Ifb2ed9b9e573784df57383671f1c29d8abae90d4
Reviewed-on: https://go-review.googlesource.com/c/go/+/245497
Run-TryBot: Michael Munday <mike.munday@ibm.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ruixin(Peter) Bao <ruixin.bao@ibm.com>
Reviewed-by: Filippo Valsorda <filippo@golang.org>
3 years agoruntime: hold sched.lock over globrunqputbatch in runqputbatch
Michael Anthony Knyszek [Tue, 28 Jul 2020 20:02:57 +0000 (20:02 +0000)]
runtime: hold sched.lock over globrunqputbatch in runqputbatch

globrunqputbatch should never be called without sched.lock held.
runqputbatch's documentation even says it may acquire sched.lock in
order to call it.

Fixes #40457.

Change-Id: I5421b64f1da3a6087dfebbef7203db0c95d213a8
Reviewed-on: https://go-review.googlesource.com/c/go/+/245377
Run-TryBot: Michael Knyszek <mknyszek@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Michael Pratt <mpratt@google.com>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
3 years agoruntime: ensure startm new M is consistently visible to checkdead
Michael Pratt [Mon, 27 Jul 2020 19:04:17 +0000 (15:04 -0400)]
runtime: ensure startm new M is consistently visible to checkdead

If no M is available, startm first grabs an idle P, then drops
sched.lock and calls newm to start a new M to run than P.

Unfortunately, that leaves a window in which a G (e.g., returning from a
syscall) may find no idle P, add to the global runq, and then in stopm
discover that there are no running M's, a condition that should be
impossible with runnable G's.

To avoid this condition, we pre-allocate the new M ID in startm before
dropping sched.lock. This ensures that checkdead will see the M as
running, and since that new M must eventually run the scheduler, it will
handle any pending work as necessary.

Outside of startm, most other calls to newm/allocm don't have a P at
all. The only exception is startTheWorldWithSema, which always has an M
if there is 1 P (i.e., the currently running M), and if there is >1 P
the findrunnable spinning dance ensures the problem never occurs.

This has been tested with strategically placed sleeps in the runtime to
help induce the correct race ordering, but the timing on this is too
narrow for a test that can be checked in.

Fixes #40368

Change-Id: If5e0293a430cc85154b7ed55bc6dadf9b340abe2
Reviewed-on: https://go-review.googlesource.com/c/go/+/245018
Run-TryBot: Michael Pratt <mpratt@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
3 years agocmd/compile: add floating point load+op operations to addressing modes pass
Keith Randall [Mon, 27 Jul 2020 16:45:21 +0000 (09:45 -0700)]
cmd/compile: add floating point load+op operations to addressing modes pass

They were missed as part of the refactoring to use a separate
addressing modes pass.

Fixes #40426

Change-Id: Ie0418b2fac4ba1ffe720644ac918f6d728d5e420
Reviewed-on: https://go-review.googlesource.com/c/go/+/244859
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
3 years agocmd/link: don't mark shared library symbols reachable unconditionally
Cherry Zhang [Mon, 27 Jul 2020 15:36:41 +0000 (11:36 -0400)]
cmd/link: don't mark shared library symbols reachable unconditionally

During the transitioning period, we mark symbols from Go shared
libraries reachable unconditionally. That might be useful when
there was still a large portion of the linker using sym.Symbols,
and only reachable symbols were converted to sym.Symbols. Marking
them reachable brings them to the dynamic symbol table, even if
they are not needed, increased the binary size unexpectedly.

That time has passed. Now we largely operate on loader symbols,
and it is not needed to mark them reachable anymore.

Fixes #40416.

Change-Id: I1e2bdb93a960ba7dc96575fabe15af93d8e95329
Reviewed-on: https://go-review.googlesource.com/c/go/+/244839
Run-TryBot: Cherry Zhang <cherryyz@google.com>
Reviewed-by: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

3 years agosyscall: use correct file descriptor in dup2 fallback path
Ian Lance Taylor [Fri, 24 Jul 2020 22:13:43 +0000 (15:13 -0700)]
syscall: use correct file descriptor in dup2 fallback path

This fixes a mistake in CL 220422. This changes code that is only
executed on Linux kernel versions earlier than 2.6.27.

Change-Id: I01280184f4d7b75e06387c38f1891e8f0a81f793
Reviewed-on: https://go-review.googlesource.com/c/go/+/244630
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
3 years agoruntime, sync: add copyright headers to new files
Ian Lance Taylor [Fri, 24 Jul 2020 23:50:47 +0000 (16:50 -0700)]
runtime, sync: add copyright headers to new files

For #38029

Change-Id: I71de2b66c1de617d32c46d4f2c1866f9ff1756ec
Reviewed-on: https://go-review.googlesource.com/c/go/+/244631
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Dan Scales <danscales@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

3 years agodoc/go1.15: surface the crypto/x509 CommonName deprecation note
Filippo Valsorda [Fri, 17 Jul 2020 07:52:23 +0000 (03:52 -0400)]
doc/go1.15: surface the crypto/x509 CommonName deprecation note

Updates #39568
Updates #37419
Updates #24151

Change-Id: I44c940e09e26a039076396bbfecb2b1574197cf7
Reviewed-on: https://go-review.googlesource.com/c/go/+/243221
Reviewed-by: Kevin Burke <kev@inburke.com>
3 years ago[release-branch.go1.15] go1.15rc1 go1.15rc1
Alexander Rakoczy [Fri, 24 Jul 2020 15:40:44 +0000 (11:40 -0400)]
[release-branch.go1.15] go1.15rc1

Change-Id: I660c4655dfa0914dbe09a68921e102d06d9a2ed1
Reviewed-on: https://go-review.googlesource.com/c/go/+/244761
Run-TryBot: Alexander Rakoczy <alex@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Carlos Amedee <carlos@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

3 years agodoc/go1.15: announce GO386=387 deprecation
Austin Clements [Thu, 16 Jul 2020 19:34:29 +0000 (15:34 -0400)]
doc/go1.15: announce GO386=387 deprecation

For #40255.
Updates #37419.

Change-Id: If9210c855cc2eea079e7e469463d4203888748f7
Reviewed-on: https://go-review.googlesource.com/c/go/+/243137
Reviewed-by: Andrew Bonventre <andybons@golang.org>
3 years agoruntime: don't mlock on Ubuntu 5.4 systems
Ian Lance Taylor [Wed, 22 Jul 2020 04:37:58 +0000 (21:37 -0700)]
runtime: don't mlock on Ubuntu 5.4 systems

For #35777
For #37436
Fixes #40184

Change-Id: I68561497d9258e994d1c6c48d4fb41ac6130ee3a
Reviewed-on: https://go-review.googlesource.com/c/go/+/244059
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
3 years agocmd/compile: add test for fixed ICE on untyped conversion
Alberto Donizetti [Mon, 20 Jul 2020 16:32:53 +0000 (18:32 +0200)]
cmd/compile: add test for fixed ICE on untyped conversion

The ICE reported as #33308 was fixed by a related CL; this change adds
a regression test with the crasher.

Fixes #33308

Change-Id: I3260075dbe3823b56b8825e6269e57a0fad185a6
Reviewed-on: https://go-review.googlesource.com/c/go/+/243458
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
3 years agodoc/go1.15: add release notes for math/cmplx
Brian Kessler [Thu, 16 Jul 2020 04:04:57 +0000 (22:04 -0600)]
doc/go1.15: add release notes for math/cmplx

Updates #37419

Change-Id: Id7c9aba518c826c1a6fccbbf82210072bd3346f3
Reviewed-on: https://go-review.googlesource.com/c/go/+/242903
Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
Reviewed-by: Robert Griesemer <gri@golang.org>
3 years agogo/printer: remove exported StdFormat flag
Dmitri Shuralyov [Wed, 1 Jul 2020 16:49:43 +0000 (12:49 -0400)]
go/printer: remove exported StdFormat flag

The StdFormat flag was added as part of CL 231461, where the primary aim
was to fix the bug #37476. It's expected that the existing printer modes
only adjust spacing but do not change any of the code text itself. A new
printing flag served as a way for cmd/gofmt and go/format to delegate
a part of formatting work to the printer—where it's more more convenient
and efficient to perform—while maintaining current low-level printing
behavior of go/printer unmodified.

We already have cmd/gofmt and the go/format API that implement standard
formatting of Go source code, so there isn't a need to expose StdFormat
flag to the world, as it can only cause confusion.

Consider that to format source in canonical gofmt style completely it
may require tasks A, B, C to be done. In one version of Go, the printer
may do both A and B, while cmd/gofmt and go/format will do the remaining
task C. In another version, the printer may take on doing just A, while
cmd/gofmt and go/format will perform B and C. This makes it hard to add
a gofmt-like mode to the printer without compromising on above fluidity.

This change prefers to shift back some complexity to the implementation
of the standard library, allowing us to avoid creating the new exported
printing flag just for the internal needs of gofmt and go/format today.

We may still want to re-think the API and consider if something better
should be added, but unfortunately there isn't time for Go 1.15. We are
not adding new APIs now, so we can defer this decision until Go 1.16 or
later, when there is more time.

For #37476.
For #37453.
For #39489.
For #37419.

Change-Id: I0bb07156dca852b043487099dcf05c5350b29e20
Reviewed-on: https://go-review.googlesource.com/c/go/+/240683
Reviewed-by: Robert Griesemer <gri@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
3 years agocompress/flate: fix another deflate Reset inconsistency
Russ Cox [Thu, 16 Jul 2020 20:56:53 +0000 (16:56 -0400)]
compress/flate: fix another deflate Reset inconsistency

While investigating #34121, fixed by CL 193605,
I discovered another case where Reset was not quite
resetting enough.

This specific case is not a problem in Reset itself but
rather that the Huffman bit writer in one code path
is using uninitialized memory left over from a previous
block, making the compression not choose the optimal
compression method.

Fixes #34121.

Change-Id: I29245b28214d924e382f91e2c56b4b8a9b7da13d
Reviewed-on: https://go-review.googlesource.com/c/go/+/243140
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Joe Tsai <thebrokentoaster@gmail.com>
3 years agocompress/flate: fix deflate Reset consistency
Klaus Post [Thu, 7 May 2020 12:50:00 +0000 (12:50 +0000)]
compress/flate: fix deflate Reset consistency

Modify the overflow detection logic to shuffle the contents
of the table to a lower offset to avoid leaking the effects
of a previous use of compress.Writer past Reset calls.

Fixes #34121

Change-Id: I9963eadfa5482881e7b7adbad4c2cae146b669ab
GitHub-Last-Rev: 8b35798cdd4d5a901d6422647b12984d7e500ba3
GitHub-Pull-Request: golang/go#34128
Reviewed-on: https://go-review.googlesource.com/c/go/+/193605
Reviewed-by: Joe Tsai <thebrokentoaster@gmail.com>
Run-TryBot: Joe Tsai <thebrokentoaster@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

3 years agocmd/link: skip TestOldLink if the old linker does not exist
Cherry Zhang [Tue, 14 Jul 2020 22:55:29 +0000 (18:55 -0400)]
cmd/link: skip TestOldLink if the old linker does not exist

We don't ship the old linker in binary releases. Skip the test if
we cannot find the old linker.

Fixes #39509.

Change-Id: I1af5552bc56aff5314a384bcb5f3717b725d68e5
Reviewed-on: https://go-review.googlesource.com/c/go/+/242604
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
3 years agonet/http: synchronize "100 Continue" write and Handler writes
Russ Cox [Mon, 13 Jul 2020 17:27:22 +0000 (13:27 -0400)]
net/http: synchronize "100 Continue" write and Handler writes

The expectContinueReader writes to the connection on the first
Request.Body read. Since a Handler might be doing a read in parallel or
before a write, expectContinueReader needs to synchronize with the
ResponseWriter, and abort if a response already went out.

The tests will land in a separate CL.

Fixes #34902
Fixes CVE-2020-15586

Change-Id: Icdd8dd539f45e8863762bd378194bb4741e875fc
Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/793350
Reviewed-by: Filippo Valsorda <valsorda@google.com>
Reviewed-on: https://go-review.googlesource.com/c/go/+/242598
Run-TryBot: Katie Hockman <katie@golang.org>
Reviewed-by: Filippo Valsorda <filippo@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

3 years agocrypto/x509: respect VerifyOptions.KeyUsages on Windows
Filippo Valsorda [Fri, 19 Jun 2020 02:45:52 +0000 (22:45 -0400)]
crypto/x509: respect VerifyOptions.KeyUsages on Windows

When using the platform verifier on Windows (because Roots is nil) we
were always enforcing server auth EKUs if DNSName was set, and none
otherwise. If an application was setting KeyUsages, they were not being
respected.

Started correctly surfacing IncompatibleUsage errors from the system
verifier, as those are the ones applications will see if they are
affected by this change.

Also refactored verify_test.go to make it easier to add tests for this,
and replaced the EKULeaf chain with a new one that doesn't have a SHA-1
signature.

Thanks to Niall Newman for reporting this.

Fixes #39360
Fixes CVE-2020-14039

Change-Id: If5c00d615f2944f7d57007891aae1307f9571c32
Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/774414
Reviewed-by: Katie Hockman <katiehockman@google.com>
Reviewed-on: https://go-review.googlesource.com/c/go/+/242597
Run-TryBot: Katie Hockman <katie@golang.org>
Reviewed-by: Filippo Valsorda <filippo@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

3 years agohtml/template: add tests from text/template
Russ Cox [Mon, 6 Jul 2020 16:27:01 +0000 (12:27 -0400)]
html/template: add tests from text/template

Copy and adapt tests from text/template, to exercise more of html/template's copy.

Various differences in behavior are flagged with NOTE comments or t.Skip
and documented in #40075. Many of them are probably bugs.
One clarifying test case added to both text/template and html/template.

No changes to the package itself.

Change-Id: Ifefad83d647db846040d24c2741a0244b00ade82
Reviewed-on: https://go-review.googlesource.com/c/go/+/241084
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
3 years agocmd/go: include GOMODCACHE in 'go help environment'
Jay Conrod [Tue, 7 Jul 2020 18:17:30 +0000 (14:17 -0400)]
cmd/go: include GOMODCACHE in 'go help environment'

Updates #34527
Fixes #40089

Change-Id: Ie9c8573536e5c31e874d755f4d888ffc805b796f
Reviewed-on: https://go-review.googlesource.com/c/go/+/241275
Run-TryBot: Jay Conrod <jayconrod@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Michael Matloob <matloob@golang.org>
3 years agonet: hangup TCP connection after Dial timeout in Plan 9
Fazlul Shahriar [Wed, 8 Jul 2020 20:57:10 +0000 (16:57 -0400)]
net: hangup TCP connection after Dial timeout in Plan 9

After Dial timeout, force close the TCP connection by writing "hangup"
to the control file. This unblocks the "connect" command if the
connection is taking too long to establish, and frees up the control
file FD.

Fixes #40118

Change-Id: I1cef8539cd9fe0793e32b49c9d0ef636b4b26e1d
Reviewed-on: https://go-review.googlesource.com/c/go/+/241638
Run-TryBot: David du Colombier <0intro@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: David du Colombier <0intro@gmail.com>
3 years agodoc/go1.15: fix TODO about -buildmode=pie
Austin Clements [Thu, 9 Jul 2020 18:16:44 +0000 (14:16 -0400)]
doc/go1.15: fix TODO about -buildmode=pie

Updates #37419.

Change-Id: If77067eb348de47a4b101325de8a43502383b6d3
Reviewed-on: https://go-review.googlesource.com/c/go/+/241740
Reviewed-by: Cherry Zhang <cherryyz@google.com>
3 years agonet/textproto: correct documentation of empty line handling
Norman B. Lancaster [Wed, 10 Jul 2019 22:31:00 +0000 (17:31 -0500)]
net/textproto: correct documentation of empty line handling

Fixes #32493

Change-Id: I9c93791c4cc5c0c14556802733066407de3181ca
Reviewed-on: https://go-review.googlesource.com/c/go/+/185542
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
3 years agodoc/go1.15: add line for testing streaming change
Jean de Klerk [Thu, 9 Jul 2020 15:55:49 +0000 (09:55 -0600)]
doc/go1.15: add line for testing streaming change

Updates #37419.
Updates #38458.
Updates #24929.

Change-Id: I793bb20fa9db4432fc3a5b69956b7108e4695081
Reviewed-on: https://go-review.googlesource.com/c/go/+/241660
Run-TryBot: Jean de Klerk <deklerk@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
3 years agocrypto/x509/internal/macos: rename package to lowercase
Filippo Valsorda [Tue, 7 Jul 2020 18:04:18 +0000 (14:04 -0400)]
crypto/x509/internal/macos: rename package to lowercase

Also add a test to lock in this policy.

Fixes #40065

Change-Id: Iedc4586f2f5598046d84132a8f3bba8f2e93ddc2
Reviewed-on: https://go-review.googlesource.com/c/go/+/241274
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
3 years agoruntime: mark OpenBSD raise function nosplit
Ian Lance Taylor [Mon, 6 Jul 2020 21:23:26 +0000 (14:23 -0700)]
runtime: mark OpenBSD raise function nosplit

It is called by the signal handler before switching to gsignal
(sigtrampgo -> sigfwdgo -> dieFromSignal -> raise)
which means that it must not split the stack.

All other instances of raise are already marked nosplit.

Fixes #40076

Change-Id: I4794491331af48c46d0d8ebc82d34c6483f0e6cd
Reviewed-on: https://go-review.googlesource.com/c/go/+/241121
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
3 years agoos: fix regression with handling of nil *File
Joe Tsai [Wed, 8 Jul 2020 05:18:17 +0000 (22:18 -0700)]
os: fix regression with handling of nil *File

Use of a nil *File as an argument should not result in a panic,
but result in the ErrInvalid error being returned.
Fix the copy_file_range implementation to preserve this semantic.

Fixes #40115

Change-Id: Iad5ac39664a3efb7964cf55685be636940a8db13
Reviewed-on: https://go-review.googlesource.com/c/go/+/241417
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Damien Neil <dneil@google.com>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

3 years agocrypto: fix PKCS space in docs
Katie Hockman [Wed, 8 Jul 2020 13:40:33 +0000 (09:40 -0400)]
crypto: fix PKCS space in docs

Change-Id: Iee53acb963a889410f8c6daaa9a7841f1b12c6fb
Reviewed-on: https://go-review.googlesource.com/c/go/+/241497
Run-TryBot: Katie Hockman <katie@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Filippo Valsorda <filippo@golang.org>
3 years agodoc/editors.html: update VS Code Go extension url
Hana (Hyang-Ah) Kim [Mon, 6 Jul 2020 17:30:56 +0000 (13:30 -0400)]
doc/editors.html: update VS Code Go extension url

Change-Id: I7aa73861de053db6b424f113733de9caba19145b
Reviewed-on: https://go-review.googlesource.com/c/go/+/241086
Reviewed-by: Andrew Bonventre <andybons@golang.org>
3 years agoA+C: add Kush Patel (corporate CLA for Hootsuite Inc)
Kush Patel [Tue, 7 Jul 2020 03:58:50 +0000 (03:58 +0000)]
A+C: add Kush Patel (corporate CLA for Hootsuite Inc)

I'm from Hootsuite. We're a Canadian tech company who provides products
and services to businesses, organizations and individuals to really help
them succeed on social. We have leveraged Go in our stack for the past
4+ years. I am super happy to give back to Go on behalf of Hootsuite
through a small contribution to pkgsite (with a few more in the works).
We love this project and we love open source :)

Hopefully we can give back more in the future!
Kush

Change-Id: Id534a41d78e17e1fa48a8ddecd1ca110cf812388
GitHub-Last-Rev: 297b8b06e75c3ce485f62677ce4591c5cabe8008
GitHub-Pull-Request: golang/go#40088
Reviewed-on: https://go-review.googlesource.com/c/go/+/241218
Reviewed-by: Julie Qiu <julie@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
3 years agocrypto/tls: relax the docs of InsecureSkipVerify
Filippo Valsorda [Wed, 24 Jun 2020 18:31:49 +0000 (14:31 -0400)]
crypto/tls: relax the docs of InsecureSkipVerify

Fixes #39074

Change-Id: I72ec95f4b190253bb82d52a03a769b0399170b93
Reviewed-on: https://go-review.googlesource.com/c/go/+/239746
Reviewed-by: Katie Hockman <katie@golang.org>
3 years agonet: correct address when listening on IPv4zero tcp4/udp4 on Plan 9
Fazlul Shahriar [Sun, 5 Jul 2020 05:03:16 +0000 (01:03 -0400)]
net: correct address when listening on IPv4zero tcp4/udp4 on Plan 9

Since Plan 9 doesn't allow us to listen on 0.0.0.0, the Listener
address that's read in from /net is the IPv6 address ::. Convert
this address to 0.0.0.0 when the network is tcp4 or udp4.

Fixes #40045

Change-Id: Icfb69b823e5b80603742d23c3762a812996fe43f
Reviewed-on: https://go-review.googlesource.com/c/go/+/240918
Run-TryBot: David du Colombier <0intro@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: David du Colombier <0intro@gmail.com>
3 years agocrypto/x509/pkix: print non-standard parsed Names at the end
Filippo Valsorda [Tue, 30 Jun 2020 16:04:46 +0000 (12:04 -0400)]
crypto/x509/pkix: print non-standard parsed Names at the end

This doesn't change how ExtraNames are printed, so as not to cause
unnecessary churn of current outputs. Switched the ExtraNames check to a
nil check as we are checking for just-parsed values.

Fixes #39924
Fixes #39873

Change-Id: Ifa07cfc1a057d73643710a774ef8a154222db187
Reviewed-on: https://go-review.googlesource.com/c/go/+/240543
Run-TryBot: Filippo Valsorda <filippo@golang.org>
Reviewed-by: Katie Hockman <katie@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

3 years agodoc/go1.15: add html/template and text/template docs
Filippo Valsorda [Tue, 30 Jun 2020 17:23:32 +0000 (13:23 -0400)]
doc/go1.15: add html/template and text/template docs

Updates #37419

Change-Id: I23abfeabc6be704aad9da2649bbbe7c8e237dfab
Reviewed-on: https://go-review.googlesource.com/c/go/+/240546
Reviewed-by: Carlos Amedee <carlos@golang.org>
3 years agogo/build: rewrite TestDependencies to be cleaner, more correct
Russ Cox [Mon, 6 Jul 2020 12:54:12 +0000 (08:54 -0400)]
go/build: rewrite TestDependencies to be cleaner, more correct

TestDependencies defines the dependency policy
(what can depend on what) for the standard library.

The standard library has outgrown the idea of writing
the policy as a plain map literal. Also, the checker was
ignoring vendored packages, which makes it miss real
problems.

This commit adds a little language for describing
partial orders and rewrites the policy in that language.

It also changes the checker to look inside vendored
packages and adds those to the policy as well.

This turned up one important problem: net is depending
on fmt, unicode via golang.org/x/net/dns/dnsmessage,
filed as #40070.

This is a test-only change, so it should be appropriate
even for the release freeze, especially since it identified
a real bug.

Change-Id: I9b79f30761f167b8587204c959baa973583e39f2
Reviewed-on: https://go-review.googlesource.com/c/go/+/241078
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
3 years agoall: go get golang.org/x/net@ab3426394381
Russ Cox [Tue, 7 Jul 2020 03:46:17 +0000 (23:46 -0400)]
all: go get golang.org/x/net@ab3426394381

Pull in dns/dnsmessage fix to drop fmt dependency.
Also pulled in minor bug fix in x/crypto (dep of net).

Change-Id: I0f618e81a24ac24a5adae00af34b728b243dfdbb
Reviewed-on: https://go-review.googlesource.com/c/go/+/241257
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
3 years agodoc/go1.15: update Go 1.15 release notes using relnote
Carlos Amedee [Tue, 7 Jul 2020 11:39:05 +0000 (07:39 -0400)]
doc/go1.15: update Go 1.15 release notes using relnote

The additions were generated using golang.org/x/build/cmd/relnote.

Updates #37419

Change-Id: I99e934377e4bb511c44908039ad6d3bfd3ee35ce
Reviewed-on: https://go-review.googlesource.com/c/go/+/241065
Run-TryBot: Carlos Amedee <carlos@golang.org>
Reviewed-by: Alexander Rakoczy <alex@golang.org>
Reviewed-by: Andrew Bonventre <andybons@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

3 years agopath/filepath: add explicit comment marking elided errors
Russ Cox [Mon, 6 Jul 2020 15:28:15 +0000 (11:28 -0400)]
path/filepath: add explicit comment marking elided errors

The errors on these lines are meant to be discarded.
Add a comment to make that extra clear.

Change-Id: I38f72af6dfbb0e86677087baf47780b3cc6e7d40
Reviewed-on: https://go-review.googlesource.com/c/go/+/241083
Reviewed-by: Ian Lance Taylor <iant@golang.org>
3 years agocmd/go: display test binary output if invoked with -help
Ian Lance Taylor [Thu, 2 Jul 2020 19:32:13 +0000 (12:32 -0700)]
cmd/go: display test binary output if invoked with -help

Fixes #39997

Change-Id: I87ea616bac809b96fcd40f3bbdbbf1c603b9d00e
Reviewed-on: https://go-review.googlesource.com/c/go/+/240878
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
3 years agocmd/oldlink: port bug fixes to old linker
Cherry Zhang [Mon, 6 Jul 2020 18:22:38 +0000 (14:22 -0400)]
cmd/oldlink: port bug fixes to old linker

This CL ports CL 234105 and CL 240621 to the old linker, which
fix critical bugs (runtime crashes).

Updates #39049.
Updates #39927.

Change-Id: I47afc84349119e320d2e60d64b7188a410835d2b
Reviewed-on: https://go-review.googlesource.com/c/go/+/241087
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
Reviewed-by: Jeremy Faller <jeremy@golang.org>
3 years agogo/build: remove use of package log
Russ Cox [Mon, 6 Jul 2020 03:39:45 +0000 (23:39 -0400)]
go/build: remove use of package log

package log does not belong here,
even for an impossible condition.

Change-Id: I6180a4f7766a8e5759db4f33d03703d0b678d0b4
Reviewed-on: https://go-review.googlesource.com/c/go/+/241077
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

3 years agodoc/go1.15: fix wording in a few places
Alberto Donizetti [Sun, 5 Jul 2020 12:25:03 +0000 (14:25 +0200)]
doc/go1.15: fix wording in a few places

Change-Id: I1dc6871bdab7f3048eacd6738fdcfa64b8700c8a
Reviewed-on: https://go-review.googlesource.com/c/go/+/240998
Reviewed-by: Ian Lance Taylor <iant@golang.org>
3 years agocrypto/tls: create certs w/o KeyEncipherment KU for non-RSA keys in generate_cert.go
Daniel [Fri, 3 Jul 2020 03:07:02 +0000 (03:07 +0000)]
crypto/tls: create certs w/o KeyEncipherment KU for non-RSA keys in generate_cert.go

Summary

The crypto/tls/generate_cert.go utility should only set the template
x509.Certificate's KeyUsage field to a value with the
x509.KeyUsageKeyEncipherment bits set when the certificate subject
public key is an RSA public key, not an ECDSA or ED25519 public key.

Background

RFC 5480 describes the usage of ECDSA elliptic curve subject keys with
X.509. Unfortunately while Section 3 "Key Usages Bits" indicates which
key usage bits MAY be used with a certificate that indicates
id-ecPublicKey in the SubjectPublicKeyInfo field it doesn't provide
guidance on which usages should *not* be included (e.g. the
keyEncipherment bit, which is particular to RSA key exchange). The same
problem is present in RFC 8410 Section 5 describing Key Usage Bits for
ED25519 elliptic curve subject keys.

There's an update to RFC 5480 in last call stage within the IETF LAMPS
WG, draft-ietf-lamps-5480-ku-clarifications-00. This update is meant
to clarify the allowed Key Usages extension values for certificates with
ECDSA subject public keys by adding:

> If the keyUsage extension is present in a certificate that indicates
> id-ecPublicKey as algorithm of AlgorithmIdentifier [RFC2986] in
> SubjectPublicKeyInfo, then following values MUST NOT be present:
>
> keyEncipherment; and
> dataEncipherment.

I don't believe there is an update for RFC 8410 in the works but I
suspect it will be clarified similarly in the future.

This commit updates generate_cert.go to ensure when the certificate
public key is ECDSA or ED25519 the generated certificate has the
x509.Certificate.KeyUsage field set to a value that doesn't include KUs
specific to RSA. For ECDSA keys this will adhere to the updated RFC 5480
language.

Fixes #36499

Change-Id: Ib1b0757c039b7fe97fc6d1e826fe6b88856c1964
GitHub-Last-Rev: a8f34fb33dde90e09b6f9a27b2598a82b3023abb
GitHub-Pull-Request: golang/go#36500
Reviewed-on: https://go-review.googlesource.com/c/go/+/214337
Reviewed-by: Filippo Valsorda <filippo@golang.org>
Run-TryBot: Filippo Valsorda <filippo@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

3 years agoRevert "encoding/json: don't reuse slice elements when decoding"
Daniel Martí [Wed, 1 Jul 2020 11:31:15 +0000 (11:31 +0000)]
Revert "encoding/json: don't reuse slice elements when decoding"

This reverts https://golang.org/cl/191783.

Reason for revert: Broke too many programs which depended on the previous
behavior, even when it was the opposite of what the documentation said.

We can attempt to fix the original issue again for 1.16, while keeping
those programs in mind.

Fixes #39427.

Change-Id: I7a7f24b2a594c597ef625aeff04fff29aaa88fc6
Reviewed-on: https://go-review.googlesource.com/c/go/+/240657
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
3 years agocmd/link: skip fallocate test if not supported, and adjust allocation size on darwin
Cherry Zhang [Tue, 30 Jun 2020 20:51:27 +0000 (16:51 -0400)]
cmd/link: skip fallocate test if not supported, and adjust allocation size on darwin

On Linux, the linker uses fallocate to preallocate the output
file storage. The underlying file system may not support
fallocate, causing the test to fail. Skip the test in this case.

On darwin, apparently F_PREALLOCATE allocates from the end of the
allocation instead of the logical end of the file. Adjust the
size calculation.

Fixes #39905.

Change-Id: I01e676737fd2619ebbdba05c7cf7f424ec27de35
Reviewed-on: https://go-review.googlesource.com/c/go/+/240618
Reviewed-by: Than McIntosh <thanm@google.com>
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

3 years agocmd/link: fix GC data reading from shared library (attempt 2)
Cherry Zhang [Mon, 29 Jun 2020 21:07:17 +0000 (17:07 -0400)]
cmd/link: fix GC data reading from shared library (attempt 2)

When linking against a Go shared library, when a global variable
in the main module has a type defined in the shared library, the
linker needs to pull the GC data from the shared library to build
the GC program for the global variable. Currently, this fails
silently, as the shared library file is closed too early and the
read failed (with no error check), causing a zero GC map emitted
for the variable, which in turn causes the runtime to treat the
variable as pointerless.

For now, fix this by keeping the file open. In the future we may
want to use mmap to read from the shared library instead.

Also add error checking. And fix a (mostly harmless) mistake in
size caluculation.

Also remove an erroneous condition for ARM64. ARM64 used to have
a special case to get the addend from the relocation on the
gcdata field. That was removed, but the new code accidentally
returned 0 unconditionally. It's no longer necessary to have any
special case, since the addend is now applied directly to the
gcdata field on ARM64, like on all the other platforms.

Fixes #39927.

This is the second attempt of CL 240462. And this reverts
CL 240616.

Change-Id: I01c82422b9f67e872d833336885935bc509bc91b
Reviewed-on: https://go-review.googlesource.com/c/go/+/240621
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
3 years agocmd/link: mark special symbols reachable
Cherry Zhang [Tue, 30 Jun 2020 22:41:24 +0000 (18:41 -0400)]
cmd/link: mark special symbols reachable

The special symbols are linker-created symbols for special
purposes, therefore reachable (otherwise the linker won't create
them). Mark them so, so they get converted to sym.Symbols when we
convert to old symbol representation.

In particular, the failure for building shared library on PPC64
is due to .TOC. symbol not being converted to sym.Symbol, but
referenced in addmoduledata.

Change-Id: Iaf5d145ffa5d15122e86a6e6983514e56dd5d456
Reviewed-on: https://go-review.googlesource.com/c/go/+/240620
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
3 years agodoc: add riscv64 to ports list
Tobias Klauser [Mon, 29 Jun 2020 12:32:22 +0000 (14:32 +0200)]
doc: add riscv64 to ports list

Mention support for the 64-bit RISC-V instruction set (GOARCH=riscv64)
in the "Installing Go from source" document. Also sort the list of
supported instruction sets alphabetically.

Updates #27532

Change-Id: I07a443044a41a803853978dd7f7446de89ecceb5
Reviewed-on: https://go-review.googlesource.com/c/go/+/240377
Reviewed-by: Alberto Donizetti <alb.donizetti@gmail.com>
3 years agoRevert "cmd/link: fix GC data reading from shared library"
Cherry Zhang [Tue, 30 Jun 2020 19:09:38 +0000 (19:09 +0000)]
Revert "cmd/link: fix GC data reading from shared library"

This reverts CL 240462.

Reason for revert: test fails on PPC64LE.

Updates #39927.

Change-Id: I4f14fd0c36e604a80ae9f2f86d1e643e28945e93
Reviewed-on: https://go-review.googlesource.com/c/go/+/240616
Reviewed-by: Austin Clements <austin@google.com>
Reviewed-by: Than McIntosh <thanm@google.com>
3 years agocmd/link: fix GC data reading from shared library
Cherry Zhang [Mon, 29 Jun 2020 21:07:17 +0000 (17:07 -0400)]
cmd/link: fix GC data reading from shared library

When linking against a Go shared library, when a global variable
in the main module has a type defined in the shared library, the
linker needs to pull the GC data from the shared library to build
the GC program for the global variable. Currently, this fails
silently, as the shared library file is closed too early and the
read failed (with no error check), causing a zero GC map emitted
for the variable, which in turn causes the runtime to treat the
variable as pointerless.

For now, fix this by keeping the file open. In the future we may
want to use mmap to read from the shared library instead.

Also add error checking. And fix a (mostly harmless) mistake in
size caluculation.

Also remove an erroneous condition for ARM64. ARM64 used to have
a special case to get the addend from the relocation on the
gcdata field. That was removed, but the new code accidentally
returned 0 unconditionally. It's no longer necessary to have any
special case, since the addend is now applied directly to the
gcdata field on ARM64, like on all the other platforms.

Fixes #39927.

Change-Id: Iecd32315b326c7059587fdc190e2fa99426e497e
Reviewed-on: https://go-review.googlesource.com/c/go/+/240462
Reviewed-by: Than McIntosh <thanm@google.com>
Reviewed-by: Austin Clements <austin@google.com>
3 years agodoc/go1.15: add encoding/asn1 note about minimal encoding
Roland Shoemaker [Tue, 30 Jun 2020 16:14:15 +0000 (09:14 -0700)]
doc/go1.15: add encoding/asn1 note about minimal encoding

Also fix missing <code> tags in the other encoding/asn1 note.

Updates #37419

Change-Id: Ic0e9131016b44ed864629aa8d0a7fddb57146d21
Reviewed-on: https://go-review.googlesource.com/c/go/+/240518
Reviewed-by: Filippo Valsorda <filippo@golang.org>
3 years agonet: fix TestDialerLocalAddr on Plan 9
Fazlul Shahriar [Mon, 29 Jun 2020 23:22:34 +0000 (19:22 -0400)]
net: fix TestDialerLocalAddr on Plan 9

We cannot use "0.0.0.0" (IPv4) or "::" (IPv6) for local address, so
don't use those addresses in the control message. Alternatively, we
could've used "*" instead.

Fixes #39931

Change-Id: Ib2dcbb1a0c648296c3ecaddbe938053a569b1f1b
Reviewed-on: https://go-review.googlesource.com/c/go/+/240464
Run-TryBot: David du Colombier <0intro@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: David du Colombier <0intro@gmail.com>
3 years agodoc: add note about missing lock in sample code
Ferenc Szabo [Thu, 25 Jun 2020 09:12:50 +0000 (11:12 +0200)]
doc: add note about missing lock in sample code

The sample code in 'Interfaces and methods' section contains a
data race. Handlers are served concurrently. The handler does write
and read operations; `go test -race` would fail (with concurrent
requests). Since the doc is frozen and the code remains less
cluttered without locks/atomic, don't change the sample code.

Change-Id: I654b324d2f0b7f48497822751907c7d39e2f0e3d
Reviewed-on: https://go-review.googlesource.com/c/go/+/239877
Reviewed-by: Rob Pike <r@golang.org>
3 years agodoc/go1.15: remove encoding/xml doc
Ian Lance Taylor [Fri, 26 Jun 2020 18:31:02 +0000 (11:31 -0700)]
doc/go1.15: remove encoding/xml doc

The change is rolled back in CL 240179.

For #35151
For #39876

Change-Id: Id26ccbdb482772ac31c642156a9900102397b043
Reviewed-on: https://go-review.googlesource.com/c/go/+/240012
Reviewed-by: Alberto Donizetti <alb.donizetti@gmail.com>
Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
3 years agoRevert "encoding/xml: fix reserved namespace check to be case-insensitive"
Ian Lance Taylor [Fri, 26 Jun 2020 18:29:34 +0000 (18:29 +0000)]
Revert "encoding/xml: fix reserved namespace check to be case-insensitive"

This reverts CL 203417.

Reason for revert: This change changes uses of tags like "XMLSchema-instance" without any recourse.

For #35151
Fixes #39876

Change-Id: I4c85c8267a46b3748664b5078794dafffb42aa26
Reviewed-on: https://go-review.googlesource.com/c/go/+/240179
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
Reviewed-by: Andrew Bonventre <andybons@golang.org>
3 years agodoc: add alt attribute to gopher image in help.html
Alexander Nohe [Sat, 27 Jun 2020 23:22:29 +0000 (23:22 +0000)]
doc: add alt attribute to gopher image in help.html

This adds an alt tag for accessibility. The alt text is a visual
description of the text that is read out loud to users using a
screen reader. The HTML specifications indicate that alt tags for
decorative images should be left blank.

Fixes #39861

Change-Id: I76c39a461ceabe685826aa46e4f26ad893d50634
Reviewed-on: https://go-review.googlesource.com/c/go/+/240258
Reviewed-by: Alexander Nohe <alex.nohe427@gmail.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
3 years agodoc/go1.15: add release note for encoding/asn1
Roland Shoemaker [Sat, 27 Jun 2020 04:33:22 +0000 (21:33 -0700)]
doc/go1.15: add release note for encoding/asn1

Updates #37419

Change-Id: I05368efbedd8c7e0b50cd691559491699c3a0945
Reviewed-on: https://go-review.googlesource.com/c/go/+/240201
Reviewed-by: Filippo Valsorda <filippo@golang.org>
3 years agonet/http: fix panic with If-None-Match value in http.ServeContent
Marcus Weiner [Wed, 24 Jun 2020 15:24:56 +0000 (15:24 +0000)]
net/http: fix panic with If-None-Match value in http.ServeContent

Fixes #39817

Change-Id: I79f2ad7c836a8a46569f603aca583fdd526d22dc
GitHub-Last-Rev: 5b88aada219aaa2af0c7e1969ed6fa646117d9da
GitHub-Pull-Request: golang/go#39821
Reviewed-on: https://go-review.googlesource.com/c/go/+/239699
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
3 years agonet: add support for dialing from a custom local address on Plan 9
Fazlul Shahriar [Thu, 25 Jun 2020 23:41:13 +0000 (19:41 -0400)]
net: add support for dialing from a custom local address on Plan 9

Make use of the extra parameter on "connect" control message to set the
local IP address and port. The ip(3) man page doesn't document that the
local IP address is settable, but upon inspection of the source code,
it's clearly settable.

Fixes #39747

Change-Id: Ied3d60452f20d6e5af23d1c1dcb34774af0dbd5b
Reviewed-on: https://go-review.googlesource.com/c/go/+/240064
Run-TryBot: David du Colombier <0intro@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: David du Colombier <0intro@gmail.com>
3 years agonet: handle more interface types without a hardware address on Plan 9
Fazlul Shahriar [Mon, 29 Jun 2020 05:50:50 +0000 (01:50 -0400)]
net: handle more interface types without a hardware address on Plan 9

We were handling loopback devices when attempting to read hardware
address, but packet interfaces were not being handled. As a general fix,
don't attempt to read hardware address of any device that's not inside
/net.

Fixes #39908

Change-Id: Ifa05e270357e111c60906110db2cc23dc7c1c49c
Reviewed-on: https://go-review.googlesource.com/c/go/+/240259
Run-TryBot: David du Colombier <0intro@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: David du Colombier <0intro@gmail.com>
3 years agodoc: fix typos and grammatical errors in contribute.html
Jie Ma [Sat, 27 Jun 2020 23:15:53 +0000 (23:15 +0000)]
doc: fix typos and grammatical errors in contribute.html

Fixed some typos and grammatical errors in contribute.html

Change-Id: Ifb31f22d876b7bea84b5e130870c26813b2fa139
GitHub-Last-Rev: 43519198859ca8f5e1c870b8f3eeb1b465aa6bc5
GitHub-Pull-Request: golang/go#39892
Reviewed-on: https://go-review.googlesource.com/c/go/+/240277
Reviewed-by: Ian Lance Taylor <iant@golang.org>
3 years agoruntime: ensure arenaBaseOffset makes it into DWARF (for viewcore)
Keith Randall [Fri, 26 Jun 2020 23:38:40 +0000 (16:38 -0700)]
runtime: ensure arenaBaseOffset makes it into DWARF (for viewcore)

This constant does not make it into DWARF because it is an ideal
constant larger than maxint (1<<63-1). DWARF has no way to represent
signed values that large. Define a different typed constant that
is unsigned and so can represent this constant properly.

Viewcore needs this constant to interrogate the heap data structures.
In addition, the sign of arenaBaseOffset changed in 1.15, and providing
a new name lets viewcore detect the sign change easily.

Change-Id: I4274a2f6e79ebbf1411e85d64758fac1672fb96b
Reviewed-on: https://go-review.googlesource.com/c/go/+/240198
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
3 years agocmd/cgo: prevent redeclaration of _Ctype_void when C.void is used
Matthew Dempsky [Fri, 26 Jun 2020 18:26:33 +0000 (11:26 -0700)]
cmd/cgo: prevent redeclaration of _Ctype_void when C.void is used

CL 230037 changed cmd/cgo to emit "type _Ctype_foo = bar" aliases for
all C.foo types mentioned in the original Go source files. However,
cmd/cgo already emits an appropriate type definition for _Ctype_void.
So if a source file explicitly mentions C.void, this resulted in
_Ctype_void being declared multiple times.

This CL fixes the issue by suppressing the "type _Ctype_void =
_Ctype_void" alias before printing it. This should be safe because
_Ctype_void is the only type that's specially emitted in out.go at the
moment.

A somewhat better fix might be to fix how _Ctype_void is declared in
the cmd/cgo "frontend", but this is a less invasive fix.

Fixes #39877.

Change-Id: Ief264b3847c8ef8df1478a6333647ff2cf09b63d
Reviewed-on: https://go-review.googlesource.com/c/go/+/240180
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

3 years agodoc/go1.15: fix typos and wording in a few places
Alberto Donizetti [Fri, 26 Jun 2020 17:05:13 +0000 (19:05 +0200)]
doc/go1.15: fix typos and wording in a few places

Change-Id: Ib1fc7a8305f3bc698b9022e0a565ccbcf687e0d1
Reviewed-on: https://go-review.googlesource.com/c/go/+/240158
Reviewed-by: Ian Lance Taylor <iant@golang.org>
3 years agodoc/go1.14: crypto/tls.Config.NameToCertificate is deprecated
Ian Lance Taylor [Thu, 25 Jun 2020 23:39:56 +0000 (16:39 -0700)]
doc/go1.14: crypto/tls.Config.NameToCertificate is deprecated

Also crypto/tls.Config.BuildNameToCertificate.

Note that this field and method were deprecated in the Go 1.14 release,
so this change is to the 1.14 release notes.

Fixes #37626

Change-Id: If8549bc746f42a93f1903439e1b464b3e81e2c19
Reviewed-on: https://go-review.googlesource.com/c/go/+/240005
Reviewed-by: Filippo Valsorda <filippo@golang.org>
3 years agoruntime: don't preempt if preemption is disabled
Cherry Zhang [Fri, 26 Jun 2020 15:57:08 +0000 (11:57 -0400)]
runtime: don't preempt if preemption is disabled

If asyncpreemptoff is set, don't preempt upon receiving a SIGURG.

Fixes #38531.

Change-Id: I6d9a828b45c199d3e479cbdfe17a896a40d540f9
Reviewed-on: https://go-review.googlesource.com/c/go/+/240121
Run-TryBot: Cherry Zhang <cherryyz@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

3 years agodoc/go1.15: fix bad link to crypto/tls
Alberto Donizetti [Fri, 26 Jun 2020 16:24:15 +0000 (18:24 +0200)]
doc/go1.15: fix bad link to crypto/tls

Change-Id: Ie81579cbb1873349a91280f5aebe59624fcb1ef8
Reviewed-on: https://go-review.googlesource.com/c/go/+/240157
Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
3 years agocrypto/x509: move and update the SSL_CERT_FILE and SSL_CERT_DIR docs
Filippo Valsorda [Wed, 24 Jun 2020 20:49:05 +0000 (16:49 -0400)]
crypto/x509: move and update the SSL_CERT_FILE and SSL_CERT_DIR docs

Fixes #37907

Change-Id: Ia077de6dcc74ed761d278eab4efbf45e151429b8
Reviewed-on: https://go-review.googlesource.com/c/go/+/239747
Run-TryBot: Filippo Valsorda <filippo@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Katie Hockman <katie@golang.org>
3 years agocmd/compile: remove check that Zero's arg has the correct base type
Keith Randall [Thu, 25 Jun 2020 03:59:18 +0000 (20:59 -0700)]
cmd/compile: remove check that Zero's arg has the correct base type

It doesn't have to. The type in the aux field is authoritative.
There are cases involving casting from interface{} where pointers
have a placeholder pointer type (because the type is not known when
the IData op is generated).

The check was introduced in CL 13447.

Fixes #39459

Change-Id: Id77a57577806a271aeebd20bea5d92d08ee7aa6b
Reviewed-on: https://go-review.googlesource.com/c/go/+/239817
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
3 years agoos: return *PathError error in File.Sync on Plan 9
Fazlul Shahriar [Thu, 25 Jun 2020 05:15:42 +0000 (01:15 -0400)]
os: return *PathError error in File.Sync on Plan 9

File.Sync was returning *SyscallError instead of *PathError on Plan 9.
Adjust the error type to match other systems.

Fixes #39800

Change-Id: I844e716eb61c193ef78d29cb0b4a3ef790bb3320
Reviewed-on: https://go-review.googlesource.com/c/go/+/239857
Reviewed-by: David du Colombier <0intro@gmail.com>
3 years agodoc/go1.15: mention consequence of os.File.ReadFrom
Ian Lance Taylor [Fri, 19 Jun 2020 05:43:36 +0000 (22:43 -0700)]
doc/go1.15: mention consequence of os.File.ReadFrom

Now that we've added a os.File.ReadFrom method, io.CopyBuffer to a
os.File will no longer use the provided buffer.

For #16474
For #36817
For #37419

Change-Id: I79a3bf778ff93eab88e88dd9ecbb8c7ea101e868
Reviewed-on: https://go-review.googlesource.com/c/go/+/238864
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
3 years agodoc/faq: fix a grammar mistake
Kerollos Magdy [Tue, 23 Jun 2020 10:45:36 +0000 (10:45 +0000)]
doc/faq: fix a grammar mistake

Change-Id: Ifa060f5f91d7b964eb180465245104411310d423
GitHub-Last-Rev: cd1862f2ca721a4f3d4ede7bcb3e7759ce96c6d5
GitHub-Pull-Request: golang/go#39780
Reviewed-on: https://go-review.googlesource.com/c/go/+/239388
Reviewed-by: Ian Lance Taylor <iant@golang.org>
3 years agonet: consistently document deadline handling
Ian Lance Taylor [Wed, 24 Jun 2020 21:47:41 +0000 (14:47 -0700)]
net: consistently document deadline handling

After CL 228645 some mentions of the Deadline methods referred
to the Timeout method, and some to os.ErrDeadlineExceeded.
Stop referring to the Timeout method, to encourage ErrDeadlineExceeded.

For #31449

Change-Id: I27b8ff34f31798f38b06437546886af8cce98ca4
Reviewed-on: https://go-review.googlesource.com/c/go/+/239705
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Damien Neil <dneil@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

3 years agocrypto/tls: replace VerifyPeerCertificate example with VerifyConnection
Filippo Valsorda [Tue, 23 Jun 2020 21:19:01 +0000 (17:19 -0400)]
crypto/tls: replace VerifyPeerCertificate example with VerifyConnection

Look at how much better it is!

Updates #36736

Change-Id: I53a314a103a42dd869c05823fa50f37d70f9d283
Reviewed-on: https://go-review.googlesource.com/c/go/+/239560
Run-TryBot: Filippo Valsorda <filippo@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Katie Hockman <katie@golang.org>
3 years agocrypto/tls: expand the ConnectionState docs
Filippo Valsorda [Wed, 24 Jun 2020 18:27:32 +0000 (14:27 -0400)]
crypto/tls: expand the ConnectionState docs

Fixes #37572

Change-Id: I493392f535a979ee16609861041da2ecfe21cf77
Reviewed-on: https://go-review.googlesource.com/c/go/+/239744
Run-TryBot: Filippo Valsorda <filippo@golang.org>
Reviewed-by: Katie Hockman <katie@golang.org>
3 years agocrypto/tls: fix DialContext docs
Filippo Valsorda [Wed, 24 Jun 2020 18:29:20 +0000 (14:29 -0400)]
crypto/tls: fix DialContext docs

Change-Id: I58e3febbf63049bebb4f8ed8893288183c8aaccd
Reviewed-on: https://go-review.googlesource.com/c/go/+/239745
Run-TryBot: Filippo Valsorda <filippo@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Katie Hockman <katie@golang.org>
3 years agocrypto/x509: restore support for ios tag on darwin/amd64
Filippo Valsorda [Wed, 24 Jun 2020 16:59:10 +0000 (12:59 -0400)]
crypto/x509: restore support for ios tag on darwin/amd64

Fixes #38710

Change-Id: I9b210e95fd997ff53ec704c5f61110045aaa94bb
Reviewed-on: https://go-review.googlesource.com/c/go/+/239559
Run-TryBot: Filippo Valsorda <filippo@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
3 years agocrypto/x509: update bundled iOS roots and rewrite generator
Filippo Valsorda [Tue, 23 Jun 2020 19:04:46 +0000 (15:04 -0400)]
crypto/x509: update bundled iOS roots and rewrite generator

Switched the generator to using the open source releases of the root
store rather than HTML parsing, while trying to emulate the sorting
algorithm of the table to reduce churn.

Updates #38843

Change-Id: I78608d245eabc2a35c2f98635ed5f1a531ad2ba8
Reviewed-on: https://go-review.googlesource.com/c/go/+/239557
Run-TryBot: Filippo Valsorda <filippo@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
3 years agocrypto/elliptic: document and test that IsOnCurve(∞) == false
Filippo Valsorda [Tue, 23 Jun 2020 22:14:25 +0000 (18:14 -0400)]
crypto/elliptic: document and test that IsOnCurve(∞) == false

This also implies it can't be passed to Marshal.

Fixes #37294

Change-Id: I1e6b6abd87ff31f323486958d5cb34a5c8f76b5f
Reviewed-on: https://go-review.googlesource.com/c/go/+/239562
Run-TryBot: Filippo Valsorda <filippo@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Katie Hockman <katie@golang.org>
3 years agocmd/link: skip zero values in fingerprint check
Cherry Zhang [Tue, 23 Jun 2020 16:02:54 +0000 (12:02 -0400)]
cmd/link: skip zero values in fingerprint check

Normally, packages are loaded in dependency order, and if a
Library object is not nil, it is already loaded with the actual
fingerprint. In shared build mode, however, packages may be added
not in dependency order (e.g. go install -buildmode=shared std
adds all std packages before loading them), and it is possible
that a Library's fingerprint is not yet loaded. Skip the check
in this case (when the fingerprint is the zero value).

Fixes #39777.

Change-Id: I66208e92bf687c8778963ba8e33e9bd948f82f3a
Reviewed-on: https://go-review.googlesource.com/c/go/+/239517
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
3 years agonet/http: document Dir behavior with symlinks
Katie Hockman [Thu, 18 Jun 2020 15:26:07 +0000 (11:26 -0400)]
net/http: document Dir behavior with symlinks

Based on CL 229377.

Change-Id: I016eec20672c909e8fabe799c277f4d2540fc555
Reviewed-on: https://go-review.googlesource.com/c/go/+/238698
Run-TryBot: Katie Hockman <katie@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Filippo Valsorda <filippo@golang.org>
3 years agotext/template: fix lint typo in VariableNode doc
Macks [Tue, 23 Jun 2020 00:09:26 +0000 (00:09 +0000)]
text/template: fix lint typo in VariableNode doc

Change-Id: I68b8c782478aa3e7adbd36a2de1c20b04e8c395b
GitHub-Last-Rev: 50f27197837e57e1d68b8905eaa66ea142bd45fc
GitHub-Pull-Request: golang/go#39622
Reviewed-on: https://go-review.googlesource.com/c/go/+/239383
Reviewed-by: Rob Pike <r@golang.org>