linux/crypto
David Howells 4ae71c1dce KEYS: Provide signature verification with an asymmetric key
Provide signature verification using an asymmetric-type key to indicate the
public key to be used.

The API is a single function that can be found in crypto/public_key.h:

	int verify_signature(const struct key *key,
			     const struct public_key_signature *sig)

The first argument is the appropriate key to be used and the second argument
is the parsed signature data:

	struct public_key_signature {
		u8 *digest;
		u16 digest_size;
		enum pkey_hash_algo pkey_hash_algo : 8;
		union {
			MPI mpi[2];
			struct {
				MPI s;		/* m^d mod n */
			} rsa;
			struct {
				MPI r;
				MPI s;
			} dsa;
		};
	};

This should be filled in prior to calling the function.  The hash algorithm
should already have been called and the hash finalised and the output should
be in a buffer pointed to by the 'digest' member.

Any extra data to be added to the hash by the hash format (eg. PGP) should
have been added by the caller prior to finalising the hash.

It is assumed that the signature is made up of a number of MPI values.  If an
algorithm becomes available for which this is not the case, the above structure
will have to change.

It is also assumed that it will have been checked that the signature algorithm
matches the key algorithm.

Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-10-08 13:50:15 +10:30
..
asymmetric_keys KEYS: Provide signature verification with an asymmetric key 2012-10-08 13:50:15 +10:30
async_tx crypto: remove the second argument of k[un]map_atomic() 2012-03-20 21:48:16 +08:00
Kconfig KEYS: Implement asymmetric key type 2012-10-08 13:50:12 +10:30
Makefile KEYS: Implement asymmetric key type 2012-10-08 13:50:12 +10:30
ablkcipher.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2012-04-10 14:30:45 -04:00
aead.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2012-04-10 14:30:45 -04:00
aes_generic.c crypto: aes_generic - Fix checkpatch errors 2010-02-16 20:34:59 +08:00
af_alg.c atomic: use <linux/atomic.h> 2011-07-26 16:49:47 -07:00
ahash.c crypto: Stop using NLA_PUT*(). 2012-04-02 04:33:42 -04:00
algapi.c crypto: algapi - Move larval completion into algboss 2012-06-22 20:08:29 +08:00
algboss.c crypto: algapi - Fix hang on crypto allocation 2012-06-27 20:59:12 +08:00
algif_hash.c crypto: algif_hash - Handle initial af_alg_make_sg error correctly 2011-06-30 07:44:06 +08:00
algif_skcipher.c crypto: algif_skcipher - Handle unaligned receive buffer 2010-11-30 17:04:31 +08:00
ansi_cprng.c crypto: ansi_cprng - enforce key != seed in fips mode 2011-11-09 12:04:06 +08:00
anubis.c crypto: anubis - Fix checkpatch errors 2010-02-16 20:25:39 +08:00
api.c crypto: api - Fix checkpatch errors 2010-02-16 20:26:46 +08:00
arc4.c crypto: arc4 - improve performance by using u32 for ctx and variables 2012-06-14 10:07:23 +08:00
authenc.c crypto: authenc - Fix crash with zero-length assoc data 2012-09-11 12:05:45 +08:00
authencesn.c crypto: authencesn - Add algorithm to handle IPsec extended sequence numbers 2011-03-13 20:22:27 -07:00
blkcipher.c crypto: Stop using NLA_PUT*(). 2012-04-02 04:33:42 -04:00
blowfish_common.c crypto: blowfish - split generic and common c code 2011-09-22 21:25:25 +10:00
blowfish_generic.c crypto: blowfish - rename C-version to blowfish_generic 2011-09-22 21:25:26 +10:00
camellia_generic.c crypto: camellia - rename camellia.c to camellia_generic.c 2012-03-14 17:25:55 +08:00
cast5.c crypto: cast5 - simplify if-statements 2010-11-13 21:47:55 +09:00
cast6.c crypto: cast6 - Fix checkpatch errors 2010-02-16 20:29:45 +08:00
cbc.c
ccm.c crypto: remove the second argument of k[un]map_atomic() 2012-03-20 21:48:16 +08:00
chainiv.c
cipher.c crypto: cipher - Fix checkpatch errors 2010-02-16 20:31:37 +08:00
compress.c crypto: compress - Fix checkpatch errors 2010-02-16 20:31:04 +08:00
crc32c.c crypto: crc32c should use library implementation 2012-03-23 16:58:38 -07:00
cryptd.c crypto: cryptd - Use subsys_initcall to prevent races with aesni 2011-08-20 16:08:03 +08:00
crypto_null.c crypto: crypto_null - Fix checkpatch errors 2010-02-16 20:31:54 +08:00
crypto_user.c netlink: add netlink_kernel_cfg parameter to netlink_kernel_create 2012-06-29 16:46:02 -07:00
crypto_wq.c crypto: add module.h to those files that are explicitly using it 2011-10-31 19:31:11 -04:00
ctr.c crypto: Use ERR_CAST 2010-05-26 10:36:51 +10:00
cts.c
deflate.c net+crypto: Use vmalloc for zlib inflate buffers. 2011-06-29 05:48:41 -07:00
des_generic.c Blackfin: Rename DES PC2() symbol to avoid collision 2010-10-07 14:08:50 +01:00
ecb.c crypto: ecb - Fix checkpatch errors 2010-02-16 20:33:49 +08:00
eseqiv.c crypto: Use scatterwalk_crypto_chain 2010-12-02 14:47:16 +08:00
fcrypt.c crypto: fcrypt - Fix checkpatch errors 2010-02-16 20:34:07 +08:00
fips.c
gcm.c crypto: Use scatterwalk_crypto_chain 2010-12-02 14:47:16 +08:00
gf128mul.c crypto: gf128mul - fix call to memset() 2011-07-08 17:21:21 +08:00
ghash-generic.c crypto: ghash - Avoid null pointer dereference if no key is set 2011-10-21 13:18:42 +02:00
hmac.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
internal.h crypto: algapi - Move larval completion into algboss 2012-06-22 20:08:29 +08:00
khazad.c
krng.c
lrw.c crypto: lrw - add interface for parallelized cipher implementions 2011-11-09 11:50:31 +08:00
lzo.c
md4.c crypto: add module.h to those files that are explicitly using it 2011-10-31 19:31:11 -04:00
md5.c crypto: Move md5_transform to lib/md5.c 2011-08-06 18:32:45 -07:00
michael_mic.c
pcbc.c
pcompress.c crypto: Stop using NLA_PUT*(). 2012-04-02 04:33:42 -04:00
pcrypt.c crypto: pcrypt - Use the online cpumask as the default 2012-03-29 19:52:47 +08:00
proc.c crypto: add module.h to those files that are explicitly using it 2011-10-31 19:31:11 -04:00
ripemd.h
rmd128.c crypto: ripemd - Set module author and update email address 2011-01-04 23:34:03 +11:00
rmd160.c crypto: ripemd - Set module author and update email address 2011-01-04 23:34:03 +11:00
rmd256.c crypto: ripemd - Set module author and update email address 2011-01-04 23:34:03 +11:00
rmd320.c crypto: ripemd - Set module author and update email address 2011-01-04 23:34:03 +11:00
rng.c crypto: Stop using NLA_PUT*(). 2012-04-02 04:33:42 -04:00
salsa20_generic.c
scatterwalk.c crypto: remove the second argument of k[un]map_atomic() 2012-03-20 21:48:16 +08:00
seed.c
seqiv.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
serpent_generic.c crypto: serpent - rename serpent.c to serpent_generic.c 2011-11-30 16:12:44 +08:00
sha1_generic.c crypto: sha1 - export sha1_update for reuse 2011-08-10 19:00:28 +08:00
sha256_generic.c
sha512_generic.c crypto: sha512 - Fix byte counter overflow in SHA-512 2012-04-05 20:34:20 +08:00
shash.c crypto: Stop using NLA_PUT*(). 2012-04-02 04:33:42 -04:00
tcrypt.c crypto: atmel - add new tests to tcrypt 2012-07-11 11:08:28 +08:00
tcrypt.h crypto: tcrypt - add xts(serpent) tests 2011-11-09 11:57:56 +08:00
tea.c
testmgr.c crypto: testmgr - add aead cbc aes hmac sha1,256,512 test vectors 2012-07-11 11:08:30 +08:00
testmgr.h crypto: testmgr - add aead cbc aes hmac sha1,256,512 test vectors 2012-07-11 11:08:30 +08:00
tgr192.c
twofish_common.c crypto: twofish-x86_64-3way - add lrw support 2011-11-09 11:53:32 +08:00
twofish_generic.c crypto: twofish: Rename twofish to twofish_generic and add an alias 2010-06-03 21:02:51 +10:00
vmac.c crypto: add module.h to those files that are explicitly using it 2011-10-31 19:31:11 -04:00
wp512.c crypto: whirlpool - count rounds from 0 2011-10-21 14:24:16 +02:00
xcbc.c crypto: add module.h to those files that are explicitly using it 2011-10-31 19:31:11 -04:00
xor.c md updates for 3.5 2012-05-23 17:08:40 -07:00
xts.c crypto: xts: add interface for parallelized cipher implementations 2011-11-09 11:56:06 +08:00
zlib.c net+crypto: Use vmalloc for zlib inflate buffers. 2011-06-29 05:48:41 -07:00