KEYS: Add identifier pointers to public_key_signature struct
authorDavid Howells <dhowells@redhat.com>
Wed, 6 Apr 2016 15:13:33 +0000 (16:13 +0100)
committerDavid Howells <dhowells@redhat.com>
Wed, 6 Apr 2016 15:13:33 +0000 (16:13 +0100)
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
include/crypto/public_key.h

index 3beee3976ed5327f13f64b2afb4497a7e963ed4d..11b7ba1709041864868a6ca2b05680a20b5fb3f9 100644 (file)
  */
 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);
index 19f557ca50bab268f187c10f74107dc21352434e..2f5de5c1a3a08014f8448f7a4f7210fe35b48b23 100644 (file)
@@ -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;