commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mt...@apache.org
Subject svn commit: r1169793 - in /commons/sandbox/runtime/trunk/src/main/native: include/acr/ssl.h modules/openssl/api.c
Date Mon, 12 Sep 2011 15:20:05 GMT
Author: mturk
Date: Mon Sep 12 15:20:05 2011
New Revision: 1169793

URL: http://svn.apache.org/viewvc?rev=1169793&view=rev
Log:
Allow pre 1.0.0 ABI

Modified:
    commons/sandbox/runtime/trunk/src/main/native/include/acr/ssl.h
    commons/sandbox/runtime/trunk/src/main/native/modules/openssl/api.c

Modified: commons/sandbox/runtime/trunk/src/main/native/include/acr/ssl.h
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/include/acr/ssl.h?rev=1169793&r1=1169792&r2=1169793&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/include/acr/ssl.h (original)
+++ commons/sandbox/runtime/trunk/src/main/native/include/acr/ssl.h Mon Sep 12 15:20:05 2011
@@ -68,6 +68,12 @@
 #endif
 #endif
 
+#if (OPENSSL_VERSION_NUMBER >= 0x10000000)
+#define CONST_SSL_METHOD        const SSL_METHOD
+#else
+#define CONST_SSL_METHOD        SSL_METHOD
+#endif
+
 /* Default setting for per-dir reneg buffer. */
 #ifndef DEFAULT_RENEG_BUFFER_SIZE
 #define DEFAULT_RENEG_BUFFER_SIZE (128 * 1024)

