From a79a69d9f5a9cd9c4e7ff03b7f7f82ca22bc8bdf Mon Sep 17 00:00:00 2001 From: hc-github-team-secure-vault-core <82990506+hc-github-team-secure-vault-core@users.noreply.github.com> Date: Thu, 19 May 2022 16:57:55 -0400 Subject: [PATCH] Remove spurious fmt.Printf calls including one of a key (#15344) (#15516) Co-authored-by: Christopher Swenson --- builtin/credential/aws/pkcs7/decrypt.go | 1 - builtin/credential/aws/pkcs7/verify_test_dsa.go | 3 +-- builtin/logical/rabbitmq/path_role_create.go | 1 - command/server/config_test_helpers.go | 1 - helper/dhutil/dhutil.go | 2 -- 5 files changed, 1 insertion(+), 7 deletions(-) diff --git a/builtin/credential/aws/pkcs7/decrypt.go b/builtin/credential/aws/pkcs7/decrypt.go index 0d088d6287c9c..acedb1ec92afc 100644 --- a/builtin/credential/aws/pkcs7/decrypt.go +++ b/builtin/credential/aws/pkcs7/decrypt.go @@ -60,7 +60,6 @@ func (eci encryptedContentInfo) decrypt(key []byte) ([]byte, error) { !alg.Equal(OIDEncryptionAlgorithmAES128CBC) && !alg.Equal(OIDEncryptionAlgorithmAES128GCM) && !alg.Equal(OIDEncryptionAlgorithmAES256GCM) { - fmt.Printf("Unsupported Content Encryption Algorithm: %s\n", alg) return nil, ErrUnsupportedAlgorithm } diff --git a/builtin/credential/aws/pkcs7/verify_test_dsa.go b/builtin/credential/aws/pkcs7/verify_test_dsa.go index 1eb05bc3eae66..860b11b6d11ad 100644 --- a/builtin/credential/aws/pkcs7/verify_test_dsa.go +++ b/builtin/credential/aws/pkcs7/verify_test_dsa.go @@ -5,7 +5,6 @@ package pkcs7 import ( "crypto/x509" "encoding/pem" - "fmt" "io/ioutil" "os" "os/exec" @@ -108,7 +107,7 @@ but that's not what ships are built for. if err != nil { t.Fatal(err) } - fmt.Printf("%s\n", pemSignature) + t.Logf("%s\n", pemSignature) derBlock, _ := pem.Decode(pemSignature) if derBlock == nil { t.Fatalf("failed to read DER block from signature PEM %s", tmpSignedFile.Name()) diff --git a/builtin/logical/rabbitmq/path_role_create.go b/builtin/logical/rabbitmq/path_role_create.go index 35cc34c1b0bcf..58b1edbb5280b 100644 --- a/builtin/logical/rabbitmq/path_role_create.go +++ b/builtin/logical/rabbitmq/path_role_create.go @@ -74,7 +74,6 @@ func (b *backend) pathCredsRead(ctx context.Context, req *logical.Request, d *fr if err != nil { return nil, fmt.Errorf("failed to generate username: %w", err) } - fmt.Printf("username: %s\n", username) password, err := b.generatePassword(ctx, config.PasswordPolicy) if err != nil { diff --git a/command/server/config_test_helpers.go b/command/server/config_test_helpers.go index 106ad7dce22b6..0ff33bcc09a22 100644 --- a/command/server/config_test_helpers.go +++ b/command/server/config_test_helpers.go @@ -320,7 +320,6 @@ func testParseEntropy(t *testing.T, oss bool) { case err != test.outErr: t.Fatalf("error mismatch: expected %#v got %#v", err, test.outErr) case err == nil && config.Entropy != nil && *config.Entropy != test.outEntropy: - fmt.Printf("\n config.Entropy: %#v", config.Entropy) t.Fatalf("entropy config mismatch: expected %#v got %#v", test.outEntropy, *config.Entropy) } } diff --git a/helper/dhutil/dhutil.go b/helper/dhutil/dhutil.go index a86314c200e87..a0ddde25bd43a 100644 --- a/helper/dhutil/dhutil.go +++ b/helper/dhutil/dhutil.go @@ -6,7 +6,6 @@ import ( "crypto/cipher" "crypto/rand" "crypto/sha256" - "encoding/hex" "errors" "fmt" "io" @@ -90,7 +89,6 @@ func DeriveSharedKey(secret, ourPublic, theirPublic []byte) ([]byte, error) { if n != 32 { return nil, errors.New("short read from hkdf") } - fmt.Printf("Key: %s\n", hex.EncodeToString(key[:])) return key[:], nil }