Pass volume key as a KeyBuffer

Not for security, but for consistency with the way we handle other
keys, and to move the length check to where it belongs.

Test: create private volume on Cuttlefish
Bug: 147814592
Change-Id: I10fc4896183d050ce25ff174faf78f525cf62930
diff --git a/cryptfs.h b/cryptfs.h
index 98ba7d6..463db7f 100644
--- a/cryptfs.h
+++ b/cryptfs.h
@@ -25,6 +25,8 @@
 
 #include <cutils/properties.h>
 
+#include "KeyBuffer.h"
+
 #define CRYPT_FOOTER_OFFSET 0x4000
 
 /* Return values for cryptfs_crypto_complete */
@@ -62,8 +64,8 @@
 int cryptfs_enable(int type, const char* passwd, int no_ui);
 int cryptfs_changepw(int type, const char* newpw);
 int cryptfs_enable_default(int no_ui);
-int cryptfs_setup_ext_volume(const char* label, const char* real_blkdev, const unsigned char* key,
-                             std::string* out_crypto_blkdev);
+int cryptfs_setup_ext_volume(const char* label, const char* real_blkdev,
+                             const android::vold::KeyBuffer& key, std::string* out_crypto_blkdev);
 int cryptfs_revert_ext_volume(const char* label);
 int cryptfs_getfield(const char* fieldname, char* value, int len);
 int cryptfs_setfield(const char* fieldname, const char* value);