g_eli_integrity.c (221625) | g_eli_integrity.c (221628) |
---|---|
1/*- 2 * Copyright (c) 2005-2011 Pawel Jakub Dawidek <pawel@dawidek.net> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 11 unchanged lines hidden (view full) --- 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 */ 26 27#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2005-2011 Pawel Jakub Dawidek <pawel@dawidek.net> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 11 unchanged lines hidden (view full) --- 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 */ 26 27#include <sys/cdefs.h> |
28__FBSDID("$FreeBSD: head/sys/geom/eli/g_eli_integrity.c 221625 2011-05-08 09:09:49Z pjd $"); | 28__FBSDID("$FreeBSD: head/sys/geom/eli/g_eli_integrity.c 221628 2011-05-08 09:17:56Z pjd $"); |
29 30#include <sys/param.h> 31#include <sys/systm.h> 32#include <sys/kernel.h> 33#include <sys/linker.h> 34#include <sys/module.h> 35#include <sys/lock.h> 36#include <sys/mutex.h> --- 471 unchanged lines hidden (view full) --- 508 crp->crp_desc = crda; 509 crda->crd_next = crde; 510 crde->crd_next = NULL; 511 } 512 513 crde->crd_skip = sc->sc_alen; 514 crde->crd_len = data_secsize; 515 crde->crd_flags = CRD_F_IV_EXPLICIT | CRD_F_IV_PRESENT; | 29 30#include <sys/param.h> 31#include <sys/systm.h> 32#include <sys/kernel.h> 33#include <sys/linker.h> 34#include <sys/module.h> 35#include <sys/lock.h> 36#include <sys/mutex.h> --- 471 unchanged lines hidden (view full) --- 508 crp->crp_desc = crda; 509 crda->crd_next = crde; 510 crde->crd_next = NULL; 511 } 512 513 crde->crd_skip = sc->sc_alen; 514 crde->crd_len = data_secsize; 515 crde->crd_flags = CRD_F_IV_EXPLICIT | CRD_F_IV_PRESENT; |
516 if ((sc->sc_flags & G_ELI_FLAG_FIRST_KEY) == 0) 517 crde->crd_flags |= CRD_F_KEY_EXPLICIT; |
|
516 if (bp->bio_cmd == BIO_WRITE) 517 crde->crd_flags |= CRD_F_ENCRYPT; 518 crde->crd_alg = sc->sc_ealgo; 519 crde->crd_key = g_eli_key_hold(sc, dstoff, encr_secsize); 520 crde->crd_klen = sc->sc_ekeylen; 521 if (sc->sc_ealgo == CRYPTO_AES_XTS) 522 crde->crd_klen <<= 1; 523 g_eli_crypto_ivgen(sc, dstoff, crde->crd_iv, --- 19 unchanged lines hidden --- | 518 if (bp->bio_cmd == BIO_WRITE) 519 crde->crd_flags |= CRD_F_ENCRYPT; 520 crde->crd_alg = sc->sc_ealgo; 521 crde->crd_key = g_eli_key_hold(sc, dstoff, encr_secsize); 522 crde->crd_klen = sc->sc_ekeylen; 523 if (sc->sc_ealgo == CRYPTO_AES_XTS) 524 crde->crd_klen <<= 1; 525 g_eli_crypto_ivgen(sc, dstoff, crde->crd_iv, --- 19 unchanged lines hidden --- |