Deleted Added
full compact
g_eli.h (172031) g_eli.h (211927)
1/*-
2 * Copyright (c) 2005-2006 Pawel Jakub Dawidek <pjd@FreeBSD.org>
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

--- 9 unchanged lines hidden (view full) ---

18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
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 *
1/*-
2 * Copyright (c) 2005-2006 Pawel Jakub Dawidek <pjd@FreeBSD.org>
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

--- 9 unchanged lines hidden (view full) ---

18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
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 * $FreeBSD: head/sys/geom/eli/g_eli.h 172031 2007-09-01 06:33:02Z pjd $
26 * $FreeBSD: head/sys/geom/eli/g_eli.h 211927 2010-08-28 08:30:20Z pjd $
27 */
28
29#ifndef _G_ELI_H_
30#define _G_ELI_H_
31
32#include <sys/endian.h>
33#include <sys/errno.h>
34#include <sys/malloc.h>

--- 17 unchanged lines hidden (view full) ---

52#define G_ELI_SUFFIX ".eli"
53
54/*
55 * Version history:
56 * 0 - Initial version number.
57 * 1 - Added data authentication support (md_aalgo field and
58 * G_ELI_FLAG_AUTH flag).
59 * 2 - Added G_ELI_FLAG_READONLY.
27 */
28
29#ifndef _G_ELI_H_
30#define _G_ELI_H_
31
32#include <sys/endian.h>
33#include <sys/errno.h>
34#include <sys/malloc.h>

--- 17 unchanged lines hidden (view full) ---

52#define G_ELI_SUFFIX ".eli"
53
54/*
55 * Version history:
56 * 0 - Initial version number.
57 * 1 - Added data authentication support (md_aalgo field and
58 * G_ELI_FLAG_AUTH flag).
59 * 2 - Added G_ELI_FLAG_READONLY.
60 * - IV is generated from offset converted to little-endian
61 * (flag G_ELI_FLAG_NATIVE_BYTE_ORDER will be set for older versions).
62 * 3 - Added 'configure' subcommand.
60 * 3 - Added 'configure' subcommand.
61 * 4 - IV is generated from offset converted to little-endian
62 * (flag G_ELI_FLAG_NATIVE_BYTE_ORDER will be set for older versions).
63 */
63 */
64#define G_ELI_VERSION 3
64#define G_ELI_VERSION 4
65
66/* ON DISK FLAGS. */
67/* Use random, onetime keys. */
68#define G_ELI_FLAG_ONETIME 0x00000001
69/* Ask for the passphrase from the kernel, before mounting root. */
70#define G_ELI_FLAG_BOOT 0x00000002
71/* Detach on last close, if we were open for writing. */
72#define G_ELI_FLAG_WO_DETACH 0x00000004

--- 316 unchanged lines hidden (view full) ---

389 case CRYPTO_NULL_CBC:
390 if (keylen == 0)
391 keylen = 64 * 8;
392 else {
393 if (keylen > 64 * 8)
394 keylen = 0;
395 }
396 return (keylen);
65
66/* ON DISK FLAGS. */
67/* Use random, onetime keys. */
68#define G_ELI_FLAG_ONETIME 0x00000001
69/* Ask for the passphrase from the kernel, before mounting root. */
70#define G_ELI_FLAG_BOOT 0x00000002
71/* Detach on last close, if we were open for writing. */
72#define G_ELI_FLAG_WO_DETACH 0x00000004

--- 316 unchanged lines hidden (view full) ---

389 case CRYPTO_NULL_CBC:
390 if (keylen == 0)
391 keylen = 64 * 8;
392 else {
393 if (keylen > 64 * 8)
394 keylen = 0;
395 }
396 return (keylen);
397 case CRYPTO_AES_CBC: /* FALLTHROUGH */
397 case CRYPTO_AES_CBC:
398 case CRYPTO_CAMELLIA_CBC:
399 switch (keylen) {
400 case 0:
401 return (128);
402 case 128:
403 case 192:
404 case 256:
405 return (keylen);

--- 91 unchanged lines hidden ---
398 case CRYPTO_CAMELLIA_CBC:
399 switch (keylen) {
400 case 0:
401 return (128);
402 case 128:
403 case 192:
404 case 256:
405 return (keylen);

--- 91 unchanged lines hidden ---