Modified: commons/sandbox/runtime/trunk/src/main/native/modules/openssl/api.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/modules/openssl/api.c?rev=1169793&r1=1169792&r2=1169793&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/modules/openssl/api.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/modules/openssl/api.c Mon Sep 12 15:20:05
2011
@@ -138,7 +138,7 @@ struct SSLAPIst {
     
     /*** SSL_CTX  ***/
     long                (*fpSSL_CTX_ctrl)(SSL_CTX *, int, long, void *);
-    SSL_CTX*            (*fpSSL_CTX_new)(const SSL_METHOD *);
+    SSL_CTX*            (*fpSSL_CTX_new)(CONST_SSL_METHOD *);
     void                (*fpSSL_CTX_free)(SSL_CTX *);
     
     /*** SSL      ***/
@@ -148,21 +148,21 @@ struct SSLAPIst {
     void                (*fpSSL_load_error_strings)(void);
     int                 (*fpSSL_set_ex_data)(SSL *, int, void *);
 
-    const SSL_METHOD*   (*fpSSLv3_method)(void);           /* SSLv3 */
-    const SSL_METHOD*   (*fpSSLv3_server_method)(void);    /* SSLv3 */
-    const SSL_METHOD*   (*fpSSLv3_client_method)(void);    /* SSLv3 */
-
-    const SSL_METHOD*   (*fpSSLv23_method)(void);          /* SSLv3 but can rollback to v2
*/
-    const SSL_METHOD*   (*fpSSLv23_server_method)(void);   /* SSLv3 but can rollback to v2
*/
-    const SSL_METHOD*   (*fpSSLv23_client_method)(void);   /* SSLv3 but can rollback to v2
*/
-
-    const SSL_METHOD*   (*fpTLSv1_method)(void);           /* TLSv1.0 */
-    const SSL_METHOD*   (*fpTLSv1_server_method)(void);    /* TLSv1.0 */
-    const SSL_METHOD*   (*fpTLSv1_client_method)(void);    /* TLSv1.0 */
-
-    const SSL_METHOD*   (*fpDTLSv1_method)(void);          /* DTLSv1.0 */
-    const SSL_METHOD*   (*fpDTLSv1_server_method)(void);   /* DTLSv1.0 */
-    const SSL_METHOD*   (*fpDTLSv1_client_method)(void);   /* DTLSv1.0 */
+    CONST_SSL_METHOD*   (*fpSSLv3_method)(void);           /* SSLv3 */
+    CONST_SSL_METHOD*   (*fpSSLv3_server_method)(void);    /* SSLv3 */
+    CONST_SSL_METHOD*   (*fpSSLv3_client_method)(void);    /* SSLv3 */
+
+    CONST_SSL_METHOD*   (*fpSSLv23_method)(void);          /* SSLv3 but can rollback to v2
*/
+    CONST_SSL_METHOD*   (*fpSSLv23_server_method)(void);   /* SSLv3 but can rollback to v2
*/
+    CONST_SSL_METHOD*   (*fpSSLv23_client_method)(void);   /* SSLv3 but can rollback to v2
*/
+
+    CONST_SSL_METHOD*   (*fpTLSv1_method)(void);           /* TLSv1.0 */
+    CONST_SSL_METHOD*   (*fpTLSv1_server_method)(void);    /* TLSv1.0 */
+    CONST_SSL_METHOD*   (*fpTLSv1_client_method)(void);    /* TLSv1.0 */
+
+    CONST_SSL_METHOD*   (*fpDTLSv1_method)(void);          /* DTLSv1.0 */
+    CONST_SSL_METHOD*   (*fpDTLSv1_server_method)(void);   /* DTLSv1.0 */
+    CONST_SSL_METHOD*   (*fpDTLSv1_client_method)(void);   /* DTLSv1.0 */
 
     void                (*fpSSL_CTX_set_default_passwd_cb)(SSL_CTX *, pem_password_cb *);
     void                (*fpSSL_CTX_set_default_passwd_cb_userdata)(SSL_CTX *ctx, void *u);
@@ -172,7 +172,9 @@ struct SSLAPIst {
     void                (*fpNULL)(void);
 
     /*** _STACK   ***/
+#if (OPENSSL_VERSION_NUMBER >= 0x10000000)
     void                (*fpsk_pop_free)(_STACK *, void (*)(void *));
+#endif
     
 };
 
@@ -201,9 +203,9 @@ struct SSLOPTst {
 #endif
 
 #ifndef OPENSSL_NO_SSL2
-    const SSL_METHOD*   (*fpSSLv2_method)(void);           /* SSLv2 */
-    const SSL_METHOD*   (*fpSSLv2_server_method)(void);    /* SSLv2 */
-    const SSL_METHOD*   (*fpSSLv2_client_method)(void);    /* SSLv2 */
+    CONST_SSL_METHOD*   (*fpSSLv2_method)(void);           /* SSLv2 */
+    CONST_SSL_METHOD*   (*fpSSLv2_server_method)(void);    /* SSLv2 */
+    CONST_SSL_METHOD*   (*fpSSLv2_client_method)(void);    /* SSLv2 */
 #endif
     
     void                (*fpNULL)(void);
@@ -623,7 +625,7 @@ long SSL_CTX_ctrl(SSL_CTX *ctx, int cmd,
     return SSLAPI_CALL(SSL_CTX_ctrl)(ctx, cmd, larg, parg);
 }
 
-SSL_CTX *SSL_CTX_new(const SSL_METHOD *meth)
+SSL_CTX *SSL_CTX_new(CONST_SSL_METHOD *meth)
 {
     return SSLAPI_CALL(SSL_CTX_new)(meth);
 }
@@ -660,12 +662,12 @@ int SSL_set_ex_data(SSL *ssl, int idx, v
 }
 
 #define IMPLEMENT_SSLAPI_METHOD(name)                   \
-const SSL_METHOD *name##_method(void) {                 \
+CONST_SSL_METHOD *name##_method(void) {                 \
     return (*SSLapi.fp##name##_method)();               \
 }
 
 #define IMPLEMENT_SSLOPT_METHOD(name)                   \
-const SSL_METHOD *name##_method(void) {                 \
+CONST_SSL_METHOD *name##_method(void) {                 \
     if (SSLopt.fp##name##_method != 0)                  \
         return (*SSLopt.fp##name##_method)();           \
     else { ACR_SET_OS_ERROR(ACR_ENOTIMPL); return 0; }  \



Mime
View raw message