Skip to contentSkip to conversation

Add MMC password protection (lock/unlock) support

PATCH New Anderson Briglia 1 participant 1 message Dec 13, 2005 MMC, SD and SDIO

lore
Share & tools
lore
#0 lore raw

PATCH 3/5 Add MMC password protection (lock/unlock) support

Implement key retention operations. mmc_key_instantiate() is used for unlocking and password assignment (from no-password state). mmc_key_update() is used for password change.

drivers/mmc/Kconfig +13 -0
Index: linux-2.6.14-omap2/drivers/mmc/Kconfig
===================================================================
@@ -19,6 +19,19 @@ config MMC_DEBUG
 	  This is an option for use by developers; most people should
 	  say N here.  This enables MMC core and driver debugging.
 
+config MMC_PASSWORDS
+	boolean "MMC card lock/unlock passwords (EXPERIMENTAL)"
+	depends on MMC && EXPERIMENTAL
+	select KEYS
+	help
+	  Say Y here to enable the use of passwords to lock and unlock
+	  MMC cards.  This uses the access key retention support, using
+	  request_key to look up the key associated with each card.
+
+	  For example, if you have an MMC card that was locked using
+	  Symbian OS on your cell phone, you won't be able to read it
+	  on Linux without this support.
+
 config MMC_BLOCK
 	tristate "MMC block device driver"
 	depends on MMC
drivers/mmc/mmc.h +8 -0
Index: linux-2.6.14-omap2/drivers/mmc/mmc.h
===================================================================
@@ -18,4 +18,12 @@ struct mmc_host *mmc_alloc_host_sysfs(in
 int mmc_add_host_sysfs(struct mmc_host *host);
 void mmc_remove_host_sysfs(struct mmc_host *host);
 void mmc_free_host_sysfs(struct mmc_host *host);
+
+/* core-internal data */
+extern struct key_type mmc_key_type;
+struct mmc_key_payload {
+	struct rcu_head	rcu;		/* RCU destructor */
+	unsigned short	datalen;	/* length of this data */
+	char		data[0];	/* actual data */
+};
 #endif
drivers/mmc/mmc_sysfs.c +157 -0

187 lines not on this page · raw message

--
Anderson Briglia,
Anderson Lizardo,
Carlos Eduardo Aguiar

Embedded Linux Lab - 10LE
Nokia Institute of Technology - INdT
Manaus - Brazil