]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Make sure that the last argument to RAND_add() is a float, or some
authorRichard Levitte <levitte@openssl.org>
Mon, 15 Mar 2004 22:37:08 +0000 (22:37 +0000)
committerRichard Levitte <levitte@openssl.org>
Mon, 15 Mar 2004 22:37:08 +0000 (22:37 +0000)
compilers may complain.

crypto/rand/md_rand.c
crypto/rand/rand_unix.c
crypto/rsa/rsa_eay.c
crypto/rsa/rsa_lib.c

index 66b229c9b9cc5f73c461985577ce912d2edf39a7..303e5898c498e22008174ec82357445161fc00f8 100644 (file)
@@ -315,7 +315,7 @@ static void ssleay_rand_add(const void *buf, int num, double add)
 
 static void ssleay_rand_seed(const void *buf, int num)
        {
-       ssleay_rand_add(buf, num, num);
+       ssleay_rand_add(buf, num, (float)num);
        }
 
 static int ssleay_rand_bytes(unsigned char *buf, int num)
index ef80201212883d84cce9dd64c1f08935ca50802c..aef6914bb1a23061354b07e79f905139a8b202be 100644 (file)
@@ -233,19 +233,19 @@ int RAND_poll(void)
 #if defined(DEVRANDOM) || defined(DEVRANDOM_EGD)
        if (n > 0)
                {
-               RAND_add(tmpbuf,sizeof tmpbuf,n);
+               RAND_add(tmpbuf,sizeof tmpbuf,(float)n);
                OPENSSL_cleanse(tmpbuf,n);
                }
 #endif
 
        /* put in some default random data, we need more than just this */
        l=curr_pid;
-       RAND_add(&l,sizeof(l),0);
+       RAND_add(&l,sizeof(l),0.0);
        l=getuid();
-       RAND_add(&l,sizeof(l),0);
+       RAND_add(&l,sizeof(l),0.0);
 
        l=time(NULL);
-       RAND_add(&l,sizeof(l),0);
+       RAND_add(&l,sizeof(l),0.0);
 
 #if defined(DEVRANDOM) || defined(DEVRANDOM_EGD)
        return 1;
index ee2a70bb483a371efde9d73e6ee5b3856442b667..5beb9c9fdf0c61c23c71c979d4e4fb69815d786d 100644 (file)
@@ -243,7 +243,7 @@ static BN_BLINDING *setup_blinding(RSA *rsa, BN_CTX *ctx)
        if ((RAND_status() == 0) && rsa->d != NULL && rsa->d->d != NULL)
                {
                /* if PRNG is not properly seeded, resort to secret exponent as unpredictable seed */
-               RAND_add(rsa->d->d, rsa->d->dmax * sizeof rsa->d->d[0], 0);
+               RAND_add(rsa->d->d, rsa->d->dmax * sizeof rsa->d->d[0], 0.0);
                if (!BN_pseudo_rand_range(A,rsa->n)) goto err;
                }
        else
index e4d622851eed84b1e9d4ec76e36e6db76f12a1cb..cba2dd66cd3ce9bc44dac4345f101f52871b12cf 100644 (file)
@@ -343,7 +343,7 @@ int RSA_blinding_on(RSA *rsa, BN_CTX *p_ctx)
        if ((RAND_status() == 0) && rsa->d != NULL && rsa->d->d != NULL)
                {
                /* if PRNG is not properly seeded, resort to secret exponent as unpredictable seed */
-               RAND_add(rsa->d->d, rsa->d->dmax * sizeof rsa->d->d[0], 0);
+               RAND_add(rsa->d->d, rsa->d->dmax * sizeof rsa->d->d[0], 0.0);
                if (!BN_pseudo_rand_range(A,rsa->n)) goto err;
                }
        else