diff --git a/direct/src/plugin/Sources.pp b/direct/src/plugin/Sources.pp index 09aedd319a..6edc489028 100644 --- a/direct/src/plugin/Sources.pp +++ b/direct/src/plugin/Sources.pp @@ -164,7 +164,7 @@ #define USE_PACKAGES wx openssl #define TARGET p3dcert - #define SOURCES p3dCert.cxx + #define SOURCES p3dCert.cxx p3dCert.h #define OSX_SYS_FRAMEWORKS Carbon #end bin_target diff --git a/direct/src/plugin/p3dCert.cxx b/direct/src/plugin/p3dCert.cxx index fcf5b65e38..cc552a4a2e 100644 --- a/direct/src/plugin/p3dCert.cxx +++ b/direct/src/plugin/p3dCert.cxx @@ -177,7 +177,7 @@ AuthDialog:: _cert = NULL; } if (_stack != NULL) { - sk_free(_stack); + sk_X509_free(_stack); _stack = NULL; } } @@ -273,10 +273,10 @@ read_cert_file(const wxString &cert_filename) { } // Build up a STACK of the remaining certificates in the file. - _stack = sk_new(NULL); + _stack = sk_X509_new(NULL); X509 *c = PEM_read_X509(fp, NULL, NULL, (void *)""); while (c != NULL) { - sk_push(_stack, (char *)c); + sk_X509_push(_stack, c); c = PEM_read_X509(fp, NULL, NULL, (void *)""); } diff --git a/direct/src/plugin/p3dCert.h b/direct/src/plugin/p3dCert.h index 1af4bb3604..addb95de17 100644 --- a/direct/src/plugin/p3dCert.h +++ b/direct/src/plugin/p3dCert.h @@ -29,6 +29,17 @@ using namespace std; class ViewCertDialog; +#ifndef STACK_OF + // At some point, presumably in 1.0.0, openssl went to the + // STACK_OF() macro system to typedef the contents of a stack. + // Unfortunately, that new API is different. We define some macros + // here here for backward compatiblity. + #define STACK_OF(type) STACK + #define sk_X509_push(stack, item) sk_push((stack), (char *)(item)) + #define sk_X509_free(stack) sk_free(stack) + #define sk_X509_new(cmp) sk_new(cmp) +#endif + //////////////////////////////////////////////////////////////////// // Class : P3DCertApp // Description : This is the wxApp that drives this application. @@ -84,7 +95,7 @@ private: wxString _cert_dir; X509 *_cert; - STACK *_stack; + STACK_OF(X509) *_stack; wxString _friendly_name; int _verify_result;