diff --git a/internal/user/user_manager.go b/internal/user/user_manager.go index b73625251..f1432017f 100644 --- a/internal/user/user_manager.go +++ b/internal/user/user_manager.go @@ -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, diff --git a/internal/user/user_profile_pw_hash.go b/internal/user/user_profile_pw_hash.go index c01a8502f..d1c58e222 100644 --- a/internal/user/user_profile_pw_hash.go +++ b/internal/user/user_profile_pw_hash.go @@ -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...)