Fix warnings: printf format mismatches on 64 bit platforms.
authorDr. Stephen Henson <steve@openssl.org>
Sun, 2 Nov 2008 15:41:30 +0000 (15:41 +0000)
committerDr. Stephen Henson <steve@openssl.org>
Sun, 2 Nov 2008 15:41:30 +0000 (15:41 +0000)
Change assert to OPENSSL_assert().
Fix e_padlock prototype.

apps/s_cb.c
crypto/bio/bio_cb.c
crypto/evp/evp_test.c
crypto/jpake/jpake.c
engines/e_padlock.c

index 95860d208f754377e634d8d9ad96b88c93be03e3..d750ca9ddded4d3e69b80190a0b75293a4da69e4 100644 (file)
@@ -269,15 +269,15 @@ long MS_CALLBACK bio_dump_callback(BIO *bio, int cmd, const char *argp,
 
        if (cmd == (BIO_CB_READ|BIO_CB_RETURN))
                {
-               BIO_printf(out,"read from %p [%p] (%d bytes => %ld (0x%lX))\n",
-                       (void *)bio,argp,argi,ret,ret);
+               BIO_printf(out,"read from %p [%p] (%lu bytes => %ld (0x%lX))\n",
+                       (void *)bio,argp,(unsigned long)argi,ret,ret);
                BIO_dump(out,argp,(int)ret);
                return(ret);
                }
        else if (cmd == (BIO_CB_WRITE|BIO_CB_RETURN))
                {
-               BIO_printf(out,"write to %p [%p] (%d bytes => %ld (0x%lX))\n",
-                       (void *)bio,argp,argi,ret,ret);
+               BIO_printf(out,"write to %p [%p] (%lu bytes => %ld (0x%lX))\n",
+                       (void *)bio,argp,(unsigned long)argi,ret,ret);
                BIO_dump(out,argp,(int)ret);
                }
        return(ret);
index 4a72cc98964760b38cc8a83f86b73b5213f97d18..5d310dd1c7391be1db9f6863931f80cc62d1f470 100644 (file)
@@ -85,28 +85,32 @@ long MS_CALLBACK BIO_debug_callback(BIO *bio, int cmd, const char *argp,
                break;
        case BIO_CB_READ:
                if (bio->method->type & BIO_TYPE_DESCRIPTOR)
-                       BIO_snprintf(p,p_maxlen,"read(%d,%d) - %s fd=%d\n",
-                                bio->num,argi,bio->method->name,bio->num);
+                       BIO_snprintf(p,p_maxlen,"read(%d,%lu) - %s fd=%d\n",
+                                bio->num,(unsigned long)argi,
+                                bio->method->name,bio->num);
                else
-                       BIO_snprintf(p,p_maxlen,"read(%d,%d) - %s\n",
-                                bio->num,argi,bio->method->name);
+                       BIO_snprintf(p,p_maxlen,"read(%d,%lu) - %s\n",
+                                bio->num,(unsigned long)argi,
+                                bio->method->name);
                break;
        case BIO_CB_WRITE:
                if (bio->method->type & BIO_TYPE_DESCRIPTOR)
-                       BIO_snprintf(p,p_maxlen,"write(%d,%d) - %s fd=%d\n",
-                                bio->num,argi,bio->method->name,bio->num);
+                       BIO_snprintf(p,p_maxlen,"write(%d,%lu) - %s fd=%d\n",
+                                bio->num,(unsigned long)argi,
+                                bio->method->name,bio->num);
                else
-                       BIO_snprintf(p,p_maxlen,"write(%d,%d) - %s\n",
-                                bio->num,argi,bio->method->name);
+                       BIO_snprintf(p,p_maxlen,"write(%d,%lu) - %s\n",
+                                bio->num,(unsigned long)argi,
+                                bio->method->name);
                break;
        case BIO_CB_PUTS:
                BIO_snprintf(p,p_maxlen,"puts() - %s\n",bio->method->name);
                break;
        case BIO_CB_GETS:
-               BIO_snprintf(p,p_maxlen,"gets(%d) - %s\n",argi,bio->method->name);
+               BIO_snprintf(p,p_maxlen,"gets(%lu) - %s\n",(unsigned long)argi,bio->method->name);
                break;
        case BIO_CB_CTRL:
-               BIO_snprintf(p,p_maxlen,"ctrl(%d) - %s\n",argi,bio->method->name);
+               BIO_snprintf(p,p_maxlen,"ctrl(%lu) - %s\n",(unsigned long)argi,bio->method->name);
                break;
        case BIO_CB_RETURN|BIO_CB_READ:
                BIO_snprintf(p,p_maxlen,"read return %ld\n",ret);
index b8c9235d3e3f5328ae8f668491ea7c74dda2a495..e723265acebefcec5d200b38ce708907a0a1bf2d 100644 (file)
@@ -153,8 +153,8 @@ static void test1(const EVP_CIPHER *c,const unsigned char *key,int kn,
     
     if(kn != c->key_len)
        {
-       fprintf(stderr,"Key length doesn't match, got %d expected %d\n",kn,
-               c->key_len);
+       fprintf(stderr,"Key length doesn't match, got %d expected %lu\n",kn,
+               (unsigned long)c->key_len);
        test1_exit(5);
        }
     EVP_CIPHER_CTX_init(&ctx);
index 577b7ef375cdb1678977ad278dad32e3196c8e3b..086d9f47e065f7b9dd67ebd0a7db51c6415d6940 100644 (file)
@@ -4,7 +4,6 @@
 #include <openssl/sha.h>
 #include <openssl/err.h>
 #include <memory.h>
-#include <assert.h>
 
 /*
  * In the definition, (xa, xb, xc, xd) are Alice's (x1, x2, x3, x4) or
@@ -134,7 +133,7 @@ static void hashlength(SHA_CTX *sha, size_t l)
     {
     unsigned char b[2];
 
-    assert(l <= 0xffff);
+    OPENSSL_assert(l <= 0xffff);
     b[0] = l >> 8;
     b[1] = l&0xff;
     SHA1_Update(sha, b, 2);
@@ -172,7 +171,7 @@ static void zkp_hash(BIGNUM *h, const BIGNUM *zkpg, const JPAKE_STEP_PART *p,
     */
     SHA1_Init(&sha);
     hashbn(&sha, zkpg);
-    assert(!BN_is_zero(p->zkpx.gr));
+    OPENSSL_assert(!BN_is_zero(p->zkpx.gr));
     hashbn(&sha, p->zkpx.gr);
     hashbn(&sha, p->gx);
     hashstring(&sha, proof_name);
index 64a13e754c7801d00ef2c83948ac59c2e0e4e2f4..fbb0dae3cfc96ec21a08f4ca282352fe147e2a7b 100644 (file)
@@ -1169,7 +1169,7 @@ padlock_aes_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out_arg,
 /* Wrapper that provides an interface between the API and 
    the raw PadLock RNG */
 static int
-padlock_rand_bytes(unsigned char *output, int count)
+padlock_rand_bytes(unsigned char *output, size_t count)
 {
        unsigned int eax, buf;