Skip to content

Commit

Permalink
fix: encryption parameters validation switch
Browse files Browse the repository at this point in the history
  • Loading branch information
gllm-dev committed Sep 6, 2024
1 parent e1e8d8d commit 3024902
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [v0.1.21]
### Fixed
- Register Share encryption validation switch

## [v0.1.20]
### Fixed
- Register Share encryption validation for entropy `none`
Expand Down
3 changes: 1 addition & 2 deletions internal/adapters/handlers/rest/sharehdl/validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ func (v *validator) validateShare(share *Share) *api.Error {
}

switch share.Entropy {
case EntropyNone:
case "":
case "", EntropyNone:
if share.Salt != "" || share.Iterations != 0 || share.Length != 0 || share.Digest != "" || share.EncryptionPart != "" || share.EncryptionSession != "" {
return api.ErrBadRequestWithMessage("if entropy is not set, encryption parameters should not be set")
}
Expand Down

0 comments on commit 3024902

Please sign in to comment.