bn/bn_lcl.h,bn_nist.c: addres strict warnings with -DBN_DEBUG.
authorAndy Polyakov <appro@openssl.org>
Thu, 12 Jul 2018 17:15:26 +0000 (19:15 +0200)
committerAndy Polyakov <appro@openssl.org>
Sat, 14 Jul 2018 11:44:24 +0000 (13:44 +0200)
Reviewed-by: Rich Salz <rsalz@openssl.org>
crypto/bn/bn_lcl.h
crypto/bn/bn_nist.c

index 0d3a8bfd5dbb1851972dd8775d07deb8aa39a399..d74b590841a58315dca396409d7dfb764cfd713e 100644 (file)
  * all operations manipulating the bit in question in non-BN_DEBUG build.
  */
 #  define BN_FLG_FIXED_TOP 0x10000
-#  include <assert.h>
 #  ifdef BN_DEBUG_RAND
 #   define bn_pollute(a) \
         do { \
         do { \
                 const BIGNUM *_bnum2 = (a); \
                 if (_bnum2 != NULL) { \
-                        int top = _bnum2->top; \
-                        assert((top == 0 && !_bnum2->neg) || \
-                               (top && ((_bnum2->flags & BN_FLG_FIXED_TOP) \
-                                        || _bnum2->d[top - 1] != 0))); \
+                        int _top = _bnum2->top; \
+                        (void)ossl_assert((_top == 0 && !_bnum2->neg) || \
+                                  (_top && ((_bnum2->flags & BN_FLG_FIXED_TOP) \
+                                            || _bnum2->d[_top - 1] != 0))); \
                         bn_pollute(_bnum2); \
                 } \
         } while(0)
index fcc2b77f45a05ab28121049eb70291c3388911ae..4d71afda7e73b6cacbe882af17bd36d0b53f2b70 100644 (file)
@@ -254,7 +254,7 @@ static void nist_cp_bn_0(BN_ULONG *dst, const BN_ULONG *src, int top, int max)
     int i;
 
 #ifdef BN_DEBUG
-    assert(top <= max);
+    (void)ossl_assert(top <= max);
 #endif
     for (i = 0; i < top; i++)
         dst[i] = src[i];