From e201af16d1ec76ccd19b90484d767984ff451f18 Mon Sep 17 00:00:00 2001 From: Thiago Jung Bauermann Date: Thu, 27 Jun 2019 23:19:26 -0300 Subject: PKCS#7: Introduce pkcs7_get_digest() IMA will need to access the digest of the PKCS7 message (as calculated by the kernel) before the signature is verified, so introduce pkcs7_get_digest() for that purpose. Also, modify pkcs7_digest() to detect when the digest was already calculated so that it doesn't have to do redundant work. Verifying that sinfo->sig->digest isn't NULL is sufficient because both places which allocate sinfo->sig (pkcs7_parse_message() and pkcs7_note_signed_info()) use kzalloc() so sig->digest is always initialized to zero. Signed-off-by: Thiago Jung Bauermann Reviewed-by: Mimi Zohar Cc: David Howells Cc: David Woodhouse Cc: Herbert Xu Cc: "David S. Miller" Signed-off-by: Mimi Zohar --- include/crypto/pkcs7.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include/crypto') diff --git a/include/crypto/pkcs7.h b/include/crypto/pkcs7.h index 96071bee03ac..38ec7f5f9041 100644 --- a/include/crypto/pkcs7.h +++ b/include/crypto/pkcs7.h @@ -9,6 +9,7 @@ #define _CRYPTO_PKCS7_H #include +#include #include struct key; @@ -40,4 +41,7 @@ extern int pkcs7_verify(struct pkcs7_message *pkcs7, extern int pkcs7_supply_detached_data(struct pkcs7_message *pkcs7, const void *data, size_t datalen); +extern int pkcs7_get_digest(struct pkcs7_message *pkcs7, const u8 **buf, + u32 *len, enum hash_algo *hash_algo); + #endif /* _CRYPTO_PKCS7_H */ -- cgit v1.2.3 t' method='get' action='/linux/log/drivers/net/can/sja1000'>
AgeCommit message (Expand)AuthorFilesLines
2016-01-24Linux 4.5-rc1v4.5-rc1Linus Torvalds1-2/+2
2016-01-24ideapad-laptop: Add Lenovo Yoga 700 to no_hw_rfkill dmi listJosh Boyer1-0/+7
2016-01-24MAINTAINERS: Combine multiple telemetry entriesSouvik Kumar Chakravarty1-3/+1
2016-01-24intel_telemetry_debugfs: Fix unused warnings in telemetry debugfsSouvik Kumar Chakravarty1-0/+2
2016-01-24vmstat: Remove BUG_ON from vmstat_updateChristoph Lameter1-11/+1
2016-01-24MIPS: zboot: Add support for serial debug using the PROMAlban Bedel3-0/+12
2016-01-24MIPS: zboot: Avoid useless rebuildsAlban Bedel1-6/+8
2016-01-24MIPS: BMIPS: Enable ARCH_WANT_OPTIONAL_GPIOLIBFlorian Fainelli1-0/+1
2016-01-24MIPS: bcm63xx: nvram: Remove unused bcm63xx_nvram_get_psi_size() functionSimon Arlott2-13/+0
2016-01-24MIPS: bcm963xx: Update bcm_tag field image_sequenceSimon Arlott1-6/+5
2016-01-24MIPS: bcm963xx: Move extended flash address to bcm_tag header fileSimon Arlott2-4/+7
2016-01-24MIPS: bcm963xx: Move Broadcom BCM963xx image tag data structureSimon Arlott3-4/+7
2016-01-24MIPS: bcm63xx: nvram: Use nvram structure definition from header fileSimon Arlott1-32/+3
2016-01-24MIPS: bcm963xx: Add Broadcom BCM963xx board nvram data structureSimon Arlott2-0/+113
2016-01-24MAINTAINERS: Add KVM for MIPS entryJames Hogan1-0/+8
2016-01-24MIPS: KVM: Add missing newline to kvm_err()James Hogan1-1/+1
2016-01-24MIPS: Move KVM specific opcodes into asm/inst.hJames Hogan4-28/+5
2016-01-24MIPS: KVM: Use cacheops.h definitionsJames Hogan1-22/+8
2016-01-24MIPS: Break down cacheops.h definitionsJames Hogan1-42/+64
2016-01-24MIPS: Use EXCCODE_ constants with set_except_vector()James Hogan2-30/+30
2016-01-24MIPS: Update trap codesJames Hogan1-2/+10
2016-01-24MIPS: Move Cause.ExcCode trap codes to mipsregs.hJames Hogan5-83/+80
2016-01-24MIPS: KVM: Make kvm_mips_{init,exit}() staticJames Hogan1-2/+2
2016-01-24MIPS: KVM: Refactor added offsetof()sJames Hogan1-7/+3
2016-01-24MIPS: KVM: Convert EXPORT_SYMBOL to _GPLJames Hogan2-19/+19
2016-01-24MIPS: KVM: Drop unused kvm_mips_host_tlb_inv_index()James Hogan2-38/+0
2016-01-24MIPS: Move definition of DC bit to mipsregs.hJames Hogan2-3/+2
2016-01-24MIPS: KVM: Drop some unused definitions from kvm_host.hJames Hogan1-5/+0
2016-01-24MIPS: KVM: Trivial whitespace and style fixesJames Hogan5-15/+14