summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorMarc Kleine-Budde <mkl@pengutronix.de>2015-10-25 22:03:34 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2015-11-27 08:26:40 +0100
commitcd04ed31209d31db0642dcc910354eda9c6d5c52 (patch)
tree62be1a6a0e1b2064f9c0c06f9ffa8070709ee7a2 /include
parent7ce48b67cb9abd7772c72a9e3f9d6c7716741be4 (diff)
downloadbarebox-cd04ed31209d31db0642dcc910354eda9c6d5c52.tar.gz
barebox-cd04ed31209d31db0642dcc910354eda9c6d5c52.tar.xz
crypto: add simple keystore
This patch adds a simple keystore to barebox. The keystore implements a simple key-value store to hold arbitrary values. Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include')
-rw-r--r--include/crypto/keystore.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/include/crypto/keystore.h b/include/crypto/keystore.h
new file mode 100644
index 0000000000..29915854b8
--- /dev/null
+++ b/include/crypto/keystore.h
@@ -0,0 +1,26 @@
+/*
+ * Copyright (C) 2015 Pengutronix, Marc Kleine-Budde <kernel@pengutronix.de>
+ *
+ * This program is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License version 2 as published by the
+ * Free Software Foundation.
+ */
+
+#ifndef __CRYPTO_KEYSTORE_H
+#define __CRYPTO_KEYSTORE_H
+
+#ifdef CONFIG_CRYPTO_KEYSTORE
+int keystore_get_secret(const char *name, const u8 **secret, int *secret_len);
+int keystore_set_secret(const char *name, const u8 *secret, int secret_len);
+#else
+static inline int keystore_get_secret(const char *name, const u8 **secret, int *secret_len)
+{
+ return -EINVAL;
+}
+static inline int keystore_set_secret(const char *name, const u8 *secret, int secret_len)
+{
+ return 0;
+}
+#endif
+
+#endif