Skip to content

Commit

Permalink
Fix an order dependent test by registering a fakekms client.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 603486600
Change-Id: Iaacaaefdd56075fa0a0ee1314d3311b2125f586e
  • Loading branch information
chuckx authored and copybara-github committed Feb 1, 2024
1 parent a9714fd commit 2a4a672
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions aead/kms_envelope_aead_key_manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (

"google.golang.org/protobuf/proto"
"github.com/tink-crypto/tink-go/v2/aead"
"github.com/tink-crypto/tink-go/v2/core/registry"
"github.com/tink-crypto/tink-go/v2/keyset"
"github.com/tink-crypto/tink-go/v2/mac"
"github.com/tink-crypto/tink-go/v2/testing/fakekms"
Expand Down Expand Up @@ -64,6 +65,12 @@ func TestNewKMSEnvelopeAEADKeyWithInvalidSerializedKeyFormat(t *testing.T) {
if err != nil {
t.Fatalf("fakekms.NewKeyURI() err = %v", err)
}
fakeClient, err := fakekms.NewClient(keyURI)
if err != nil {
t.Fatalf("fakekms.NewClient() err = %v", err)
}
registry.RegisterKMSClient(fakeClient)
defer registry.ClearKMSClients()

// Create DEK template with unset embedded key parameters.
dekFormat := &ctrhmacpb.AesCtrHmacAeadKeyFormat{
Expand Down

0 comments on commit 2a4a672

Please sign in to comment.