Skip to content

Commit

Permalink
fix: issue with listing versioned keys
Browse files Browse the repository at this point in the history
  • Loading branch information
praetoriansentry committed Jan 4, 2024
1 parent 54ac7c3 commit 7cf896e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions cmd/signer/signer.go
Original file line number Diff line number Diff line change
Expand Up @@ -328,9 +328,11 @@ func (g *GCPKMS) ListKeyRingKeys(ctx context.Context) error {
if err != nil {
return err
}

pubKey, err := getPublicKeyByName(ctx, c, fmt.Sprintf("%s/cryptoKeyVersions/%d", resp.Name, *inputSignerOpts.gcpKeyVersion))
if err != nil {
return err
log.Error().Err(err).Str("name", resp.Name).Msg("key not found")
continue
}
ethAddress := gcpPubKeyToEthAddress(pubKey)

Expand Down Expand Up @@ -544,7 +546,7 @@ func wrapKeyForGCPKMS(ctx context.Context, client *kms.KeyManagementClient) ([]b

// Generate a temporary 32-byte key for AES-KWP and wrap the key material.
kwpKey := make([]byte, 32)
if _, err := rand.Read(kwpKey); err != nil {
if _, err = rand.Read(kwpKey); err != nil {
return nil, fmt.Errorf("failed to generate AES-KWP key: %w", err)
}
kwp, err := subtle.NewKWP(kwpKey)
Expand Down Expand Up @@ -755,7 +757,7 @@ func sanityCheck(cmd *cobra.Command, args []string) error {
keyStoreMethods += 1
}
if keyStoreMethods > 1 {
return fmt.Errorf("Multiple conflicting keystore mults were specified")
return fmt.Errorf("Multiple conflicting keystore sources were specified")
}
pwErr := passwordValidation(*inputSignerOpts.unsafePassword)
if *inputSignerOpts.unsafePassword != "" && pwErr != nil {
Expand Down

0 comments on commit 7cf896e

Please sign in to comment.