Merge tag 'rtc-5.4' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux
[linux-2.6-block.git] / crypto / aead.c
index fbf0ec93bc8e1ea343ea19ab276a2f112df9c336..ce035589cf577b962423de8181d3520daf260818 100644 (file)
@@ -70,7 +70,8 @@ int crypto_aead_setauthsize(struct crypto_aead *tfm, unsigned int authsize)
 {
        int err;
 
-       if (authsize > crypto_aead_maxauthsize(tfm))
+       if ((!authsize && crypto_aead_maxauthsize(tfm)) ||
+           authsize > crypto_aead_maxauthsize(tfm))
                return -EINVAL;
 
        if (crypto_aead_alg(tfm)->setauthsize) {