Skip to content
This repository has been archived by the owner on Apr 22, 2024. It is now read-only.

FIPS enabled message using the logging framework #77

Merged
merged 3 commits into from
Mar 6, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
2 changes: 2 additions & 0 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ func main() {
&signal.Handler{}, // handle graceful termination
)

internal.LogFIPS() // Print the FIPS status
nacx marked this conversation as resolved.
Show resolved Hide resolved

if err := g.Run(); err != nil {
fmt.Printf("Unexpected exit: %v\n", err)
os.Exit(-1)
Expand Down
2 changes: 1 addition & 1 deletion config/gen/go/v1/config.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion config/gen/go/v1/mock/config.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion config/gen/go/v1/oidc/config.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 22 additions & 0 deletions internal/fips_disabled.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// Copyright 2024 Tetrate
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

//go:build !boringcrypto

package internal

// LogFIPS logs whether FIPS is enabled or not.
func LogFIPS() {
Logger(Default).Info("FIPS: boringcrypto", "enabled", false)
}
13 changes: 5 additions & 8 deletions cmd/fips.go → internal/fips_enabled.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,11 @@

//go:build boringcrypto

package main
package internal

import (
"crypto/boring"
"fmt"
)
import "crypto/boring"

// This line will only be printed in the output if boringcrypto is enabled.
func init() {
fmt.Println("FIPS: boringcrypto enabled:", boring.Enabled())
// LogFIPS logs whether FIPS is enabled or not.
func LogFIPS() {
Logger(Default).Info("FIPS: boringcrypto", "enabled", boring.Enabled())
}