From 4815f92fa87b52afb2efa6ca1570ea235ba96ee6 Mon Sep 17 00:00:00 2001 From: Andreas Auernhammer Date: Sat, 1 May 2021 03:47:30 +0200 Subject: [PATCH] fix MINIO_KMS_SECRET_KEY env. variable parsing (#12200) This commit fixes a bug when parsing the env. variable `MINIO_KMS_SECRET_KEY`. Before, the env. variable name - instead of its value - was parsed. This (obviously) did not work properly. This commit fixes this. Signed-off-by: Andreas Auernhammer --- cmd/common-main.go | 2 +- .../identity/openid/ecdsa-sha3_contrib.go | 29 ++++++++---------- .../identity/openid/rsa-sha3_contrib.go | 30 +++++++++---------- 3 files changed, 28 insertions(+), 33 deletions(-) diff --git a/cmd/common-main.go b/cmd/common-main.go index e5df02cdc..83baad223 100644 --- a/cmd/common-main.go +++ b/cmd/common-main.go @@ -340,7 +340,7 @@ func handleCommonEnvVars() { } if env.IsSet(config.EnvKMSSecretKey) { - GlobalKMS, err = kms.Parse(config.EnvKMSSecretKey) + GlobalKMS, err = kms.Parse(env.Get(config.EnvKMSSecretKey, "")) if err != nil { logger.Fatal(err, "Unable to parse the KMS secret key inherited from the shell environment") } diff --git a/cmd/config/identity/openid/ecdsa-sha3_contrib.go b/cmd/config/identity/openid/ecdsa-sha3_contrib.go index 93fc539ab..1a9a367c7 100644 --- a/cmd/config/identity/openid/ecdsa-sha3_contrib.go +++ b/cmd/config/identity/openid/ecdsa-sha3_contrib.go @@ -1,20 +1,17 @@ -// +build !fips +// MinIO Object Storage (c) 2021 MinIO, Inc. +// +// 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. -/* - * MinIO Object Storage (c) 2021 MinIO, Inc. - * - * 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. - */ +// +build !fips package openid diff --git a/cmd/config/identity/openid/rsa-sha3_contrib.go b/cmd/config/identity/openid/rsa-sha3_contrib.go index cf29cd824..bba855849 100644 --- a/cmd/config/identity/openid/rsa-sha3_contrib.go +++ b/cmd/config/identity/openid/rsa-sha3_contrib.go @@ -1,20 +1,18 @@ -// +build !fips +// MinIO Object Storage (c) 2021 MinIO, Inc. +// +// 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. -/* - * MinIO Object Storage (c) 2021 MinIO, Inc. - * - * 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. - */ +// +build !fips package openid