diff options
| author | Brent Cook <busterb@gmail.com> | 2015-05-02 01:40:33 -0500 |
|---|---|---|
| committer | Brent Cook <busterb@gmail.com> | 2015-05-23 19:27:57 -0500 |
| commit | 769d58e4946b35976c4da2ab54c56f6430a45d89 (patch) | |
| tree | 5ff27229f208de7077c9e8f9894c32a1ef8f6f1f /libtls-standalone/include | |
| parent | d3771a41cb106c945e0f538073d0a6e7b35d145b (diff) | |
| download | portable-769d58e4946b35976c4da2ab54c56f6430a45d89.tar.gz portable-769d58e4946b35976c4da2ab54c56f6430a45d89.tar.bz2 portable-769d58e4946b35976c4da2ab54c56f6430a45d89.zip | |
further refactoring, working libtls-standalone
Diffstat (limited to 'libtls-standalone/include')
| -rw-r--r-- | libtls-standalone/include/Makefile.am | 28 | ||||
| -rw-r--r-- | libtls-standalone/include/string.h | 49 |
2 files changed, 50 insertions, 27 deletions
diff --git a/libtls-standalone/include/Makefile.am b/libtls-standalone/include/Makefile.am index 7fbefdc..0783318 100644 --- a/libtls-standalone/include/Makefile.am +++ b/libtls-standalone/include/Makefile.am | |||
| @@ -1,27 +1,5 @@ | |||
| 1 | #noinst_HEADERS = err.h | 1 | noinst_HEADERS = stdlib.h |
| 2 | #noinst_HEADERS += netdb.h | 2 | noinst_HEADERS += string.h |
| 3 | #noinst_HEADERS += poll.h | 3 | noinst_HEADERS += unistd.h |
| 4 | #noinst_HEADERS += pqueue.h | ||
| 5 | #noinst_HEADERS += stdio.h | ||
| 6 | #noinst_HEADERS += stdlib.h | ||
| 7 | #noinst_HEADERS += string.h | ||
| 8 | #noinst_HEADERS += syslog.h | ||
| 9 | #noinst_HEADERS += unistd.h | ||
| 10 | #noinst_HEADERS += win32netcompat.h | ||
| 11 | # | ||
| 12 | #noinst_HEADERS += arpa/inet.h | ||
| 13 | # | ||
| 14 | #noinst_HEADERS += machine/endian.h | ||
| 15 | # | ||
| 16 | #noinst_HEADERS += netinet/in.h | ||
| 17 | #noinst_HEADERS += netinet/tcp.h | ||
| 18 | # | ||
| 19 | #noinst_HEADERS += sys/ioctl.h | ||
| 20 | #noinst_HEADERS += sys/mman.h | ||
| 21 | #noinst_HEADERS += sys/select.h | ||
| 22 | #noinst_HEADERS += sys/socket.h | ||
| 23 | #noinst_HEADERS += sys/times.h | ||
| 24 | #noinst_HEADERS += sys/types.h | ||
| 25 | #noinst_HEADERS += sys/uio.h | ||
| 26 | 4 | ||
| 27 | include_HEADERS = tls.h | 5 | include_HEADERS = tls.h |
diff --git a/libtls-standalone/include/string.h b/libtls-standalone/include/string.h index c42fcba..05d1ffc 100644 --- a/libtls-standalone/include/string.h +++ b/libtls-standalone/include/string.h | |||
| @@ -17,12 +17,57 @@ | |||
| 17 | #include <strings.h> | 17 | #include <strings.h> |
| 18 | #endif | 18 | #endif |
| 19 | 19 | ||
| 20 | #ifndef HAVE_EXPLICIT_BZERO | 20 | #ifndef HAVE_STRLCPY |
| 21 | void explicit_bzero(void *, size_t); | 21 | size_t strlcpy(char *dst, const char *src, size_t siz); |
| 22 | #endif | ||
| 23 | |||
| 24 | #ifndef HAVE_STRLCAT | ||
| 25 | size_t strlcat(char *dst, const char *src, size_t siz); | ||
| 26 | #endif | ||
| 27 | |||
| 28 | #ifndef HAVE_STRNDUP | ||
| 29 | char * strndup(const char *str, size_t maxlen); | ||
| 30 | /* the only user of strnlen is strndup, so only build it if needed */ | ||
| 31 | #ifndef HAVE_STRNLEN | ||
| 32 | size_t strnlen(const char *str, size_t maxlen); | ||
| 33 | #endif | ||
| 22 | #endif | 34 | #endif |
| 23 | 35 | ||
| 24 | #ifndef HAVE_STRSEP | 36 | #ifndef HAVE_STRSEP |
| 25 | char *strsep(char **stringp, const char *delim); | 37 | char *strsep(char **stringp, const char *delim); |
| 26 | #endif | 38 | #endif |
| 27 | 39 | ||
| 40 | #ifndef HAVE_EXPLICIT_BZERO | ||
| 41 | void explicit_bzero(void *, size_t); | ||
| 42 | #endif | ||
| 43 | |||
| 44 | #ifndef HAVE_TIMINGSAFE_BCMP | ||
| 45 | int timingsafe_bcmp(const void *b1, const void *b2, size_t n); | ||
| 46 | #endif | ||
| 47 | |||
| 48 | #ifndef HAVE_TIMINGSAFE_MEMCMP | ||
| 49 | int timingsafe_memcmp(const void *b1, const void *b2, size_t len); | ||
| 50 | #endif | ||
| 51 | |||
| 52 | #ifndef HAVE_MEMMEM | ||
| 53 | void * memmem(const void *big, size_t big_len, const void *little, | ||
| 54 | size_t little_len); | ||
| 55 | #endif | ||
| 56 | |||
| 57 | #ifdef _WIN32 | ||
| 58 | #include <errno.h> | ||
| 59 | |||
| 60 | static inline char * | ||
| 61 | posix_strerror(int errnum) | ||
| 62 | { | ||
| 63 | if (errnum == ECONNREFUSED) { | ||
| 64 | return "Connection refused"; | ||
| 65 | } | ||
| 66 | return strerror(errnum); | ||
| 67 | } | ||
| 68 | |||
| 69 | #define strerror(errnum) posix_strerror(errnum) | ||
| 70 | |||
| 71 | #endif | ||
| 72 | |||
| 28 | #endif | 73 | #endif |
