aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2000-03-02 23:01:35 +0000
committerDaniel Stenberg <daniel@haxx.se>2000-03-02 23:01:35 +0000
commitd4e18e4179f091ea0207ff21a6fc1f59e8dfa402 (patch)
treef21d2d48c9c1ca5f8e893ca30b44c94373464925
parentcc80e5b582bbe004858dff59dddd51aea9eefbf6 (diff)
Adjusted to run properly with OpenSSL 0.9.5.
-rw-r--r--lib/ssluse.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/lib/ssluse.c b/lib/ssluse.c
index bb78df009..17bec70da 100644
--- a/lib/ssluse.c
+++ b/lib/ssluse.c
@@ -43,6 +43,7 @@
#include "urldata.h"
#include "sendf.h"
+#include "formdata.h" /* for the boundary function */
#ifdef USE_SSLEAY
@@ -162,6 +163,29 @@ UrgSSLConnect (struct UrlData *data)
/* Lets get nice error messages */
SSL_load_error_strings();
+#ifdef HAVE_RAND_STATUS
+ /* RAND_status() was introduced in OpenSSL 0.9.5 */
+ if(0 == RAND_status())
+#endif
+ {
+ /* We need to seed the PRNG properly! */
+#ifdef WIN32
+ /* This one gets a random value by reading the currently shown screen */
+ RAND_screen();
+#else
+ int len;
+ char *area = MakeFormBoundary();
+ if(!area)
+ return 3; /* out of memory */
+
+ len = strlen(area);
+
+ RAND_seed(area, len);
+
+ free(area); /* now remove the random junk */
+#endif
+ }
+
/* Setup all the global SSL stuff */
SSLeay_add_ssl_algorithms();