projects
/
openssl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
use consistent indentation
[openssl.git]
/
apps
/
speed.c
diff --git
a/apps/speed.c
b/apps/speed.c
index c4fd79f884fe210e85b80dea5808ba0dae5ae296..163d5237c2969b3b58f2f0c899ccd88869a00063 100644
(file)
--- a/
apps/speed.c
+++ b/
apps/speed.c
@@
-238,6
+238,8
@@
static double Time_F(int s)
#endif
}
#endif
}
+int MAIN(int, char **);
+
int MAIN(int argc, char **argv)
{
unsigned char *buf=NULL,*buf2=NULL;
int MAIN(int argc, char **argv)
{
unsigned char *buf=NULL,*buf2=NULL;
@@
-360,7
+362,7
@@
int MAIN(int argc, char **argv)
rsa_key[i]=NULL;
#endif
rsa_key[i]=NULL;
#endif
- if ((buf=(unsigned char *)
M
alloc((int)BUFSIZE)) == NULL)
+ if ((buf=(unsigned char *)
OPENSSL_m
alloc((int)BUFSIZE)) == NULL)
{
BIO_printf(bio_err,"out of memory\n");
goto end;
{
BIO_printf(bio_err,"out of memory\n");
goto end;
@@
-368,7
+370,7
@@
int MAIN(int argc, char **argv)
#ifndef NO_DES
buf_as_des_cblock = (des_cblock *)buf;
#endif
#ifndef NO_DES
buf_as_des_cblock = (des_cblock *)buf;
#endif
- if ((buf2=(unsigned char *)
M
alloc((int)BUFSIZE)) == NULL)
+ if ((buf2=(unsigned char *)
OPENSSL_m
alloc((int)BUFSIZE)) == NULL)
{
BIO_printf(bio_err,"out of memory\n");
goto end;
{
BIO_printf(bio_err,"out of memory\n");
goto end;
@@
-1028,6
+1030,11
@@
int MAIN(int argc, char **argv)
RAND_pseudo_bytes(buf,20);
#ifndef NO_DSA
RAND_pseudo_bytes(buf,20);
#ifndef NO_DSA
+ if (RAND_status() != 1)
+ {
+ RAND_seed(rnd_seed, sizeof rnd_seed);
+ rnd_fake = 1;
+ }
for (j=0; j<DSA_NUM; j++)
{
unsigned int kk;
for (j=0; j<DSA_NUM; j++)
{
unsigned int kk;
@@
-1087,6
+1094,7
@@
int MAIN(int argc, char **argv)
dsa_doit[j]=0;
}
}
dsa_doit[j]=0;
}
}
+ if (rnd_fake) RAND_cleanup();
#endif
fprintf(stdout,"%s\n",SSLeay_version(SSLEAY_VERSION));
#endif
fprintf(stdout,"%s\n",SSLeay_version(SSLEAY_VERSION));
@@
-1165,8
+1173,8
@@
int MAIN(int argc, char **argv)
#endif
mret=0;
end:
#endif
mret=0;
end:
- if (buf != NULL)
F
ree(buf);
- if (buf2 != NULL)
F
ree(buf2);
+ if (buf != NULL)
OPENSSL_f
ree(buf);
+ if (buf2 != NULL)
OPENSSL_f
ree(buf2);
#ifndef NO_RSA
for (i=0; i<RSA_NUM; i++)
if (rsa_key[i] != NULL)
#ifndef NO_RSA
for (i=0; i<RSA_NUM; i++)
if (rsa_key[i] != NULL)