size_t issues + assert-->OPENSSL_assert:

--- \\Debbie\ger\prj\1original\openssl\openssl\crypto\bn\bn_asm.c       
2005-10-22
21:20:06.000000000 +-0100
+++ \\Debbie\ger\prj\3actual\openssl\crypto\bn\bn_asm.c 2008-11-01
23:10:36.000000000 +-0100
@@ -66,16 +70,17 @@
 #include "cryptlib.h"
 #include "bn_lcl.h"

+#if !defined(BN_ASM) /* [i_a] */
 #if defined(BN_LLONG) || defined(BN_UMULT_HIGH)

-BN_ULONG bn_mul_add_words(BN_ULONG *rp, const BN_ULONG *ap, int num,
BN_ULONG w)
+BN_ULONG bn_mul_add_words(BN_ULONG *rp, const BN_ULONG *ap, size_t
num, BN_ULONG w)
        {
        BN_ULONG c1=0;

-       assert(num >= 0);
+       OPENSSL_assert(num >= 0);
        if (num <= 0) return(c1);

 #ifndef OPENSSL_SMALL_FOOTPRINT
        while (num&~3)
                {
                mul_add(rp[0],ap[0],w,c1);
@@ -91,17 +96,17 @@
                ap++; rp++; num--;
                }
        
        return(c1);
        }

-BN_ULONG bn_mul_words(BN_ULONG *rp, const BN_ULONG *ap, int num, BN_ULONG w)
+BN_ULONG bn_mul_words(BN_ULONG *rp, const BN_ULONG *ap, size_t num, BN_ULONG w)
        {
        BN_ULONG c1=0;

-       assert(num >= 0);
+       OPENSSL_assert(num >= 0);
        if (num <= 0) return(c1);

 #ifndef OPENSSL_SMALL_FOOTPRINT
        while (num&~3)
                {
                mul(rp[0],ap[0],w,c1);
@@ -116,15 +121,15 @@
                mul(rp[0],ap[0],w,c1);
                ap++; rp++; num--;
                }
        return(c1);
        }

-void bn_sqr_words(BN_ULONG *r, const BN_ULONG *a, int n)
+void bn_sqr_words(BN_ULONG *r, const BN_ULONG *a, size_t n)
         {
-       assert(n >= 0);
+       OPENSSL_assert(n >= 0);
        if (n <= 0) return;

 #ifndef OPENSSL_SMALL_FOOTPRINT
        while (n&~3)
                {
                sqr(r[0],r[1],a[0]);
@@ -140,18 +145,18 @@
                a++; r+=2; n--;
                }
        }

 #else /* !(defined(BN_LLONG) || defined(BN_UMULT_HIGH)) */

-BN_ULONG bn_mul_add_words(BN_ULONG *rp, const BN_ULONG *ap, int num,
BN_ULONG w)
+BN_ULONG bn_mul_add_words(BN_ULONG *rp, const BN_ULONG *ap, size_t
num, BN_ULONG w)
        {
        BN_ULONG c=0;
        BN_ULONG bl,bh;

-       assert(num >= 0);
+       OPENSSL_assert(num >= 0);
        if (num <= 0) return((BN_ULONG)0);

        bl=LBITS(w);
        bh=HBITS(w);

 #ifndef OPENSSL_SMALL_FOOTPRINT
@@ -169,18 +174,18 @@
                mul_add(rp[0],ap[0],bl,bh,c);
                ap++; rp++; num--;
                }
        return(c);
        }

-BN_ULONG bn_mul_words(BN_ULONG *rp, const BN_ULONG *ap, int num, BN_ULONG w)
+BN_ULONG bn_mul_words(BN_ULONG *rp, const BN_ULONG *ap, size_t num, BN_ULONG w)
        {
        BN_ULONG carry=0;
        BN_ULONG bl,bh;

-       assert(num >= 0);
+       OPENSSL_assert(num >= 0);
        if (num <= 0) return((BN_ULONG)0);

        bl=LBITS(w);
        bh=HBITS(w);

 #ifndef OPENSSL_SMALL_FOOTPRINT
@@ -198,15 +203,15 @@
                mul(rp[0],ap[0],bl,bh,carry);
                ap++; rp++; num--;
                }
        return(carry);
        }

