Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: 🔒Enable and enforce boringcrypto experiment #2353

Merged
merged 1 commit into from
Jun 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,10 @@ test-ui-watch: ## Run UI unit tests
cd ui && $(MAKE) test

build-server: ## Build server for current OS/Arch
go build $(LDFLAGS) -o waved cmd/wave/main.go
GOEXPERIMENT=boringcrypto go build $(LDFLAGS) -o waved cmd/wave/main.go

build-db: ## Build database server for current OS/Arch
go build $(LDFLAGS) -o wavedb cmd/wavedb/main.go
GOEXPERIMENT=boringcrypto go build $(LDFLAGS) -o wavedb cmd/wavedb/main.go

build-db-micro:
go build -ldflags '-s -w -X main.Version=$(VERSION) -X main.BuildDate=$(BUILD_DATE)' -o wavedb cmd/wavedb/main.go
Expand Down Expand Up @@ -201,7 +201,7 @@ release-os:
rm -rf test/cypress/screenshots/*.*
rm -rf test/cypress/videos/*.*
rsync --exclude node_modules -a test build/$(REL)/
GOOS=$(OS) GOARCH=$(ARCH) go build $(LDFLAGS) -o build/$(REL)/waved$(EXE_EXT) cmd/wave/main.go
GOOS=$(OS) GOARCH=$(ARCH) GOEXPERIMENT=boringcrypto go build $(LDFLAGS) -o build/$(REL)/waved$(EXE_EXT) cmd/wave/main.go
cd build && tar -czf $(REL).tar.gz --exclude='*.state' --exclude='__pycache__' $(REL)

.PHONY: website
Expand Down
7 changes: 7 additions & 0 deletions cmd/wave/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,13 @@ import (
"strings"
"time"

// Blank import of "crypto/tls/fipsonly" enforces that only FIPS-approved algorithms
// are used for TLS.
// Package is only available only when GOEXPERIMENT=boringcrypto is set.
// We do not hide the import behind a build tag so that we enforce that the binary is built with
// the boring crypto experiment enabled.
_ "crypto/tls/fipsonly"

"github.com/h2oai/goconfig"
_ "github.com/h2oai/goconfig/env"
"github.com/h2oai/wave"
Expand Down
7 changes: 7 additions & 0 deletions cmd/wavedb/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@ import (
"fmt"
"runtime"

// Blank import of "crypto/tls/fipsonly" enforces that only FIPS-approved algorithms
// are used for TLS.
// Package is only available only when GOEXPERIMENT=boringcrypto is set.
// We do not hide the import behind a build tag so that we enforce that the binary is built with
// the boring crypto experiment enabled.
_ "crypto/tls/fipsonly"

"github.com/h2oai/wave/pkg/db"
"github.com/h2oai/wave/pkg/keychain"
)
Expand Down