From: David Howells <dhowells@redhat.com>
To: keyrings@vger.kernel.org
Cc: dhowells@redhat.com, linux-security-module@vger.kernel.org,
linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 00/10] KEYS: Change how keys are determined to be trusted
Date: Wed, 21 Oct 2015 16:13:15 +0100 [thread overview]
Message-ID: <20151021151314.4583.90962.stgit@warthog.procyon.org.uk> (raw)
Here's a set of patches that changes how keys are determined to be trusted
- currently, that's a case of whether a key has KEY_FLAG_TRUSTED set upon
it. A keyring can then have a flag set (KEY_FLAG_TRUSTED ONLY) that
indicates that only keys with this flag set may be added to that keyring.
Further, any time an X.509 certificate is instantiated without this flag
set, the certificate is judged against the contents of the system trusted
keyring to determine whether KEY_FLAG_TRUSTED should be set upon it.
With these patches, KEY_FLAG_TRUSTED is removed. The kernel may add
implicitly trusted keys to a trusted-only keyring by asserting
KEY_ALLOC_TRUSTED when the key is created, but otherwise the key will only
be allowed to be added to the keyring if it can be verified by a key
already in that keyring. The system trusted keyring is not then special in
this sense and other trusted keyrings can be set up that are wholly
independent of it.
To make this work, we have to retain sufficient data from the X.509
certificate that we can then verify the signature at need.
The patches can be found here also:
http://git.kernel.org/cgit/linux/kernel/git/dhowells/linux-fs.git/log/?h=keys-trust
and are tagged with:
keys-trust-20151021
David
---
David Howells (10):
KEYS: Generalise system_verify_data() to provide access to internal content
PKCS#7: Make trust determination dependent on contents of trust keyring
KEYS: Add facility to check key trustworthiness upon link creation
KEYS: Allow authentication data to be stored in an asymmetric key
KEYS: Add identifier pointers to public_key_signature struct
X.509: Retain the key verification data
X.509: Extract signature digest and make self-signed cert checks earlier
PKCS#7: Make the signature a pointer rather than embedding it
X.509: Move the trust validation code out to its own file
KEYS: Move the point of trust determination to __key_link()
Documentation/security/keys.txt | 17 ++
arch/x86/kernel/kexec-bzimage64.c | 18 --
certs/system_keyring.c | 49 +++--
crypto/asymmetric_keys/Kconfig | 1
crypto/asymmetric_keys/Makefile | 4
crypto/asymmetric_keys/asymmetric_keys.h | 2
crypto/asymmetric_keys/asymmetric_type.c | 22 ++
crypto/asymmetric_keys/mscode_parser.c | 21 +-
crypto/asymmetric_keys/pkcs7_key_type.c | 64 +++---
crypto/asymmetric_keys/pkcs7_parser.c | 59 +++--
crypto/asymmetric_keys/pkcs7_parser.h | 11 -
crypto/asymmetric_keys/pkcs7_trust.c | 44 ++--
crypto/asymmetric_keys/pkcs7_verify.c | 108 ++++------
crypto/asymmetric_keys/public_key.c | 43 ++++
crypto/asymmetric_keys/public_key.h | 6 +
crypto/asymmetric_keys/public_key_trust.c | 180 +++++++++++++++++
crypto/asymmetric_keys/verify_pefile.c | 40 +---
crypto/asymmetric_keys/verify_pefile.h | 5
crypto/asymmetric_keys/x509_cert_parser.c | 53 +++--
crypto/asymmetric_keys/x509_parser.h | 12 -
crypto/asymmetric_keys/x509_public_key.c | 312 +++++++++--------------------
include/crypto/pkcs7.h | 6 -
include/crypto/public_key.h | 28 +--
include/keys/asymmetric-subtype.h | 6 -
include/keys/asymmetric-type.h | 8 -
include/keys/system_keyring.h | 7 -
include/linux/key-type.h | 10 +
include/linux/key.h | 12 +
include/linux/verification.h | 49 +++++
include/linux/verify_pefile.h | 22 --
kernel/module_signing.c | 5
security/integrity/digsig_asymmetric.c | 5
security/keys/key.c | 44 +++-
security/keys/keyring.c | 18 +-
34 files changed, 735 insertions(+), 556 deletions(-)
create mode 100644 crypto/asymmetric_keys/public_key_trust.c
create mode 100644 include/linux/verification.h
delete mode 100644 include/linux/verify_pefile.h
next reply other threads:[~2015-10-21 15:13 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-21 15:13 David Howells [this message]
2015-10-21 15:13 ` [PATCH 01/10] KEYS: Generalise system_verify_data() to provide access to internal content David Howells
2015-10-21 15:13 ` [PATCH 02/10] PKCS#7: Make trust determination dependent on contents of trust keyring David Howells
2015-10-21 15:13 ` [PATCH 03/10] KEYS: Add facility to check key trustworthiness upon link creation David Howells
2015-10-21 15:13 ` [PATCH 04/10] KEYS: Allow authentication data to be stored in an asymmetric key David Howells
2015-10-21 15:14 ` [PATCH 05/10] KEYS: Add identifier pointers to public_key_signature struct David Howells
2015-10-21 15:14 ` [PATCH 06/10] X.509: Retain the key verification data David Howells
2015-10-21 15:14 ` [PATCH 07/10] X.509: Extract signature digest and make self-signed cert checks earlier David Howells
2015-10-21 15:14 ` [PATCH 08/10] PKCS#7: Make the signature a pointer rather than embedding it David Howells
2015-10-21 15:14 ` [PATCH 09/10] X.509: Move the trust validation code out to its own file David Howells
2015-10-21 15:14 ` [PATCH 10/10] KEYS: Move the point of trust determination to __key_link() David Howells
2015-10-21 17:02 ` [PATCH 00/10] KEYS: Change how keys are determined to be trusted Mimi Zohar
2015-10-21 17:21 ` Josh Boyer
2015-10-21 18:11 ` Mimi Zohar
2015-10-21 18:21 ` Josh Boyer
2015-10-21 18:33 ` Mimi Zohar
2015-10-21 18:48 ` Petko Manolov
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=20151021151314.4583.90962.stgit@warthog.procyon.org.uk \
--to=dhowells@redhat.com \
--cc=keyrings@vger.kernel.org \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-security-module@vger.kernel.org \
/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
all inboxes | Powered by JetHome®