1. 12 Nov, 2015 18 commits
  2. 11 Nov, 2015 18 commits
  3. 10 Nov, 2015 4 commits
    • Ian Lance Taylor's avatar
      cmd/cgo, runtime: add checks for passing pointers from Go to C · 9dcc58c3
      Ian Lance Taylor authored
      This implements part of the proposal in issue 12416 by adding dynamic
      checks for passing pointers from Go to C.  This code is intended to be
      on at all times.  It does not try to catch every case.  It does not
      implement checks on calling Go functions from C.
      
      The new cgo checks may be disabled using GODEBUG=cgocheck=0.
      
      Update #12416.
      
      Change-Id: I48de130e7e2e83fb99a1e176b2c856be38a4d3c8
      Reviewed-on: https://go-review.googlesource.com/16003Reviewed-by: default avatarRuss Cox <rsc@golang.org>
      9dcc58c3
    • Ralph Corderoy's avatar
      crypto/tls: len(clientRandom) used for serverRandom source · 9c8cd837
      Ralph Corderoy authored
      In keysFromMasterSecret(), don't copy from serverRandom into
      seed[:len(clientRandom)].  Actually, switch from an array to a slice in
      keysFromMasterSecret() and masterFromPreMasterSecret() so the length
      need not be given;  that's how it's done elsewhere in the file.
      
      Fixes #13181
      
      Change-Id: I92abaa892d1bba80c2d4f12776341cda7d538837
      Reviewed-on: https://go-review.googlesource.com/16697
      Run-TryBot: Adam Langley <agl@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarAdam Langley <agl@golang.org>
      9c8cd837
    • Adam Langley's avatar
      crypto/tls: don't send IP literals as SNI values. · 9f08b6c4
      Adam Langley authored
      (This relands commit a4dcc692.)
      
      https://tools.ietf.org/html/rfc6066#section-3 states:
      
        “Literal IPv4 and IPv6 addresses are not permitted in "HostName".”
      
      However, if an IP literal was set as Config.ServerName (which could
      happen as easily as calling Dial with an IP address) then the code would
      send the IP literal as the SNI value.
      
      This change filters out IP literals, as recognised by net.ParseIP, from
      being sent as the SNI value.
      
      Fixes #13111.
      
      Change-Id: I6e544a78a01388f8fe98150589d073b917087f75
      Reviewed-on: https://go-review.googlesource.com/16776
      Run-TryBot: Adam Langley <agl@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      Reviewed-by: default avatarRuss Cox <rsc@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      9f08b6c4
    • Vlad Krasnov's avatar
      crypto/elliptic,crypto/ecdsa: P256 amd64 assembly · 7bacfc64
      Vlad Krasnov authored
      This is based on the implementation used in OpenSSL, from a
      submission by Shay Gueron and myself. Besides using assembly,
      this implementation employs several optimizations described in:
      
          S.Gueron and V.Krasnov, "Fast prime field elliptic-curve
                                   cryptography with 256-bit primes"
      
      In addition a new and improved modular inverse modulo N is
      implemented here.
      
      The performance measured on a Haswell based Macbook Pro shows 21X
      speedup for the sign and 9X for the verify operations.
      The operation BaseMult is 30X faster (and the Diffie-Hellman/ECDSA
      key generation that use it are sped up as well).
      
      The adaptation to Go with the help of Filippo Valsorda
      
      Updated the submission for faster verify/ecdh, fixed some asm syntax
      and API problems and added benchmarks.
      
      Change-Id: I86a33636747d5c92f15e0c8344caa2e7e07e0028
      Reviewed-on: https://go-review.googlesource.com/8968
      Run-TryBot: Adam Langley <agl@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarAdam Langley <agl@golang.org>
      7bacfc64