diff options
-rw-r--r-- | ChangeLog | 10 | ||||
-rw-r--r-- | configure.ac | 5 | ||||
-rw-r--r-- | misc.c | 13 | ||||
-rw-r--r-- | misc.h | 3 | ||||
-rw-r--r-- | openbsd-compat/openbsd-compat.h | 6 | ||||
-rw-r--r-- | openbsd-compat/timingsafe_bcmp.c | 34 |
6 files changed, 54 insertions, 17 deletions
@@ -1,3 +1,13 @@ | |||
1 | 20101007 | ||
2 | - (djm) OpenBSD CVS Sync | ||
3 | - matthew@cvs.openbsd.org 2010/09/24 13:33:00 | ||
4 | [misc.c misc.h configure.ac openbsd-compat/openbsd-compat.h] | ||
5 | [openbsd-compat/timingsafe_bcmp.c] | ||
6 | Add timingsafe_bcmp(3) to libc, mention that it's already in the | ||
7 | kernel in kern(9), and remove it from OpenSSH. | ||
8 | ok deraadt@, djm@ | ||
9 | NB. re-added under openbsd-compat/ for portable OpenSSH | ||
10 | |||
1 | 20100924 | 11 | 20100924 |
2 | - (djm) OpenBSD CVS Sync | 12 | - (djm) OpenBSD CVS Sync |
3 | - naddy@cvs.openbsd.org 2010/09/10 15:19:29 | 13 | - naddy@cvs.openbsd.org 2010/09/10 15:19:29 |
diff --git a/configure.ac b/configure.ac index d267ba2b1..9b67e3d47 100644 --- a/configure.ac +++ b/configure.ac | |||
@@ -1,4 +1,4 @@ | |||
1 | # $Id: configure.ac,v 1.452 2010/09/10 01:39:27 djm Exp $ | 1 | # $Id: configure.ac,v 1.453 2010/10/07 10:25:28 djm Exp $ |
2 | # | 2 | # |
3 | # Copyright (c) 1999-2004 Damien Miller | 3 | # Copyright (c) 1999-2004 Damien Miller |
4 | # | 4 | # |
@@ -15,7 +15,7 @@ | |||
15 | # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | 15 | # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
16 | 16 | ||
17 | AC_INIT(OpenSSH, Portable, openssh-unix-dev@mindrot.org) | 17 | AC_INIT(OpenSSH, Portable, openssh-unix-dev@mindrot.org) |
18 | AC_REVISION($Revision: 1.452 $) | 18 | AC_REVISION($Revision: 1.453 $) |
19 | AC_CONFIG_SRCDIR([ssh.c]) | 19 | AC_CONFIG_SRCDIR([ssh.c]) |
20 | 20 | ||
21 | AC_CONFIG_HEADER(config.h) | 21 | AC_CONFIG_HEADER(config.h) |
@@ -1434,6 +1434,7 @@ AC_CHECK_FUNCS( \ | |||
1434 | swap32 \ | 1434 | swap32 \ |
1435 | sysconf \ | 1435 | sysconf \ |
1436 | tcgetpgrp \ | 1436 | tcgetpgrp \ |
1437 | timingsafe_bcmp \ | ||
1437 | truncate \ | 1438 | truncate \ |
1438 | unsetenv \ | 1439 | unsetenv \ |
1439 | updwtmpx \ | 1440 | updwtmpx \ |
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: misc.c,v 1.81 2010/09/22 22:58:51 djm Exp $ */ | 1 | /* $OpenBSD: misc.c,v 1.82 2010/09/24 13:33:00 matthew Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2000 Markus Friedl. All rights reserved. | 3 | * Copyright (c) 2000 Markus Friedl. All rights reserved. |
4 | * Copyright (c) 2005,2006 Damien Miller. All rights reserved. | 4 | * Copyright (c) 2005,2006 Damien Miller. All rights reserved. |
@@ -850,17 +850,6 @@ ms_to_timeval(struct timeval *tv, int ms) | |||
850 | tv->tv_usec = (ms % 1000) * 1000; | 850 | tv->tv_usec = (ms % 1000) * 1000; |
851 | } | 851 | } |
852 | 852 | ||
853 | int | ||
854 | timingsafe_bcmp(const void *b1, const void *b2, size_t n) | ||
855 | { | ||
856 | const unsigned char *p1 = b1, *p2 = b2; | ||
857 | int ret = 0; | ||
858 | |||
859 | for (; n > 0; n--) | ||
860 | ret |= *p1++ ^ *p2++; | ||
861 | return (ret != 0); | ||
862 | } | ||
863 | |||
864 | void | 853 | void |
865 | bandwidth_limit_init(struct bwlimit *bw, u_int64_t kbps, size_t buflen) | 854 | bandwidth_limit_init(struct bwlimit *bw, u_int64_t kbps, size_t buflen) |
866 | { | 855 | { |
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: misc.h,v 1.44 2010/09/22 22:58:51 djm Exp $ */ | 1 | /* $OpenBSD: misc.h,v 1.45 2010/09/24 13:33:00 matthew Exp $ */ |
2 | 2 | ||
3 | /* | 3 | /* |
4 | * Author: Tatu Ylonen <ylo@cs.hut.fi> | 4 | * Author: Tatu Ylonen <ylo@cs.hut.fi> |
@@ -36,7 +36,6 @@ void sanitise_stdfd(void); | |||
36 | void ms_subtract_diff(struct timeval *, int *); | 36 | void ms_subtract_diff(struct timeval *, int *); |
37 | void ms_to_timeval(struct timeval *, int); | 37 | void ms_to_timeval(struct timeval *, int); |
38 | void sock_set_v6only(int); | 38 | void sock_set_v6only(int); |
39 | int timingsafe_bcmp(const void *, const void *, size_t); | ||
40 | 39 | ||
41 | struct passwd *pwcopy(struct passwd *); | 40 | struct passwd *pwcopy(struct passwd *); |
42 | const char *ssh_gai_strerror(int); | 41 | const char *ssh_gai_strerror(int); |
diff --git a/openbsd-compat/openbsd-compat.h b/openbsd-compat/openbsd-compat.h index e15d2bd96..77c5ed2b1 100644 --- a/openbsd-compat/openbsd-compat.h +++ b/openbsd-compat/openbsd-compat.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $Id: openbsd-compat.h,v 1.50 2010/08/16 03:15:23 dtucker Exp $ */ | 1 | /* $Id: openbsd-compat.h,v 1.51 2010/10/07 10:25:29 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. |
@@ -213,6 +213,10 @@ char *user_from_uid(uid_t, int); | |||
213 | char *group_from_gid(gid_t, int); | 213 | char *group_from_gid(gid_t, int); |
214 | #endif | 214 | #endif |
215 | 215 | ||
216 | #ifndef HAVE_TIMINGSAFE_BCMP | ||
217 | int timingsafe_bcmp(const void *, const void *, size_t); | ||
218 | #endif | ||
219 | |||
216 | void *xmmap(size_t size); | 220 | void *xmmap(size_t size); |
217 | char *xcrypt(const char *password, const char *salt); | 221 | char *xcrypt(const char *password, const char *salt); |
218 | char *shadow_pw(struct passwd *pw); | 222 | char *shadow_pw(struct passwd *pw); |
diff --git a/openbsd-compat/timingsafe_bcmp.c b/openbsd-compat/timingsafe_bcmp.c new file mode 100644 index 000000000..7e28c0e2a --- /dev/null +++ b/openbsd-compat/timingsafe_bcmp.c | |||
@@ -0,0 +1,34 @@ | |||
1 | /* $OpenBSD: timingsafe_bcmp.c,v 1.1 2010/09/24 13:33:00 matthew Exp $ */ | ||
2 | /* | ||
3 | * Copyright (c) 2010 Damien Miller. All rights reserved. | ||
4 | * | ||
5 | * Permission to use, copy, modify, and distribute this software for any | ||
6 | * purpose with or without fee is hereby granted, provided that the above | ||
7 | * copyright notice and this permission notice appear in all copies. | ||
8 | * | ||
9 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | ||
10 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | ||
11 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | ||
12 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | ||
13 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | ||
14 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | ||
15 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||
16 | */ | ||
17 | |||
18 | /* OPENBSD ORIGINAL: lib/libc/string/timingsafe_bcmp.c */ | ||
19 | |||
20 | #include "includes.h" | ||
21 | #ifndef HAVE_TIMINGSAFE_BCMP | ||
22 | |||
23 | int | ||
24 | timingsafe_bcmp(const void *b1, const void *b2, size_t n) | ||
25 | { | ||
26 | const unsigned char *p1 = b1, *p2 = b2; | ||
27 | int ret = 0; | ||
28 | |||
29 | for (; n > 0; n--) | ||
30 | ret |= *p1++ ^ *p2++; | ||
31 | return (ret != 0); | ||
32 | } | ||
33 | |||
34 | #endif /* TIMINGSAFE_BCMP */ | ||