pkgsrc/devel/pwlib/patches/patch-ba
rillig 3257e6ac7c Fixed compilation errors with patch-ba and "old" OpenSSL versions. Can
someone please have a look if the data types are all correct, as I don't
know OpenSSL.
2006-03-13 22:58:45 +00:00

78 lines
2.4 KiB
Text

$NetBSD: patch-ba,v 1.5 2006/03/13 22:58:45 rillig Exp $
--- src/ptclib/pssl.cxx.orig 2004-04-09 08:52:17.000000000 +0200
+++ src/ptclib/pssl.cxx 2006-03-13 23:48:01.000000000 +0100
@@ -297,14 +297,22 @@ PSSLPrivateKey::PSSLPrivateKey(const PFi
PSSLPrivateKey::PSSLPrivateKey(const BYTE * keyData, PINDEX keySize)
{
+#if OPENSSL_VERSION_NUMBER >= 0x00908000L
+ key = d2i_AutoPrivateKey(NULL, &keyData, keySize);
+#else
key = d2i_AutoPrivateKey(NULL, (BYTE **)&keyData, keySize);
+#endif
}
PSSLPrivateKey::PSSLPrivateKey(const PBYTEArray & keyData)
{
+#if OPENSSL_VERSION_NUMBER >= 0x00908000L
const BYTE * keyPtr = keyData;
- key = d2i_AutoPrivateKey(NULL, (BYTE **)&keyPtr, keyData.GetSize());
+#else
+ BYTE * keyPtr = (BYTE *)&keyData;
+#endif
+ key = d2i_AutoPrivateKey(NULL, &keyPtr, keyData.GetSize());
}
@@ -472,14 +480,22 @@ PSSLCertificate::PSSLCertificate(const P
PSSLCertificate::PSSLCertificate(const BYTE * certData, PINDEX certSize)
{
- certificate = d2i_X509(NULL, (unsigned char **)&certData, certSize);
+#if OPENSSL_VERSION_NUMBER >= 0x00908000L
+ certificate = d2i_X509(NULL, &certData, certSize);
+#else
+ certificate = d2i_X509(NULL, (BYTE **)&certData, certSize);
+#endif
}
PSSLCertificate::PSSLCertificate(const PBYTEArray & certData)
{
- const BYTE * certPtr = certData;
- certificate = d2i_X509(NULL, (unsigned char **)&certPtr, certData.GetSize());
+#if OPENSSL_VERSION_NUMBER >= 0x00908000L
+ const BYTE *certPtr = certData;
+#else
+ BYTE *certPtr = (BYTE *)&certData;
+#endif
+ certificate = d2i_X509(NULL, &certPtr, certData.GetSize());
}
@@ -488,8 +504,12 @@ PSSLCertificate::PSSLCertificate(const P
PBYTEArray certData;
PBase64::Decode(certStr, certData);
if (certData.GetSize() > 0) {
- const BYTE * certPtr = certData;
- certificate = d2i_X509(NULL, (unsigned char **)&certPtr, certData.GetSize());
+#if OPENSSL_VERSION_NUMBER >= 0x00908000L
+ const BYTE *certPtr = certData;
+#else
+ BYTE *certPtr = (BYTE *)&certData;
+#endif
+ certificate = d2i_X509(NULL, &certPtr, certData.GetSize());
}
else
certificate = NULL;
@@ -743,7 +763,7 @@ PSSLDiffieHellman::~PSSLDiffieHellman()
DH_free(dh);
}
-#ifdef __BEOS__
+#if defined(__BEOS__) || (defined(__NetBSD__) && OPENSSL_VERSION_NUMBER < 0x00908000L)
// 2/21/04 Yuri Kiryanov - fix for compiler choke on BeOS for usage of
// SSL function d2i_DHparams_bio below in PSSLDiffieHellman::Load
#undef d2i_DHparams_bio