diff options
-rw-r--r-- | helper.c | 16 | ||||
-rw-r--r-- | helper.h | 7 | ||||
-rw-r--r-- | mktemp.c | 5 | ||||
-rw-r--r-- | mktemp.h | 4 | ||||
-rw-r--r-- | rc4.c | 4 | ||||
-rw-r--r-- | rc4.h | 5 | ||||
-rw-r--r-- | strlcpy.c | 5 | ||||
-rw-r--r-- | strlcpy.h | 5 |
8 files changed, 45 insertions, 6 deletions
@@ -45,18 +45,15 @@ | |||
45 | 45 | ||
46 | #include "rc4.h" | 46 | #include "rc4.h" |
47 | #include "xmalloc.h" | 47 | #include "xmalloc.h" |
48 | 48 | #include "config.h" | |
49 | #include "helper.h" | 49 | #include "helper.h" |
50 | 50 | ||
51 | #ifndef HAVE_ARC4RANDOM | ||
52 | |||
51 | void get_random_bytes(unsigned char *buf, int len); | 53 | void get_random_bytes(unsigned char *buf, int len); |
52 | 54 | ||
53 | static rc4_t *rc4 = NULL; | 55 | static rc4_t *rc4 = NULL; |
54 | 56 | ||
55 | void setproctitle(const char *fmt, ...) | ||
56 | { | ||
57 | /* FIXME */ | ||
58 | } | ||
59 | |||
60 | unsigned int arc4random(void) | 57 | unsigned int arc4random(void) |
61 | { | 58 | { |
62 | unsigned int r; | 59 | unsigned int r; |
@@ -105,4 +102,11 @@ void get_random_bytes(unsigned char *buf, int len) | |||
105 | exit(1); | 102 | exit(1); |
106 | } | 103 | } |
107 | } | 104 | } |
105 | #endif /* !HAVE_ARC4RANDOM */ | ||
108 | 106 | ||
107 | #ifndef HAVE_SETPROCTITLE | ||
108 | void setproctitle(const char *fmt, ...) | ||
109 | { | ||
110 | /* FIXME */ | ||
111 | } | ||
112 | #endif /* !HAVE_SETPROCTITLE */ | ||
@@ -36,8 +36,15 @@ | |||
36 | #ifndef _HELPER_H | 36 | #ifndef _HELPER_H |
37 | #define _HELPER_H | 37 | #define _HELPER_H |
38 | 38 | ||
39 | #include "config.h" | ||
40 | |||
41 | #ifndef HAVE_ARC4RANDOM | ||
39 | unsigned int arc4random(void); | 42 | unsigned int arc4random(void); |
40 | void arc4random_stir(void); | 43 | void arc4random_stir(void); |
44 | #endif /* !HAVE_ARC4RANDOM */ | ||
45 | |||
46 | #ifndef HAVE_SETPROCTITLE | ||
41 | void setproctitle(const char *fmt, ...); | 47 | void setproctitle(const char *fmt, ...); |
48 | #endif /* !HAVE_SETPROCTITLE */ | ||
42 | 49 | ||
43 | #endif /* _HELPER_H */ | 50 | #endif /* _HELPER_H */ |
@@ -47,8 +47,11 @@ static char rcsid[] = "$OpenBSD: mktemp.c,v 1.13 1998/06/30 23:03:13 deraadt Exp | |||
47 | #include <ctype.h> | 47 | #include <ctype.h> |
48 | #include <unistd.h> | 48 | #include <unistd.h> |
49 | 49 | ||
50 | #include "config.h" | ||
50 | #include "helper.h" | 51 | #include "helper.h" |
51 | 52 | ||
53 | #ifndef HAVE_MKDTEMP | ||
54 | |||
52 | static int _gettemp __P((char *, int *, int, int)); | 55 | static int _gettemp __P((char *, int *, int, int)); |
53 | 56 | ||
54 | int | 57 | int |
@@ -181,3 +184,5 @@ _gettemp(path, doopen, domkdir, slen) | |||
181 | } | 184 | } |
182 | /*NOTREACHED*/ | 185 | /*NOTREACHED*/ |
183 | } | 186 | } |
187 | |||
188 | #endif /* !HAVE_MKDTEMP */ | ||
@@ -1,7 +1,11 @@ | |||
1 | #ifndef _MKTEMP_H | 1 | #ifndef _MKTEMP_H |
2 | #define _MKTEMP_H | 2 | #define _MKTEMP_H |
3 | |||
4 | #include "config.h" | ||
5 | #ifndef HAVE_MKDTEMP | ||
3 | int mkstemps(char *path, int slen); | 6 | int mkstemps(char *path, int slen); |
4 | int mkstemp(char *path); | 7 | int mkstemp(char *path); |
5 | char *mkdtemp(char *path); | 8 | char *mkdtemp(char *path); |
9 | #endif /* !HAVE_MKDTEMP */ | ||
6 | 10 | ||
7 | #endif /* _MKTEMP_H */ | 11 | #endif /* _MKTEMP_H */ |
@@ -41,6 +41,9 @@ | |||
41 | 41 | ||
42 | /* $Id: rc4.c,v 1.1.1.1 1999/10/26 05:48:13 damien Exp $ */ | 42 | /* $Id: rc4.c,v 1.1.1.1 1999/10/26 05:48:13 damien Exp $ */ |
43 | 43 | ||
44 | #include "config.h" | ||
45 | |||
46 | #ifndef HAVE_ARC4RANDOM | ||
44 | #include "rc4.h" | 47 | #include "rc4.h" |
45 | 48 | ||
46 | 49 | ||
@@ -103,3 +106,4 @@ void rc4_getbytes(rc4_t *r, unsigned char *buffer, int len) | |||
103 | c++; | 106 | c++; |
104 | } | 107 | } |
105 | } | 108 | } |
109 | #endif /* !HAVE_ARC4RANDOM */ | ||
@@ -44,6 +44,9 @@ | |||
44 | #ifndef _RC4_H | 44 | #ifndef _RC4_H |
45 | #define _RC4_H | 45 | #define _RC4_H |
46 | 46 | ||
47 | #include "config.h" | ||
48 | #ifndef HAVE_ARC4RANDOM | ||
49 | |||
47 | /*! \struct rc4_t | 50 | /*! \struct rc4_t |
48 | \brief RC4 stream cipher state object | 51 | \brief RC4 stream cipher state object |
49 | \var s State array | 52 | \var s State array |
@@ -107,4 +110,6 @@ void rc4_crypt(rc4_t *r, unsigned char *plaintext, int len); | |||
107 | */ | 110 | */ |
108 | void rc4_getbytes(rc4_t *r, unsigned char *buffer, int len); | 111 | void rc4_getbytes(rc4_t *r, unsigned char *buffer, int len); |
109 | 112 | ||
113 | #endif /* !HAVE_ARC4RANDOM */ | ||
114 | |||
110 | #endif /* _RC4_H */ | 115 | #endif /* _RC4_H */ |
@@ -34,6 +34,9 @@ static char *rcsid = "$OpenBSD: strlcpy.c,v 1.4 1999/05/01 18:56:41 millert Exp | |||
34 | #include <sys/types.h> | 34 | #include <sys/types.h> |
35 | #include <string.h> | 35 | #include <string.h> |
36 | 36 | ||
37 | #include "config.h" | ||
38 | #ifndef HAVE_STRLCPY | ||
39 | |||
37 | /* | 40 | /* |
38 | * Copy src to string dst of size siz. At most siz-1 characters | 41 | * Copy src to string dst of size siz. At most siz-1 characters |
39 | * will be copied. Always NUL terminates (unless siz == 0). | 42 | * will be copied. Always NUL terminates (unless siz == 0). |
@@ -66,3 +69,5 @@ size_t strlcpy(dst, src, siz) | |||
66 | 69 | ||
67 | return(s - src - 1); /* count does not include NUL */ | 70 | return(s - src - 1); /* count does not include NUL */ |
68 | } | 71 | } |
72 | |||
73 | #endif /* !HAVE_STRLCPY */ | ||
@@ -1,4 +1,9 @@ | |||
1 | #ifndef _STRLCPY_H | 1 | #ifndef _STRLCPY_H |
2 | #define _STRLCPY_H | 2 | #define _STRLCPY_H |
3 | |||
4 | #include "config.h" | ||
5 | #ifndef HAVE_STRLCPY | ||
3 | size_t strlcpy(char *dst, const char *src, size_t siz); | 6 | size_t strlcpy(char *dst, const char *src, size_t siz); |
7 | #endif /* !HAVE_STRLCPY */ | ||
8 | |||
4 | #endif /* _STRLCPY_H */ | 9 | #endif /* _STRLCPY_H */ |