Skip to content

Commit

Permalink
fix to find cipher both by name and id
Browse files Browse the repository at this point in the history
  • Loading branch information
bykovme committed Feb 26, 2023
1 parent 54fddc4 commit d1a60f1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions internal/pkg/security/security.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"github.com/oxipass/oxilib/internal/pkg/oxierr"
)

func (enc OxiEncryptor) GetCypherNames() []string {
func (enc *OxiEncryptor) GetCypherNames() []string {
var lCyphers []string
for _, cypher := range oxicrypt.GetCiphers() {
lCyphers = append(lCyphers, cypher.Description)
Expand All @@ -30,9 +30,9 @@ func (enc *OxiEncryptor) Init(cryptID string) error {
return oxierr.FormError(oxierr.BSERR00004EncCypherNotExist, "OxiEncryptor.Init", "CryptID: "+cryptID)
}

func (enc OxiEncryptor) GetCryptIDbyName(cypherName string) (string, error) {
func (enc *OxiEncryptor) GetCryptIDbyName(cypherName string) (string, error) {
for _, cypher := range oxicrypt.GetCiphers() {
if cypher.Description == cypherName {
if cypher.Description == cypherName || cypher.ID == cypherName {
return cypher.ID, nil
}
}
Expand Down

0 comments on commit d1a60f1

Please sign in to comment.