Benny Siegert [Fri, 5 Nov 2010 17:47:56 +0000 (10:47 -0700)]
path: add Glob
As discussed in http://groups.google.com/group/golang-dev/browse_thread/thread/926b7d550d98ec9e,
add a simple "path expander" function, which returns all the
files matching the given pattern. This function is called Glob
after glob(3) in libc.
Also add a convenience function, hasMeta, that checks whether
a string contains one of the characters which are specially handled
by Match.
Adam Langley [Fri, 5 Nov 2010 13:54:56 +0000 (09:54 -0400)]
crypto/tls: use pool building for certificate checking
Previously we checked the certificate chain from the leaf
upwards and expected to jump from the last cert in the chain to
a root certificate.
Although technically correct, there are a number of sites with
problems including out-of-order certs, superfluous certs and
missing certs.
The last of these requires AIA chasing, which is a lot of
complexity. However, we can address the more common cases by
using a pool building algorithm, as browsers do.
We build a pool of root certificates and a pool from the
server's chain. We then try to build a path to a root
certificate, using either of these pools.
This differs from the behaviour of, say, Firefox in that Firefox
will accumulate intermedite certificate in a persistent pool in
the hope that it can use them to fill in gaps in future chains.
We don't do that because it leads to confusing errors which only
occur based on the order to sites visited.
This change also enabled SNI for tls.Dial so that sites will return
the correct certificate chain.
Robert Griesemer [Thu, 4 Nov 2010 20:48:32 +0000 (13:48 -0700)]
go spec: line comments may end in EOF
Consistency argument: A valid Go program should
remain valid after stripping leading and trailing
whitespace. This was not true so far if the last
text in the source was a line comment.
Graham Miller [Thu, 4 Nov 2010 20:45:18 +0000 (13:45 -0700)]
Small addition to previous optimization of memequal as discussed here: http://groups.google.com/group/golang-nuts/browse_thread/thread/f591ba36d83723c0/9aba02d344045f38
Russ Cox [Thu, 4 Nov 2010 18:00:19 +0000 (14:00 -0400)]
runtime: ,s/[a-zA-Z0-9_]+/runtime·&/g, almost
Prefix all external symbols in runtime by runtime·,
to avoid conflicts with possible symbols of the same
name in linked-in C libraries. The obvious conflicts
are printf, malloc, and free, but hide everything to
avoid future pain.
The symbols left alone are:
** known to cgo **
_cgo_free
_cgo_malloc
libcgo_thread_start
initcgo
ncgocall
** known to linker **
_rt0_$GOARCH
_rt0_$GOARCH_$GOOS
text
etext
data
end
pclntab
epclntab
symtab
esymtab
** known to C compiler **
_divv
_modv
_div64by32
etc (arch specific)
Tested on darwin/386, darwin/amd64, linux/386, linux/amd64.
Built (but not tested) for freebsd/386, freebsd/amd64, linux/arm, windows/386.
Adam Langley [Wed, 3 Nov 2010 14:43:43 +0000 (10:43 -0400)]
crypto: switch block ciphers to detination first.
Previously all the functions took two arguments: src, dst. This is the
reverse of the usual Go style and worth changing sooner rather than
later.
Unfortunately, this is a change that the type system doesn't help
with. However, it's not a subtle change: any unittest worth the name
should catch this.
R=rsc, r
CC=golang-dev
https://golang.org/cl/2751042
Rob Pike [Tue, 2 Nov 2010 17:58:27 +0000 (10:58 -0700)]
netchan: fix locking bug.
There's no need to hold the client mutex when calling encode, since encode itself
uses a mutex to make the writes atomic. However, we need to keep
the messages ordered, so add a mutex for that purpose alone.
Fixes #1244.
Robert Griesemer [Tue, 2 Nov 2010 17:38:07 +0000 (10:38 -0700)]
go/scanner: removed scanner/internal-only uses of token.Position
First step towards a more light-weight implementation of token.Position:
- only use token.Position for reporting token and error position
- use offsets only for scanner control
- no interface changes yet
Robert Griesemer [Mon, 1 Nov 2010 22:08:03 +0000 (15:08 -0700)]
go/printer: do not remove parens around composite literals starting with a type name in control clauses
(even when they are nested inside an expression).
Rob Pike [Sun, 31 Oct 2010 20:41:30 +0000 (13:41 -0700)]
gob: several fixes.
1) Be sure to use the eval-time encoder/decoder rather than
the compile-time decoder. In a few cases the receiver for
the compiling encoder was being pickled incorrectly into a
closure.
(This is the fix for issue 1238).
2) Get the innermost name right when given a pointer to an
unnamed type.
3) Use a count to delineate interface values, making it
possible to ignore values without having a concrete type
to encode into. This is a protocol change but only for the
new feature, so it shouldn't affect anyone. The old test
worked because, amazingly, it depended on bug #1.
Rob Pike [Thu, 28 Oct 2010 23:54:24 +0000 (16:54 -0700)]
testing: eliminate testing/regexp
Rather than updating the stripped-down regexp implementation embedded
in testing, delete it by passing the one function we need from the package
main file created by gotest.
Russ Cox [Tue, 26 Oct 2010 00:55:50 +0000 (17:55 -0700)]
arm: precise float64 software floating point
Adds softfloat64 to generic runtime
(will be discarded by linker when unused)
and adds test for it. I used the test to check
the software code against amd64 hardware
and then check the software code against
the arm and its simulation of hardware.
The latter should have been a no-op (testing
against itself) but turned up a bug in 5c causing
the vlrt.c routines to miscompile.
These changes make the cmath, math,
and strconv tests pass without any special
accommodations for arm.