]> Cypherpunks repositories - gostls13.git/commit
crypto/tls: Add mutex to protect KeyLogWriter
authorJoonas Kuorilehto <joneskoo@derbian.fi>
Sat, 10 Sep 2016 19:07:33 +0000 (22:07 +0300)
committerBrad Fitzpatrick <bradfitz@golang.org>
Sat, 10 Sep 2016 21:31:48 +0000 (21:31 +0000)
commitf30598dd71b5bb7109eda56b02ea10d2b6cc1362
tree87d86a8c24fca8f1aff898d5c31a2869243e5dd6
parentc564aebce99fb92b8dc26b203f4f32e4977c0aed
crypto/tls: Add mutex to protect KeyLogWriter

Concurrent use of tls.Config is allowed, and may lead to
KeyLogWriter being written to concurrently. Without a mutex
to protect it, corrupted output may occur. A mutex is added
for correctness.

The mutex is made global to save size of the config struct as
KeyLogWriter is rarely enabled.

Related to #13057.

Change-Id: I5ee55b6d8b43a191ec21f06e2aaae5002a71daef
Reviewed-on: https://go-review.googlesource.com/29016
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
src/crypto/tls/common.go