linux-crypto.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tudor Ambarus <tudor.ambarus@microchip.com>
To: "Stephan Müller" <smueller@chronox.de>
Cc: <herbert@gondor.apana.org.au>, <davem@davemloft.net>,
	<linux-crypto@vger.kernel.org>, <marcel@holtmann.org>,
	<Nicolas.Ferre@microchip.com>
Subject: Re: [RFC PATCH v2 1/4] crypto: ecc - add privkey generation support
Date: Mon, 29 May 2017 16:27:23 +0300	[thread overview]
Message-ID: <f9602040-d25e-212e-f4f1-daea3a2e833a@microchip.com> (raw)
In-Reply-To: <1712750.5bvosCThh4@tauon.chronox.de>

Hi, Stephan,

On 29.05.2017 12:56, Stephan Müller wrote:
> Am Montag, 29. Mai 2017, 11:47:48 CEST schrieb Tudor Ambarus:
> 
> Hi Tudor,
> 
>>> Hm, there should be no blocking for the DRBG to initialize.
>>>
>>> What happens if you compile that as a module and insmod it at runtime?
>>
>> We will have a nop:
>>
>> #ifdef CONFIG_CRYPTO_MANAGER_DISABLE_TESTS
>>
>> /* a perfect nop */
>> int alg_test(const char *driver, const char *alg, u32 type, u32 mask)
>> {
>> 	printk(KERN_ERR "no op in alg_test");
>> 	return 0;
>> }
>>
>> #else
>> ...
>> #endif
>>
>> If I further mangle it and change #ifdef with #ifndef then the tests are
>> passing.
> 
> Can you please enable the testmgr in the kernel config and compile the DH/ECDH
> code as a module. Then I would insmod the dh/ecdh kernel module to see whether
> the self tests work or not.

dh/ecdh self tests are passing when I insert dh/ecdh modules.

> 
> Note, if you use the calls of crypto_get_default_rng and friends, the DRBG
> must be present in the kernel at the time of calling. I.e. if you statically
> compile dh/ecdh but compile the RNG support as a module, the RNG will not load
> during self test. If you compile dh/ecdh as a module, the RNG can stay as a
> module.

However, when the self tests are enabled and DH/ECDH code is built-in, 
the kernel blocks.

I have to ensure that the drivers are loaded in the right order. 
Deferring the probe or just simply changing the order of the object
files from crypto/Makefile solves the issue. I'll go with the second
approach.

Thanks,
ta

  reply	other threads:[~2017-05-29 13:27 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-17 15:26 [RFC PATCH v2 0/4] crypto: (ec)dh - add privkey generation support Tudor Ambarus
2017-05-17 15:26 ` [RFC PATCH v2 1/4] crypto: ecc " Tudor Ambarus
2017-05-28 18:44   ` Stephan Müller
2017-05-29  9:08     ` Tudor Ambarus
2017-05-29  9:23       ` Stephan Müller
2017-05-29  9:47         ` Tudor Ambarus
2017-05-29  9:56           ` Stephan Müller
2017-05-29 13:27             ` Tudor Ambarus [this message]
2017-05-17 15:26 ` [RFC PATCH v2 2/4] crypto: ecdh - allow user to provide NULL privkey Tudor Ambarus
2017-05-17 15:26 ` [RFC PATCH v2 3/4] crypto: dh " Tudor Ambarus
2017-05-28 18:50   ` Stephan Müller
2017-05-17 15:26 ` [RFC PATCH v2 4/4] crypto: testmgr - add genkey kpp test Tudor Ambarus
2017-05-26 13:44   ` Tudor Ambarus
2017-05-28 18:57   ` Stephan Müller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f9602040-d25e-212e-f4f1-daea3a2e833a@microchip.com \
    --to=tudor.ambarus@microchip.com \
    --cc=Nicolas.Ferre@microchip.com \
    --cc=davem@davemloft.net \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-crypto@vger.kernel.org \
    --cc=marcel@holtmann.org \
    --cc=smueller@chronox.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).