Skip to content

Commit

Permalink
remove algorithmFromString
Browse files Browse the repository at this point in the history
Signed-off-by: qmuntal <qmuntaldiaz@microsoft.com>
  • Loading branch information
qmuntal committed Jul 4, 2023
1 parent 76a7047 commit 42d29c5
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 13 deletions.
5 changes: 0 additions & 5 deletions algorithm.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,3 @@ func computeHash(h crypto.Hash, data []byte) ([]byte, error) {
}
return hh.Sum(nil), nil
}

// NOTE: there are currently no registered string values for an algorithm.
func algorithmFromString(v string) Algorithm {
return AlgorithmInvalid
}
9 changes: 1 addition & 8 deletions headers.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,14 +119,7 @@ func (h ProtectedHeader) Algorithm() (Algorithm, error) {
case int64:
return Algorithm(alg), nil
case string:
v := algorithmFromString(alg)

var err error
if v == AlgorithmInvalid {
err = fmt.Errorf("unknown algorithm value %q", alg)
}

return v, err
return AlgorithmInvalid, fmt.Errorf("unknown algorithm value %q", alg)
default:
return AlgorithmInvalid, ErrInvalidAlgorithm
}
Expand Down

0 comments on commit 42d29c5

Please sign in to comment.