Re: [Ocf-linux-users] [PATCH - EP80579 driver update patch]
Brought to you by:
david-m
From: David M. <dav...@mc...> - 2010-03-10 06:14:02
|
Jivin Kennedy, Brendan lays it down ... > Hi Dave, All, > > Attached is an update to the EP80579 driver. It allows it to compile > under FreeBSD Opencrypto framework and fixes a few bugs. > > Would it be possible to include the updated code in your later releases > of OCF? Done, will be in the next release. > There??s also an update to cryptodev.c to allow a distinction between > a process fail and algorithm fail. This helps DSA verify functionality > when, for example, certain key sizes are not supported. > > There is a corresponding OpenSSL eng_cryptodev patch (third attachment) > if you want to check it out. This fixes some of the PKE ?? OCF calls. Ok, some questions for you on this one. For the change: - if (cryptodev_asym(&kop, BN_num_bytes(m), r, 0, NULL) == -1) { + if (cryptodev_asym(&kop, BN_num_bytes(m), r, 0, NULL)) { + printf("OCF asym process failed, Running in software\n"); + const RSA_METHOD *meth = RSA_PKCS1_SSLeay(); + ret = meth->bn_mod_exp(r, a, p, m, ctx, in_mont); + + } else if (ECANCELED == kop.crk_status) { + printf("OCF hardware operation cancelled. Running in Software\n"); const RSA_METHOD *meth = RSA_PKCS1_SSLeay(); ret = meth->bn_mod_exp(r, a, p, m, ctx, in_mont); } + /* else cryptodev operation worked ok ==> ret = 1*/ + This changes the behaviour for other drivers (safe/ixp) that will fall back to software on an ERANGE/E2BIG or any other error. Did you just want to be able to identify the HW condition that causes this separate to an error ? If so, then something like: if (cryptodev_asym(&kop, BN_num_bytes(m), r, 0, NULL)) { const RSA_METHOD *meth = RSA_PKCS1_SSLeay(); printf("OCF asym process failed, Running in software\n"); ret = meth->bn_mod_exp(r, a, p, m, ctx, in_mont); } else if (kop.crk_status) { const RSA_METHOD *meth = RSA_PKCS1_SSLeay(); printf("OCF hardware operation failed(%d). Running in Software\n", kop.crk_status); ret = meth->bn_mod_exp(r, a, p, m, ctx, in_mont); } /* else cryptodev operation worked ok ==> ret = 1*/ Should do. I don't think ECANCELED needs to be any different than any other driver error, but perhaps I am missing something. If this sounds ok I will fix up teh patch on the way in, Cheers, Davidm -- David McCullough, dav...@mc..., Ph:+61 734352815 McAfee - SnapGear http://www.mcafee.com http://www.uCdot.org |