Re: [Ocf-linux-users] crypto_newsession / crypto_freesession
Brought to you by:
david-m
|
From: David M. <Dav...@se...> - 2009-01-28 23:58:33
|
Jivin Pirasenna Thiyagarajan lays it down ... > I've used OCF patch and attempting to use the cryptodev interface. In > ocf-compat.h, I see crypto_newsession's session ID is passed in as a > u_int32_t *, whereas, the crypto_freesession takes the session id as > u_int64_t. It seems like this is in error. Looks like sid data type should > be u_int64_t *sidp. In cryptodev.c where it is used, the sid is defined as > u_int64_t in cryptodev_ioctl. I had to look twice at that too now that you point it out. The trick is that device_method_t structure and resulting CRYPTODEV_NEWSESSION and cryptodev_newsession used for it are part of the interface for OCF drivers. This is how OCF communicates with it's crypto drivers (ie., safe, hifn7751, cryptosoft etc). cryptodev, the user interface driver, doesn't talk to the crypto drivers, it uses the OCF API's: crypto_newsession crypto_freesession and they are both u_int64_t. Are you having a problem with cryptodev or did you just notice this oddity in the code ? I admit the naming is confusing, but we inherited that with that last round of BSD updates. Unless you are writing a driver, ignore the section at the top of ocf-compat.h, in fact, ignore as much of ocf-compat.h as you can every chance you get :-) It's where we hide the older OS support and some BSD compat things to try and keep the driver source as close to the original as practical. Cheers, Davidm -- David McCullough, dav...@se..., Ph:+61 734352815 Secure Computing - SnapGear http://www.uCdot.org http://www.snapgear.com |