diff options
Diffstat (limited to 'openbsd-compat')
-rw-r--r-- | openbsd-compat/explicit_bzero.c | 20 | ||||
-rw-r--r-- | openbsd-compat/openbsd-compat.h | 6 |
2 files changed, 25 insertions, 1 deletions
diff --git a/openbsd-compat/explicit_bzero.c b/openbsd-compat/explicit_bzero.c new file mode 100644 index 000000000..b106741e5 --- /dev/null +++ b/openbsd-compat/explicit_bzero.c | |||
@@ -0,0 +1,20 @@ | |||
1 | /* OPENBSD ORIGINAL: lib/libc/string/explicit_bzero.c */ | ||
2 | /* $OpenBSD: explicit_bzero.c,v 1.1 2014/01/22 21:06:45 tedu Exp $ */ | ||
3 | /* | ||
4 | * Public domain. | ||
5 | * Written by Ted Unangst | ||
6 | */ | ||
7 | |||
8 | #include "includes.h" | ||
9 | |||
10 | #ifndef HAVE_EXPLICIT_BZERO | ||
11 | |||
12 | /* | ||
13 | * explicit_bzero - don't let the compiler optimize away bzero | ||
14 | */ | ||
15 | void | ||
16 | explicit_bzero(void *p, size_t n) | ||
17 | { | ||
18 | bzero(p, n); | ||
19 | } | ||
20 | #endif | ||
diff --git a/openbsd-compat/openbsd-compat.h b/openbsd-compat/openbsd-compat.h index f34619e4a..bc9888e31 100644 --- a/openbsd-compat/openbsd-compat.h +++ b/openbsd-compat/openbsd-compat.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $Id: openbsd-compat.h,v 1.60 2013/12/07 00:51:54 djm Exp $ */ | 1 | /* $Id: openbsd-compat.h,v 1.61 2014/02/04 00:18:23 djm Exp $ */ |
2 | 2 | ||
3 | /* | 3 | /* |
4 | * Copyright (c) 1999-2003 Damien Miller. All rights reserved. | 4 | * Copyright (c) 1999-2003 Damien Miller. All rights reserved. |
@@ -246,6 +246,10 @@ int bcrypt_pbkdf(const char *, size_t, const u_int8_t *, size_t, | |||
246 | u_int8_t *, size_t, unsigned int); | 246 | u_int8_t *, size_t, unsigned int); |
247 | #endif | 247 | #endif |
248 | 248 | ||
249 | #ifndef HAVE_EXPLICIT_BZERO | ||
250 | void explicit_bzero(void *p, size_t n); | ||
251 | #endif | ||
252 | |||
249 | void *xmmap(size_t size); | 253 | void *xmmap(size_t size); |
250 | char *xcrypt(const char *password, const char *salt); | 254 | char *xcrypt(const char *password, const char *salt); |
251 | char *shadow_pw(struct passwd *pw); | 255 | char *shadow_pw(struct passwd *pw); |