Skip to content

Commit

Permalink
crypto: cmac - return -EINVAL if block size is unsupported
Browse files Browse the repository at this point in the history
cmac_create() previously returned 0 if a cipher with a block size other
than 8 or 16 bytes was specified.  It should return -EINVAL instead.
Granted, this doesn't actually change any behavior because cryptomgr
currently ignores any return value other than -EAGAIN from template
->create() functions.

Signed-off-by: Eric Biggers <[email protected]>
Signed-off-by: Herbert Xu <[email protected]>
  • Loading branch information
ebiggers authored and herbertx committed Oct 21, 2016
1 parent 9c8ae17 commit 48ee41b
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions crypto/cmac.c
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@ static int cmac_create(struct crypto_template *tmpl, struct rtattr **tb)
case 8:
break;
default:
err = -EINVAL;
goto out_put_alg;
}

Expand Down

0 comments on commit 48ee41b

Please sign in to comment.