Linux-Security-Module Archive on lore.kernel.org
 help / color / Atom feed
From: Jessica Yu <jeyu@kernel.org>
To: Stefan Berger <stefanb@linux.ibm.com>
Cc: keyrings@vger.kernel.org, dhowells@redhat.com,
	zohar@linux.ibm.com, jarkko@kernel.org, nayna@linux.ibm.com,
	linux-integrity@vger.kernel.org,
	linux-security-module@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 2/2] certs: Add support for using elliptic curve keys for signing modules
Date: Wed, 21 Apr 2021 14:58:05 +0200
Message-ID: <YIAhXfFiHjzPU19U@gunter> (raw)
In-Reply-To: <c562e50f-b25c-4cf0-80c7-a5aa56d0d5f7@linux.ibm.com>

+++ Stefan Berger [21/04/21 08:54 -0400]:
>
>On 4/21/21 8:52 AM, Jessica Yu wrote:
>>+++ Stefan Berger [20/04/21 17:02 -0400]:
>>>
>>>On 4/20/21 10:03 AM, Jessica Yu wrote:
>>>>+++ Stefan Berger [08/04/21 11:24 -0400]:
>>>>>
>>>>>diff --git a/crypto/asymmetric_keys/pkcs7_parser.c 
>>>>>b/crypto/asymmetric_keys/pkcs7_parser.c
>>>>>index 967329e0a07b..2546ec6a0505 100644
>>>>>--- a/crypto/asymmetric_keys/pkcs7_parser.c
>>>>>+++ b/crypto/asymmetric_keys/pkcs7_parser.c
>>>>>@@ -269,6 +269,10 @@ int pkcs7_sig_note_pkey_algo(void 
>>>>>*context, size_t hdrlen,
>>>>>        ctx->sinfo->sig->pkey_algo = "rsa";
>>>>>        ctx->sinfo->sig->encoding = "pkcs1";
>>>>>        break;
>>>>>+    case OID_id_ecdsa_with_sha256:
>>>>>+        ctx->sinfo->sig->pkey_algo = "ecdsa";
>>>>>+        ctx->sinfo->sig->encoding = "x962";
>>>>>+        break;
>>>>
>>>>Hi Stefan,
>>>>
>>>>Does CONFIG_MODULE_SIG_KEY_TYPE_ECDSA have a dependency on 
>>>>MODULE_SIG_SHA256?
>>>
>>>You are right, per the code above it does have a dependency on 
>>>SHA256. ECDSA is using NIST p384 (secp384r1) for signing and per 
>>>my tests it can be paired with all the sha hashes once the code 
>>>above is extended. Now when it comes to module signing, should we 
>>>pair it with a particular hash? I am not currently aware of a 
>>>guidance document on this but sha256 and sha384 seem to be good 
>>>choices these days, so maybe selecting ECDSA module signing should 
>>>have a 'depends on' on these?
>>
>>Yeah, I would tack on the 'depends on' until the code above has been
>>extended to cover more sha hashes - because currently if someone
>>builds and signs a bunch of modules with an ECDSA key, they will fail
>>to load if they picked something other than sha256. I am unfortunately
>>not knowledgeable enough to suggest an official guideline on choice of
>>hash, but for now it is reasonable to have a 'depends on' for which
>>hashes the code currently supports, so that users don't run into
>>module loading rejection issues.
>
>
>I was going to repost this series now with the additional OIDs 
>supported above and a recommendation to use sha384 in the help text 
>for ECDSA-signed modules, but not enforcing this but instead trusting 
>the user that they will choose a reasonable hash (probably >= sha256).

OK, that sounds good to me.

Thanks Stefan!


      reply index

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-08 15:24 [PATCH v2 0/2] Add support for ECDSA-signed kernel modules Stefan Berger
2021-04-08 15:24 ` [PATCH v2 1/2] certs: Trigger creation of RSA module signing key if it's not an RSA key Stefan Berger
2021-04-08 17:15   ` Mimi Zohar
2021-04-08 19:19     ` Stefan Berger
2021-04-08 21:34       ` Mimi Zohar
2021-04-08 15:24 ` [PATCH v2 2/2] certs: Add support for using elliptic curve keys for signing modules Stefan Berger
2021-04-08 17:15   ` Mimi Zohar
2021-04-20 14:03   ` Jessica Yu
2021-04-20 21:02     ` Stefan Berger
2021-04-21 12:52       ` Jessica Yu
2021-04-21 12:54         ` Stefan Berger
2021-04-21 12:58           ` Jessica Yu [this message]

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=YIAhXfFiHjzPU19U@gunter \
    --to=jeyu@kernel.org \
    --cc=dhowells@redhat.com \
    --cc=jarkko@kernel.org \
    --cc=keyrings@vger.kernel.org \
    --cc=linux-integrity@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=nayna@linux.ibm.com \
    --cc=stefanb@linux.ibm.com \
    --cc=zohar@linux.ibm.com \
    /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

Linux-Security-Module Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-security-module/0 linux-security-module/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-security-module linux-security-module/ https://lore.kernel.org/linux-security-module \
		linux-security-module@vger.kernel.org
	public-inbox-index linux-security-module

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-security-module


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git