mirror of
https://github.com/torvalds/linux.git
synced 2024-11-12 15:11:50 +00:00
b3426827c8
To avoid code duplication this patch refactors asymmetric_key_match(), making partial ID string match a separate function. This patch also implicitly fixes a bug in the code. asymmetric_key_match() allows to match the key by its subtype. But subtype matching could be undone if asymmetric_key_id(key) would return NULL. This patch first checks for matching spec and then for its value. Signed-off-by: Dmitry Kasatkin <d.kasatkin@samsung.com> Signed-off-by: Mimi Zohar <zohar@linux.vnet.ibm.com>
18 lines
580 B
C
18 lines
580 B
C
/* Internal definitions for asymmetric key type
|
|
*
|
|
* Copyright (C) 2012 Red Hat, Inc. All Rights Reserved.
|
|
* Written by David Howells (dhowells@redhat.com)
|
|
*
|
|
* This program is free software; you can redistribute it and/or
|
|
* modify it under the terms of the GNU General Public Licence
|
|
* as published by the Free Software Foundation; either version
|
|
* 2 of the Licence, or (at your option) any later version.
|
|
*/
|
|
|
|
int asymmetric_keyid_match(const char *kid, const char *id);
|
|
|
|
static inline const char *asymmetric_key_id(const struct key *key)
|
|
{
|
|
return key->type_data.p[1];
|
|
}
|