-void bn_sqr_words(BN_ULONG *r, const BN_ULONG *a, int n)
+void bn_sqr_words(BN_ULONG *r, const BN_ULONG *a, size_t n)
         {
-       assert(n >= 0);
+       OPENSSL_assert(n >= 0);
        if (n <= 0) return;

 #ifndef OPENSSL_SMALL_FOOTPRINT
        while (n&~3)
                {
                sqr64(r[0],r[1],a[0]);
@@ -241,13 +246,13 @@
        BN_ULONG dh,dl,q,ret=0,th,tl,t;
        int i,count=2;

        if (d == 0) return(BN_MASK2);

        i=BN_num_bits_word(d);
-       assert((i == BN_BITS2) || (h <= (BN_ULONG)1<<i));
+       OPENSSL_assert((i == BN_BITS2) || (h <= (BN_ULONG)1<<i));

        i=BN_BITS2-i;
        if (h >= d) h-=d;

        if (i)
                {
@@ -300,17 +305,17 @@
        ret|=q;
        return(ret);
        }
 #endif /* !defined(BN_LLONG) && defined(BN_DIV2W) */

 #ifdef BN_LLONG
-BN_ULONG bn_add_words(BN_ULONG *r, const BN_ULONG *a, const BN_ULONG *b, int n)
+BN_ULONG bn_add_words(BN_ULONG *r, const BN_ULONG *a, const BN_ULONG
*b, size_t n)
         {
        BN_ULLONG ll=0;

-       assert(n >= 0);
+       OPENSSL_assert(n >= 0);
        if (n <= 0) return((BN_ULONG)0);

 #ifndef OPENSSL_SMALL_FOOTPRINT
        while (n&~3)
                {
                ll+=(BN_ULLONG)a[0]+b[0];
@@ -335,17 +340,17 @@
                ll>>=BN_BITS2;
                a++; b++; r++; n--;
                }
        return((BN_ULONG)ll);
        }
 #else /* !BN_LLONG */
-BN_ULONG bn_add_words(BN_ULONG *r, const BN_ULONG *a, const BN_ULONG *b, int n)
+BN_ULONG bn_add_words(BN_ULONG *r, const BN_ULONG *a, const BN_ULONG
*b, size_t n)
         {
        BN_ULONG c,l,t;

-       assert(n >= 0);
+       OPENSSL_assert(n >= 0);
        if (n <= 0) return((BN_ULONG)0);

        c=0;
 #ifndef OPENSSL_SMALL_FOOTPRINT
        while (n&~3)
                {
@@ -387,18 +392,18 @@
                a++; b++; r++; n--;
                }
        return((BN_ULONG)c);
        }
 #endif /* !BN_LLONG */

-BN_ULONG bn_sub_words(BN_ULONG *r, const BN_ULONG *a, const BN_ULONG *b, int n)
+BN_ULONG bn_sub_words(BN_ULONG *r, const BN_ULONG *a, const BN_ULONG
*b, size_t n)
         {
        BN_ULONG t1,t2;
        int c=0;

-       assert(n >= 0);
+       OPENSSL_assert(n >= 0);
        if (n <= 0) return((BN_ULONG)0);

 #ifndef OPENSSL_SMALL_FOOTPRINT
        while (n&~3)
                {
                t1=a[0]; t2=b[0];
@@ -1003,6 +1008,7 @@
 int bn_mul_mont(BN_ULONG *rp, const BN_ULONG *ap, const BN_ULONG *bp,
const BN_ULONG *np,const BN_ULONG *n0, int num)
 {      return 0;       }
 #endif /* OPENSSL_BN_ASM_MONT */
 #endif

 #endif /* !BN_MUL_COMBA */
+#endif /*!BN_ASM */ /* [i_a] */







EC with ASN1 i2d/d2i callback function def vs. callback size_t mismatch:

--- \\Debbie\ger\prj\1original\openssl\openssl\crypto\ec\ec_asn1.c      
2008-11-01
20:08:50.000000000 +-0100
+++ \\Debbie\ger\prj\3actual\openssl\crypto\ec\ec_asn1.c        2008-11-01
23:23:21.000000000 +-0100
@@ -1328,6 +1328,6 @@
        }

-EC_KEY *d2i_ECParameters(EC_KEY **a, const unsigned char **in, long len)
+EC_KEY *d2i_ECParameters(EC_KEY **a, const unsigned char **in, size_t len)
        {
        EC_KEY   *ret;


plus:

--- \\Debbie\ger\prj\1original\openssl\openssl\crypto\ec\ec.h   2008-11-01
20:08:50.000000000 +-0100
+++ \\Debbie\ger\prj\3actual\openssl\crypto\ec\ec.h     2008-11-01
23:23:17.000000000 +-0100
@@ -834,5 +838,5 @@
  */
-EC_KEY *d2i_ECParameters(EC_KEY **key, const unsigned char **in, long len);
+EC_KEY *d2i_ECParameters(EC_KEY **key, const unsigned char **in, size_t len);

 /** Encodes ec parameter and stores the result in a buffer.
  *  \param  key  the EC_KEY object with ec paramters to encode









-- 
Met vriendelijke groeten / Best regards,

Ger Hobbelt

--------------------------------------------------
web:    http://www.hobbelt.com/
        http://www.hebbut.net/
mail:   [EMAIL PROTECTED]
mobile: +31-6-11 120 978
--------------------------------------------------

______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [email protected]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to