summaryrefslogtreecommitdiff
path: root/devel/pwlib152/files/patch-src_ptclib_pssl.cxx
blob: 4d5d8d34e99e7f6ed2b29a46a0f688c46ba5a7ec (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
--- src/ptclib/pssl.cxx.orig	Wed Apr 16 04:00:19 2003
+++ src/ptclib/pssl.cxx	Wed Feb 22 09:24:08 2006
@@ -285,14 +285,22 @@
 
 PSSLPrivateKey::PSSLPrivateKey(const BYTE * keyData, PINDEX keySize)
 {
+#if (OPENSSL_VERSION_NUMBER < 0x0090801f)
   key = d2i_AutoPrivateKey(NULL, (BYTE **)&keyData, keySize);
+#else
+  key = d2i_AutoPrivateKey(NULL, (const unsigned char **)&keyData, keySize);
+#endif
 }
 
 
 PSSLPrivateKey::PSSLPrivateKey(const PBYTEArray & keyData)
 {
   const BYTE * keyPtr = keyData;
+#if (OPENSSL_VERSION_NUMBER < 0x0090801f)
   key = d2i_AutoPrivateKey(NULL, (BYTE **)&keyPtr, keyData.GetSize());
+#else
+  key = d2i_AutoPrivateKey(NULL, (const unsigned char **)&keyPtr, keyData.GetSize());
+#endif
 }
 
 
@@ -460,14 +468,22 @@
 
 PSSLCertificate::PSSLCertificate(const BYTE * certData, PINDEX certSize)
 {
+#if (OPENSSL_VERSION_NUMBER < 0x0090801f)
   certificate = d2i_X509(NULL, (unsigned char **)&certData, certSize);
+#else
+  certificate = d2i_X509(NULL, (const unsigned char **)&certData, certSize);
+#endif
 }
 
 
 PSSLCertificate::PSSLCertificate(const PBYTEArray & certData)
 {
   const BYTE * certPtr = certData;
+#if (OPENSSL_VERSION_NUMBER < 0x0090801f)
   certificate = d2i_X509(NULL, (unsigned char **)&certPtr, certData.GetSize());
+#else
+  certificate = d2i_X509(NULL, (const unsigned char **)&certPtr, certData.GetSize());
+#endif
 }
 
 
@@ -477,7 +493,11 @@
   PBase64::Decode(certStr, certData);
   if (certData.GetSize() > 0) {
     const BYTE * certPtr = certData;
+#if (OPENSSL_VERSION_NUMBER < 0x0090801f)
     certificate = d2i_X509(NULL, (unsigned char **)&certPtr, certData.GetSize());
+#else
+    certificate = d2i_X509(NULL, (const unsigned char **)&certPtr, certData.GetSize());
+#endif
   }
   else
     certificate = NULL;