| .. | .. |
|---|
| 68 | 68 | |
|---|
| 69 | 69 | struct cryptd_skcipher_ctx { |
|---|
| 70 | 70 | refcount_t refcnt; |
|---|
| 71 | | - struct crypto_sync_skcipher *child; |
|---|
| 71 | + struct crypto_skcipher *child; |
|---|
| 72 | 72 | }; |
|---|
| 73 | 73 | |
|---|
| 74 | 74 | struct cryptd_skcipher_request_ctx { |
|---|
| 75 | 75 | crypto_completion_t complete; |
|---|
| 76 | + struct skcipher_request req; |
|---|
| 76 | 77 | }; |
|---|
| 77 | 78 | |
|---|
| 78 | 79 | struct cryptd_hash_ctx { |
|---|
| .. | .. |
|---|
| 227 | 228 | const u8 *key, unsigned int keylen) |
|---|
| 228 | 229 | { |
|---|
| 229 | 230 | struct cryptd_skcipher_ctx *ctx = crypto_skcipher_ctx(parent); |
|---|
| 230 | | - struct crypto_sync_skcipher *child = ctx->child; |
|---|
| 231 | + struct crypto_skcipher *child = ctx->child; |
|---|
| 231 | 232 | |
|---|
| 232 | | - crypto_sync_skcipher_clear_flags(child, CRYPTO_TFM_REQ_MASK); |
|---|
| 233 | | - crypto_sync_skcipher_set_flags(child, |
|---|
| 234 | | - crypto_skcipher_get_flags(parent) & |
|---|
| 235 | | - CRYPTO_TFM_REQ_MASK); |
|---|
| 236 | | - return crypto_sync_skcipher_setkey(child, key, keylen); |
|---|
| 233 | + crypto_skcipher_clear_flags(child, CRYPTO_TFM_REQ_MASK); |
|---|
| 234 | + crypto_skcipher_set_flags(child, |
|---|
| 235 | + crypto_skcipher_get_flags(parent) & |
|---|
| 236 | + CRYPTO_TFM_REQ_MASK); |
|---|
| 237 | + return crypto_skcipher_setkey(child, key, keylen); |
|---|
| 237 | 238 | } |
|---|
| 238 | 239 | |
|---|
| 239 | 240 | static void cryptd_skcipher_complete(struct skcipher_request *req, int err) |
|---|
| .. | .. |
|---|
| 258 | 259 | struct cryptd_skcipher_request_ctx *rctx = skcipher_request_ctx(req); |
|---|
| 259 | 260 | struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req); |
|---|
| 260 | 261 | struct cryptd_skcipher_ctx *ctx = crypto_skcipher_ctx(tfm); |
|---|
| 261 | | - struct crypto_sync_skcipher *child = ctx->child; |
|---|
| 262 | | - SYNC_SKCIPHER_REQUEST_ON_STACK(subreq, child); |
|---|
| 262 | + struct skcipher_request *subreq = &rctx->req; |
|---|
| 263 | + struct crypto_skcipher *child = ctx->child; |
|---|
| 263 | 264 | |
|---|
| 264 | 265 | if (unlikely(err == -EINPROGRESS)) |
|---|
| 265 | 266 | goto out; |
|---|
| 266 | 267 | |
|---|
| 267 | | - skcipher_request_set_sync_tfm(subreq, child); |
|---|
| 268 | + skcipher_request_set_tfm(subreq, child); |
|---|
| 268 | 269 | skcipher_request_set_callback(subreq, CRYPTO_TFM_REQ_MAY_SLEEP, |
|---|
| 269 | 270 | NULL, NULL); |
|---|
| 270 | 271 | skcipher_request_set_crypt(subreq, req->src, req->dst, req->cryptlen, |
|---|
| .. | .. |
|---|
| 286 | 287 | struct cryptd_skcipher_request_ctx *rctx = skcipher_request_ctx(req); |
|---|
| 287 | 288 | struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req); |
|---|
| 288 | 289 | struct cryptd_skcipher_ctx *ctx = crypto_skcipher_ctx(tfm); |
|---|
| 289 | | - struct crypto_sync_skcipher *child = ctx->child; |
|---|
| 290 | | - SYNC_SKCIPHER_REQUEST_ON_STACK(subreq, child); |
|---|
| 290 | + struct skcipher_request *subreq = &rctx->req; |
|---|
| 291 | + struct crypto_skcipher *child = ctx->child; |
|---|
| 291 | 292 | |
|---|
| 292 | 293 | if (unlikely(err == -EINPROGRESS)) |
|---|
| 293 | 294 | goto out; |
|---|
| 294 | 295 | |
|---|
| 295 | | - skcipher_request_set_sync_tfm(subreq, child); |
|---|
| 296 | + skcipher_request_set_tfm(subreq, child); |
|---|
| 296 | 297 | skcipher_request_set_callback(subreq, CRYPTO_TFM_REQ_MAY_SLEEP, |
|---|
| 297 | 298 | NULL, NULL); |
|---|
| 298 | 299 | skcipher_request_set_crypt(subreq, req->src, req->dst, req->cryptlen, |
|---|
| .. | .. |
|---|
| 343 | 344 | if (IS_ERR(cipher)) |
|---|
| 344 | 345 | return PTR_ERR(cipher); |
|---|
| 345 | 346 | |
|---|
| 346 | | - ctx->child = (struct crypto_sync_skcipher *)cipher; |
|---|
| 347 | + ctx->child = cipher; |
|---|
| 347 | 348 | crypto_skcipher_set_reqsize( |
|---|
| 348 | | - tfm, sizeof(struct cryptd_skcipher_request_ctx)); |
|---|
| 349 | + tfm, sizeof(struct cryptd_skcipher_request_ctx) + |
|---|
| 350 | + crypto_skcipher_reqsize(cipher)); |
|---|
| 349 | 351 | return 0; |
|---|
| 350 | 352 | } |
|---|
| 351 | 353 | |
|---|
| .. | .. |
|---|
| 353 | 355 | { |
|---|
| 354 | 356 | struct cryptd_skcipher_ctx *ctx = crypto_skcipher_ctx(tfm); |
|---|
| 355 | 357 | |
|---|
| 356 | | - crypto_free_sync_skcipher(ctx->child); |
|---|
| 358 | + crypto_free_skcipher(ctx->child); |
|---|
| 357 | 359 | } |
|---|
| 358 | 360 | |
|---|
| 359 | 361 | static void cryptd_skcipher_free(struct skcipher_instance *inst) |
|---|
| .. | .. |
|---|
| 931 | 933 | { |
|---|
| 932 | 934 | struct cryptd_skcipher_ctx *ctx = crypto_skcipher_ctx(&tfm->base); |
|---|
| 933 | 935 | |
|---|
| 934 | | - return &ctx->child->base; |
|---|
| 936 | + return ctx->child; |
|---|
| 935 | 937 | } |
|---|
| 936 | 938 | EXPORT_SYMBOL_GPL(cryptd_skcipher_child); |
|---|
| 937 | 939 | |
|---|