summaryrefslogtreecommitdiff
path: root/sys/dev/softraidvar.h
diff options
context:
space:
mode:
authorHans-Joerg Hoexer <hshoexer@cvs.openbsd.org>2008-06-13 21:03:41 +0000
committerHans-Joerg Hoexer <hshoexer@cvs.openbsd.org>2008-06-13 21:03:41 +0000
commit4743fd3d70d1fce61146ff4761a1ba23af953aff (patch)
tree6fa45227eb6ab820b7a6ee0d6ced4186e0d43e21 /sys/dev/softraidvar.h
parent6de47580a7d1b6e2b4ab4c332a5385825eca8f43 (diff)
Implement pbkdf2 in in bioctl to derive master key from a passphrase.
ok marco djm
Diffstat (limited to 'sys/dev/softraidvar.h')
-rw-r--r--sys/dev/softraidvar.h19
1 files changed, 17 insertions, 2 deletions
diff --git a/sys/dev/softraidvar.h b/sys/dev/softraidvar.h
index 6999078cd27..7a2712fb79f 100644
--- a/sys/dev/softraidvar.h
+++ b/sys/dev/softraidvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: softraidvar.h,v 1.54 2008/06/13 18:27:42 djm Exp $ */
+/* $OpenBSD: softraidvar.h,v 1.55 2008/06/13 21:03:40 hshoexer Exp $ */
/*
* Copyright (c) 2006 Marco Peereboom <marco@peereboom.us>
* Copyright (c) 2008 Chris Kuethe <ckuethe@openbsd.org>
@@ -107,6 +107,16 @@ struct sr_crypto_genkdf {
#define SR_CRYPTOKDFT_PBKDF2 (1<<0)
};
+struct sr_crypto_kdf_pbkdf2 {
+ u_int32_t len;
+ u_int32_t type;
+#define SR_CRYPTOKDFT_INVALID (0)
+#define SR_CRYPTOKDFT_PBKDF2 (1<<0)
+ u_int32_t rounds;
+ u_int8_t salt[128];
+};
+
+
struct sr_crypto_kdfinfo {
u_int32_t len;
u_int32_t flags;
@@ -114,7 +124,12 @@ struct sr_crypto_kdfinfo {
#define SR_CRYPTOKDF_KEY (1<<0)
#define SR_CRYPTOKDF_HINT (1<<1)
u_int8_t maskkey[SR_CRYPTO_MAXKEYBYTES];
- struct sr_crypto_genkdf kdfhint;
+ union {
+ struct sr_crypto_genkdf generic;
+ struct sr_crypto_kdf_pbkdf2 pbkdf2;
+ } _kdfhint;
+#define genkdf _kdfhint.generic
+#define pbkdf2 _kdfhint.pbkdf2
};
struct sr_crypto_metadata {