Skip to content

Commit c8fd070

Browse files
committed
update go to 1.26.1
1 parent 63f002d commit c8fd070

5 files changed

Lines changed: 41 additions & 3 deletions

File tree

_ertgo

Submodule _ertgo updated 2616 files

dockerfiles/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ RUN apt-get install -y --no-install-recommends \
1313

1414
ARG erttag=v0.5.1
1515
ARG egotag=v1.8.1
16-
RUN wget -qO- https://go.dev/dl/go1.25.6.linux-amd64.tar.gz | tar -C /usr/local -xz \
16+
RUN wget -qO- https://go.dev/dl/go1.26.1.linux-amd64.tar.gz | tar -C /usr/local -xz \
1717
&& git clone -b $erttag --depth=1 https://github.com/edgelesssys/edgelessrt \
1818
&& git clone -b $egotag --depth=1 https://github.com/edgelesssys/ego \
1919
&& mkdir ertbuild egobuild

dockerfiles/Dockerfile.focal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
1313

1414
ARG erttag=v0.5.1
1515
ARG egotag=v1.8.1
16-
RUN wget -qO- https://go.dev/dl/go1.25.6.linux-amd64.tar.gz | tar -C /usr/local -xz \
16+
RUN wget -qO- https://go.dev/dl/go1.26.1.linux-amd64.tar.gz | tar -C /usr/local -xz \
1717
&& git clone -b $erttag --depth=1 https://github.com/edgelesssys/edgelessrt \
1818
&& git clone -b $egotag --depth=1 https://github.com/edgelesssys/ego \
1919
&& mkdir ertbuild egobuild

ego/cmd/integration-test/main.go

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,10 @@
77
package main
88

99
import (
10+
"crypto/rand"
1011
"io"
1112
"log"
13+
"math"
1214
"os"
1315

1416
"github.com/edgelesssys/ego/ego/test"
@@ -28,6 +30,7 @@ func main() {
2830
testFileSystemMounts(assert, require)
2931
testEnvVars(assert, require)
3032
testCpuid(assert, require)
33+
testRand(assert, require)
3134
}
3235

3336
func testFileSystemMounts(assert *assert.Assertions, require *require.Assertions) {
@@ -104,3 +107,32 @@ func testEnvVars(assert *assert.Assertions, require *require.Assertions) {
104107
func testCpuid(assert *assert.Assertions, require *require.Assertions) {
105108
assert.True(cpuid.CPU.Has(cpuid.CMOV))
106109
}
110+
111+
func testRand(assert *assert.Assertions, require *require.Assertions) {
112+
// This test
113+
// - does a sanity check of returned randomness
114+
// - implicitly verifies that FIPS entropy initialization succeeds when built with GOFIPS140
115+
buf := make([]byte, 8192)
116+
n, err := rand.Read(buf)
117+
require.NoError(err)
118+
require.Equal(8192, n)
119+
assert.Greater(entropy(buf), 7.9)
120+
}
121+
122+
func entropy(data []byte) float64 {
123+
var freq [256]int
124+
for _, b := range data {
125+
freq[b]++
126+
}
127+
128+
lenData := float64(len(data))
129+
var entropy float64
130+
for _, n := range freq {
131+
if n > 0 {
132+
p := float64(n) / lenData
133+
entropy -= p * math.Log2(p)
134+
}
135+
}
136+
137+
return entropy
138+
}

ego/test/t.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,12 @@ func (t *T) FailNow() {
3131

3232
// Exit exits the program with an appropriate exit code.
3333
func (t *T) Exit() {
34+
// This func is usually run deferred, so repanic on panic
35+
// because otherwise the test would be marked as passed.
36+
if e := recover(); e != nil {
37+
panic(e)
38+
}
39+
3440
var msg string
3541
if t.exitCode == 0 {
3642
msg = "passed"

0 commit comments

Comments
 (0)