summaryrefslogtreecommitdiff
path: root/sys/dev/softraidvar.h
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/softraidvar.h')
-rw-r--r--sys/dev/softraidvar.h18
1 files changed, 14 insertions, 4 deletions
diff --git a/sys/dev/softraidvar.h b/sys/dev/softraidvar.h
index f2f1af32612..292d667ddcc 100644
--- a/sys/dev/softraidvar.h
+++ b/sys/dev/softraidvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: softraidvar.h,v 1.44 2008/02/07 15:08:49 marco Exp $ */
+/* $OpenBSD: softraidvar.h,v 1.45 2008/02/14 22:04:34 ckuethe Exp $ */
/*
* Copyright (c) 2006 Marco Peereboom <marco@peereboom.us>
*
@@ -134,6 +134,11 @@ struct sr_raid1 {
};
/* CRYPTO */
+#define SR_CRYPTO_MAXKEYS 32
+#define SR_CRYPTO_KEYBITS 256
+#define SR_CRYPTO_KEYBYTES (SR_CRYPTO_KEYBITS >> 3)
+#define SR_CRYPTO_ROUNDS 14
+
struct sr_crypto_metadata {
u_int32_t scm_flags;
#define SR_CRYPTOF_INVALID (0)
@@ -142,8 +147,9 @@ struct sr_crypto_metadata {
#define SR_CRYPTOF_PASSPHRASE (1<<2)
u_int32_t scm_pad;
- char scm_key[64];
- char scm_salt[64];
+ u_int8_t scm_key1[SR_CRYPTO_MAXKEYS][SR_CRYPTO_KEYBYTES];
+ u_int8_t scm_key2[SR_CRYPTO_MAXKEYS][SR_CRYPTO_KEYBYTES];
+ u_int8_t scm_salt[64];
char scm_passphrase[128]; /* _PASSWORD_LEN */
};
@@ -155,8 +161,11 @@ struct sr_crypto {
*/
struct sr_crypto_metadata scr_meta[2];
+ /* decrypted keys */
+ u_int8_t scr_key1[SR_CRYPTO_MAXKEYS][SR_CRYPTO_KEYBYTES];
+ u_int8_t scr_key2[SR_CRYPTO_MAXKEYS][SR_CRYPTO_KEYBYTES];
+
u_int64_t scr_sid;
- char scr_key[64]; /* unencrypted key */
};
#define SR_META_SIZE 32 /* save space at chunk beginning */
@@ -421,6 +430,7 @@ int sr_crypto_alloc_resources(struct sr_discipline *);
int sr_crypto_free_resources(struct sr_discipline *);
int sr_crypto_rw(struct sr_workunit *);
int sr_crypto_encrypt_key(struct sr_discipline *);
+void sr_crypto_create_keys(struct sr_discipline *);
#ifdef SR_DEBUG
void sr_dump_mem(u_int8_t *, int);