Skip to content

Commit

Permalink
fix(sdk): Error message improvements (#1176)
Browse files Browse the repository at this point in the history
- error messages should be unique to ease debugging
  • Loading branch information
dmihalcik-virtru authored Nov 5, 2024
1 parent 70518ff commit 0ef65d4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sdk/kas_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ func (k *KASClient) makeRewrapRequest(ctx context.Context, keyAccess KeyAccess,
func (k *KASClient) unwrap(ctx context.Context, keyAccess KeyAccess, policy string) ([]byte, error) {
response, err := k.makeRewrapRequest(ctx, keyAccess, policy)
if err != nil {
return nil, fmt.Errorf("error making request to kas: %w", err)
return nil, fmt.Errorf("error making rewrap request to kas: %w", err)
}

key, err := k.asymDecryption.Decrypt(response.GetEntityWrappedKey())
Expand Down Expand Up @@ -198,7 +198,7 @@ func (k *KASClient) unwrapNanoTDF(ctx context.Context, header string, kasURL str

response, err := k.makeNanoTDFRewrapRequest(ctx, header, kasURL, publicKeyAsPem)
if err != nil {
return nil, fmt.Errorf("error making request to kas: %w", err)
return nil, fmt.Errorf("error making nano rewrap request to kas: %w", err)
}

sessionKey, err := ocrypto.ComputeECDHKey([]byte(privateKeyAsPem), []byte(response.GetSessionPublicKey()))
Expand Down

0 comments on commit 0ef65d4

Please sign in to comment.