Skip to content
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
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,12 @@ if(PRODUCTION)
endif()
configure_file(enclave/coordinator.conf coordinator.conf)

# Sign enclave
add_custom_command(
OUTPUT coordinator-enclave.signed
DEPENDS coordinator-enclave ${CMAKE_BINARY_DIR}/coordinator.conf signing-key
# Add fips140 verification checksum, which is usually added by the Go linker, which is not used with -buildmode=c-archive
COMMAND go run github.com/edgelesssys/goelffips@latest $<TARGET_FILE:coordinator-enclave>
# Sign enclave
COMMAND openenclave::oesign sign -e $<TARGET_FILE:coordinator-enclave> -c
${CMAKE_BINARY_DIR}/coordinator.conf -k private.pem)

Expand Down
2 changes: 1 addition & 1 deletion build_with_version.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ set(PROJECT_VERSION ${CMAKE_ARGV4})
set(OUTPUT_NAME ${CMAKE_ARGV5})
set(INJECT_PATH ${CMAKE_ARGV6})
set(TRIMPATH ${CMAKE_ARGV7})

set(ENV{GOFIPS140} latest)

if("${COMPILER}" STREQUAL "go")
execute_process(
Expand Down
5 changes: 5 additions & 0 deletions cmd/coordinator/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ package main
import (
"bytes"
"context"
"crypto/fips140"
"encoding/binary"
"encoding/hex"
"errors"
Expand Down Expand Up @@ -52,6 +53,10 @@ func run(log *zap.Logger, validator quote.Validator, issuer quote.Issuer, sealDi

log.Info("Starting coordinator", zap.String("version", Version), zap.String("commit", GitCommit), zap.Bool("distributed", distributedDeployment))

if !fips140.Enabled() {
log.Fatal("FIPS 140 not enabled")
}

// fetching env vars
dnsNamesString := util.Getenv(constants.DNSNames, constants.DNSNamesDefault)
dnsNames := strings.Split(dnsNamesString, ",")
Expand Down