lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 25 Nov 2009 05:35:16 -0500
From:	"Youquan,Song" <youquan.song@...ux.intel.com>
To:	Herbert Xu <herbert@...dor.apana.org.au>
Cc:	"Youquan,Song" <youquan.song@...ux.intel.com>,
	linux-kernel@...r.kernel.org, ying.huang@...el.com,
	kent.liu@...el.com, youquan.song@...el.com
Subject: Re: [PATCH]crypto: Fix algorithm and driver duplicate registered

> On Mon, Nov 23, 2009 at 12:47:24PM -0500, Youquan,Song wrote:
> >
> > The alg->cra_name and alg->cra_driver_name, from the description,
> > cra_name is the algorithm name and cra_driver_name is the driver name.
> 
> For each algorithm you may have an arbitrary number of drivers
> implementing it.  The driver name must be unique.  However,
> duplicates are allowed so that a new version of a driver may
> be loaded while the older instances of it are still in use.
> 
> > But when I read the code, I often get confuse about these two names.
> > They often mix each other.  
> > 
> > Can you give me some instruction about them? or Can we make them more clear? Thanks. 
> 
> Well can you tell me what exactly confuses you?

Thanks. 
For example:

struct crypto_alg *crypto_larval_lookup(const char *name, u32 type, u32
mask)

The parameter "name",  sometime it is "alg->cra_name" while sometime it
become "alg->cra_driver_name". What's to lookup, algorithm or driver, depends on
the context of parameter, So it need confirm no duplicate name exists between 
cra_driver_name and cra_name. Therefore, there are some werid checking needed, 
such as following:

                if (!strcmp(q->cra_driver_name, alg->cra_name) ||
                    !strcmp(q->cra_name, alg->cra_driver_name))


I wonder, Can we define two functions: one lookup algorithm other lookup
driver? It will be more clear. 
 

Thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