search for: ahash_request

Displaying 20 results from an estimated 28 matches for "ahash_request".

2018 Jan 10
1
[PATCH 5/6] crypto: stm32-hash: convert to the new crypto engine API
...> + void *areq); merge these two lines in a single one > +static int stm32_hash_prepare_req(struct crypto_engine *engine, > + void *areq); merge these two lines in a single one > + > static int stm32_hash_handle_queue(struct stm32_hash_dev *hdev, > struct ahash_request *req) > { > @@ -835,8 +841,9 @@ static int stm32_hash_handle_queue(struct stm32_hash_dev *hdev, > } > > static int stm32_hash_prepare_req(struct crypto_engine *engine, > - struct ahash_request *req) > + void *areq) merge these two lines in a single one >...
2018 Jan 10
1
[PATCH 2/6] crypto: engine - Permit to enqueue all async requests
...h> > #include <uapi/linux/sched/types.h> > #include "internal.h" > > @@ -34,11 +33,10 @@ static void crypto_pump_requests(struct crypto_engine *engine, > bool in_kthread) > { > struct crypto_async_request *async_req, *backlog; > - struct ahash_request *hreq; > - struct ablkcipher_request *breq; > unsigned long flags; > bool was_busy = false; > - int ret, rtype; > + int ret; > + struct crypto_engine_reqctx *enginectx; > > spin_lock_irqsave(&engine->queue_lock, flags); > > @@ -94,7 +92,6 @@ stati...
2018 Jan 03
11
[PATCH 0/6] crypto: engine - Permit to enqueue all async requests
Hello The current crypto_engine support only ahash and ablkcipher request. My first patch which try to add skcipher was Nacked, it will add too many functions and adding other algs(aead, asymetric_key) will make the situation worst. This patchset remove all algs specific stuff and now only process generic crypto_async_request. The requests handler function pointer are now moved out of struct
2018 Jan 03
0
[PATCH 5/6] crypto: stm32-hash: convert to the new crypto engine API
...t(struct stm32_hash_dev *hdev, return 0; } +static int stm32_hash_one_request(struct crypto_engine *engine, + void *areq); +static int stm32_hash_prepare_req(struct crypto_engine *engine, + void *areq); + static int stm32_hash_handle_queue(struct stm32_hash_dev *hdev, struct ahash_request *req) { @@ -835,8 +841,9 @@ static int stm32_hash_handle_queue(struct stm32_hash_dev *hdev, } static int stm32_hash_prepare_req(struct crypto_engine *engine, - struct ahash_request *req) + void *areq) { + struct ahash_request *req = container_of(areq, struct ahash_request, base);...
2018 Jan 03
0
[PATCH 2/6] crypto: engine - Permit to enqueue all async requests
...gine.h> -#include <crypto/internal/hash.h> #include <uapi/linux/sched/types.h> #include "internal.h" @@ -34,11 +33,10 @@ static void crypto_pump_requests(struct crypto_engine *engine, bool in_kthread) { struct crypto_async_request *async_req, *backlog; - struct ahash_request *hreq; - struct ablkcipher_request *breq; unsigned long flags; bool was_busy = false; - int ret, rtype; + int ret; + struct crypto_engine_reqctx *enginectx; spin_lock_irqsave(&engine->queue_lock, flags); @@ -94,7 +92,6 @@ static void crypto_pump_requests(struct crypto_engine *engin...
2017 Nov 29
9
[PATCH RFC 0/4] crypto: engine - Permit to enqueue all async requests
Hello The current crypto_engine support only ahash and ablkcipher. My first patch which try to add skcipher was Nacked, it will add too many functions and adding other algs(aead, asymetric_key) will make the situation worst. This patchset remove all algs specific stuff and now only process generic crypto_async_request. The requests handler function pointer are now moved out of struct engine and
2017 Nov 29
9
[PATCH RFC 0/4] crypto: engine - Permit to enqueue all async requests
Hello The current crypto_engine support only ahash and ablkcipher. My first patch which try to add skcipher was Nacked, it will add too many functions and adding other algs(aead, asymetric_key) will make the situation worst. This patchset remove all algs specific stuff and now only process generic crypto_async_request. The requests handler function pointer are now moved out of struct engine and
2017 Nov 29
0
[PATCH RFC 4/4] crypto: stm32: convert to the new crypto engine API
...ivers/crypto/stm32/stm32-hash.c @@ -122,6 +122,7 @@ enum stm32_hash_data_format { #define HASH_DMA_THRESHOLD 50 struct stm32_hash_ctx { + struct crypto_engine_reqctx enginectx; struct stm32_hash_dev *hdev; unsigned long flags; @@ -811,7 +812,7 @@ static void stm32_hash_finish_req(struct ahash_request *req, int err) rctx->flags |= HASH_FLAGS_ERRORS; } - crypto_finalize_hash_request(hdev->engine, req, err); + crypto_finalize_request(hdev->engine, &req->base, err); } static int stm32_hash_hw_init(struct stm32_hash_dev *hdev, @@ -828,15 +829,21 @@ static int stm32_hash_hw...
2017 Nov 29
0
[PATCH RFC 1/4] crypto: engine - Permit to enqueue all async requests
...gine.c b/crypto/crypto_engine.c index 61e7c4e02fd2..f7c4c4c1f41b 100644 --- a/crypto/crypto_engine.c +++ b/crypto/crypto_engine.c @@ -34,11 +34,10 @@ static void crypto_pump_requests(struct crypto_engine *engine, bool in_kthread) { struct crypto_async_request *async_req, *backlog; - struct ahash_request *hreq; - struct ablkcipher_request *breq; unsigned long flags; bool was_busy = false; - int ret, rtype; + int ret; + struct crypto_engine_reqctx *enginectx; spin_lock_irqsave(&engine->queue_lock, flags); @@ -94,7 +93,6 @@ static void crypto_pump_requests(struct crypto_engine *engin...
2018 Jan 26
0
[PATCH v2 2/6] crypto: engine - Permit to enqueue all async requests
...ngine queue to process * @engine: the hardware engine * @in_kthread: true if we are in the context of the request pump thread @@ -34,11 +71,10 @@ static void crypto_pump_requests(struct crypto_engine *engine, bool in_kthread) { struct crypto_async_request *async_req, *backlog; - struct ahash_request *hreq; - struct ablkcipher_request *breq; unsigned long flags; bool was_busy = false; - int ret, rtype; + int ret; + struct crypto_engine_ctx *enginectx; spin_lock_irqsave(&engine->queue_lock, flags); @@ -94,7 +130,6 @@ static void crypto_pump_requests(struct crypto_engine *engine,...
2017 Dec 06
1
[PATCH RFC 1/4] crypto: engine - Permit to enqueue all async requests
...61e7c4e02fd2..f7c4c4c1f41b 100644 > --- a/crypto/crypto_engine.c > +++ b/crypto/crypto_engine.c > @@ -34,11 +34,10 @@ static void crypto_pump_requests(struct crypto_engine *engine, > bool in_kthread) > { > struct crypto_async_request *async_req, *backlog; > - struct ahash_request *hreq; > - struct ablkcipher_request *breq; > unsigned long flags; > bool was_busy = false; > - int ret, rtype; > + int ret; > + struct crypto_engine_reqctx *enginectx; > > spin_lock_irqsave(&engine->queue_lock, flags); > > @@ -94,7 +93,6 @@ stati...
2017 Dec 06
1
[PATCH RFC 1/4] crypto: engine - Permit to enqueue all async requests
...61e7c4e02fd2..f7c4c4c1f41b 100644 > --- a/crypto/crypto_engine.c > +++ b/crypto/crypto_engine.c > @@ -34,11 +34,10 @@ static void crypto_pump_requests(struct crypto_engine *engine, > bool in_kthread) > { > struct crypto_async_request *async_req, *backlog; > - struct ahash_request *hreq; > - struct ablkcipher_request *breq; > unsigned long flags; > bool was_busy = false; > - int ret, rtype; > + int ret; > + struct crypto_engine_reqctx *enginectx; > > spin_lock_irqsave(&engine->queue_lock, flags); > > @@ -94,7 +93,6 @@ stati...
2018 Jan 26
10
[PATCH v2 0/6] crypto: engine - Permit to enqueue all async requests
Hello The current crypto_engine support only ahash and ablkcipher request. My first patch which try to add skcipher was Nacked, it will add too many functions and adding other algs(aead, asymetric_key) will make the situation worst. This patchset remove all algs specific stuff and now only process generic crypto_async_request. The requests handler function pointer are now moved out of struct
2018 Jan 26
10
[PATCH v2 0/6] crypto: engine - Permit to enqueue all async requests
Hello The current crypto_engine support only ahash and ablkcipher request. My first patch which try to add skcipher was Nacked, it will add too many functions and adding other algs(aead, asymetric_key) will make the situation worst. This patchset remove all algs specific stuff and now only process generic crypto_async_request. The requests handler function pointer are now moved out of struct
2017 Dec 07
0
[PATCH RFC 1/4] crypto: engine - Permit to enqueue all async requests
...gt; > --- a/crypto/crypto_engine.c > > +++ b/crypto/crypto_engine.c > > @@ -34,11 +34,10 @@ static void crypto_pump_requests(struct crypto_engine *engine, > > bool in_kthread) > > { > > struct crypto_async_request *async_req, *backlog; > > - struct ahash_request *hreq; > > - struct ablkcipher_request *breq; > > unsigned long flags; > > bool was_busy = false; > > - int ret, rtype; > > + int ret; > > + struct crypto_engine_reqctx *enginectx; > > > > spin_lock_irqsave(&engine->queue_lock, flag...
2020 Apr 13
0
[PATCH 2/2] crypto: Remove unnecessary memzero_explicit()
...a/drivers/crypto/inside-secure/safexcel_hash.c b/drivers/crypto/inside-secure/safexcel_hash.c index 43962bc709c6..4a2d162914de 100644 --- a/drivers/crypto/inside-secure/safexcel_hash.c +++ b/drivers/crypto/inside-secure/safexcel_hash.c @@ -1081,8 +1081,7 @@ static int safexcel_hmac_init_pad(struct ahash_request *areq, } /* Avoid leaking */ - memzero_explicit(keydup, keylen); - kfree(keydup); + kfree_sensitive(keydup); if (ret) return ret; -- 2.18.1
2020 Apr 13
0
[PATCH v2 2/2] crypto: Remove unnecessary memzero_explicit()
...a/drivers/crypto/inside-secure/safexcel_hash.c b/drivers/crypto/inside-secure/safexcel_hash.c index 43962bc709c6..4a2d162914de 100644 --- a/drivers/crypto/inside-secure/safexcel_hash.c +++ b/drivers/crypto/inside-secure/safexcel_hash.c @@ -1081,8 +1081,7 @@ static int safexcel_hmac_init_pad(struct ahash_request *areq, } /* Avoid leaking */ - memzero_explicit(keydup, keylen); - kfree(keydup); + kfree_sensitive(keydup); if (ret) return ret; -- 2.18.1
2020 Apr 13
10
[PATCH 0/2] mm, treewide: Rename kzfree() to kfree_sensitive()
This patchset makes a global rename of the kzfree() to kfree_sensitive() to highlight the fact buffer clearing is only needed if the data objects contain sensitive information like encrpytion key. The fact that kzfree() uses memset() to do the clearing isn't totally safe either as compiler may compile out the clearing in their optimizer. Instead, the new kfree_sensitive() uses
2020 Jun 16
0
[PATCH v5 2/2] mm, treewide: Rename kzfree() to kfree_sensitive()
...hash *tfm, const u8 *key, alignbuffer = (u8 *)ALIGN((unsigned long)buffer, alignmask + 1); memcpy(alignbuffer, key, keylen); ret = tfm->setkey(tfm, alignbuffer, keylen); - kzfree(buffer); + kfree_sensitive(buffer); return ret; } @@ -302,7 +302,7 @@ static void ahash_restore_req(struct ahash_request *req, int err) req->priv = NULL; /* Free the req->priv.priv from the ADJUSTED request. */ - kzfree(priv); + kfree_sensitive(priv); } static void ahash_notify_einprogress(struct ahash_request *req) diff --git a/crypto/api.c b/crypto/api.c index edcf690800d4..58f66ba09dac 100644 --- a...
2020 Apr 13
0
[PATCH 1/2] mm, treewide: Rename kzfree() to kfree_sensitive()
...hash *tfm, const u8 *key, alignbuffer = (u8 *)ALIGN((unsigned long)buffer, alignmask + 1); memcpy(alignbuffer, key, keylen); ret = tfm->setkey(tfm, alignbuffer, keylen); - kzfree(buffer); + kfree_sensitive(buffer); return ret; } @@ -302,7 +302,7 @@ static void ahash_restore_req(struct ahash_request *req, int err) req->priv = NULL; /* Free the req->priv.priv from the ADJUSTED request. */ - kzfree(priv); + kfree_sensitive(priv); } static void ahash_notify_einprogress(struct ahash_request *req) diff --git a/crypto/api.c b/crypto/api.c index 7d71a9b10e5f..5fa4fac4bd02 100644 --- a...