summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/modes/cts128.c
diff options
context:
space:
mode:
authormiod <>2015-02-10 09:46:30 +0000
committermiod <>2015-02-10 09:46:30 +0000
commitc54f1e6efb3beda80d415ba75614cbc695f799be (patch)
tree8bb4657eb5417a2a0ea6710585ef13aa7b25433c /src/lib/libcrypto/modes/cts128.c
parentbedef42af36243e74221aa77e809718c15fae035 (diff)
downloadopenbsd-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/modes/cts128.c')
-rw-r--r--src/lib/libcrypto/modes/cts128.c19
1 files changed, 1 insertions, 18 deletions
diff --git a/src/lib/libcrypto/modes/cts128.c b/src/lib/libcrypto/modes/cts128.c
index e34989adc1..192dfb7c14 100644
--- a/src/lib/libcrypto/modes/cts128.c
+++ b/src/lib/libcrypto/modes/cts128.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: cts128.c,v 1.3 2014/06/12 15:49:30 deraadt Exp $ */ 1/* $OpenBSD: cts128.c,v 1.4 2015/02/10 09:46:30 miod Exp $ */
2/* ==================================================================== 2/* ====================================================================
3 * Copyright (c) 2008 The OpenSSL Project. All rights reserved. 3 * Copyright (c) 2008 The OpenSSL Project. All rights reserved.
4 * 4 *
@@ -15,7 +15,6 @@
15# define NDEBUG 15# define NDEBUG
16# endif 16# endif
17#endif 17#endif
18#include <assert.h>
19 18
20/* 19/*
21 * Trouble with Ciphertext Stealing, CTS, mode is that there is no 20 * Trouble with Ciphertext Stealing, CTS, mode is that there is no
@@ -35,8 +34,6 @@ size_t CRYPTO_cts128_encrypt_block(const unsigned char *in, unsigned char *out,
35 unsigned char ivec[16], block128_f block) 34 unsigned char ivec[16], block128_f block)
36{ size_t residue, n; 35{ size_t residue, n;
37 36
38 assert (in && out && key && ivec);
39
40 if (len <= 16) return 0; 37 if (len <= 16) return 0;
41 38
42 if ((residue=len%16) == 0) residue = 16; 39 if ((residue=len%16) == 0) residue = 16;
@@ -62,8 +59,6 @@ size_t CRYPTO_nistcts128_encrypt_block(const unsigned char *in, unsigned char *o
62 unsigned char ivec[16], block128_f block) 59 unsigned char ivec[16], block128_f block)
63{ size_t residue, n; 60{ size_t residue, n;
64 61
65 assert (in && out && key && ivec);
66
67 if (len < 16) return 0; 62 if (len < 16) return 0;
68 63
69 residue=len%16; 64 residue=len%16;
@@ -91,8 +86,6 @@ size_t CRYPTO_cts128_encrypt(const unsigned char *in, unsigned char *out,
91{ size_t residue; 86{ size_t residue;
92 union { size_t align; unsigned char c[16]; } tmp; 87 union { size_t align; unsigned char c[16]; } tmp;
93 88
94 assert (in && out && key && ivec);
95
96 if (len <= 16) return 0; 89 if (len <= 16) return 0;
97 90
98 if ((residue=len%16) == 0) residue = 16; 91 if ((residue=len%16) == 0) residue = 16;
@@ -123,8 +116,6 @@ size_t CRYPTO_nistcts128_encrypt(const unsigned char *in, unsigned char *out,
123{ size_t residue; 116{ size_t residue;
124 union { size_t align; unsigned char c[16]; } tmp; 117 union { size_t align; unsigned char c[16]; } tmp;
125 118
126 assert (in && out && key && ivec);
127
128 if (len < 16) return 0; 119 if (len < 16) return 0;
129 120
130 residue=len%16; 121 residue=len%16;
@@ -154,8 +145,6 @@ size_t CRYPTO_cts128_decrypt_block(const unsigned char *in, unsigned char *out,
154{ size_t residue, n; 145{ size_t residue, n;
155 union { size_t align; unsigned char c[32]; } tmp; 146 union { size_t align; unsigned char c[32]; } tmp;
156 147
157 assert (in && out && key && ivec);
158
159 if (len<=16) return 0; 148 if (len<=16) return 0;
160 149
161 if ((residue=len%16) == 0) residue = 16; 150 if ((residue=len%16) == 0) residue = 16;
@@ -191,8 +180,6 @@ size_t CRYPTO_nistcts128_decrypt_block(const unsigned char *in, unsigned char *o
191{ size_t residue, n; 180{ size_t residue, n;
192 union { size_t align; unsigned char c[32]; } tmp; 181 union { size_t align; unsigned char c[32]; } tmp;
193 182
194 assert (in && out && key && ivec);
195
196 if (len<16) return 0; 183 if (len<16) return 0;
197 184
198 residue=len%16; 185 residue=len%16;
@@ -234,8 +221,6 @@ size_t CRYPTO_cts128_decrypt(const unsigned char *in, unsigned char *out,
234{ size_t residue; 221{ size_t residue;
235 union { size_t align; unsigned char c[32]; } tmp; 222 union { size_t align; unsigned char c[32]; } tmp;
236 223
237 assert (in && out && key && ivec);
238
239 if (len<=16) return 0; 224 if (len<=16) return 0;
240 225
241 if ((residue=len%16) == 0) residue = 16; 226 if ((residue=len%16) == 0) residue = 16;
@@ -268,8 +253,6 @@ size_t CRYPTO_nistcts128_decrypt(const unsigned char *in, unsigned char *out,
268{ size_t residue; 253{ size_t residue;
269 union { size_t align; unsigned char c[32]; } tmp; 254 union { size_t align; unsigned char c[32]; } tmp;
270 255
271 assert (in && out && key && ivec);
272
273 if (len<16) return 0; 256 if (len<16) return 0;
274 257
275 residue=len%16; 258 residue=len%16;