Commit graph

374 commits

Author SHA1 Message Date
Sergey Frolov
3b53b610a6 go vet fixes 2017-09-08 15:59:05 -06:00
sergeyfrolov
f6ecfa941c Update README 2017-09-08 12:53:50 -06:00
sergeyfrolov
048fc50c2d Merge pull request #2 from refraction-networking/getoutkeystream
Implement GetOutKeystream()
2017-09-07 11:40:08 -06:00
Sergey Frolov
08a039c453 Implement GetOutKeystream() 2017-09-07 09:03:04 -06:00
Sergey Frolov
004572df2e Make ApplyConfig() and MarshalClientHello() public 2017-09-06 19:26:38 -06:00
Sergey Frolov
5893031118 RandomizedHello: fix cipherSuite' shuffling 2017-09-06 19:26:16 -06:00
Benjamin M. Schwartz
21fd80b8b6 Merge pull request #11 from Jigsaw-Code/readme-update
Update README.md
2017-09-05 23:35:13 +02:00
Justin Henck
769571a451 Update README.md 2017-09-05 16:36:58 -04:00
Artyom Pervukhin
fe92b81ca1 crypto/tls: fix docstring of Config.ClientSessionCache
Closes #21519

Change-Id: I1247e9435de93aae7e4db2b6e8e5be1b010c296b
Reviewed-on: https://go-review.googlesource.com/56832
Reviewed-by: Avelino <t@avelino.xxx>
Reviewed-by: Adam Langley <agl@golang.org>
2017-08-25 22:37:26 +00:00
Benjamin M. Schwartz
a6b7d98736 Merge pull request #10 from Jigsaw-Code/utls-write
Add utls.Write(). Fixes #3
2017-08-18 20:11:18 +02:00
Sergey Frolov
853deec862 Add utls.Write(). Fixes #3 2017-08-18 14:08:51 -04:00
Sergey Frolov
b36d51a64c Merge branch 'master' of github.com:Jigsaw-Code/utls 2017-08-18 14:06:07 -04:00
Sergey Frolov
e797c80048 Update README 2017-08-18 14:05:48 -04:00
sergeyfrolov
a83ace6117 Merge pull request #8 from Jigsaw-Code/fix-races
Fixes #5
2017-08-16 17:22:35 -04:00
Sergey Frolov
fd96e317e6 Fixes #5
The root cause of races is that global variables supportedSignatureAlgorithms and
cipherSuites are used both to form handshake and to check whether or not
peer responded with supported algorithm.
In this patch I create separate variables for this purpose.
Updated tests for kicks.
Finally, go fmt.
2017-08-16 16:12:27 -04:00
Sergey Frolov
09f732cdd6 Update and add new tests 2017-08-16 14:34:06 -04:00
Sergey Frolov
a07d9bc87d Added global cipherSuites are disabled by default
Makes sure that old cipher suite ids, added to global cipherSuites,
are now disabled by default, and, thus, do not affect default Golang
handshake.
2017-08-16 11:56:58 -04:00
Sergey Frolov
eb3c8be9a1 Revert "Remove appendToGlobalCipherSuites"
This reverts commit 0af497570e.
2017-08-16 11:55:39 -04:00
Sergey Frolov
ab61409e7d Add ems 2017-08-16 11:54:20 -04:00
Filippo Valsorda
f3b1bbce00 crypto/tls: disallow handshake messages fragmented across CCS
Detected by BoGo test FragmentAcrossChangeCipherSpec-Server-Packed.

Change-Id: I9a76697b9cdeb010642766041971de5c7e533481
Reviewed-on: https://go-review.googlesource.com/48811
Reviewed-by: Adam Langley <agl@golang.org>
Run-TryBot: Adam Langley <agl@golang.org>
2017-08-15 18:45:06 +00:00
Filippo Valsorda
b1d5de15f4 crypto/tls: add BenchmarkHandshakeServer
name                                       time/op
HandshakeServer/RSA-4                      1.10ms ± 0%
HandshakeServer/ECDHE-P256-RSA-4           1.23ms ± 1%
HandshakeServer/ECDHE-P256-ECDSA-P256-4     178µs ± 1%
HandshakeServer/ECDHE-X25519-ECDSA-P256-4   180µs ± 2%
HandshakeServer/ECDHE-P521-ECDSA-P521-4    19.8ms ± 1%

Change-Id: I6b2c79392995d259cfdfc5199be44cc7cc40e155
Reviewed-on: https://go-review.googlesource.com/44730
Reviewed-by: Adam Langley <agl@golang.org>
Run-TryBot: Adam Langley <agl@golang.org>
2017-08-15 18:44:38 +00:00
Andreas Auernhammer
a3bb151457 crypto/tls: don't check whether an ec point is on a curve twice
The processClientKeyExchange and processServerKeyExchange functions unmarshal an
encoded EC point and explicitly check whether the point is on the curve. The explicit
check can be omitted because elliptic.Unmarshal fails if the point is not on the curve
and the returned error would always be the same.

