summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authordrochner <drochner@NetBSD.org>2012-08-30 12:16:48 +0000
committerdrochner <drochner@NetBSD.org>2012-08-30 12:16:48 +0000
commit23bb9c3d2a6b4e05b1262696420e976fc6b15cc6 (patch)
tree25b7e2933fe8ca6f1d0a4afbeb776da833de014e /include
parent3ac5dbc4e542b7cd06bcb2ec8788fdd376152196 (diff)
Add "consttime_bcmp" and "explicit_bzero" functions for both kernel
abd userland, as proposed on tech-security, with explicit_bzero using a volatile function pointer as suggested by Alan Barrett. Both do what the name says. For userland, both are prefixed by "__" to keep them out of the user namespace. Change some memset/memcmp uses to the new functions where it makes sense -- these are just some examples, more to come.
Diffstat (limited to 'include')
-rw-r--r--include/string.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/include/string.h b/include/string.h
index ddf77ee27a4..a02ab19e7fa 100644
--- a/include/string.h
+++ b/include/string.h
@@ -1,4 +1,4 @@
-/* $NetBSD: string.h,v 1.40 2012/04/20 16:20:45 joerg Exp $ */
+/* $NetBSD: string.h,v 1.41 2012/08/30 12:16:48 drochner Exp $ */
/*-
* Copyright (c) 1990, 1993
@@ -109,6 +109,8 @@ char *strsep(char **, const char *);
char *stresep(char **, const char *, int);
char *strndup(const char *, size_t);
void *memrchr(const void *, int, size_t);
+void __explicit_bzero(void *, size_t);
+int __consttime_bcmp(const void *, const void *, size_t);
__END_DECLS
#endif
116a56d4'>Add the "mailwrapper" program, which is designed to act as a switchperry