2012-04-16 05:29:23

by Larry Finger

[permalink] [raw]
Subject: Problem with crypto when initializing TKIP

I am trying to fix the driver r8192e_pci from the staging tree. It works fine
with WEP and CCMP encryption, but it fails when trying to initialize TKIP. This
driver does not use mac80211, but incorporates its own softmac routines.

This problem is a regression between 3.2.0 and 3.3.0, but I was unable to get a
reasonable result using bisection.

Routine rtllib_tkip_init() from drivers/staging/rtl8192e/rtllib_crypt_tkip.c
does the same set of steps as is done in mac80211. Everything works with mac80211.

The block cipher allocation calls to crypto_alloc_blkcipher("ecb(arc4)",...) are
OK. The crypto_alloc_hash("michael_mic",...) call is the part that fails. The
problem shows up in the code fragment below from crypto/api.c:

ok = crypto_probing_notify(CRYPTO_MSG_ALG_REQUEST, larval);

if (ok == NOTIFY_STOP)
alg = crypto_larval_wait(larval);
else {
crypto_mod_put(larval);
alg = ERR_PTR(-ENOENT);
}

The value of ok is NOTIFY_OK, which leads to a return of -ENOENT and a failure
of the initialization.

I know this code is pretty old, and perhaps nobody remembers it, but I would
appreciate some pointers on debugging this issue.

Thanks,

Larry


2012-04-16 15:51:29

by Larry Finger

[permalink] [raw]
Subject: Re: Problem with crypto when initializing TKIP

On 04/16/2012 07:48 AM, Herbert Xu wrote:
> On Mon, Apr 16, 2012 at 12:29:19AM -0500, Larry Finger wrote:
>>
>> The value of ok is NOTIFY_OK, which leads to a return of -ENOENT and
>> a failure of the initialization.
>
> NOTIFY_OK means that we have no notifiers installed. Did you
> compile/load CRYPTO_MANAGER?

Thanks for responding. The CRYPTO_MANAGER is built in, but your suggestion got
me into the correct area. For some unknown reason, CONFIG_MICHAEL_MIC was
dropped from my configuration. When I added it, everything works.

I will improve the error message in the driver.

Thanks again,

Larry

2012-04-16 13:28:30

by Herbert Xu

[permalink] [raw]
Subject: Re: Problem with crypto when initializing TKIP

On Mon, Apr 16, 2012 at 12:29:19AM -0500, Larry Finger wrote:
>
> The value of ok is NOTIFY_OK, which leads to a return of -ENOENT and
> a failure of the initialization.

NOTIFY_OK means that we have no notifiers installed. Did you
compile/load CRYPTO_MANAGER?

Cheers,
--
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt