projects
/
openssl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Avoid shadowing variables,
[openssl.git]
/
crypto
/
rand
/
rand_lib.c
diff --git
a/crypto/rand/rand_lib.c
b/crypto/rand/rand_lib.c
index c4b44e5186ca66cfe58e77170a7af9e725ad73fe..3cdba48ba8470cba6cb1635ec08c54d4d0a8e48e 100644
(file)
--- a/
crypto/rand/rand_lib.c
+++ b/
crypto/rand/rand_lib.c
@@
-57,48
+57,48
@@
*/
#include <stdio.h>
*/
#include <stdio.h>
-#include "cryptlib.h"
-#include <sys/types.h>
#include <time.h>
#include <time.h>
-#include
"rand.h"
+#include
<openssl/rand.h>
#ifdef NO_RAND
static RAND_METHOD *rand_meth=NULL;
#else
#ifdef NO_RAND
static RAND_METHOD *rand_meth=NULL;
#else
-extern RAND_METHOD rand_ssleay;
-static RAND_METHOD *rand_meth= &rand_ssleay;
+extern RAND_METHOD rand_ssleay
_meth
;
+static RAND_METHOD *rand_meth= &rand_ssleay
_meth
;
#endif
#endif
-void RAND_set_rand_method(meth)
-RAND_METHOD *meth;
+void RAND_set_rand_method(RAND_METHOD *meth)
{
rand_meth=meth;
}
{
rand_meth=meth;
}
-RAND_METHOD *RAND_get_rand_method()
+RAND_METHOD *RAND_get_rand_method(
void
)
{
return(rand_meth);
}
{
return(rand_meth);
}
-void RAND_cleanup()
+void RAND_cleanup(
void
)
{
if (rand_meth != NULL)
rand_meth->cleanup();
}
{
if (rand_meth != NULL)
rand_meth->cleanup();
}
-void RAND_seed(buf,num)
-unsigned char *buf;
-int num;
+void RAND_seed(const void *buf, int num)
{
if (rand_meth != NULL)
rand_meth->seed(buf,num);
}
{
if (rand_meth != NULL)
rand_meth->seed(buf,num);
}
-void RAND_bytes(buf,num)
-unsigned char *buf;
-int num;
+void RAND_add(const void *buf, int num, int entropy)
{
if (rand_meth != NULL)
{
if (rand_meth != NULL)
- rand_meth->bytes(buf,num);
+ rand_meth->add(buf,num,entropy);
+ }
+
+int RAND_bytes(unsigned char *buf, int num)
+ {
+ if (rand_meth != NULL)
+ return rand_meth->bytes(buf,num);
+ return(-1);
}
}