Path: blob/main/stand/libsa/geli/geliboot_internal.h
34860 views
/*-1* Copyright (c) 2015 Allan Jude <[email protected]>2* Copyright (c) 2005-2011 Pawel Jakub Dawidek <[email protected]>3* All rights reserved.4*5* Redistribution and use in source and binary forms, with or without6* modification, are permitted provided that the following conditions7* are met:8* 1. Redistributions of source code must retain the above copyright9* notice, this list of conditions and the following disclaimer.10* 2. Redistributions in binary form must reproduce the above copyright11* notice, this list of conditions and the following disclaimer in the12* documentation and/or other materials provided with the distribution.13*14* THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND15* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE16* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE17* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE18* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL19* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS20* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)21* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT22* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY23* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF24* SUCH DAMAGE.25*/2627#ifndef _GELIBOOT_INTERNAL_H_28#define _GELIBOOT_INTERNAL_H_2930#define _STRING_H_31#define _STRINGS_H_32#define _STDIO_H_3334#include <sys/endian.h>35#include <sys/queue.h>3637#include <geom/eli/g_eli.h>38#include <geom/eli/pkcs5v2.h>3940/* Pull in the md5, sha256, and sha512 implementations */41#include <sys/md5.h>42#include <crypto/sha2/sha256.h>43#include <crypto/sha2/sha512.h>4445/* Pull in AES implementation */46#include <crypto/rijndael/rijndael-api-fst.h>4748/* AES-XTS implementation */49#define _STAND 150#define STAND_H /* We don't want stand.h in {gpt,zfs,gptzfs}boot */51#include <opencrypto/xform_enc.h>5253#include "geliboot.h"5455#define GELIDEV_NAMELEN 325657struct geli_dev {58off_t part_end;59struct g_eli_softc sc;60struct g_eli_metadata md;61int keybuf_slot;62char *name; /* for prompting; it ends in ':' */63};6465int geliboot_crypt(u_int algo, geli_op_t enc, u_char *data, size_t datasize,66const u_char *key, size_t keysize, u_char *iv);6768#endif /* _GELIBOOT_INTERNAL_H_ */697071