<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/include/crypto, branch v4.20.12</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v4.20.12</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v4.20.12'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2018-10-26T08:30:46Z</updated>
<entry>
<title>KEYS: asym_tpm: extract key size &amp; public key [ver #2]</title>
<updated>2018-10-26T08:30:46Z</updated>
<author>
<name>Denis Kenzior</name>
<email>denkenz@gmail.com</email>
</author>
<published>2018-10-09T16:48:10Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=f8c54e1ac4b82933dfcf88c37892da8ae35ccbe4'/>
<id>urn:sha1:f8c54e1ac4b82933dfcf88c37892da8ae35ccbe4</id>
<content type='text'>
The parsed BER/DER blob obtained from user space contains a TPM_Key
structure.  This structure has some information about the key as well as
the public key portion.

This patch extracts this information for future use.

Signed-off-by: Denis Kenzior &lt;denkenz@gmail.com&gt;
Signed-off-by: David Howells &lt;dhowells@redhat.com&gt;
Tested-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
Reviewed-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
Signed-off-by: James Morris &lt;james.morris@microsoft.com&gt;
</content>
</entry>
<entry>
<title>KEYS: asym_tpm: add skeleton for asym_tpm [ver #2]</title>
<updated>2018-10-26T08:30:46Z</updated>
<author>
<name>Denis Kenzior</name>
<email>denkenz@gmail.com</email>
</author>
<published>2018-10-09T16:48:02Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=903be6bb84c544551150a6f5aab9fda1ed9a6895'/>
<id>urn:sha1:903be6bb84c544551150a6f5aab9fda1ed9a6895</id>
<content type='text'>
This patch adds the basic skeleton for the asym_tpm asymmetric key
subtype.

Signed-off-by: Denis Kenzior &lt;denkenz@gmail.com&gt;
Signed-off-by: David Howells &lt;dhowells@redhat.com&gt;
Tested-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
Reviewed-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
Signed-off-by: James Morris &lt;james.morris@microsoft.com&gt;
</content>
</entry>
<entry>
<title>KEYS: Allow the public_key struct to hold a private key [ver #2]</title>
<updated>2018-10-26T08:30:46Z</updated>
<author>
<name>David Howells</name>
<email>dhowells@redhat.com</email>
</author>
<published>2018-10-09T16:47:31Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=f7c4e06e066c3df282e6e3d4e7d8c498be9e1e46'/>
<id>urn:sha1:f7c4e06e066c3df282e6e3d4e7d8c498be9e1e46</id>
<content type='text'>
Put a flag in the public_key struct to indicate if the structure is holding
a private key.  The private key must be held ASN.1 encoded in the format
specified in RFC 3447 A.1.2.  This is the form required by crypto/rsa.c.

The software encryption subtype's verification and query functions then
need to select the appropriate crypto function to set the key.

Signed-off-by: David Howells &lt;dhowells@redhat.com&gt;
Tested-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
Reviewed-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
Reviewed-by: Denis Kenzior &lt;denkenz@gmail.com&gt;
Tested-by: Denis Kenzior &lt;denkenz@gmail.com&gt;
Signed-off-by: James Morris &lt;james.morris@microsoft.com&gt;
</content>
</entry>
<entry>
<title>KEYS: Provide missing asymmetric key subops for new key type ops [ver #2]</title>
<updated>2018-10-26T08:30:46Z</updated>
<author>
<name>David Howells</name>
<email>dhowells@redhat.com</email>
</author>
<published>2018-10-09T16:47:07Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=5a30771832aab228e0863e414f9182f86797429e'/>
<id>urn:sha1:5a30771832aab228e0863e414f9182f86797429e</id>
<content type='text'>
Provide the missing asymmetric key subops for new key type ops.  This
include query, encrypt, decrypt and create signature.  Verify signature
already exists.  Also provided are accessor functions for this:

	int query_asymmetric_key(const struct key *key,
				 struct kernel_pkey_query *info);

	int encrypt_blob(struct kernel_pkey_params *params,
			 const void *data, void *enc);
	int decrypt_blob(struct kernel_pkey_params *params,
			 const void *enc, void *data);
	int create_signature(struct kernel_pkey_params *params,
			     const void *data, void *enc);

The public_key_signature struct gains an encoding field to carry the
encoding for verify_signature().

Signed-off-by: David Howells &lt;dhowells@redhat.com&gt;
Tested-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
Reviewed-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
Reviewed-by: Denis Kenzior &lt;denkenz@gmail.com&gt;
Tested-by: Denis Kenzior &lt;denkenz@gmail.com&gt;
Signed-off-by: James Morris &lt;james.morris@microsoft.com&gt;
</content>
</entry>
<entry>
<title>crypto/morus(640,1280) - make crypto_...-algs static</title>
<updated>2018-10-05T02:22:48Z</updated>
<author>
<name>valdis.kletnieks@vt.edu</name>
<email>valdis.kletnieks@vt.edu</email>
</author>
<published>2018-09-26T22:49:38Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=90a8c78b8b5e2c8537a170ee675127f02ca94532'/>
<id>urn:sha1:90a8c78b8b5e2c8537a170ee675127f02ca94532</id>
<content type='text'>
sparse complains thusly:

  CHECK   arch/x86/crypto/morus640-sse2-glue.c
arch/x86/crypto/morus640-sse2-glue.c:38:1: warning: symbol 'crypto_morus640_sse2_algs' was not declared. Should it be static?
  CHECK   arch/x86/crypto/morus1280-sse2-glue.c
arch/x86/crypto/morus1280-sse2-glue.c:38:1: warning: symbol 'crypto_morus1280_sse2_algs' was not declared. Should it be static?
  CHECK   arch/x86/crypto/morus1280-avx2-glue.c
arch/x86/crypto/morus1280-avx2-glue.c:38:1: warning: symbol 'crypto_morus1280_avx2_algs' was not declared. Should it be static?

and sparse is correct - these don't need to be global and polluting the namespace.

Signed-off-by: Valdis Kletnieks &lt;valdis.kletnieks@vt.edu&gt;
Acked-by: Ondrej Mosnacek &lt;omosnacek@gmail.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>crypto: user - Implement a generic crypto statistics</title>
<updated>2018-09-28T04:46:25Z</updated>
<author>
<name>Corentin Labbe</name>
<email>clabbe@baylibre.com</email>
</author>
<published>2018-09-19T10:10:54Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=cac5818c25d0423bda73e2b6997404ed0a7ed9e3'/>
<id>urn:sha1:cac5818c25d0423bda73e2b6997404ed0a7ed9e3</id>
<content type='text'>
This patch implement a generic way to get statistics about all crypto
usages.

Signed-off-by: Corentin Labbe &lt;clabbe@baylibre.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>crypto: skcipher - Remove SKCIPHER_REQUEST_ON_STACK()</title>
<updated>2018-09-28T04:46:09Z</updated>
<author>
<name>Kees Cook</name>
<email>keescook@chromium.org</email>
</author>
<published>2018-09-19T02:11:00Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=a9cbfe4c784436368790f0c59674f99ba97ae21e'/>
<id>urn:sha1:a9cbfe4c784436368790f0c59674f99ba97ae21e</id>
<content type='text'>
Now that all the users of the VLA-generating SKCIPHER_REQUEST_ON_STACK()
macro have been moved to SYNC_SKCIPHER_REQUEST_ON_STACK(), we can remove
the former.

Signed-off-by: Kees Cook &lt;keescook@chromium.org&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>crypto: null - Remove VLA usage of skcipher</title>
<updated>2018-09-28T04:46:08Z</updated>
<author>
<name>Kees Cook</name>
<email>keescook@chromium.org</email>
</author>
<published>2018-09-19T02:10:51Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=8d605398425843c7ce3c0e9a0434d832d3bd54cc'/>
<id>urn:sha1:8d605398425843c7ce3c0e9a0434d832d3bd54cc</id>
<content type='text'>
In the quest to remove all stack VLA usage from the kernel[1], this
replaces struct crypto_skcipher and SKCIPHER_REQUEST_ON_STACK() usage
with struct crypto_sync_skcipher and SYNC_SKCIPHER_REQUEST_ON_STACK(),
which uses a fixed stack size.

[1] https://lkml.kernel.org/r/CA+55aFzCG-zNmZwX4A2FQpadafLfEzK6CC=qPXydAacU1RqZWA@mail.gmail.com

Signed-off-by: Kees Cook &lt;keescook@chromium.org&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>crypto: skcipher - Introduce crypto_sync_skcipher</title>
<updated>2018-09-28T04:46:06Z</updated>
<author>
<name>Kees Cook</name>
<email>keescook@chromium.org</email>
</author>
<published>2018-09-19T02:10:38Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=b350bee5ea0f4db75d4c6191a2e95db16f40c278'/>
<id>urn:sha1:b350bee5ea0f4db75d4c6191a2e95db16f40c278</id>
<content type='text'>
In preparation for removal of VLAs due to skcipher requests on the stack
via SKCIPHER_REQUEST_ON_STACK() usage, this introduces the infrastructure
for the "sync skcipher" tfm, which is for handling the on-stack cases of
skcipher, which are always non-ASYNC and have a known limited request
size.

The crypto API additions:

	struct crypto_sync_skcipher (wrapper for struct crypto_skcipher)
	crypto_alloc_sync_skcipher()
	crypto_free_sync_skcipher()
	crypto_sync_skcipher_setkey()
	crypto_sync_skcipher_get_flags()
	crypto_sync_skcipher_set_flags()
	crypto_sync_skcipher_clear_flags()
	crypto_sync_skcipher_blocksize()
	crypto_sync_skcipher_ivsize()
	crypto_sync_skcipher_reqtfm()
	skcipher_request_set_sync_tfm()
	SYNC_SKCIPHER_REQUEST_ON_STACK() (with tfm type check)

Signed-off-by: Kees Cook &lt;keescook@chromium.org&gt;
Reviewed-by: Ard Biesheuvel &lt;ard.biesheuvel@linaro.org&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>crypto: chacha20 - Fix chacha20_block() keystream alignment (again)</title>
<updated>2018-09-21T05:24:50Z</updated>
<author>
<name>Eric Biggers</name>
<email>ebiggers@google.com</email>
</author>
<published>2018-09-12T03:05:10Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=a5e9f557098e54af44ade5d501379be18435bfbf'/>
<id>urn:sha1:a5e9f557098e54af44ade5d501379be18435bfbf</id>
<content type='text'>
In commit 9f480faec58c ("crypto: chacha20 - Fix keystream alignment for
chacha20_block()"), I had missed that chacha20_block() can be called
directly on the buffer passed to get_random_bytes(), which can have any
alignment.  So, while my commit didn't break anything, it didn't fully
solve the alignment problems.

Revert my solution and just update chacha20_block() to use
put_unaligned_le32(), so the output buffer need not be aligned.
This is simpler, and on many CPUs it's the same speed.

But, I kept the 'tmp' buffers in extract_crng_user() and
_get_random_bytes() 4-byte aligned, since that alignment is actually
needed for _crng_backtrack_protect() too.

Reported-by: Stephan Müller &lt;smueller@chronox.de&gt;
Cc: Theodore Ts'o &lt;tytso@mit.edu&gt;
Signed-off-by: Eric Biggers &lt;ebiggers@google.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
</feed>
