linux-stable/include/crypto
David Howells bc1c373dd2 MODSIGN: Provide a utility to append a PKCS#7 signature to a module
Provide a utility that:

 (1) Digests a module using the specified hash algorithm (typically sha256).

     [The digest can be dumped into a file by passing the '-d' flag]

 (2) Generates a PKCS#7 message that:

     (a) Has detached data (ie. the module content).

     (b) Is signed with the specified private key.

     (c) Refers to the specified X.509 certificate.

     (d) Has an empty X.509 certificate list.

     [The PKCS#7 message can be dumped into a file by passing the '-p' flag]

 (3) Generates a signed module by concatenating the old module, the PKCS#7
     message, a descriptor and a magic string.  The descriptor contains the
     size of the PKCS#7 message and indicates the id_type as PKEY_ID_PKCS7.

 (4) Either writes the signed module to the specified destination or renames
     it over the source module.

This allows module signing to reuse the PKCS#7 handling code that was added
for PE file parsing for signed kexec.

Note that the utility is written in C and must be linked against the OpenSSL
crypto library.

Note further that I have temporarily dropped support for handling externally
created signatures until we can work out the best way to do those.  Hopefully,
whoever creates the signature can give me a PKCS#7 certificate.

Signed-off-by: David Howells <dhowells@redhat.com>
Tested-by: Vivek Goyal <vgoyal@redhat.com>
2015-08-07 16:26:13 +01:00
..
internal crypto: rng - Do not free default RNG when it becomes unused 2015-06-22 15:49:18 +08:00
ablk_helper.h crypto: create generic version of ablk_helper 2013-09-24 06:02:24 +10:00
aead.h crypto: doc - Fix typo in crypto-API.xml 2015-06-04 15:05:08 +08:00
aes.h
akcipher.h crypto: akcipher - add PKE API 2015-06-17 17:03:14 +08:00
algapi.h crypto: aead - Convert top level interface to new style 2015-05-13 10:31:53 +08:00
authenc.h crypto: authenc - Export key parsing helper function 2013-10-16 20:56:25 +08:00
b128ops.h
blowfish.h crypto: blowfish - split generic and common c code 2011-09-22 21:25:25 +10:00
cast5.h crypto: cast5/cast6 - move lookup tables to shared module 2012-12-06 17:16:26 +08:00
cast6.h crypto: cast5/cast6 - move lookup tables to shared module 2012-12-06 17:16:26 +08:00
cast_common.h crypto: cast5/cast6 - move lookup tables to shared module 2012-12-06 17:16:26 +08:00
compress.h crypto: pcomp - Constify (de)compression parameters 2015-05-01 11:16:37 +08:00
cryptd.h crypto: cryptd - Add missing aead.h inclusion 2015-05-13 10:31:46 +08:00
crypto_wq.h
ctr.h
des.h crypto: des_3des - add x86-64 assembly implementation 2014-06-20 21:27:58 +08:00
drbg.h crypto: drbg - reseed often if seedsource is degraded 2015-06-10 19:14:05 +08:00
gf128mul.h
hash.h crypto: doc - Fix typo in crypto-API.xml 2015-06-04 15:05:08 +08:00
hash_info.h crypto: provide single place for hash algo information 2013-10-25 17:14:03 -04:00
if_alg.h crypto: af_alg - Allow to link sgl 2015-03-23 16:41:37 -04:00
lrw.h crypto: lrw - add interface for parallelized cipher implementions 2011-11-09 11:50:31 +08:00
mcryptd.h crypto: sha-mb - multibuffer crypto infrastructure 2014-08-25 20:32:25 +08:00
md5.h crypto: md5 - add MD5 initial vectors 2015-05-18 12:20:18 +08:00
null.h crypto: null - Add default null skcipher 2015-05-22 11:25:55 +08:00
padlock.h crypto: padlock - Move padlock.h into include/crypto 2011-01-07 14:52:00 +11:00
pcrypt.h
pkcs7.h PKCS#7: Allow detached data to be supplied for signature checking purposes 2015-08-07 16:26:13 +01:00
public_key.h MODSIGN: Provide a utility to append a PKCS#7 signature to a module 2015-08-07 16:26:13 +01:00
rng.h crypto: doc - Fix typo in crypto-API.xml 2015-06-04 15:05:08 +08:00
scatterwalk.h crypto: scatterwalk - Add scatterwalk_ffwd helper 2015-05-22 11:25:50 +08:00
serpent.h crypto: serpent-sse2 - add lrw support 2011-11-21 16:13:24 +08:00
sha.h crypto: sha512-generic - move to generic glue implementation 2015-04-10 21:39:41 +08:00
sha1_base.h crypto: sha1 - implement base layer for SHA-1 2015-04-10 21:39:39 +08:00
sha256_base.h crypto: sha256 - implement base layer for SHA-256 2015-04-10 21:39:39 +08:00
sha512_base.h crypto: sha512 - implement base layer for SHA-512 2015-04-10 21:39:39 +08:00
skcipher.h crypto: Resolve shadow warnings 2014-08-01 22:35:55 +08:00
twofish.h crypto: twofish-x86_64-3way - add lrw support 2011-11-09 11:53:32 +08:00
vmac.h crypto: vmac - Make VMAC work when blocks aren't aligned 2012-10-15 22:33:20 +08:00
xts.h crypto: xts: add interface for parallelized cipher implementations 2011-11-09 11:56:06 +08:00