diff options
author | miod <> | 2015-02-10 09:46:30 +0000 |
---|---|---|
committer | miod <> | 2015-02-10 09:46:30 +0000 |
commit | c54f1e6efb3beda80d415ba75614cbc695f799be (patch) | |
tree | 8bb4657eb5417a2a0ea6710585ef13aa7b25433c /src/lib/libcrypto/aes | |
parent | bedef42af36243e74221aa77e809718c15fae035 (diff) | |
download | openbsd-c54f1e6efb3beda80d415ba75614cbc695f799be.tar.gz openbsd-c54f1e6efb3beda80d415ba75614cbc695f799be.tar.bz2 openbsd-c54f1e6efb3beda80d415ba75614cbc695f799be.zip |
Remove assert() or OPENSSL_assert() of pointers being non-NULL. The policy
for libraries in OpenBSD is to deliberately let NULL pointers cause a SIGSEGV.
ok doug@ jsing@
Diffstat (limited to 'src/lib/libcrypto/aes')
-rw-r--r-- | src/lib/libcrypto/aes/aes_core.c | 5 | ||||
-rw-r--r-- | src/lib/libcrypto/aes/aes_ecb.c | 6 | ||||
-rw-r--r-- | src/lib/libcrypto/aes/aes_ige.c | 6 | ||||
-rw-r--r-- | src/lib/libcrypto/aes/aes_x86core.c | 5 |
4 files changed, 5 insertions, 17 deletions
diff --git a/src/lib/libcrypto/aes/aes_core.c b/src/lib/libcrypto/aes/aes_core.c index ee21057392..93c32b919b 100644 --- a/src/lib/libcrypto/aes/aes_core.c +++ b/src/lib/libcrypto/aes/aes_core.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: aes_core.c,v 1.11 2014/07/09 09:10:07 miod Exp $ */ | 1 | /* $OpenBSD: aes_core.c,v 1.12 2015/02/10 09:46:30 miod Exp $ */ |
2 | /** | 2 | /** |
3 | * rijndael-alg-fst.c | 3 | * rijndael-alg-fst.c |
4 | * | 4 | * |
@@ -33,7 +33,6 @@ | |||
33 | # define NDEBUG | 33 | # define NDEBUG |
34 | # endif | 34 | # endif |
35 | #endif | 35 | #endif |
36 | #include <assert.h> | ||
37 | 36 | ||
38 | #include <stdlib.h> | 37 | #include <stdlib.h> |
39 | #include <openssl/aes.h> | 38 | #include <openssl/aes.h> |
@@ -795,7 +794,6 @@ AES_encrypt(const unsigned char *in, unsigned char *out, const AES_KEY *key) | |||
795 | int r; | 794 | int r; |
796 | #endif /* ?FULL_UNROLL */ | 795 | #endif /* ?FULL_UNROLL */ |
797 | 796 | ||
798 | assert(in && out && key); | ||
799 | rk = key->rd_key; | 797 | rk = key->rd_key; |
800 | 798 | ||
801 | /* | 799 | /* |
@@ -986,7 +984,6 @@ AES_decrypt(const unsigned char *in, unsigned char *out, const AES_KEY *key) | |||
986 | int r; | 984 | int r; |
987 | #endif /* ?FULL_UNROLL */ | 985 | #endif /* ?FULL_UNROLL */ |
988 | 986 | ||
989 | assert(in && out && key); | ||
990 | rk = key->rd_key; | 987 | rk = key->rd_key; |
991 | 988 | ||
992 | /* | 989 | /* |
diff --git a/src/lib/libcrypto/aes/aes_ecb.c b/src/lib/libcrypto/aes/aes_ecb.c index 976c48fdbc..b05e53994b 100644 --- a/src/lib/libcrypto/aes/aes_ecb.c +++ b/src/lib/libcrypto/aes/aes_ecb.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: aes_ecb.c,v 1.5 2014/06/12 15:49:27 deraadt Exp $ */ | 1 | /* $OpenBSD: aes_ecb.c,v 1.6 2015/02/10 09:46:30 miod Exp $ */ |
2 | /* ==================================================================== | 2 | /* ==================================================================== |
3 | * Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved. | 3 | * Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved. |
4 | * | 4 | * |
@@ -54,7 +54,6 @@ | |||
54 | # define NDEBUG | 54 | # define NDEBUG |
55 | # endif | 55 | # endif |
56 | #endif | 56 | #endif |
57 | #include <assert.h> | ||
58 | 57 | ||
59 | #include <openssl/aes.h> | 58 | #include <openssl/aes.h> |
60 | #include "aes_locl.h" | 59 | #include "aes_locl.h" |
@@ -63,9 +62,6 @@ void | |||
63 | AES_ecb_encrypt(const unsigned char *in, unsigned char *out, | 62 | AES_ecb_encrypt(const unsigned char *in, unsigned char *out, |
64 | const AES_KEY *key, const int enc) | 63 | const AES_KEY *key, const int enc) |
65 | { | 64 | { |
66 | assert(in && out && key); | ||
67 | assert((AES_ENCRYPT == enc) || (AES_DECRYPT == enc)); | ||
68 | |||
69 | if (AES_ENCRYPT == enc) | 65 | if (AES_ENCRYPT == enc) |
70 | AES_encrypt(in, out, key); | 66 | AES_encrypt(in, out, key); |
71 | else | 67 | else |
diff --git a/src/lib/libcrypto/aes/aes_ige.c b/src/lib/libcrypto/aes/aes_ige.c index a8dec0a361..16ef5612eb 100644 --- a/src/lib/libcrypto/aes/aes_ige.c +++ b/src/lib/libcrypto/aes/aes_ige.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: aes_ige.c,v 1.6 2014/07/11 08:44:47 jsing Exp $ */ | 1 | /* $OpenBSD: aes_ige.c,v 1.7 2015/02/10 09:46:30 miod Exp $ */ |
2 | /* ==================================================================== | 2 | /* ==================================================================== |
3 | * Copyright (c) 2006 The OpenSSL Project. All rights reserved. | 3 | * Copyright (c) 2006 The OpenSSL Project. All rights reserved. |
4 | * | 4 | * |
@@ -81,10 +81,8 @@ AES_ige_encrypt(const unsigned char *in, unsigned char *out, size_t length, | |||
81 | const AES_KEY *key, unsigned char *ivec, const int enc) | 81 | const AES_KEY *key, unsigned char *ivec, const int enc) |
82 | { | 82 | { |
83 | size_t n; | 83 | size_t n; |
84 | size_t len = length; | 84 | size_t len; |
85 | 85 | ||
86 | OPENSSL_assert(in && out && key && ivec); | ||
87 | OPENSSL_assert((AES_ENCRYPT == enc) || (AES_DECRYPT == enc)); | ||
88 | OPENSSL_assert((length % AES_BLOCK_SIZE) == 0); | 86 | OPENSSL_assert((length % AES_BLOCK_SIZE) == 0); |
89 | 87 | ||
90 | len = length / AES_BLOCK_SIZE; | 88 | len = length / AES_BLOCK_SIZE; |
diff --git a/src/lib/libcrypto/aes/aes_x86core.c b/src/lib/libcrypto/aes/aes_x86core.c index c7a2e0a9a6..c604fa876f 100644 --- a/src/lib/libcrypto/aes/aes_x86core.c +++ b/src/lib/libcrypto/aes/aes_x86core.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: aes_x86core.c,v 1.7 2014/10/28 07:35:58 jsg Exp $ */ | 1 | /* $OpenBSD: aes_x86core.c,v 1.8 2015/02/10 09:46:30 miod Exp $ */ |
2 | /** | 2 | /** |
3 | * rijndael-alg-fst.c | 3 | * rijndael-alg-fst.c |
4 | * | 4 | * |
@@ -40,7 +40,6 @@ | |||
40 | # define NDEBUG | 40 | # define NDEBUG |
41 | # endif | 41 | # endif |
42 | #endif | 42 | #endif |
43 | #include <assert.h> | ||
44 | 43 | ||
45 | #include <stdlib.h> | 44 | #include <stdlib.h> |
46 | #include <openssl/aes.h> | 45 | #include <openssl/aes.h> |
@@ -661,7 +660,6 @@ AES_encrypt(const unsigned char *in, unsigned char *out, const AES_KEY *key) | |||
661 | u32 s0, s1, s2, s3, t[4]; | 660 | u32 s0, s1, s2, s3, t[4]; |
662 | int r; | 661 | int r; |
663 | 662 | ||
664 | assert(in && out && key); | ||
665 | rk = key->rd_key; | 663 | rk = key->rd_key; |
666 | 664 | ||
667 | /* | 665 | /* |
@@ -881,7 +879,6 @@ AES_decrypt(const unsigned char *in, unsigned char *out, const AES_KEY *key) | |||
881 | u32 s0, s1, s2, s3, t[4]; | 879 | u32 s0, s1, s2, s3, t[4]; |
882 | int r; | 880 | int r; |
883 | 881 | ||
884 | assert(in && out && key); | ||
885 | rk = key->rd_key; | 882 | rk = key->rd_key; |
886 | 883 | ||
887 | /* | 884 | /* |