Author: mturk
Date: Tue Apr 3 07:16:23 2007
New Revision: 525163
URL: http://svn.apache.org/viewvc?view=rev&rev=525163
Log:
Parse the random file name as mod_ssl does.
Use egd only if prefixed with egd:
(eg, egd:/var/run/egd-pool)
Modified:
tomcat/connectors/trunk/jni/native/src/ssl.c
Modified: tomcat/connectors/trunk/jni/native/src/ssl.c
URL:
http://svn.apache.org/viewvc/tomcat/connectors/trunk/jni/native/src/ssl.c?view=diff&rev=525163&r1=525162&r2=525163
==============================================================================
--- tomcat/connectors/trunk/jni/native/src/ssl.c (original)
+++ tomcat/connectors/trunk/jni/native/src/ssl.c Tue Apr 3 07:16:23 2007
@@ -257,16 +257,21 @@
if (file == NULL)
file = ssl_global_rand_file;
-
- if (file == NULL)
+ if (file && (strcmp(file, "builtin") == 0))
return -1;
- else if ((n = RAND_egd(file)) > 0) {
- return n;
+ if (file == NULL)
+ file = RAND_file_name(buffer, sizeof(buffer));
+ if (file) {
+ if (strncmp(file, "egd:", 4) == 0) {
+ if ((n = RAND_egd(file + 4)) > 0)
+ return n;
+ else
+ return -1;
+ }
+ if ((n = RAND_load_file(file, -1)) > 0)
+ return n;
}
- if (file && (n = RAND_load_file(file, -1)) > 0)
- return n;
- else
- return -1;
+ return -1;
}
/*
@@ -492,7 +497,7 @@
TCN_ALLOC_CSTRING(file);
UNREFERENCED(o);
if (J2S(file)) {
- ssl_global_rand_file = apr_pstrdup(tcn_global_pool, J2S(file));
+ ssl_global_rand_file = apr_pstrdup(tcn_global_pool, J2S(file));
}
TCN_FREE_CSTRING(file);
}
@@ -569,7 +574,7 @@
if (bi->init) {
JNIEnv *e = NULL;
bi->init = 0;
- tcn_get_java_env(&e);
+ tcn_get_java_env(&e);
TCN_UNLOAD_CLASS(e, j->cb.obj);
}
OPENSSL_free(bi->ptr);
@@ -625,7 +630,7 @@
if (b->init && in != NULL) {
BIO_JAVA *j = (BIO_JAVA *)b->ptr;
JNIEnv *e = NULL;
- tcn_get_java_env(&e);
+ tcn_get_java_env(&e);
ret = (*e)->CallIntMethod(e, j->cb.obj,
j->cb.mid[2],
tcn_new_string(e, in));
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]