Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6

Merge crypto tree to pick up scompress and ahash fixes. The
scompress fix becomes mostly unnecessary as the bugs no longer
exist with the new acompress code. However, keep the NULL assignment
in crypto_acomp_free_streams so that if the user decides to call
crypto_acomp_alloc_streams again it will work.

+8 -77
+1
crypto/acompress.c
··· 483 483 void (*free_ctx)(void *); 484 484 int i; 485 485 486 + s->streams = NULL; 486 487 if (!streams) 487 488 return; 488 489
+1 -75
crypto/ahash.c
··· 315 315 316 316 static bool ahash_request_hasvirt(struct ahash_request *req) 317 317 { 318 - struct ahash_request *r2; 319 - 320 - if (ahash_request_isvirt(req)) 321 - return true; 322 - 323 - list_for_each_entry(r2, &req->base.list, base.list) 324 - if (ahash_request_isvirt(r2)) 325 - return true; 326 - 327 - return false; 318 + return ahash_request_isvirt(req); 328 319 } 329 320 330 321 static int ahash_reqchain_virt(struct ahash_save_req_state *state, ··· 463 472 bool update = op == crypto_ahash_alg(tfm)->update; 464 473 struct ahash_save_req_state *state; 465 474 struct ahash_save_req_state state0; 466 - struct ahash_request *r2; 467 475 u8 *page = NULL; 468 476 int err; 469 477 ··· 499 509 state->offset = 0; 500 510 state->nbytes = 0; 501 511 INIT_LIST_HEAD(&state->head); 502 - list_splice_init(&req->base.list, &state->head); 503 512 504 513 if (page) 505 514 sg_init_one(&state->sg, page, PAGE_SIZE); ··· 529 540 530 541 out_set_chain: 531 542 req->base.err = err; 532 - list_for_each_entry(r2, &req->base.list, base.list) 533 - r2->base.err = err; 534 - 535 543 return err; 536 544 } 537 545 ··· 537 551 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); 538 552 539 553 if (likely(tfm->using_shash)) { 540 - struct ahash_request *r2; 541 554 int err; 542 555 543 556 err = crypto_shash_init(prepare_shash_desc(req, tfm)); 544 557 req->base.err = err; 545 - 546 - list_for_each_entry(r2, &req->base.list, base.list) { 547 - struct shash_desc *desc; 548 - 549 - desc = prepare_shash_desc(r2, tfm); 550 - r2->base.err = crypto_shash_init(desc); 551 - } 552 - 553 558 return err; 554 559 } 555 560 ··· 597 620 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); 598 621 599 622 if (likely(tfm->using_shash)) { 600 - struct ahash_request *r2; 601 623 int err; 602 624 603 625 err = shash_ahash_update(req, ahash_request_ctx(req)); 604 626 req->base.err = err; 605 - 606 - list_for_each_entry(r2, &req->base.list, base.list) { 607 - struct shash_desc *desc; 608 - 609 - desc = ahash_request_ctx(r2); 610 - r2->base.err = shash_ahash_update(r2, desc); 611 - } 612 - 613 627 return err; 614 628 } 615 629 ··· 613 645 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); 614 646 615 647 if (likely(tfm->using_shash)) { 616 - struct ahash_request *r2; 617 648 int err; 618 649 619 650 err = crypto_shash_final(ahash_request_ctx(req), req->result); 620 651 req->base.err = err; 621 - 622 - list_for_each_entry(r2, &req->base.list, base.list) { 623 - struct shash_desc *desc; 624 - 625 - desc = ahash_request_ctx(r2); 626 - r2->base.err = crypto_shash_final(desc, r2->result); 627 - } 628 - 629 652 return err; 630 653 } 631 654 ··· 629 670 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); 630 671 631 672 if (likely(tfm->using_shash)) { 632 - struct ahash_request *r2; 633 673 int err; 634 674 635 675 err = shash_ahash_finup(req, ahash_request_ctx(req)); 636 676 req->base.err = err; 637 - 638 - list_for_each_entry(r2, &req->base.list, base.list) { 639 - struct shash_desc *desc; 640 - 641 - desc = ahash_request_ctx(r2); 642 - r2->base.err = shash_ahash_finup(r2, desc); 643 - } 644 - 645 677 return err; 646 678 } 647 679 ··· 707 757 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); 708 758 709 759 if (likely(tfm->using_shash)) { 710 - struct ahash_request *r2; 711 760 int err; 712 761 713 762 err = shash_ahash_digest(req, prepare_shash_desc(req, tfm)); 714 763 req->base.err = err; 715 - 716 - list_for_each_entry(r2, &req->base.list, base.list) { 717 - struct shash_desc *desc; 718 - 719 - desc = prepare_shash_desc(r2, tfm); 720 - r2->base.err = shash_ahash_digest(r2, desc); 721 - } 722 - 723 764 return err; 724 765 } 725 766 ··· 1073 1132 return crypto_register_instance(tmpl, ahash_crypto_instance(inst)); 1074 1133 } 1075 1134 EXPORT_SYMBOL_GPL(ahash_register_instance); 1076 - 1077 - void ahash_request_free(struct ahash_request *req) 1078 - { 1079 - struct ahash_request *tmp; 1080 - struct ahash_request *r2; 1081 - 1082 - if (unlikely(!req)) 1083 - return; 1084 - 1085 - list_for_each_entry_safe(r2, tmp, &req->base.list, base.list) 1086 - kfree_sensitive(r2); 1087 - 1088 - kfree_sensitive(req); 1089 - } 1090 - EXPORT_SYMBOL_GPL(ahash_request_free); 1091 1135 1092 1136 MODULE_LICENSE("GPL"); 1093 1137 MODULE_DESCRIPTION("Asynchronous cryptographic hash type");
+5 -1
include/crypto/hash.h
··· 10 10 11 11 #include <linux/atomic.h> 12 12 #include <linux/crypto.h> 13 + #include <linux/slab.h> 13 14 #include <linux/string.h> 14 15 15 16 /* Set this bit for virtual address instead of SG list. */ ··· 582 581 * ahash_request_free() - zeroize and free the request data structure 583 582 * @req: request data structure cipher handle to be freed 584 583 */ 585 - void ahash_request_free(struct ahash_request *req); 584 + static inline void ahash_request_free(struct ahash_request *req) 585 + { 586 + kfree_sensitive(req); 587 + } 586 588 587 589 static inline struct ahash_request *ahash_request_cast( 588 590 struct crypto_async_request *req)
+1 -1
include/crypto/internal/hash.h
··· 249 249 250 250 static inline bool ahash_request_chained(struct ahash_request *req) 251 251 { 252 - return crypto_request_chained(&req->base); 252 + return false; 253 253 } 254 254 255 255 static inline bool ahash_request_isvirt(struct ahash_request *req)