summaryrefslogtreecommitdiff
path: root/sys/dev/softraid_crypto.c
AgeCommit message (Collapse)Author
2010-05-18dont let sys/ioctl.h imply that you get the ioctls in dkio.h. thisDavid Gwynne
gets rid of #include <sys/dkio.h> in sys/ioctl.h and adds #include <sys/dkio.h> to the places that actually want and use the disk ioctls. this became an issue when krw@'s X build failed when he was testing a change to dkio.h. tested by krw@ help from and ok miod@
2010-04-18Make key disks use their own optional metadata type, rather than reusingJoel Sing
crypto optional metadata. ok marco@
2010-03-28Completely overhaul optional metadata handling, allowing for multipleJoel Sing
optional metadata per volume and discipline specific optional metadata processing. ok marco@
2010-03-28Correctly initialise variables to prevent possible free without malloc inJoel Sing
error path. Found by jsg@ using the clang static analyser.
2010-03-26Add storage for the boot block and boot loader to the softraid metadata.Joel Sing
Also add a new optional metadata type for boot data. This is the first step (of many) towards being able to boot from softraid volumes. WARNING: This version of the softraid metadata is not compatible with previous versions. As a result, any softraid volumes created with older kernels will not assemble. Data on existing softraid volumes should be backed up before upgrading. The volume should then be recreated and the data restored. ok marco@
2010-01-09Zap all setting of ITSDONE in drivers that don't look at it. NobodyKenneth R Westerback
else cares so it's just noise. Drivers that actually look at ITSDONE are unchanged. ok marco@ (for his files) dlg@ beck@
2009-12-31Assert copyright.Joel Sing
ok marco@
2009-12-31Add support for key disks. This allows a crypto volume to be constructedJoel Sing
without using a passphrase - instead the encryption mask key is stored on the specified key disk partition (ideally being one on a removable device). This also enables automatic assembly of crypto volumes at boot time. ok marco@
2009-12-15Factor out discipline specific create/assemble code.Joel Sing
"in, in, in!" marco@
2009-12-07Define discipline capabilities using a set of flags.Joel Sing
"shiny!!" marco@
2009-11-24Allow the passphrase to be changed on softraid crypto volumes. Ensure thatJoel Sing
you backup your data and lock up your pets prior to using this. Tested by todd@ ok marco@
2009-11-24Factor out crypto code allowing for future reuse.Joel Sing
ok marco@
2009-08-09Switch softraid to vnodes to prevent bad things from happening when usingMarco Peereboom
d_open/d_close. tested by many, ok jsing, thib, krw
2009-06-11Create a hotplug callback mechanism.Marco Peereboom
2009-06-11KNFMarco Peereboom
2009-06-09fix potential null dereference.Charles Longeau
Found by LLVM/Clang Static Analyzer. ok marco@
2009-06-03whitespace. "Sure" marco@Chris Kuethe
2009-06-02Abuse bio layer a little less by marking fake buffers with B_PHYS.Marco Peereboom
From beck with lots of squealing and ear bleeds. Issue originally reported by todd. ok beck
2009-06-02marco needs to learn how to do his range checks better, found by ParfaitTheo de Raadt
ok oga guenther
2009-05-11Move the discipline initialisation code into discipline specific functions,Joel Sing
rather than initialising everything in softraid.c. This makes a discipline more self-contained and reduces the number of function declarations needed in softraidvar.h. ok marco@
2008-11-25Add generic sr_scsi_done function that does the spl danceMarco Peereboom
2008-09-22Make sure some possibly uninitialized local variables are assigned correctMiod Vallat
values in all cases. ok marco@
2008-08-15use new shared HMAC_SHA1 code in crypto/hmac.[ch] rather than localDamien Miller
copy; ok hshoexer@
2008-07-19Full rewrite of metadata handling. This fixes power failures and crashesMarco Peereboom
that caused illegal checksums. The new metadata code is more or less ready to deal with other vendor's metadata formats. While here clean up the name space. Fix thib's pool mess by adding removing bad flags in interrupt context. tested on macppc, amd64, i386, sparc64 & hppa sparc64 has issues with crypto however those do not seem to be softraid specific. help from okan@ ckuethe@ Will Backman and others
2008-06-25use pools for the uio and iovec allocations in sr_crypto_getcryptop()Thordur I. Bjornsson
instead of malloc; OK hshoexer@ and macro@
2008-06-14Provide a status field for operations on the bc_opaque data. Now we'reHans-Joerg Hoexer
able to distinguish cleanly an failing ioctl (ie. return value -1) from trying to retrieve a KDF hint from a not yet initialized volume. ok marco djm
2008-06-14Use multiple crypto keys per volume. Each key is used to encrypt atDamien Miller
most 0.5TB of disk. This is well below P1619-2007's recommendation for AES-XTS of 1TB/key, but small enough so we can test that we actually use multiple keys with inexpensive hardware. We allocate 32 keys, so this will do for volumes up to 16TB. Fix a crypto session leak in sr_crypto_free_resources() much debugging help mshoexer@; ok hshoexer@ marco@
2008-06-14implement a check code to determine whether the disk keys haveDamien Miller
been correctly decrypted using the masking key. The check code is a HMAC-SHA1 over the disk keys using a hash of the masking key. It should be slow enough to provide no useful brute force success oracle and should not leak significant data about the masking key or disk keys. ok hshoexer@ marco@
2008-06-13make the disk key masking algorithm a parameter and add some extraDamien Miller
reserved space in case we ever want to support a different scheme ok hshoexer@ marco@
2008-06-13Implement pbkdf2 in in bioctl to derive master key from a passphrase.Hans-Joerg Hoexer
ok marco djm
2008-06-13When assembling an already initialized crytpo softraid, correctly copy inHans-Joerg Hoexer
mask key from userland. Thus, modify sr_crypto_get_kdf() do correclty handle copying kdf hint and/or mask key. While there, remove superflous sr_read_meta(). ok marco djm
2008-06-12Pass error code via the crypto descriptor (ie. crp_etype) from cryptoHans-Joerg Hoexer
callback. ok marco@
2008-06-12Get mask keying for on-disk keys from user space and keep a "hint" for keyHans-Joerg Hoexer
generation used by user space in the meta data. Actually use the masking key for encryption and decryption of on-disk key at run time. ok djm marco
2008-06-11Move first pieces of crypto softraid into the tree. Still totallyHans-Joerg Hoexer
disabled, of course, and still work in progress. help by djm@, ok marco@
2008-02-23Oops to eager with the delete button. prompted by deraadt.Marco Peereboom
2008-02-23Backout premature code.Marco Peereboom
2008-02-22Propper encryption of on-disk-keys, prodded/suggest by tedu@ and djm@Hans-Joerg Hoexer
also use aes to generate proppper IVs ok marco@
2008-02-19Cleanup, spacing and KNF.Marco Peereboom
Sprinkle some debug while here.
2008-02-17Kill stray commentMarco Peereboom
2008-02-17add my copyright, too.Hans-Joerg Hoexer
2008-02-17Add propper key encryption.Hans-Joerg Hoexer
ok marco@
2008-02-15Add myself to the copyrights, ok marco@Chris Kuethe
2008-02-14Actually implement the crypto.Chris Kuethe
ok tedu@ marco@
2008-02-07Add optional metadata memebers.Marco Peereboom
Randomize Crypto password and add salt array. Add mock key encryption functions.
2008-02-05Shave off a few more bytes by moving IO collision detection into a genericMarco Peereboom
fucntion. Fix bug in the crypto code that could casuse data corruption as a bonus, bad cut & past tedu!
2008-02-05Create a generic function to validate IO instead of copying and pastingMarco Peereboom
same code in all disciplines. This shaves of a few bytes. crypto 3185 -> 2690 raid 0 2843 -> 2378 raid 1 3474 -> 2689
2008-01-31Add me to copyright.Marco Peereboom
ok tedu
2008-01-29Improve performance dramatically by preventing severeal context switches.Marco Peereboom
Decrypt only once on entry or exit instead of on in and out regardless of direction. There is still room for improvement but this is the first stab. Tested by many ok tedu
2008-01-27Oops forgot one function when adding 16 byte scsi commands.Marco Peereboom
2008-01-26Remove duplicate protosMarco Peereboom