You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
X.509: Make algo identifiers text instead of enum
Make the identifier public key and digest algorithm fields text instead of enum. Signed-off-by: David Howells <dhowells@redhat.com> Acked-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
#include <linux/ratelimit.h>
|
||||
#include <linux/key-type.h>
|
||||
#include <crypto/public_key.h>
|
||||
#include <crypto/hash_info.h>
|
||||
#include <keys/asymmetric-type.h>
|
||||
#include <keys/system_keyring.h>
|
||||
|
||||
@@ -94,7 +95,7 @@ int asymmetric_verify(struct key *keyring, const char *sig,
|
||||
if (siglen != __be16_to_cpu(hdr->sig_size))
|
||||
return -EBADMSG;
|
||||
|
||||
if (hdr->hash_algo >= PKEY_HASH__LAST)
|
||||
if (hdr->hash_algo >= HASH_ALGO__LAST)
|
||||
return -ENOPKG;
|
||||
|
||||
key = request_asymmetric_key(keyring, __be32_to_cpu(hdr->keyid));
|
||||
@@ -103,8 +104,8 @@ int asymmetric_verify(struct key *keyring, const char *sig,
|
||||
|
||||
memset(&pks, 0, sizeof(pks));
|
||||
|
||||
pks.pkey_algo = PKEY_ALGO_RSA;
|
||||
pks.pkey_hash_algo = hdr->hash_algo;
|
||||
pks.pkey_algo = "rsa";
|
||||
pks.hash_algo = hash_algo_name[hdr->hash_algo];
|
||||
pks.digest = (u8 *)data;
|
||||
pks.digest_size = datalen;
|
||||
pks.s = hdr->sig;
|
||||
|
||||
@@ -94,7 +94,7 @@ struct ima_digest_data {
|
||||
struct signature_v2_hdr {
|
||||
uint8_t type; /* xattr type */
|
||||
uint8_t version; /* signature format version */
|
||||
uint8_t hash_algo; /* Digest algorithm [enum pkey_hash_algo] */
|
||||
uint8_t hash_algo; /* Digest algorithm [enum hash_algo] */
|
||||
uint32_t keyid; /* IMA key identifier - not X509/PGP specific */
|
||||
uint16_t sig_size; /* signature size */
|
||||
uint8_t sig[0]; /* signature payload */
|
||||
|
||||
Reference in New Issue
Block a user