Pārlūkot izejas kodu

go 1.11: Switch to GO 1.11

Minimal amount of changes needed to switch to GO 1.11
* crypto/internal/cipherhw was removed and internal/cpu was introduced
* wrong code formatting in handhsake_server_test.go was breaking
  the build
v1.2.3
Kris Kwiatkowski pirms 6 gadiem
committed by Kris Kwiatkowski
vecāks
revīzija
86b0aecf5e
4 mainītis faili ar 20 papildinājumiem un 8 dzēšanām
  1. +1
    -1
      .travis.yml
  2. +1
    -1
      _dev/bogo/Dockerfile
  3. +14
    -2
      common.go
  4. +4
    -4
      handshake_server_test.go

+ 1
- 1
.travis.yml Parādīt failu

@@ -5,7 +5,7 @@ services:
- docker

go:
- 1.10.x
- 1.11.x

env:
- TEST_SUITE=test-unit


+ 1
- 1
_dev/bogo/Dockerfile Parādīt failu

@@ -1,4 +1,4 @@
FROM golang:1.10-alpine
FROM golang:1.11-alpine

RUN apk add --update \
git \


+ 14
- 2
common.go Parādīt failu

@@ -7,12 +7,12 @@ package tls
import (
"container/list"
"crypto"
"crypto/internal/cipherhw"
"crypto/rand"
"crypto/sha512"
"crypto/x509"
"errors"
"fmt"
"internal/cpu"
"io"
"math/big"
"net"
@@ -1127,7 +1127,19 @@ func defaultTLS13CipherSuites() []uint16 {

func initDefaultCipherSuites() {
var topCipherSuites, topTLS13CipherSuites []uint16
if cipherhw.AESGCMSupport() {

// Check the cpu flags for each platform that has optimized GCM implementations.
// Worst case, these variables will just all be false
hasGCMAsmAMD64 := cpu.X86.HasAES && cpu.X86.HasPCLMULQDQ

hasGCMAsmARM64 := cpu.ARM64.HasAES && cpu.ARM64.HasPMULL

// Keep in sync with crypto/aes/cipher_s390x.go.
hasGCMAsmS390X := cpu.S390X.HasAES && cpu.S390X.HasAESCBC && cpu.S390X.HasAESCTR && (cpu.S390X.HasGHASH || cpu.S390X.HasAESGCM)

hasGCMAsm := hasGCMAsmAMD64 || hasGCMAsmARM64 || hasGCMAsmS390X

if hasGCMAsm {
// If AES-GCM hardware is provided then prioritise AES-GCM
// cipher suites.
topTLS13CipherSuites = []uint16{


+ 4
- 4
handshake_server_test.go Parādīt failu

@@ -197,9 +197,9 @@ func TestDontSelectRSAWithECDSAKey(t *testing.T) {

func TestRenegotiationExtension(t *testing.T) {
clientHello := &clientHelloMsg{
vers: VersionTLS12,
compressionMethods: []uint8{compressionNone},
random: make([]byte, 32),
vers: VersionTLS12,
compressionMethods: []uint8{compressionNone},
random: make([]byte, 32),
secureRenegotiationSupported: true,
cipherSuites: []uint16{TLS_RSA_WITH_RC4_128_SHA},
}
@@ -1002,7 +1002,7 @@ func TestFallbackSCSV(t *testing.T) {
name: "FallbackSCSV",
config: &serverConfig,
// OpenSSL 1.0.1j is needed for the -fallback_scsv option.
command: []string{"openssl", "s_client", "-fallback_scsv"},
command: []string{"openssl", "s_client", "-fallback_scsv"},
expectHandshakeErrorIncluding: "inappropriate protocol fallback",
}
runServerTestTLS11(t, test)


Notiek ielāde…
Atcelt
Saglabāt