Fixes #20496

Change-Id: I5231a655eace79acee2737dd036a0c255ed42dbb
Reviewed-on: https://go-review.googlesource.com/44311
Reviewed-by: Adam Langley <agl@golang.org>
Reviewed-by: Avelino <t@avelino.xxx>
Run-TryBot: Adam Langley <agl@golang.org>
2017-08-15 18:44:20 +00:00
Sergey Frolov
6890f3e435 Finish Firefox 55 fignerprint. Implements #4 2017-08-15 12:50:40 -04:00
Sergey Frolov
0af497570e Remove appendToGlobalCipherSuites
This function is not needed anymore, since check for whether ciphersuite is
supported is done against per-tls.Config, not against global variable.
One of needed changes for fixing data races, see #5
2017-08-15 12:48:48 -04:00
sergeyfrolov
1e0af1a3f4 Add upstream merge instruction 2017-08-11 16:12:45 -04:00
Sergey Frolov
3ab65b623c Merge branch 'master' of github.com:Jigsaw-Code/utls 2017-08-11 16:10:40 -04:00
Sergey Frolov
0f64b078aa Merge branch 'golang-tls-upstream' 2017-08-11 16:09:09 -04:00
Sergey Frolov
4419452644 crypto/tls: split clientHandshake into multiple methods
Change-Id: I23bfaa7e03a21aad4e85baa3bf52bb00c09b75d0
Reviewed-on: https://go-review.googlesource.com/44354
Reviewed-by: Adam Langley <agl@golang.org>
2017-08-09 22:24:19 +00:00
sergeyfrolov
494ea0e9d5 Fix typo + increase size of all subsubtitles 2017-08-09 17:26:28 -04:00
Sergey Frolov
120bf80363 parrotChrome_58: add SHA512 globally 2017-08-09 14:00:00 -04:00
Sergey Frolov
e96789aa6a parrotChrome_58: fix panic 2017-08-09 13:59:43 -04:00
Sergey Frolov
e66d491f21 Add BSD LICENSE headers 2017-08-07 18:33:59 -04:00
Sergey Frolov
44127316da Add CONTRIBUTING.md 2017-08-07 18:33:38 -04:00
Sergey Frolov
bfc60ea5a4 README: add note about Handshake() being mandatory 2017-07-31 18:20:09 -04:00
Sergey Frolov
37f7eb6d8a Add LICENSE 2017-07-07 11:35:15 -04:00
sergeyfrolov
736a2caf18 Merge pull request #2 from Jigsaw-Code/utls
uTLS: initial commit
2017-07-07 11:05:17 -04:00
Sergey Frolov
cd3d1c4656 uTLS: initial commit 2017-07-07 11:02:48 -04:00
Sergey Frolov
e8bc3d6d4f crypto/tls: split clientHandshake into multiple methods
https://go-review.googlesource.com/c/44354/
2017-06-23 11:06:41 -04:00
Sergey Frolov
da09099f71 Initial commit: clone of crypto/tls 2017-06-22 18:00:11 -04:00
Adam Langley
670e4b941c crypto/tls: pass argument to serverInit rather than using a field in Config.
Updates #20164.

Change-Id: Ib900095e7885f25cd779750674a712c770603ca8
Reviewed-on: https://go-review.googlesource.com/42137
Reviewed-by: Russ Cox <rsc@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-05-16 18:23:28 +00:00
Kevin Burke
fea4b4c8dd crypto/tls: recommend P256 elliptic curve
Users (like myself) may be tempted to think the higher-numbered curve
is somehow better or more secure, but P256 is currently the best
ECDSA implementation, due to its better support in TLS clients, and a
constant time implementation.

For example, sites that present a certificate signed with P521
currently fail to load in Chrome stable, and the error on the Go side
says simply "remote error: tls: illegal parameter".

Fixes #19901.

Change-Id: Ia5e689e7027ec423624627420e33029c56f0bd82
Reviewed-on: https://go-review.googlesource.com/40211
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-04-10 17:40:01 +00:00
Mike Danese
e4a524a298 crypto/tls: make Config.Clone also clone the GetClientCertificate field
Using GetClientCertificate with the http client is currently completely
broken because inside the transport we clone the tls.Config and pass it
off to the tls.Client. Since tls.Config.Clone() does not pass forward
the GetClientCertificate field, GetClientCertificate is ignored in this
context.

Fixes #19264

