public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: David Howells <dhowells@redhat.com>
To: keyrings@vger.kernel.org
Cc: dhowells@redhat.com, linux-security-module@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: [RFC PATCH 3/7] KEYS: Add identifier pointers to public_key_signature struct
Date: Mon, 29 Feb 2016 18:21:57 +0000	[thread overview]
Message-ID: <20160229182157.27797.49359.stgit@warthog.procyon.org.uk> (raw)
In-Reply-To: <20160229182136.27797.75917.stgit@warthog.procyon.org.uk>

Add key identifier pointers to public_key_signature struct so that they can
be used to retain the identifier of the key to be used to verify the
signature in both PKCS#7 and X.509.

Signed-off-by: David Howells <dhowells@redhat.com>
---

 crypto/asymmetric_keys/signature.c |    4 ++++
 include/crypto/public_key.h        |    1 +
 2 files changed, 5 insertions(+)

diff --git a/crypto/asymmetric_keys/signature.c b/crypto/asymmetric_keys/signature.c
index 3beee3976ed5..11b7ba170904 100644
--- a/crypto/asymmetric_keys/signature.c
+++ b/crypto/asymmetric_keys/signature.c
@@ -24,7 +24,11 @@
  */
 void public_key_signature_free(struct public_key_signature *sig)
 {
+	int i;
+
 	if (sig) {
+		for (i = 0; i < ARRAY_SIZE(sig->auth_ids); i++)
+			kfree(sig->auth_ids[i]);
 		kfree(sig->s);
 		kfree(sig->digest);
 		kfree(sig);
diff --git a/include/crypto/public_key.h b/include/crypto/public_key.h
index 19f557ca50ba..2f5de5c1a3a0 100644
--- a/include/crypto/public_key.h
+++ b/include/crypto/public_key.h
@@ -47,6 +47,7 @@ extern void public_key_free(struct public_key *key);
  * Public key cryptography signature data
  */
 struct public_key_signature {
+	struct asymmetric_key_id *auth_ids[2];
 	u8 *s;			/* Signature */
 	u32 s_size;		/* Number of bytes in signature */
 	u8 *digest;

  parent reply	other threads:[~2016-02-29 18:22 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-29 18:21 [RFC PATCH 0/7] KEYS: Adjust public key signature handling David Howells
2016-02-29 18:21 ` [RFC PATCH 1/7] X.509: Whitespace cleanup David Howells
2016-02-29 18:21 ` [RFC PATCH 2/7] KEYS: Allow authentication data to be stored in an asymmetric key David Howells
2016-02-29 18:21 ` David Howells [this message]
2016-02-29 18:22 ` [RFC PATCH 4/7] X.509: Retain the key verification data David Howells
2016-02-29 18:22 ` [RFC PATCH 5/7] PKCS#7: Make the signature a pointer rather than embedding it David Howells
2016-02-29 18:22 ` [RFC PATCH 6/7] X.509: Extract signature digest and make self-signed cert checks earlier David Howells
2016-02-29 18:22 ` [RFC PATCH 7/7] There's a bug in the code determining whether a certificate is self-signed David Howells
2016-03-02 12:10 ` [RFC PATCH 0/7] KEYS: Adjust public key signature handling Mimi Zohar
2016-03-02 12:24   ` David Howells
2016-03-02 15:00     ` Mimi Zohar
2016-03-04 11:22   ` David Howells

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=20160229182157.27797.49359.stgit@warthog.procyon.org.uk \
    --to=dhowells@redhat.com \
    --cc=keyrings@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