summaryrefslogtreecommitdiff
path: root/sys/uvm/uvm_swap_encrypt.h
diff options
context:
space:
mode:
authorNiels Provos <provos@cvs.openbsd.org>1999-12-30 18:21:57 +0000
committerNiels Provos <provos@cvs.openbsd.org>1999-12-30 18:21:57 +0000
commitac9765a7a6c39d899034549875b6a686f6e5809b (patch)
tree0d52c83a90b15b132501490343b4b78a30a23f5f /sys/uvm/uvm_swap_encrypt.h
parentd042358131e2c7d91a210c2130f757b04476c1d3 (diff)
swap encryption for UVM, option UVM_SWAP_ENCRYPT. needs to be enabled
via sysctl. Pages are encrypted with the Blowfish encryption algorithm, the key is initialized randomly on first swap out, ensuring that entropy has accumulated in the kernel randomness pool. Eventually, swap encryption will be decided on a process by process basis, e.g. a process that reads from a cryptographic filesystem will enable swap encrypt for its pages. okay art@ and deraadt@.
Diffstat (limited to 'sys/uvm/uvm_swap_encrypt.h')
-rw-r--r--sys/uvm/uvm_swap_encrypt.h41
1 files changed, 41 insertions, 0 deletions
diff --git a/sys/uvm/uvm_swap_encrypt.h b/sys/uvm/uvm_swap_encrypt.h
new file mode 100644
index 00000000000..b89ce4bd187
--- /dev/null
+++ b/sys/uvm/uvm_swap_encrypt.h
@@ -0,0 +1,41 @@
+/*
+ * Copyright 1999 Niels Provos <provos@citi.umich.edu>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by Niels Provos.
+ * 4. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef _UVM_SWAP_ENCRYPT_H
+#define _UVM_SWAP_ENCRYPT_H
+
+void swap_encrypt_init __P((caddr_t, size_t));
+void swap_encrypt __P((caddr_t, caddr_t, size_t));
+void swap_decrypt __P((caddr_t, caddr_t, size_t));
+
+extern int uvm_doswapencrypt; /* swapencrypt enabled/disabled */
+extern int swap_encrypt_initalized;
+
+#endif /* _UVM_SWAP_ENCRYPT_H */