github.com/gagliardetto/golang-go@v0.0.0-20201020153340-53909ea70814/cmd/go/testdata/script/mod_sumdb.txt (about)

     1  env GO111MODULE=on
     2  env sumdb=$GOSUMDB
     3  env proxy=$GOPROXY
     4  env GOPROXY GONOPROXY GOSUMDB GONOSUMDB
     5  env dbname=localhost.localdev/sumdb
     6  
     7  # disagreeing with the sumdb produces security errors
     8  # (this also populates tiles on the sumdb server).
     9  cp go.mod.orig go.mod
    10  env GOSUMDB=$sumdb' '$proxy/sumdb-wrong
    11  ! go get -d rsc.io/quote
    12  stderr 'go get rsc.io/quote: rsc.io/quote@v1.5.2: verifying module: checksum mismatch'
    13  stderr 'downloaded: h1:3fEy'
    14  stderr 'localhost.localdev/sumdb: h1:wrong'
    15  stderr 'SECURITY ERROR\nThis download does NOT match the one reported by the checksum server.'
    16  ! go get -d rsc.io/sampler
    17  ! go get -d golang.org/x/text
    18  rm go.sum
    19  
    20  # switching to truthful sumdb detects timeline inconsistency
    21  cp go.mod.orig go.mod
    22  env GOSUMDB=$sumdb
    23  ! go get -d rsc.io/fortune
    24  stderr 'SECURITY ERROR\ngo.sum database server misbehavior detected!'
    25  stderr 'proof of misbehavior:'
    26  
    27  # removing the cached wrong tree head and cached tiles clears the bad data
    28  rm $GOPATH/pkg/sumdb/$dbname/latest
    29  go clean -modcache
    30  go get -d rsc.io/fortune
    31  
    32  -- go.mod.orig --
    33  module m