9c48498f45
This adds support for private volumes which is just a filesystem wrapped in a dm-crypt layer. For now we're using the exact same configuration as internal encryption (aes-cbc-essiv:sha256), but we don't store any key material on the removable media. Instead, we store the key on internal storage, and use the GPT partition GUID to identify which key should be used. This means that private external storage is effectively as secure as the internal storage of the device. That is, if the internal storage is encrypted, then our external storage key is also encrypted. When partitioning disks, we now support a "private" mode which has a PrivateVolume partition, and a currently unused 16MB metadata partition reserved for future use. It also supports a "mixed" mode which creates both a PublicVolume and PrivateVolume on the same disk. Mixed mode is currently experimental. For now, just add ext4 support to PrivateVolume; we'll look at f2fs in a future change. Add VolumeBase lifecycle for setting up crypto mappings, and extract blkid logic into shared method. Sprinkle some more "static" around the cryptfs code to improve invariants. Bug: 19993667 Change-Id: Ibd1df6250735b706959a1eb9d9f7219ea85912a0
112 lines
2.5 KiB
Makefile
112 lines
2.5 KiB
Makefile
LOCAL_PATH:= $(call my-dir)
|
|
|
|
common_src_files := \
|
|
VolumeManager.cpp \
|
|
CommandListener.cpp \
|
|
VoldCommand.cpp \
|
|
NetlinkManager.cpp \
|
|
NetlinkHandler.cpp \
|
|
Volume.cpp \
|
|
DirectVolume.cpp \
|
|
Process.cpp \
|
|
Ext4.cpp \
|
|
Fat.cpp \
|
|
Loop.cpp \
|
|
Devmapper.cpp \
|
|
ResponseCode.cpp \
|
|
CheckBattery.cpp \
|
|
VoldUtil.c \
|
|
fstrim.c \
|
|
cryptfs.c \
|
|
Disk.cpp \
|
|
VolumeBase.cpp \
|
|
PublicVolume.cpp \
|
|
PrivateVolume.cpp \
|
|
EmulatedVolume.cpp \
|
|
Utils.cpp \
|
|
|
|
common_c_includes := \
|
|
system/extras/ext4_utils \
|
|
system/extras/f2fs_utils \
|
|
external/scrypt/lib/crypto \
|
|
frameworks/native/include \
|
|
system/security/keystore \
|
|
hardware/libhardware/include/hardware \
|
|
system/security/softkeymaster/include/keymaster
|
|
|
|
common_shared_libraries := \
|
|
libsysutils \
|
|
libbinder \
|
|
libcutils \
|
|
liblog \
|
|
libdiskconfig \
|
|
libhardware_legacy \
|
|
liblogwrap \
|
|
libext4_utils \
|
|
libf2fs_sparseblock \
|
|
libcrypto \
|
|
libselinux \
|
|
libutils \
|
|
libhardware \
|
|
libsoftkeymaster \
|
|
libbase \
|
|
|
|
common_static_libraries := \
|
|
libfs_mgr \
|
|
libscrypt_static \
|
|
libmincrypt \
|
|
libbatteryservice
|
|
|
|
vold_conlyflags := -std=c11
|
|
vold_cflags := -Werror -Wall -Wno-missing-field-initializers -Wno-unused-variable -Wno-unused-parameter
|
|
|
|
include $(CLEAR_VARS)
|
|
|
|
LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
|
|
LOCAL_MODULE := libvold
|
|
LOCAL_CLANG := true
|
|
LOCAL_SRC_FILES := $(common_src_files)
|
|
LOCAL_C_INCLUDES := $(common_c_includes)
|
|
LOCAL_SHARED_LIBRARIES := $(common_shared_libraries)
|
|
LOCAL_STATIC_LIBRARIES := $(common_static_libraries)
|
|
LOCAL_MODULE_TAGS := eng tests
|
|
LOCAL_CFLAGS := $(vold_cflags)
|
|
LOCAL_CONLYFLAGS := $(vold_conlyflags)
|
|
|
|
include $(BUILD_STATIC_LIBRARY)
|
|
|
|
include $(CLEAR_VARS)
|
|
|
|
LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
|
|
LOCAL_MODULE:= vold
|
|
LOCAL_CLANG := true
|
|
LOCAL_SRC_FILES := \
|
|
main.cpp \
|
|
$(common_src_files)
|
|
|
|
LOCAL_C_INCLUDES := $(common_c_includes)
|
|
LOCAL_CFLAGS := $(vold_cflags)
|
|
LOCAL_CONLYFLAGS := $(vold_conlyflags)
|
|
|
|
ifeq ($(TARGET_HW_DISK_ENCRYPTION),true)
|
|
LOCAL_C_INCLUDES += $(TARGET_CRYPTFS_HW_PATH)
|
|
common_shared_libraries += libcryptfs_hw
|
|
LOCAL_CFLAGS += -DCONFIG_HW_DISK_ENCRYPTION
|
|
endif
|
|
|
|
LOCAL_SHARED_LIBRARIES := $(common_shared_libraries)
|
|
LOCAL_STATIC_LIBRARIES := $(common_static_libraries)
|
|
|
|
include $(BUILD_EXECUTABLE)
|
|
|
|
include $(CLEAR_VARS)
|
|
|
|
LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
|
|
LOCAL_CLANG := true
|
|
LOCAL_SRC_FILES:= vdc.c
|
|
LOCAL_MODULE:= vdc
|
|
LOCAL_SHARED_LIBRARIES := libcutils
|
|
LOCAL_CFLAGS := $(vold_cflags)
|
|
LOCAL_CONLYFLAGS := $(vold_conlyflags)
|
|
|
|
include $(BUILD_EXECUTABLE)
|