Skip to content

Commit a022ec0

Browse files
committed
KEYS: Add identifier pointers to public_key_signature struct
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>
1 parent 3b76456 commit a022ec0

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

crypto/asymmetric_keys/signature.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,11 @@
2424
*/
2525
void public_key_signature_free(struct public_key_signature *sig)
2626
{
27+
int i;
28+
2729
if (sig) {
30+
for (i = 0; i < ARRAY_SIZE(sig->auth_ids); i++)
31+
kfree(sig->auth_ids[i]);
2832
kfree(sig->s);
2933
kfree(sig->digest);
3034
kfree(sig);

include/crypto/public_key.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ extern void public_key_free(struct public_key *key);
4747
* Public key cryptography signature data
4848
*/
4949
struct public_key_signature {
50+
struct asymmetric_key_id *auth_ids[2];
5051
u8 *s; /* Signature */
5152
u32 s_size; /* Number of bytes in signature */
5253
u8 *digest;

0 commit comments

Comments
 (0)