From: David Woodhouse Subject: Re: [RFC PATCH 8/8] KEYS: Implement PKCS#8 RSA Private Key parser [ver 3] Date: Wed, 11 May 2016 20:11:01 +0100 Message-ID: <1462993861.2484.7.camel@infradead.org> References: <20160511142152.4743.14414.stgit@warthog.procyon.org.uk> <20160511142252.4743.21903.stgit@warthog.procyon.org.uk> Mime-Version: 1.0 Content-Type: multipart/signed; micalg="sha-256"; protocol="application/x-pkcs7-signature"; boundary="=-nr3REleTD3r+0g0kjlkl" Cc: linux-kernel@vger.kernel.org, linux-security-module@vger.kernel.org, keyrings@vger.kernel.org, linux-crypto@vger.kernel.org To: David Howells , mathew.j.martineau@linux.intel.com, tadeusz.struk@intel.com Return-path: In-Reply-To: <20160511142252.4743.21903.stgit@warthog.procyon.org.uk> Sender: owner-linux-security-module@vger.kernel.org List-Id: linux-crypto.vger.kernel.org --=-nr3REleTD3r+0g0kjlkl Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, 2016-05-11 at 15:22 +0100, David Howells wrote: > Implement PKCS#8 RSA Private Key format [RFC 5208] parser for the > asymmetric key type.=C2=A0 For the moment, this will only support unencry= pted > DER blobs.=C2=A0 PEM and decryption can be added later. I would recommend *not* adding PEM and decryption support. That can live in userspace. You don't want to end up with the whole set of handlers for all the weird formats, from PKCS#12 to OpenSSL's non- standard encrypted PEM files. Trust me, I implemented a whole bunch of that for OpenConnect. You don't want it. Just mandate unencrypted binary PKCS#8 (or PKCS#1). --=20 David Woodhouse Open Source Technology Centre David.Woodhouse@intel.com Intel Corporation --=-nr3REleTD3r+0g0kjlkl Content-Type: application/x-pkcs7-signature; name="smime.p7s" Content-Disposition: attachment; filename="smime.p7s" Content-Transfer-Encoding: base64 MIAGCSqGSIb3DQEHAqCAMIACAQExDzANBglghkgBZQMEAgEFADCABgkqhkiG9w0BBwEAAKCCEeAw ggXiMIIDyqADAgECAhBrp4p9CteI1lEK+Vnk57ThMA0GCSqGSIb3DQEBCwUAMH0xCzAJBgNVBA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