summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>2010-09-08 03:55:21 +0800
committerSascha Hauer <s.hauer@pengutronix.de>2010-09-20 08:57:22 +0200
commitc83ebb95f10d1fab01395ec3d9c9b4a34224cc98 (patch)
treeb3f553115597476957edfd2dda7836ace7bae8fc /include
parentc3ad283b8b119836790f1dfe6af20c60d396870a (diff)
downloadbarebox-c83ebb95f10d1fab01395ec3d9c9b4a34224cc98.tar.gz
barebox-c83ebb95f10d1fab01395ec3d9c9b4a34224cc98.tar.xz
add password framework
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Diffstat (limited to 'include')
-rw-r--r--include/password.h41
1 files changed, 41 insertions, 0 deletions
diff --git a/include/password.h b/include/password.h
new file mode 100644
index 0000000000..32301eb482
--- /dev/null
+++ b/include/password.h
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 2008-2010 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * 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.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef __PASSWORD_H__
+#define __PASSWORD_H__
+
+#define PASSWD_FILE "/env/etc/passwd"
+#define PASSWD_DIR "/env/etc/"
+
+#define HIDE (0 << 0)
+#define STAR (1 << 1)
+#define CLEAR (1 << 2)
+
+int password(unsigned char *passwd, size_t length, int flags);
+
+int read_passwd(unsigned char *sum, size_t length);
+int write_passwd(unsigned char *sum, size_t length);
+
+int is_passwd_enable(void);
+int passwd_disable(void);
+int check_passwd(unsigned char* passwd, size_t length);
+int set_passwd(unsigned char* passwd, size_t length);
+
+#endif /* __PASSWORD_H__ */