summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/lib/libcrypto/aes/aes_core.c5
-rw-r--r--src/lib/libcrypto/aes/aes_ecb.c6
-rw-r--r--src/lib/libcrypto/aes/aes_ige.c6
-rw-r--r--src/lib/libcrypto/aes/aes_x86core.c5
-rw-r--r--src/lib/libcrypto/des/cfb_enc.c8
-rw-r--r--src/lib/libcrypto/engine/eng_aesni.c7
-rw-r--r--src/lib/libcrypto/gost/gost2814789.c6
-rw-r--r--src/lib/libcrypto/modes/cbc128.c7
-rw-r--r--src/lib/libcrypto/modes/ccm128.c3
-rw-r--r--src/lib/libcrypto/modes/cfb128.c11
-rw-r--r--src/lib/libcrypto/modes/ctr128.c4
-rw-r--r--src/lib/libcrypto/modes/cts128.c19
-rw-r--r--src/lib/libcrypto/modes/gcm128.c3
-rw-r--r--src/lib/libcrypto/modes/ofb128.c5
-rw-r--r--src/lib/libcrypto/modes/xts128.c3
-rw-r--r--src/lib/libcrypto/ts/ts_verify_ctx.c4
-rw-r--r--src/lib/libssl/src/crypto/aes/aes_core.c5
-rw-r--r--src/lib/libssl/src/crypto/aes/aes_ecb.c6
-rw-r--r--src/lib/libssl/src/crypto/aes/aes_ige.c6
-rw-r--r--src/lib/libssl/src/crypto/aes/aes_x86core.c5
-rw-r--r--src/lib/libssl/src/crypto/des/cfb_enc.c8
-rw-r--r--src/lib/libssl/src/crypto/engine/eng_aesni.c7
-rw-r--r--src/lib/libssl/src/crypto/gost/gost2814789.c6
-rw-r--r--src/lib/libssl/src/crypto/modes/cbc128.c7
-rw-r--r--src/lib/libssl/src/crypto/modes/ccm128.c3
-rw-r--r--src/lib/libssl/src/crypto/modes/cfb128.c11
-rw-r--r--src/lib/libssl/src/crypto/modes/ctr128.c4
-rw-r--r--src/lib/libssl/src/crypto/modes/cts128.c19
-rw-r--r--src/lib/libssl/src/crypto/modes/gcm128.c3
-rw-r--r--src/lib/libssl/src/crypto/modes/ofb128.c5
-rw-r--r--src/lib/libssl/src/crypto/modes/xts128.c3
-rw-r--r--src/lib/libssl/src/crypto/ts/ts_verify_ctx.c4
32 files changed, 34 insertions, 170 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
63AES_ecb_encrypt(const unsigned char *in, unsigned char *out, 62AES_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 /*
diff --git a/src/lib/libcrypto/des/cfb_enc.c b/src/lib/libcrypto/des/cfb_enc.c
index d654a6a8e2..59a3e71862 100644
--- a/src/lib/libcrypto/des/cfb_enc.c
+++ b/src/lib/libcrypto/des/cfb_enc.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: cfb_enc.c,v 1.12 2014/10/28 07:35:58 jsg Exp $ */ 1/* $OpenBSD: cfb_enc.c,v 1.13 2015/02/10 09:46:30 miod Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -57,7 +57,6 @@
57 */ 57 */
58 58
59#include "des_locl.h" 59#include "des_locl.h"
60#include <assert.h>
61#include <machine/endian.h> 60#include <machine/endian.h>
62 61
63/* The input and output are loaded in multiples of 8 bits. 62/* The input and output are loaded in multiples of 8 bits.
@@ -82,11 +81,6 @@ void DES_cfb_encrypt(const unsigned char *in, unsigned char *out, int numbits,
82#else 81#else
83 unsigned int sh[4]; 82 unsigned int sh[4];
84 unsigned char *ovec=(unsigned char *)sh; 83 unsigned char *ovec=(unsigned char *)sh;
85
86 /* I kind of count that compiler optimizes away this assertioni,*/
87 assert (sizeof(sh[0])==4); /* as this holds true for all, */
88 /* but 16-bit platforms... */
89
90#endif 84#endif
91 85
92 if (numbits<=0 || numbits > 64) return; 86 if (numbits<=0 || numbits > 64) return;
diff --git a/src/lib/libcrypto/engine/eng_aesni.c b/src/lib/libcrypto/engine/eng_aesni.c
index 94c4c1fb6a..5f9a36236a 100644
--- a/src/lib/libcrypto/engine/eng_aesni.c
+++ b/src/lib/libcrypto/engine/eng_aesni.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: eng_aesni.c,v 1.7 2014/07/11 08:44:48 jsing Exp $ */ 1/* $OpenBSD: eng_aesni.c,v 1.8 2015/02/10 09:46:30 miod Exp $ */
2/* 2/*
3 * Support for Intel AES-NI intruction set 3 * Support for Intel AES-NI intruction set
4 * Author: Huang Ying <ying.huang@intel.com> 4 * Author: Huang Ying <ying.huang@intel.com>
@@ -73,7 +73,6 @@
73 * 73 *
74 */ 74 */
75 75
76#include <assert.h>
77#include <stdio.h> 76#include <stdio.h>
78 77
79#include <openssl/opensslconf.h> 78#include <openssl/opensslconf.h>
@@ -156,8 +155,6 @@ aesni_cfb128_encrypt(const unsigned char *in, unsigned char *out,
156 unsigned int n; 155 unsigned int n;
157 size_t l = 0; 156 size_t l = 0;
158 157
159 assert(in && out && key && ivec && num);
160
161 n = *num; 158 n = *num;
162 159
163 if (enc) { 160 if (enc) {
@@ -261,8 +258,6 @@ aesni_ofb128_encrypt(const unsigned char *in, unsigned char *out,
261 unsigned int n; 258 unsigned int n;
262 size_t l = 0; 259 size_t l = 0;
263 260
264 assert(in && out && key && ivec && num);
265
266 n = *num; 261 n = *num;
267 262
268#if !defined(OPENSSL_SMALL_FOOTPRINT) 263#if !defined(OPENSSL_SMALL_FOOTPRINT)
diff --git a/src/lib/libcrypto/gost/gost2814789.c b/src/lib/libcrypto/gost/gost2814789.c
index e1084cb4ac..b1bef9eae3 100644
--- a/src/lib/libcrypto/gost/gost2814789.c
+++ b/src/lib/libcrypto/gost/gost2814789.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: gost2814789.c,v 1.3 2014/12/07 16:33:51 jsing Exp $ */ 1/* $OpenBSD: gost2814789.c,v 1.4 2015/02/10 09:46:30 miod Exp $ */
2/* 2/*
3 * Copyright (c) 2014 Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> 3 * Copyright (c) 2014 Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
4 * Copyright (c) 2005-2006 Cryptocom LTD 4 * Copyright (c) 2005-2006 Cryptocom LTD
@@ -212,8 +212,6 @@ Gost2814789_cfb64_encrypt(const unsigned char *in, unsigned char *out,
212 unsigned int n; 212 unsigned int n;
213 size_t l = 0; 213 size_t l = 0;
214 214
215 OPENSSL_assert(in && out && key && ivec && num);
216
217 n = *num; 215 n = *num;
218 216
219 if (enc) { 217 if (enc) {
@@ -357,8 +355,6 @@ Gost2814789_cnt_encrypt(const unsigned char *in, unsigned char *out, size_t len,
357 unsigned int n; 355 unsigned int n;
358 size_t l = 0; 356 size_t l = 0;
359 357
360 OPENSSL_assert(in && out && key && cnt_buf && num);
361
362 n = *num; 358 n = *num;
363 359
364#if !defined(OPENSSL_SMALL_FOOTPRINT) 360#if !defined(OPENSSL_SMALL_FOOTPRINT)
diff --git a/src/lib/libcrypto/modes/cbc128.c b/src/lib/libcrypto/modes/cbc128.c
index 74fcdbe6e3..fe45103b0c 100644
--- a/src/lib/libcrypto/modes/cbc128.c
+++ b/src/lib/libcrypto/modes/cbc128.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: cbc128.c,v 1.3 2014/06/12 15:49:30 deraadt Exp $ */ 1/* $OpenBSD: cbc128.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 *
@@ -58,7 +58,6 @@
58# define NDEBUG 58# define NDEBUG
59# endif 59# endif
60#endif 60#endif
61#include <assert.h>
62 61
63#undef STRICT_ALIGNMENT 62#undef STRICT_ALIGNMENT
64#ifdef __STRICT_ALIGNMENT 63#ifdef __STRICT_ALIGNMENT
@@ -74,8 +73,6 @@ void CRYPTO_cbc128_encrypt(const unsigned char *in, unsigned char *out,
74 size_t n; 73 size_t n;
75 const unsigned char *iv = ivec; 74 const unsigned char *iv = ivec;
76 75
77 assert(in && out && key && ivec);
78
79#if !defined(OPENSSL_SMALL_FOOTPRINT) 76#if !defined(OPENSSL_SMALL_FOOTPRINT)
80 if (STRICT_ALIGNMENT && 77 if (STRICT_ALIGNMENT &&
81 ((size_t)in|(size_t)out|(size_t)ivec)%sizeof(size_t) != 0) { 78 ((size_t)in|(size_t)out|(size_t)ivec)%sizeof(size_t) != 0) {
@@ -123,8 +120,6 @@ void CRYPTO_cbc128_decrypt(const unsigned char *in, unsigned char *out,
123 size_t n; 120 size_t n;
124 union { size_t t[16/sizeof(size_t)]; unsigned char c[16]; } tmp; 121 union { size_t t[16/sizeof(size_t)]; unsigned char c[16]; } tmp;
125 122
126 assert(in && out && key && ivec);
127
128#if !defined(OPENSSL_SMALL_FOOTPRINT) 123#if !defined(OPENSSL_SMALL_FOOTPRINT)
129 if (in != out) { 124 if (in != out) {
130 const unsigned char *iv = ivec; 125 const unsigned char *iv = ivec;
diff --git a/src/lib/libcrypto/modes/ccm128.c b/src/lib/libcrypto/modes/ccm128.c
index 241e3a9708..58cc4f44c6 100644
--- a/src/lib/libcrypto/modes/ccm128.c
+++ b/src/lib/libcrypto/modes/ccm128.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ccm128.c,v 1.3 2014/06/12 15:49:30 deraadt Exp $ */ 1/* $OpenBSD: ccm128.c,v 1.4 2015/02/10 09:46:30 miod Exp $ */
2/* ==================================================================== 2/* ====================================================================
3 * Copyright (c) 2011 The OpenSSL Project. All rights reserved. 3 * Copyright (c) 2011 The OpenSSL Project. All rights reserved.
4 * 4 *
@@ -57,7 +57,6 @@
57# define NDEBUG 57# define NDEBUG
58# endif 58# endif
59#endif 59#endif
60#include <assert.h>
61 60
62/* First you setup M and L parameters and pass the key schedule. 61/* First you setup M and L parameters and pass the key schedule.
63 * This is called once per session setup... */ 62 * This is called once per session setup... */
diff --git a/src/lib/libcrypto/modes/cfb128.c b/src/lib/libcrypto/modes/cfb128.c
index 593c337e8b..8399f0c5be 100644
--- a/src/lib/libcrypto/modes/cfb128.c
+++ b/src/lib/libcrypto/modes/cfb128.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: cfb128.c,v 1.3 2014/06/12 15:49:30 deraadt Exp $ */ 1/* $OpenBSD: cfb128.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 *
@@ -58,7 +58,6 @@
58# define NDEBUG 58# define NDEBUG
59# endif 59# endif
60#endif 60#endif
61#include <assert.h>
62 61
63/* The input and output encrypted as though 128bit cfb mode is being 62/* The input and output encrypted as though 128bit cfb mode is being
64 * used. The extra state information to record how much of the 63 * used. The extra state information to record how much of the
@@ -72,8 +71,6 @@ void CRYPTO_cfb128_encrypt(const unsigned char *in, unsigned char *out,
72 unsigned int n; 71 unsigned int n;
73 size_t l = 0; 72 size_t l = 0;
74 73
75 assert(in && out && key && ivec && num);
76
77 n = *num; 74 n = *num;
78 75
79 if (enc) { 76 if (enc) {
@@ -215,9 +212,6 @@ void CRYPTO_cfb128_1_encrypt(const unsigned char *in, unsigned char *out,
215 size_t n; 212 size_t n;
216 unsigned char c[1],d[1]; 213 unsigned char c[1],d[1];
217 214
218 assert(in && out && key && ivec && num);
219 assert(*num == 0);
220
221 for(n=0 ; n<bits ; ++n) 215 for(n=0 ; n<bits ; ++n)
222 { 216 {
223 c[0]=(in[n/8]&(1 << (7-n%8))) ? 0x80 : 0; 217 c[0]=(in[n/8]&(1 << (7-n%8))) ? 0x80 : 0;
@@ -234,9 +228,6 @@ void CRYPTO_cfb128_8_encrypt(const unsigned char *in, unsigned char *out,
234{ 228{
235 size_t n; 229 size_t n;
236 230
237 assert(in && out && key && ivec && num);
238 assert(*num == 0);
239
240 for(n=0 ; n<length ; ++n) 231 for(n=0 ; n<length ; ++n)
241 cfbr_encrypt_block(&in[n],&out[n],8,key,ivec,enc,block); 232 cfbr_encrypt_block(&in[n],&out[n],8,key,ivec,enc,block);
242} 233}
diff --git a/src/lib/libcrypto/modes/ctr128.c b/src/lib/libcrypto/modes/ctr128.c
index 99d12b5503..7fd0223701 100644
--- a/src/lib/libcrypto/modes/ctr128.c
+++ b/src/lib/libcrypto/modes/ctr128.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ctr128.c,v 1.5 2014/07/09 16:06:13 miod Exp $ */ 1/* $OpenBSD: ctr128.c,v 1.6 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 *
@@ -121,7 +121,6 @@ void CRYPTO_ctr128_encrypt(const unsigned char *in, unsigned char *out,
121 unsigned int n; 121 unsigned int n;
122 size_t l=0; 122 size_t l=0;
123 123
124 assert(in && out && key && ecount_buf && num);
125 assert(*num < 16); 124 assert(*num < 16);
126 125
127 n = *num; 126 n = *num;
@@ -196,7 +195,6 @@ void CRYPTO_ctr128_encrypt_ctr32(const unsigned char *in, unsigned char *out,
196{ 195{
197 unsigned int n,ctr32; 196 unsigned int n,ctr32;
198 197
199 assert(in && out && key && ecount_buf && num);
200 assert(*num < 16); 198 assert(*num < 16);
201 199
202 n = *num; 200 n = *num;
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;
diff --git a/src/lib/libcrypto/modes/gcm128.c b/src/lib/libcrypto/modes/gcm128.c
index 1106617763..4a72901a33 100644
--- a/src/lib/libcrypto/modes/gcm128.c
+++ b/src/lib/libcrypto/modes/gcm128.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: gcm128.c,v 1.11 2015/02/07 13:19:15 doug Exp $ */ 1/* $OpenBSD: gcm128.c,v 1.12 2015/02/10 09:46:30 miod Exp $ */
2/* ==================================================================== 2/* ====================================================================
3 * Copyright (c) 2010 The OpenSSL Project. All rights reserved. 3 * Copyright (c) 2010 The OpenSSL Project. All rights reserved.
4 * 4 *
@@ -59,7 +59,6 @@
59# define NDEBUG 59# define NDEBUG
60# endif 60# endif
61#endif 61#endif
62#include <assert.h>
63 62
64#if defined(BSWAP4) && defined(__STRICT_ALIGNMENT) 63#if defined(BSWAP4) && defined(__STRICT_ALIGNMENT)
65/* redefine, because alignment is ensured */ 64/* redefine, because alignment is ensured */
diff --git a/src/lib/libcrypto/modes/ofb128.c b/src/lib/libcrypto/modes/ofb128.c
index 031110a274..1b8a6fd500 100644
--- a/src/lib/libcrypto/modes/ofb128.c
+++ b/src/lib/libcrypto/modes/ofb128.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ofb128.c,v 1.3 2014/06/12 15:49:30 deraadt Exp $ */ 1/* $OpenBSD: ofb128.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 *
@@ -58,7 +58,6 @@
58# define NDEBUG 58# define NDEBUG
59# endif 59# endif
60#endif 60#endif
61#include <assert.h>
62 61
63/* The input and output encrypted as though 128bit ofb mode is being 62/* The input and output encrypted as though 128bit ofb mode is being
64 * used. The extra state information to record how much of the 63 * used. The extra state information to record how much of the
@@ -72,8 +71,6 @@ void CRYPTO_ofb128_encrypt(const unsigned char *in, unsigned char *out,
72 unsigned int n; 71 unsigned int n;
73 size_t l=0; 72 size_t l=0;
74 73
75 assert(in && out && key && ivec && num);
76
77 n = *num; 74 n = *num;
78 75
79#if !defined(OPENSSL_SMALL_FOOTPRINT) 76#if !defined(OPENSSL_SMALL_FOOTPRINT)
diff --git a/src/lib/libcrypto/modes/xts128.c b/src/lib/libcrypto/modes/xts128.c
index e6a0fbb0fa..3e2378379e 100644
--- a/src/lib/libcrypto/modes/xts128.c
+++ b/src/lib/libcrypto/modes/xts128.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: xts128.c,v 1.5 2014/07/09 16:06:13 miod Exp $ */ 1/* $OpenBSD: xts128.c,v 1.6 2015/02/10 09:46:30 miod Exp $ */
2/* ==================================================================== 2/* ====================================================================
3 * Copyright (c) 2011 The OpenSSL Project. All rights reserved. 3 * Copyright (c) 2011 The OpenSSL Project. All rights reserved.
4 * 4 *
@@ -58,7 +58,6 @@
58# define NDEBUG 58# define NDEBUG
59# endif 59# endif
60#endif 60#endif
61#include <assert.h>
62 61
63int CRYPTO_xts128_encrypt(const XTS128_CONTEXT *ctx, const unsigned char iv[16], 62int CRYPTO_xts128_encrypt(const XTS128_CONTEXT *ctx, const unsigned char iv[16],
64 const unsigned char *inp, unsigned char *out, 63 const unsigned char *inp, unsigned char *out,
diff --git a/src/lib/libcrypto/ts/ts_verify_ctx.c b/src/lib/libcrypto/ts/ts_verify_ctx.c
index 373399d943..7dda76e7d9 100644
--- a/src/lib/libcrypto/ts/ts_verify_ctx.c
+++ b/src/lib/libcrypto/ts/ts_verify_ctx.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ts_verify_ctx.c,v 1.7 2014/07/11 08:44:49 jsing Exp $ */ 1/* $OpenBSD: ts_verify_ctx.c,v 1.8 2015/02/10 09:46:30 miod Exp $ */
2/* Written by Zoltan Glozik (zglozik@stones.com) for the OpenSSL 2/* Written by Zoltan Glozik (zglozik@stones.com) for the OpenSSL
3 * project 2003. 3 * project 2003.
4 */ 4 */
@@ -76,7 +76,6 @@ TS_VERIFY_CTX_new(void)
76void 76void
77TS_VERIFY_CTX_init(TS_VERIFY_CTX *ctx) 77TS_VERIFY_CTX_init(TS_VERIFY_CTX *ctx)
78{ 78{
79 OPENSSL_assert(ctx != NULL);
80 memset(ctx, 0, sizeof(TS_VERIFY_CTX)); 79 memset(ctx, 0, sizeof(TS_VERIFY_CTX));
81} 80}
82 81
@@ -123,7 +122,6 @@ TS_REQ_to_TS_VERIFY_CTX(TS_REQ *req, TS_VERIFY_CTX *ctx)
123 ASN1_OCTET_STRING *msg; 122 ASN1_OCTET_STRING *msg;
124 const ASN1_INTEGER *nonce; 123 const ASN1_INTEGER *nonce;
125 124
126 OPENSSL_assert(req != NULL);
127 if (ret) 125 if (ret)
128 TS_VERIFY_CTX_cleanup(ret); 126 TS_VERIFY_CTX_cleanup(ret);
129 else if (!(ret = TS_VERIFY_CTX_new())) 127 else if (!(ret = TS_VERIFY_CTX_new()))
diff --git a/src/lib/libssl/src/crypto/aes/aes_core.c b/src/lib/libssl/src/crypto/aes/aes_core.c
index ee21057392..93c32b919b 100644
--- a/src/lib/libssl/src/crypto/aes/aes_core.c
+++ b/src/lib/libssl/src/crypto/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/libssl/src/crypto/aes/aes_ecb.c b/src/lib/libssl/src/crypto/aes/aes_ecb.c
index 976c48fdbc..b05e53994b 100644
--- a/src/lib/libssl/src/crypto/aes/aes_ecb.c
+++ b/src/lib/libssl/src/crypto/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
63AES_ecb_encrypt(const unsigned char *in, unsigned char *out, 62AES_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/libssl/src/crypto/aes/aes_ige.c b/src/lib/libssl/src/crypto/aes/aes_ige.c
index a8dec0a361..16ef5612eb 100644
--- a/src/lib/libssl/src/crypto/aes/aes_ige.c
+++ b/src/lib/libssl/src/crypto/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/libssl/src/crypto/aes/aes_x86core.c b/src/lib/libssl/src/crypto/aes/aes_x86core.c
index c7a2e0a9a6..c604fa876f 100644
--- a/src/lib/libssl/src/crypto/aes/aes_x86core.c
+++ b/src/lib/libssl/src/crypto/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 /*
diff --git a/src/lib/libssl/src/crypto/des/cfb_enc.c b/src/lib/libssl/src/crypto/des/cfb_enc.c
index d654a6a8e2..59a3e71862 100644
--- a/src/lib/libssl/src/crypto/des/cfb_enc.c
+++ b/src/lib/libssl/src/crypto/des/cfb_enc.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: cfb_enc.c,v 1.12 2014/10/28 07:35:58 jsg Exp $ */ 1/* $OpenBSD: cfb_enc.c,v 1.13 2015/02/10 09:46:30 miod Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -57,7 +57,6 @@
57 */ 57 */
58 58
59#include "des_locl.h" 59#include "des_locl.h"
60#include <assert.h>
61#include <machine/endian.h> 60#include <machine/endian.h>
62 61
63/* The input and output are loaded in multiples of 8 bits. 62/* The input and output are loaded in multiples of 8 bits.
@@ -82,11 +81,6 @@ void DES_cfb_encrypt(const unsigned char *in, unsigned char *out, int numbits,
82#else 81#else
83 unsigned int sh[4]; 82 unsigned int sh[4];
84 unsigned char *ovec=(unsigned char *)sh; 83 unsigned char *ovec=(unsigned char *)sh;
85
86 /* I kind of count that compiler optimizes away this assertioni,*/
87 assert (sizeof(sh[0])==4); /* as this holds true for all, */
88 /* but 16-bit platforms... */
89
90#endif 84#endif
91 85
92 if (numbits<=0 || numbits > 64) return; 86 if (numbits<=0 || numbits > 64) return;
diff --git a/src/lib/libssl/src/crypto/engine/eng_aesni.c b/src/lib/libssl/src/crypto/engine/eng_aesni.c
index 94c4c1fb6a..5f9a36236a 100644
--- a/src/lib/libssl/src/crypto/engine/eng_aesni.c
+++ b/src/lib/libssl/src/crypto/engine/eng_aesni.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: eng_aesni.c,v 1.7 2014/07/11 08:44:48 jsing Exp $ */ 1/* $OpenBSD: eng_aesni.c,v 1.8 2015/02/10 09:46:30 miod Exp $ */
2/* 2/*
3 * Support for Intel AES-NI intruction set 3 * Support for Intel AES-NI intruction set
4 * Author: Huang Ying <ying.huang@intel.com> 4 * Author: Huang Ying <ying.huang@intel.com>
@@ -73,7 +73,6 @@
73 * 73 *
74 */ 74 */
75 75
76#include <assert.h>
77#include <stdio.h> 76#include <stdio.h>
78 77
79#include <openssl/opensslconf.h> 78#include <openssl/opensslconf.h>
@@ -156,8 +155,6 @@ aesni_cfb128_encrypt(const unsigned char *in, unsigned char *out,
156 unsigned int n; 155 unsigned int n;
157 size_t l = 0; 156 size_t l = 0;
158 157
159 assert(in && out && key && ivec && num);
160
161 n = *num; 158 n = *num;
162 159
163 if (enc) { 160 if (enc) {
@@ -261,8 +258,6 @@ aesni_ofb128_encrypt(const unsigned char *in, unsigned char *out,
261 unsigned int n; 258 unsigned int n;
262 size_t l = 0; 259 size_t l = 0;
263 260
264 assert(in && out && key && ivec && num);
265
266 n = *num; 261 n = *num;
267 262
268#if !defined(OPENSSL_SMALL_FOOTPRINT) 263#if !defined(OPENSSL_SMALL_FOOTPRINT)
diff --git a/src/lib/libssl/src/crypto/gost/gost2814789.c b/src/lib/libssl/src/crypto/gost/gost2814789.c
index e1084cb4ac..b1bef9eae3 100644
--- a/src/lib/libssl/src/crypto/gost/gost2814789.c
+++ b/src/lib/libssl/src/crypto/gost/gost2814789.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: gost2814789.c,v 1.3 2014/12/07 16:33:51 jsing Exp $ */ 1/* $OpenBSD: gost2814789.c,v 1.4 2015/02/10 09:46:30 miod Exp $ */
2/* 2/*
3 * Copyright (c) 2014 Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> 3 * Copyright (c) 2014 Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
4 * Copyright (c) 2005-2006 Cryptocom LTD 4 * Copyright (c) 2005-2006 Cryptocom LTD
@@ -212,8 +212,6 @@ Gost2814789_cfb64_encrypt(const unsigned char *in, unsigned char *out,
212 unsigned int n; 212 unsigned int n;
213 size_t l = 0; 213 size_t l = 0;
214 214
215 OPENSSL_assert(in && out && key && ivec && num);
216
217 n = *num; 215 n = *num;
218 216
219 if (enc) { 217 if (enc) {
@@ -357,8 +355,6 @@ Gost2814789_cnt_encrypt(const unsigned char *in, unsigned char *out, size_t len,
357 unsigned int n; 355 unsigned int n;
358 size_t l = 0; 356 size_t l = 0;
359 357
360 OPENSSL_assert(in && out && key && cnt_buf && num);
361
362 n = *num; 358 n = *num;
363 359
364#if !defined(OPENSSL_SMALL_FOOTPRINT) 360#if !defined(OPENSSL_SMALL_FOOTPRINT)
diff --git a/src/lib/libssl/src/crypto/modes/cbc128.c b/src/lib/libssl/src/crypto/modes/cbc128.c
index 74fcdbe6e3..fe45103b0c 100644
--- a/src/lib/libssl/src/crypto/modes/cbc128.c
+++ b/src/lib/libssl/src/crypto/modes/cbc128.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: cbc128.c,v 1.3 2014/06/12 15:49:30 deraadt Exp $ */ 1/* $OpenBSD: cbc128.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 *
@@ -58,7 +58,6 @@
58# define NDEBUG 58# define NDEBUG
59# endif 59# endif
60#endif 60#endif
61#include <assert.h>
62 61
63#undef STRICT_ALIGNMENT 62#undef STRICT_ALIGNMENT
64#ifdef __STRICT_ALIGNMENT 63#ifdef __STRICT_ALIGNMENT
@@ -74,8 +73,6 @@ void CRYPTO_cbc128_encrypt(const unsigned char *in, unsigned char *out,
74 size_t n; 73 size_t n;
75 const unsigned char *iv = ivec; 74 const unsigned char *iv = ivec;
76 75
77 assert(in && out && key && ivec);
78
79#if !defined(OPENSSL_SMALL_FOOTPRINT) 76#if !defined(OPENSSL_SMALL_FOOTPRINT)
80 if (STRICT_ALIGNMENT && 77 if (STRICT_ALIGNMENT &&
81 ((size_t)in|(size_t)out|(size_t)ivec)%sizeof(size_t) != 0) { 78 ((size_t)in|(size_t)out|(size_t)ivec)%sizeof(size_t) != 0) {
@@ -123,8 +120,6 @@ void CRYPTO_cbc128_decrypt(const unsigned char *in, unsigned char *out,
123 size_t n; 120 size_t n;
124 union { size_t t[16/sizeof(size_t)]; unsigned char c[16]; } tmp; 121 union { size_t t[16/sizeof(size_t)]; unsigned char c[16]; } tmp;
125 122
126 assert(in && out && key && ivec);
127
128#if !defined(OPENSSL_SMALL_FOOTPRINT) 123#if !defined(OPENSSL_SMALL_FOOTPRINT)
129 if (in != out) { 124 if (in != out) {
130 const unsigned char *iv = ivec; 125 const unsigned char *iv = ivec;
diff --git a/src/lib/libssl/src/crypto/modes/ccm128.c b/src/lib/libssl/src/crypto/modes/ccm128.c
index 241e3a9708..58cc4f44c6 100644
--- a/src/lib/libssl/src/crypto/modes/ccm128.c
+++ b/src/lib/libssl/src/crypto/modes/ccm128.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ccm128.c,v 1.3 2014/06/12 15:49:30 deraadt Exp $ */ 1/* $OpenBSD: ccm128.c,v 1.4 2015/02/10 09:46:30 miod Exp $ */
2/* ==================================================================== 2/* ====================================================================
3 * Copyright (c) 2011 The OpenSSL Project. All rights reserved. 3 * Copyright (c) 2011 The OpenSSL Project. All rights reserved.
4 * 4 *
@@ -57,7 +57,6 @@
57# define NDEBUG 57# define NDEBUG
58# endif 58# endif
59#endif 59#endif
60#include <assert.h>
61 60
62/* First you setup M and L parameters and pass the key schedule. 61/* First you setup M and L parameters and pass the key schedule.
63 * This is called once per session setup... */ 62 * This is called once per session setup... */
diff --git a/src/lib/libssl/src/crypto/modes/cfb128.c b/src/lib/libssl/src/crypto/modes/cfb128.c
index 593c337e8b..8399f0c5be 100644
--- a/src/lib/libssl/src/crypto/modes/cfb128.c
+++ b/src/lib/libssl/src/crypto/modes/cfb128.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: cfb128.c,v 1.3 2014/06/12 15:49:30 deraadt Exp $ */ 1/* $OpenBSD: cfb128.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 *
@@ -58,7 +58,6 @@
58# define NDEBUG 58# define NDEBUG
59# endif 59# endif
60#endif 60#endif
61#include <assert.h>
62 61
63/* The input and output encrypted as though 128bit cfb mode is being 62/* The input and output encrypted as though 128bit cfb mode is being
64 * used. The extra state information to record how much of the 63 * used. The extra state information to record how much of the
@@ -72,8 +71,6 @@ void CRYPTO_cfb128_encrypt(const unsigned char *in, unsigned char *out,
72 unsigned int n; 71 unsigned int n;
73 size_t l = 0; 72 size_t l = 0;
74 73
75 assert(in && out && key && ivec && num);
76
77 n = *num; 74 n = *num;
78 75
79 if (enc) { 76 if (enc) {
@@ -215,9 +212,6 @@ void CRYPTO_cfb128_1_encrypt(const unsigned char *in, unsigned char *out,
215 size_t n; 212 size_t n;
216 unsigned char c[1],d[1]; 213 unsigned char c[1],d[1];
217 214
218 assert(in && out && key && ivec && num);
219 assert(*num == 0);
220
221 for(n=0 ; n<bits ; ++n) 215 for(n=0 ; n<bits ; ++n)
222 { 216 {
223 c[0]=(in[n/8]&(1 << (7-n%8))) ? 0x80 : 0; 217 c[0]=(in[n/8]&(1 << (7-n%8))) ? 0x80 : 0;
@@ -234,9 +228,6 @@ void CRYPTO_cfb128_8_encrypt(const unsigned char *in, unsigned char *out,
234{ 228{
235 size_t n; 229 size_t n;
236 230
237 assert(in && out && key && ivec && num);
238 assert(*num == 0);
239
240 for(n=0 ; n<length ; ++n) 231 for(n=0 ; n<length ; ++n)
241 cfbr_encrypt_block(&in[n],&out[n],8,key,ivec,enc,block); 232 cfbr_encrypt_block(&in[n],&out[n],8,key,ivec,enc,block);
242} 233}
diff --git a/src/lib/libssl/src/crypto/modes/ctr128.c b/src/lib/libssl/src/crypto/modes/ctr128.c
index 99d12b5503..7fd0223701 100644
--- a/src/lib/libssl/src/crypto/modes/ctr128.c
+++ b/src/lib/libssl/src/crypto/modes/ctr128.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ctr128.c,v 1.5 2014/07/09 16:06:13 miod Exp $ */ 1/* $OpenBSD: ctr128.c,v 1.6 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 *
@@ -121,7 +121,6 @@ void CRYPTO_ctr128_encrypt(const unsigned char *in, unsigned char *out,
121 unsigned int n; 121 unsigned int n;
122 size_t l=0; 122 size_t l=0;
123 123
124 assert(in && out && key && ecount_buf && num);
125 assert(*num < 16); 124 assert(*num < 16);
126 125
127 n = *num; 126 n = *num;
@@ -196,7 +195,6 @@ void CRYPTO_ctr128_encrypt_ctr32(const unsigned char *in, unsigned char *out,
196{ 195{
197 unsigned int n,ctr32; 196 unsigned int n,ctr32;
198 197
199 assert(in && out && key && ecount_buf && num);
200 assert(*num < 16); 198 assert(*num < 16);
201 199
202 n = *num; 200 n = *num;
diff --git a/src/lib/libssl/src/crypto/modes/cts128.c b/src/lib/libssl/src/crypto/modes/cts128.c
index e34989adc1..192dfb7c14 100644
--- a/src/lib/libssl/src/crypto/modes/cts128.c
+++ b/src/lib/libssl/src/crypto/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;
diff --git a/src/lib/libssl/src/crypto/modes/gcm128.c b/src/lib/libssl/src/crypto/modes/gcm128.c
index 1106617763..4a72901a33 100644
--- a/src/lib/libssl/src/crypto/modes/gcm128.c
+++ b/src/lib/libssl/src/crypto/modes/gcm128.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: gcm128.c,v 1.11 2015/02/07 13:19:15 doug Exp $ */ 1/* $OpenBSD: gcm128.c,v 1.12 2015/02/10 09:46:30 miod Exp $ */
2/* ==================================================================== 2/* ====================================================================
3 * Copyright (c) 2010 The OpenSSL Project. All rights reserved. 3 * Copyright (c) 2010 The OpenSSL Project. All rights reserved.
4 * 4 *
@@ -59,7 +59,6 @@
59# define NDEBUG 59# define NDEBUG
60# endif 60# endif
61#endif 61#endif
62#include <assert.h>
63 62
64#if defined(BSWAP4) && defined(__STRICT_ALIGNMENT) 63#if defined(BSWAP4) && defined(__STRICT_ALIGNMENT)
65/* redefine, because alignment is ensured */ 64/* redefine, because alignment is ensured */
diff --git a/src/lib/libssl/src/crypto/modes/ofb128.c b/src/lib/libssl/src/crypto/modes/ofb128.c
index 031110a274..1b8a6fd500 100644
--- a/src/lib/libssl/src/crypto/modes/ofb128.c
+++ b/src/lib/libssl/src/crypto/modes/ofb128.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ofb128.c,v 1.3 2014/06/12 15:49:30 deraadt Exp $ */ 1/* $OpenBSD: ofb128.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 *
@@ -58,7 +58,6 @@
58# define NDEBUG 58# define NDEBUG
59# endif 59# endif
60#endif 60#endif
61#include <assert.h>
62 61
63/* The input and output encrypted as though 128bit ofb mode is being 62/* The input and output encrypted as though 128bit ofb mode is being
64 * used. The extra state information to record how much of the 63 * used. The extra state information to record how much of the
@@ -72,8 +71,6 @@ void CRYPTO_ofb128_encrypt(const unsigned char *in, unsigned char *out,
72 unsigned int n; 71 unsigned int n;
73 size_t l=0; 72 size_t l=0;
74 73
75 assert(in && out && key && ivec && num);
76
77 n = *num; 74 n = *num;
78 75
79#if !defined(OPENSSL_SMALL_FOOTPRINT) 76#if !defined(OPENSSL_SMALL_FOOTPRINT)
diff --git a/src/lib/libssl/src/crypto/modes/xts128.c b/src/lib/libssl/src/crypto/modes/xts128.c
index e6a0fbb0fa..3e2378379e 100644
--- a/src/lib/libssl/src/crypto/modes/xts128.c
+++ b/src/lib/libssl/src/crypto/modes/xts128.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: xts128.c,v 1.5 2014/07/09 16:06:13 miod Exp $ */ 1/* $OpenBSD: xts128.c,v 1.6 2015/02/10 09:46:30 miod Exp $ */
2/* ==================================================================== 2/* ====================================================================
3 * Copyright (c) 2011 The OpenSSL Project. All rights reserved. 3 * Copyright (c) 2011 The OpenSSL Project. All rights reserved.
4 * 4 *
@@ -58,7 +58,6 @@
58# define NDEBUG 58# define NDEBUG
59# endif 59# endif
60#endif 60#endif
61#include <assert.h>
62 61
63int CRYPTO_xts128_encrypt(const XTS128_CONTEXT *ctx, const unsigned char iv[16], 62int CRYPTO_xts128_encrypt(const XTS128_CONTEXT *ctx, const unsigned char iv[16],
64 const unsigned char *inp, unsigned char *out, 63 const unsigned char *inp, unsigned char *out,
diff --git a/src/lib/libssl/src/crypto/ts/ts_verify_ctx.c b/src/lib/libssl/src/crypto/ts/ts_verify_ctx.c
index 373399d943..7dda76e7d9 100644
--- a/src/lib/libssl/src/crypto/ts/ts_verify_ctx.c
+++ b/src/lib/libssl/src/crypto/ts/ts_verify_ctx.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ts_verify_ctx.c,v 1.7 2014/07/11 08:44:49 jsing Exp $ */ 1/* $OpenBSD: ts_verify_ctx.c,v 1.8 2015/02/10 09:46:30 miod Exp $ */
2/* Written by Zoltan Glozik (zglozik@stones.com) for the OpenSSL 2/* Written by Zoltan Glozik (zglozik@stones.com) for the OpenSSL
3 * project 2003. 3 * project 2003.
4 */ 4 */
@@ -76,7 +76,6 @@ TS_VERIFY_CTX_new(void)
76void 76void
77TS_VERIFY_CTX_init(TS_VERIFY_CTX *ctx) 77TS_VERIFY_CTX_init(TS_VERIFY_CTX *ctx)
78{ 78{
79 OPENSSL_assert(ctx != NULL);
80 memset(ctx, 0, sizeof(TS_VERIFY_CTX)); 79 memset(ctx, 0, sizeof(TS_VERIFY_CTX));
81} 80}
82 81
@@ -123,7 +122,6 @@ TS_REQ_to_TS_VERIFY_CTX(TS_REQ *req, TS_VERIFY_CTX *ctx)
123 ASN1_OCTET_STRING *msg; 122 ASN1_OCTET_STRING *msg;
124 const ASN1_INTEGER *nonce; 123 const ASN1_INTEGER *nonce;
125 124
126 OPENSSL_assert(req != NULL);
127 if (ret) 125 if (ret)
128 TS_VERIFY_CTX_cleanup(ret); 126 TS_VERIFY_CTX_cleanup(ret);
129 else if (!(ret = TS_VERIFY_CTX_new())) 127 else if (!(ret = TS_VERIFY_CTX_new()))