Skip to content

Commit

Permalink
appease linter
Browse files Browse the repository at this point in the history
  • Loading branch information
lestrrat committed Nov 21, 2023
1 parent 479c643 commit 94d41d2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion jwk/okp.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ func buildOKPPrivateKey(alg jwa.EllipticCurveAlgorithm, xbuf []byte, dbuf []byte
}

// This is half baked. I think it will blow up if we used ecdh.* keys and/or x25519 keys
func okpJWKToRaw(key Key, hint interface{}) (interface{}, error) {
func okpJWKToRaw(key Key, _ interface{} /* this is unused because this is half baked */) (interface{}, error) {
switch key := key.(type) {
case *okpPrivateKey:
key.mu.RLock()
Expand Down
3 changes: 3 additions & 0 deletions jwk/symmetric.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +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 {
return nil, fmt.Errorf(`invalid destination object type %T for symmetric key: %w`, hint, ContinueError())
}
key.mu.RLock()
defer key.mu.RUnlock()
octets := make([]byte, len(key.octets))
Expand Down

0 comments on commit 94d41d2

Please sign in to comment.