diff options
| author | doug <> | 2015-06-27 22:42:02 +0000 |
|---|---|---|
| committer | doug <> | 2015-06-27 22:42:02 +0000 |
| commit | b1e0a2287902704dfe165a7ba7d1fe23b22bf25f (patch) | |
| tree | f07bd4c63266de218a647e6e2be1380d66d9641a /src | |
| parent | 3af2c9be3406b2ad8bbf0bd753101ef67f99b275 (diff) | |
| download | openbsd-b1e0a2287902704dfe165a7ba7d1fe23b22bf25f.tar.gz openbsd-b1e0a2287902704dfe165a7ba7d1fe23b22bf25f.tar.bz2 openbsd-b1e0a2287902704dfe165a7ba7d1fe23b22bf25f.zip | |
Fix pointer to unsigned long conversion.
bcook@ notes that this check really only impacted 64-bit Windows. Also,
changed the check to be unsigned for consistency.
ok bcook@
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/libcrypto/cryptlib.c | 8 | ||||
| -rw-r--r-- | src/lib/libcrypto/crypto/Makefile | 4 | ||||
| -rw-r--r-- | src/lib/libssl/src/crypto/cryptlib.c | 8 | ||||
| -rw-r--r-- | src/lib/libssl/ssl/Makefile | 4 |
4 files changed, 14 insertions, 10 deletions
diff --git a/src/lib/libcrypto/cryptlib.c b/src/lib/libcrypto/cryptlib.c index dc92ac89fe..896e3d39cf 100644 --- a/src/lib/libcrypto/cryptlib.c +++ b/src/lib/libcrypto/cryptlib.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: cryptlib.c,v 1.34 2015/01/22 03:56:27 bcook Exp $ */ | 1 | /* $OpenBSD: cryptlib.c,v 1.35 2015/06/27 22:42:02 doug Exp $ */ |
| 2 | /* ==================================================================== | 2 | /* ==================================================================== |
| 3 | * Copyright (c) 1998-2006 The OpenSSL Project. All rights reserved. | 3 | * Copyright (c) 1998-2006 The OpenSSL Project. All rights reserved. |
| 4 | * | 4 | * |
| @@ -114,7 +114,9 @@ | |||
| 114 | * SUN MICROSYSTEMS, INC., and contributed to the OpenSSL project. | 114 | * SUN MICROSYSTEMS, INC., and contributed to the OpenSSL project. |
| 115 | */ | 115 | */ |
| 116 | 116 | ||
| 117 | #include <limits.h> | ||
| 117 | #include <stdarg.h> | 118 | #include <stdarg.h> |
| 119 | #include <stdint.h> | ||
| 118 | #include <string.h> | 120 | #include <string.h> |
| 119 | #include <unistd.h> | 121 | #include <unistd.h> |
| 120 | 122 | ||
| @@ -431,9 +433,9 @@ CRYPTO_THREADID_set_pointer(CRYPTO_THREADID *id, void *ptr) | |||
| 431 | { | 433 | { |
| 432 | memset(id, 0, sizeof(*id)); | 434 | memset(id, 0, sizeof(*id)); |
| 433 | id->ptr = ptr; | 435 | id->ptr = ptr; |
| 434 | #if LONG_MAX >= INTPTR_MAX | 436 | #if ULONG_MAX >= UINTPTR_MAX |
| 435 | /*s u 'ptr' can be embedded in 'val' without loss of uniqueness */ | 437 | /*s u 'ptr' can be embedded in 'val' without loss of uniqueness */ |
| 436 | id->val = (unsigned long)id->ptr; | 438 | id->val = (uintptr_t)id->ptr; |
| 437 | #else | 439 | #else |
| 438 | { | 440 | { |
| 439 | SHA256_CTX ctx; | 441 | SHA256_CTX ctx; |
diff --git a/src/lib/libcrypto/crypto/Makefile b/src/lib/libcrypto/crypto/Makefile index d523e8029d..c1905516c2 100644 --- a/src/lib/libcrypto/crypto/Makefile +++ b/src/lib/libcrypto/crypto/Makefile | |||
| @@ -1,11 +1,11 @@ | |||
| 1 | # $OpenBSD: Makefile,v 1.58 2015/06/20 01:07:24 doug Exp $ | 1 | # $OpenBSD: Makefile,v 1.59 2015/06/27 22:42:02 doug Exp $ |
| 2 | 2 | ||
| 3 | LIB= crypto | 3 | LIB= crypto |
| 4 | 4 | ||
| 5 | SSL_SRC= ${.CURDIR}/../../libssl/src | 5 | SSL_SRC= ${.CURDIR}/../../libssl/src |
| 6 | LCRYPTO_SRC= ${SSL_SRC}/crypto | 6 | LCRYPTO_SRC= ${SSL_SRC}/crypto |
| 7 | 7 | ||
| 8 | CFLAGS+= -Wall -Werror | 8 | CFLAGS+= -Wall -Wundef -Werror |
| 9 | 9 | ||
| 10 | .include <bsd.own.mk> # for 'NOPIC' definition | 10 | .include <bsd.own.mk> # for 'NOPIC' definition |
| 11 | .if !defined(NOPIC) | 11 | .if !defined(NOPIC) |
diff --git a/src/lib/libssl/src/crypto/cryptlib.c b/src/lib/libssl/src/crypto/cryptlib.c index dc92ac89fe..896e3d39cf 100644 --- a/src/lib/libssl/src/crypto/cryptlib.c +++ b/src/lib/libssl/src/crypto/cryptlib.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: cryptlib.c,v 1.34 2015/01/22 03:56:27 bcook Exp $ */ | 1 | /* $OpenBSD: cryptlib.c,v 1.35 2015/06/27 22:42:02 doug Exp $ */ |
| 2 | /* ==================================================================== | 2 | /* ==================================================================== |
| 3 | * Copyright (c) 1998-2006 The OpenSSL Project. All rights reserved. | 3 | * Copyright (c) 1998-2006 The OpenSSL Project. All rights reserved. |
| 4 | * | 4 | * |
| @@ -114,7 +114,9 @@ | |||
| 114 | * SUN MICROSYSTEMS, INC., and contributed to the OpenSSL project. | 114 | * SUN MICROSYSTEMS, INC., and contributed to the OpenSSL project. |
| 115 | */ | 115 | */ |
| 116 | 116 | ||
| 117 | #include <limits.h> | ||
| 117 | #include <stdarg.h> | 118 | #include <stdarg.h> |
| 119 | #include <stdint.h> | ||
| 118 | #include <string.h> | 120 | #include <string.h> |
| 119 | #include <unistd.h> | 121 | #include <unistd.h> |
| 120 | 122 | ||
| @@ -431,9 +433,9 @@ CRYPTO_THREADID_set_pointer(CRYPTO_THREADID *id, void *ptr) | |||
| 431 | { | 433 | { |
| 432 | memset(id, 0, sizeof(*id)); | 434 | memset(id, 0, sizeof(*id)); |
| 433 | id->ptr = ptr; | 435 | id->ptr = ptr; |
| 434 | #if LONG_MAX >= INTPTR_MAX | 436 | #if ULONG_MAX >= UINTPTR_MAX |
| 435 | /*s u 'ptr' can be embedded in 'val' without loss of uniqueness */ | 437 | /*s u 'ptr' can be embedded in 'val' without loss of uniqueness */ |
| 436 | id->val = (unsigned long)id->ptr; | 438 | id->val = (uintptr_t)id->ptr; |
| 437 | #else | 439 | #else |
| 438 | { | 440 | { |
| 439 | SHA256_CTX ctx; | 441 | SHA256_CTX ctx; |
diff --git a/src/lib/libssl/ssl/Makefile b/src/lib/libssl/ssl/Makefile index a13fcdf512..0ff974e4de 100644 --- a/src/lib/libssl/ssl/Makefile +++ b/src/lib/libssl/ssl/Makefile | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | # $OpenBSD: Makefile,v 1.52 2015/06/05 21:42:37 tobiasu Exp $ | 1 | # $OpenBSD: Makefile,v 1.53 2015/06/27 22:42:02 doug Exp $ |
| 2 | 2 | ||
| 3 | LIB= ssl | 3 | LIB= ssl |
| 4 | 4 | ||
| @@ -6,7 +6,7 @@ SSL_SRC= ${.CURDIR}/../../libssl/src | |||
| 6 | LSSL_SRC= ${SSL_SRC}/ssl | 6 | LSSL_SRC= ${SSL_SRC}/ssl |
| 7 | 7 | ||
| 8 | .include <bsd.own.mk> | 8 | .include <bsd.own.mk> |
| 9 | CFLAGS+= -Wall | 9 | CFLAGS+= -Wall -Wundef |
| 10 | .if ${COMPILER_VERSION:L} != "gcc3" | 10 | .if ${COMPILER_VERSION:L} != "gcc3" |
| 11 | CFLAGS+= -Werror | 11 | CFLAGS+= -Werror |
| 12 | .endif | 12 | .endif |
