Skip to content

Commit

Permalink
fix type detection for symmetric keys
Browse files Browse the repository at this point in the history
  • Loading branch information
lestrrat committed Nov 21, 2023
1 parent 94d41d2 commit 81f489f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion jwk/symmetric.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ func (k *symmetricKey) FromRaw(rawKey []byte) error {
func octetSeqToRaw(key Key, hint interface{}) (interface{}, error) {
switch key := key.(type) {
case *symmetricKey:
if _, ok := hint.([]byte); !ok {
switch hint.(type) {
case *[]byte, *interface{}:
default:
return nil, fmt.Errorf(`invalid destination object type %T for symmetric key: %w`, hint, ContinueError())
}
key.mu.RLock()
Expand Down

0 comments on commit 81f489f

Please sign in to comment.