cryptfs: Require ext disk crypt to match code
Our external partitions have no crypto header/footer, so we
only get the keysize and key. Our code has been implicitly
assuming that this keysize off of disk matches the crypto
type we have in our code (and thus matches the keysize our
code is using as well). We now make this assumption
explicit, and check for this and no longer allow external
code to pass a keysize in to cryptfs.
Bug: 73079191
Test: Compiled and tested in combination with other CLs.
Change-Id: I1a1996187e1aaad6f103982652b1bcdfd5be33ce
diff --git a/cryptfs.h b/cryptfs.h
index bf4b405..d6c7dc5 100644
--- a/cryptfs.h
+++ b/cryptfs.h
@@ -30,6 +30,7 @@
*/
#include <stdbool.h>
+#include <stdint.h>
#include <cutils/properties.h>
/* The current cryptfs version */
@@ -235,7 +236,7 @@
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,
- int keysize, char* out_crypto_blkdev);
+ char* 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);
@@ -245,4 +246,7 @@
void cryptfs_clear_password(void);
int cryptfs_isConvertibleToFBE(void);
+uint32_t cryptfs_get_keysize();
+const char* cryptfs_get_crypto_name();
+
#endif /* ANDROID_VOLD_CRYPTFS_H */