Age | Commit message (Collapse) | Author |
|
|
|
|
|
Calculate tag and destination buffer length in a single place to avoid
code duplication. The TLS case is fixed by rounding the destination
length to cipher block size.
Signed-off-by: Cristian Stoica <cristian.stoica@freescale.com>
|
|
|
|
- block and stream ciphers have their keys copied from userspace
just like before
- for aead composite ciphers, the cipher and hmac keys are
combined into a single key
Signed-off-by: Cristian Stoica <cristian.stoica@freescale.com>
Signed-off-by: Phil Sutter <phil@nwl.cc>
|
|
The enclosing structure refers to both keys either as individuals
or as a group. For block ciphers and hmacs, both keys are used
independently. For composite ciphers the whole structure will be
used as a single key.
Signed-off-by: Cristian Stoica <cristian.stoica@freescale.com>
Signed-off-by: Phil Sutter <phil@nwl.cc>
|
|
Composite ciphers (cipher + hmac) use both keys at the same time. This
patch is the first in a series that adds support for composite ciphers
keys.
Signed-off-by: Cristian Stoica <cristian.stoica@freescale.com>
Signed-off-by: Phil Sutter <phil@nwl.cc>
|
|
That is because in AEAD modes we need to write more data than we read
(the tag value).
Reported and investigated by Dian Nguyen.
Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
|
|
If 'open /dev/crypto' fails, all allocated resources must be freed
before "open" returns; "close" can't be called to clean-up since
there is no file descriptor after a failed "open".
Signed-off-by: Cristian Stoica <cristian.stoica@freescale.com>
Signed-off-by: Phil Sutter <phil@nwl.cc>
|
|
This makes the test complain if the output fields were not altered at
all.
Signed-off-by: Phil Sutter <phil@nwl.cc>
|
|
Signed-off-by: Phil Sutter <phil@nwl.cc>
|
|
Signed-off-by: Phil Sutter <phil@nwl.cc>
|
|
Signed-off-by: Phil Sutter <phil@nwl.cc>
|
|
Signed-off-by: Phil Sutter <phil@nwl.cc>
|
|
Use them instead of directly calling dprintk. Also, line continuations
are to be indented with two tabs, unless there is good reason not to.
Signed-off-by: Phil Sutter <phil@nwl.cc>
|
|
Signed-off-by: Phil Sutter <phil@nwl.cc>
|
|
Normally we use dprintk which respects the module's own log level, but
at this early stage (driver registration), being noisy should be fine.
Signed-off-by: Phil Sutter <phil@nwl.cc>
|
|
Signed-off-by: Phil Sutter <phil@nwl.cc>
|
|
Signed-off-by: Phil Sutter <phil@nwl.cc>
|
|
Signed-off-by: Phil Sutter <phil@nwl.cc>
|
|
Signed-off-by: Phil Sutter <phil@nwl.cc>
|
|
Signed-off-by: Phil Sutter <phil@nwl.cc>
|
|
Signed-off-by: Phil Sutter <phil@nwl.cc>
|
|
Signed-off-by: Phil Sutter <phil@nwl.cc>
|
|
Signed-off-by: Phil Sutter <phil@nwl.cc>
|
|
Signed-off-by: Phil Sutter <phil@nwl.cc>
|
|
Signed-off-by: Phil Sutter <phil@nwl.cc>
|
|
Signed-off-by: Phil Sutter <phil@nwl.cc>
|
|
currently using the 3.13-rc3 Linux kernel, which leads to the following error:
cryptlib.c:279:2: error: implicit declaration of function 'INIT_COMPLETION' [-Werror=implicit-function-declaration]
INIT_COMPLETION(cdata->async.result->completion);
[1] https://github.com/torvalds/linux/commit/c32f74ab2872994bc8336ed367313da3139350ca
[2] https://github.com/torvalds/linux/commit/62026aedaacedbe1ffe94a3599ad4acd8ecdf587
Signed-off-by: Cosmin Paraschiv <cosmin.paraschiv@freescale.com>
Reviewed-by: Cristian Stoica <cristian.stoica@freescale.com>
Tested-by: Cristian Stoica <cristian.stoica@freescale.com>
Signed-off-by: Horia Geanta <horia.geanta@freescale.com>
Signed-off-by: Phil Sutter <phil@nwl.cc>
|
|
|
|
This slows down processing but prevents failures due to the driver
refusing to operate on unaligned data.
|
|
Add check for "atmel-" HW accelerator.
Signed-off-by: Karl Hiramoto <karl@hiramoto.org>
|
|
|
|
- for completion destroy also &pcr->fcrypt_sem and session mutexes
during shutdown
Signed-off-by: Cristian Stoica <cristian.stoica@freescale.com>
|
|
Signed-off-by: Cristian Stoica <cristian.stoica@freescale.com>
|
|
If one of kzalloc(todo_list_item) fail, filp->private_data remains
garbage and cryptodev_release will fail during free. To fix that,
filp->private_data is set early so that at release, there will be
knowledge about allocated memory.
Signed-off-by: Cristian Stoica <cristian.stoica@freescale.com>
|
|
The net result is the same and it makes more clear some problems with
freeing this memory (addressed in a later patch)
Signed-off-by: Cristian Stoica <cristian.stoica@freescale.com>
|
|
Signed-off-by: Cristian Stoica <cristian.stoica@freescale.com>
|
|
kmalloc + memset(0) can be replaced with a single call to kzalloc for
the same results
Signed-off-by: Cristian Stoica <cristian.stoica@freescale.com>
|
|
struct cipher_data *out (sess_new->cdata) is already initiallized to
zero as 'ses_new = kzalloc(...)' in the caller function
crypto_create_session
Signed-off-by: Cristian Stoica <cristian.stoica@freescale.com>
|
|
Signed-off-by: Cristian Stoica <cristian.stoica@freescale.com>
|
|
The attached patch contains the required modifications in order to get and set the cryptodev_verbosity variable using the following commands
root@OCSME:~# sysctl ioctl.cryptodev_verbosity
ioctl.cryptodev_verbosity = 0
root@OCSME:~# sysctl ioctl.cryptodev_verbosity=3
ioctl.cryptodev_verbosity = 3
Patch by Nikolaos Tsakalakis (nikolaos.tsakalakis@gmail.com).
|
|
Signed-off-by: Cristian Stoica <cristian.stoica@freescale.com>
|
|
This is useful for cross-building for embedded systems
Signed-off-by: Cristian Stoica <cristian.stoica@freescale.com>
|
|
|
|
|
|
|
|
|
|
|
|
|