diff options
Diffstat (limited to 'openbsd-compat')
-rw-r--r-- | openbsd-compat/Makefile.in | 4 | ||||
-rw-r--r-- | openbsd-compat/bsd-poll.c | 11 | ||||
-rw-r--r-- | openbsd-compat/explicit_bzero.c | 20 | ||||
-rw-r--r-- | openbsd-compat/openbsd-compat.h | 6 | ||||
-rw-r--r-- | openbsd-compat/openssl-compat.c | 10 | ||||
-rw-r--r-- | openbsd-compat/openssl-compat.h | 6 |
6 files changed, 45 insertions, 12 deletions
diff --git a/openbsd-compat/Makefile.in b/openbsd-compat/Makefile.in index 276646fa6..6ecfb93d5 100644 --- a/openbsd-compat/Makefile.in +++ b/openbsd-compat/Makefile.in | |||
@@ -1,4 +1,4 @@ | |||
1 | # $Id: Makefile.in,v 1.54 2013/12/07 01:37:54 djm Exp $ | 1 | # $Id: Makefile.in,v 1.55 2014/02/04 00:37:50 djm Exp $ |
2 | 2 | ||
3 | sysconfdir=@sysconfdir@ | 3 | sysconfdir=@sysconfdir@ |
4 | piddir=@piddir@ | 4 | piddir=@piddir@ |
@@ -16,7 +16,7 @@ RANLIB=@RANLIB@ | |||
16 | INSTALL=@INSTALL@ | 16 | INSTALL=@INSTALL@ |
17 | LDFLAGS=-L. @LDFLAGS@ | 17 | LDFLAGS=-L. @LDFLAGS@ |
18 | 18 | ||
19 | OPENBSD=base64.o basename.o bcrypt_pbkdf.o bindresvport.o blowfish.o daemon.o dirname.o fmt_scaled.o getcwd.o getgrouplist.o getopt_long.o getrrsetbyname.o glob.o inet_aton.o inet_ntoa.o inet_ntop.o mktemp.o pwcache.o readpassphrase.o realpath.o rresvport.o setenv.o setproctitle.o sha2.o sigact.o strlcat.o strlcpy.o strmode.o strnlen.o strptime.o strsep.o strtonum.o strtoll.o strtoul.o strtoull.o timingsafe_bcmp.o vis.o blowfish.o bcrypt_pbkdf.o | 19 | OPENBSD=base64.o basename.o bcrypt_pbkdf.o bindresvport.o blowfish.o daemon.o dirname.o fmt_scaled.o getcwd.o getgrouplist.o getopt_long.o getrrsetbyname.o glob.o inet_aton.o inet_ntoa.o inet_ntop.o mktemp.o pwcache.o readpassphrase.o realpath.o rresvport.o setenv.o setproctitle.o sha2.o sigact.o strlcat.o strlcpy.o strmode.o strnlen.o strptime.o strsep.o strtonum.o strtoll.o strtoul.o strtoull.o timingsafe_bcmp.o vis.o blowfish.o bcrypt_pbkdf.o explicit_bzero.o |
20 | 20 | ||
21 | COMPAT=arc4random.o bsd-asprintf.o bsd-closefrom.o bsd-cray.o bsd-cygwin_util.o bsd-getpeereid.o getrrsetbyname-ldns.o bsd-misc.o bsd-nextstep.o bsd-openpty.o bsd-poll.o bsd-setres_id.o bsd-snprintf.o bsd-statvfs.o bsd-waitpid.o fake-rfc2553.o openssl-compat.o xmmap.o xcrypt.o | 21 | COMPAT=arc4random.o bsd-asprintf.o bsd-closefrom.o bsd-cray.o bsd-cygwin_util.o bsd-getpeereid.o getrrsetbyname-ldns.o bsd-misc.o bsd-nextstep.o bsd-openpty.o bsd-poll.o bsd-setres_id.o bsd-snprintf.o bsd-statvfs.o bsd-waitpid.o fake-rfc2553.o openssl-compat.o xmmap.o xcrypt.o |
22 | 22 | ||
diff --git a/openbsd-compat/bsd-poll.c b/openbsd-compat/bsd-poll.c index c7ef82776..73a852480 100644 --- a/openbsd-compat/bsd-poll.c +++ b/openbsd-compat/bsd-poll.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $Id: bsd-poll.c,v 1.5 2013/11/08 10:12:58 dtucker Exp $ */ | 1 | /* $Id: bsd-poll.c,v 1.6 2014/02/05 23:44:13 dtucker Exp $ */ |
2 | 2 | ||
3 | /* | 3 | /* |
4 | * Copyright (c) 2004, 2005, 2007 Darren Tucker (dtucker at zip com au). | 4 | * Copyright (c) 2004, 2005, 2007 Darren Tucker (dtucker at zip com au). |
@@ -109,12 +109,9 @@ poll(struct pollfd *fds, nfds_t nfds, int timeout) | |||
109 | } | 109 | } |
110 | 110 | ||
111 | out: | 111 | out: |
112 | if (readfds != NULL) | 112 | free(readfds); |
113 | free(readfds); | 113 | free(writefds); |
114 | if (writefds != NULL) | 114 | free(exceptfds); |
115 | free(writefds); | ||
116 | if (exceptfds != NULL) | ||
117 | free(exceptfds); | ||
118 | if (ret == -1) | 115 | if (ret == -1) |
119 | errno = saved_errno; | 116 | errno = saved_errno; |
120 | return ret; | 117 | return ret; |
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); |
diff --git a/openbsd-compat/openssl-compat.c b/openbsd-compat/openssl-compat.c index 60eac4b17..885c121f2 100644 --- a/openbsd-compat/openssl-compat.c +++ b/openbsd-compat/openssl-compat.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $Id: openssl-compat.c,v 1.16 2014/01/17 07:00:41 dtucker Exp $ */ | 1 | /* $Id: openssl-compat.c,v 1.17 2014/02/13 05:38:33 dtucker Exp $ */ |
2 | 2 | ||
3 | /* | 3 | /* |
4 | * Copyright (c) 2005 Darren Tucker <dtucker@zip.com.au> | 4 | * Copyright (c) 2005 Darren Tucker <dtucker@zip.com.au> |
@@ -96,6 +96,14 @@ ssh_EVP_DigestUpdate(EVP_MD_CTX *ctx, const void *d, unsigned int cnt) | |||
96 | } | 96 | } |
97 | #endif | 97 | #endif |
98 | 98 | ||
99 | #ifndef HAVE_EVP_MD_CTX_COPY_EX | ||
100 | int | ||
101 | EVP_MD_CTX_copy_ex(EVP_MD_CTX *out, const EVP_MD_CTX *in) | ||
102 | { | ||
103 | return EVP_MD_CTX_copy(out, in); | ||
104 | } | ||
105 | #endif | ||
106 | |||
99 | #ifndef HAVE_BN_IS_PRIME_EX | 107 | #ifndef HAVE_BN_IS_PRIME_EX |
100 | int | 108 | int |
101 | BN_is_prime_ex(const BIGNUM *p, int nchecks, BN_CTX *ctx, void *cb) | 109 | BN_is_prime_ex(const BIGNUM *p, int nchecks, BN_CTX *ctx, void *cb) |
diff --git a/openbsd-compat/openssl-compat.h b/openbsd-compat/openssl-compat.h index 021ea98f5..276b9706d 100644 --- a/openbsd-compat/openssl-compat.h +++ b/openbsd-compat/openssl-compat.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $Id: openssl-compat.h,v 1.25 2014/01/17 06:32:31 dtucker Exp $ */ | 1 | /* $Id: openssl-compat.h,v 1.26 2014/02/13 05:38:33 dtucker Exp $ */ |
2 | 2 | ||
3 | /* | 3 | /* |
4 | * Copyright (c) 2005 Darren Tucker <dtucker@zip.com.au> | 4 | * Copyright (c) 2005 Darren Tucker <dtucker@zip.com.au> |
@@ -156,6 +156,10 @@ int EVP_DigestInit_ex(EVP_MD_CTX *, const EVP_MD *, void *); | |||
156 | int EVP_DigestFinal_ex(EVP_MD_CTX *, unsigned char *, unsigned int *); | 156 | int EVP_DigestFinal_ex(EVP_MD_CTX *, unsigned char *, unsigned int *); |
157 | # endif | 157 | # endif |
158 | 158 | ||
159 | # ifndef EVP_MD_CTX_COPY_EX | ||
160 | int EVP_MD_CTX_copy_ex(EVP_MD_CTX *, const EVP_MD_CTX *); | ||
161 | # endif | ||
162 | |||
159 | int ssh_EVP_CipherInit(EVP_CIPHER_CTX *, const EVP_CIPHER *, unsigned char *, | 163 | int ssh_EVP_CipherInit(EVP_CIPHER_CTX *, const EVP_CIPHER *, unsigned char *, |
160 | unsigned char *, int); | 164 | unsigned char *, int); |
161 | int ssh_EVP_Cipher(EVP_CIPHER_CTX *, char *, char *, int); | 165 | int ssh_EVP_Cipher(EVP_CIPHER_CTX *, char *, char *, int); |