Change-Id: Ie214f9f0039ac7c3a2dab8ffd14d30668bdb4c71
Signed-off-by: Mike Danese <mikedanese@google.com>
Reviewed-on: https://go-review.googlesource.com/37541
Reviewed-by: Filippo Valsorda <hi@filippo.io>
Reviewed-by: Adam Langley <agl@golang.org>
Run-TryBot: Adam Langley <agl@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-03-02 19:43:07 +00:00
Joe Tsai
2fdef4637a crypto/tls: use io.ReadFull in conn_test.go
An io.Reader does not guarantee that it will read in the entire buffer.
To ensure that property, io.ReadFull should be used instead.

Change-Id: I0b863135ab9abc40e813f9dac07bfb2a76199950
Reviewed-on: https://go-review.googlesource.com/37403
Reviewed-by: Mikio Hara <mikioh.mikioh@gmail.com>
Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-02-24 02:36:10 +00:00
Adam Langley
0fc02e2b6f crypto/tls: don't hold lock when closing underlying net.Conn.
There's no need to hold the handshake lock across this call and it can
lead to deadlocks if the net.Conn calls back into the tls.Conn.

Fixes #18426.

Change-Id: Ib1b2813cce385949d970f8ad2e52cfbd1390e624
Reviewed-on: https://go-review.googlesource.com/36561
Run-TryBot: Adam Langley <agl@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-02-09 19:02:55 +00:00
Максим Федосеев
14c17c5cf0 crypto/tls: fix link to more info about channel bindings
Link in the description of TLSUnique field of ConnectionState struct
leads to an article that is no longer available, so this commit
replaces it with link to a copy of the very same article on another
site.

Fixes #18842.

Change-Id: I8f8d298c4774dc0fbbad5042db0684bb3220aee8
Reviewed-on: https://go-review.googlesource.com/36052
Reviewed-by: Filippo Valsorda <hi@filippo.io>
Reviewed-by: Adam Langley <agl@golang.org>
2017-02-08 19:57:15 +00:00
Adam Langley
2a38c62848 crypto/tls: document that only tickets are supported.
This change clarifies that only ticket-based resumption is supported by
crypto/tls. It's not clear where to document this for a server,
although perhaps it's obvious there because there's nowhere to plug in
the storage that would be needed by SessionID-based resumption.

Fixes #18607

Change-Id: Iaaed53e8d8f2f45c2f24c0683052df4be6340922
Reviewed-on: https://go-review.googlesource.com/36560
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-02-08 17:54:06 +00:00
Daniel Martí
bdb5cb7a61 cmd/link, crypto/tls: don't use append loops
Change-Id: Ib47e295e8646b769c30fd81e5c7f20f964df163e
Reviewed-on: https://go-review.googlesource.com/36335
Reviewed-by: Filippo Valsorda <hi@filippo.io>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-02-07 16:42:32 +00:00
Adam Langley
905f7aea38 crypto/tls: reject SNI values with a trailing dot.
SNI values may not include a trailing dot according to
https://tools.ietf.org/html/rfc6066#section-3. Although crypto/tls
handled this correctly as a client, it didn't reject this as a server.

This change makes sending an SNI value with a trailing dot a fatal
error.

Updates #18114.

Change-Id: Ib7897ab40e98d4a7a4646ff8469a55233621f631
Reviewed-on: https://go-review.googlesource.com/33904
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-02-01 21:59:57 +00:00
Anmol Sethi
0c21fe3f19 crypto/tls: document ConnectionState.NegotiatedProtocol more clearly
ConnectionState.NegotiatedProtocol's documentation implies that it will
always be from Config.NextProtos. This commit clarifies that there is no
guarantee.

This commit also adds a note to
ConnectionState.NegotiatedProtocolIsMutual, making it clear that it is
client side only.

Fixes #18841

Change-Id: Icd028af8042f31e45575f1080c5e9bd3012e03d7
Reviewed-on: https://go-review.googlesource.com/35917
Reviewed-by: Filippo Valsorda <hi@filippo.io>
Reviewed-by: Adam Langley <agl@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Adam Langley <agl@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-02-01 21:48:27 +00:00
Filippo Valsorda
0fcebb3f32 crypto/tls: disable CBC cipher suites with SHA-256 by default
As is, they were fully vulnerable to the Lucky13 attack. The SHA1
variants implement limited countermeasures (see f28cf8346c4) but the
SHA256 ones are apparently used rarely enough (see 8741504888b) that
it's not worth the extra code.

Instead, disable them by default and update the warning.

Updates #13385
Updates #15487

Change-Id: I45b8b716001e2fa0811b17e25be76e2512e5abb2
Reviewed-on: https://go-review.googlesource.com/35290
Reviewed-by: Adam Langley <alangley@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Matt Layher <mdlayher@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-01-17 16:41:09 +00:00