Skip to content

Commit

Permalink
chore(cli): cleanup user profile errors (kopia#3889)
Browse files Browse the repository at this point in the history
  • Loading branch information
julio-lopez committed May 30, 2024
1 parent ddbd8ed commit 7fd6e59
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions internal/user/user_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ func ListUserProfiles(ctx context.Context, rep repo.Repository) ([]*Profile, err
}

// GetUserProfile returns the user profile with a given username.
// Returns ErrUserNotFound when the user does not exist.
func GetUserProfile(ctx context.Context, r repo.Repository, username string) (*Profile, error) {
manifests, err := r.FindManifests(ctx, map[string]string{
manifest.TypeLabelKey: ManifestType,
Expand Down
2 changes: 1 addition & 1 deletion internal/user/user_profile_pw_hash.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func (p *Profile) setPassword(password string) error {
func computePasswordHash(password string, salt []byte, keyDerivationAlgorithm string) ([]byte, error) {
key, err := crypto.DeriveKeyFromPassword(password, salt, passwordHashLength, keyDerivationAlgorithm)
if err != nil {
return nil, errors.Wrap(err, "error deriving key from password")
return nil, errors.Wrap(err, "error hashing password")
}

payload := append(append([]byte(nil), salt...), key...)
Expand Down

0 comments on commit 7fd6e59

Please sign in to comment.