Skip to content

Commit

Permalink
KEYS: Add identifier pointers to public_key_signature struct
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
dhowells committed Apr 6, 2016
1 parent 3b76456 commit a022ec0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions crypto/asymmetric_keys/signature.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
1 change: 1 addition & 0 deletions include/crypto/public_key.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit a022ec0

Please sign in to comment.