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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
|
$NetBSD: patch-ai,v 1.1.1.1 2009/10/02 19:18:59 markd Exp $
From https://bugs.kde.org/show_bug.cgi?id=193215
--- kio/kssl/kopenssl.h.orig 2009-05-20 00:06:53.000000000 +1200
+++ kio/kssl/kopenssl.h
@@ -43,6 +43,9 @@ class KOpenSSLProxyPrivate;
#include <openssl/evp.h>
#include <openssl/stack.h>
#include <openssl/bn.h>
+#if defined(OPENSSL_VERSION_NUMBER) && OPENSSL_VERSION_NUMBER >= 0x10000000L
+typedef _STACK STACK;
+#endif
#undef crypt
#endif
@@ -499,24 +502,50 @@ public:
*/
char *sk_pop(STACK *s);
+#if defined(OPENSSL_VERSION_NUMBER) && OPENSSL_VERSION_NUMBER >= 0x10000000L
+ /*
+ * Pop off the stack with OpenSSL 1.x
+ */
+ char *sk_pop(void *s) { return sk_pop(reinterpret_cast<STACK*>(s)); }
+#endif
+
/*
* Free the stack
*/
void sk_free(STACK *s);
+#if defined(OPENSSL_VERSION_NUMBER) && OPENSSL_VERSION_NUMBER >= 0x10000000L
+ /*
+ * Free the stack with OpenSSL 1.x
+ */
+ void sk_free(void *s) { return sk_free(reinterpret_cast<STACK*>(s)); }
+#endif
+
/*
* Number of elements in the stack
*/
int sk_num(STACK *s);
+#if defined(OPENSSL_VERSION_NUMBER) && OPENSSL_VERSION_NUMBER >= 0x10000000L
+ /*
+ * Number of elements in the stack with OpenSSL 1.x
+ */
+ int sk_num(void *s) { return sk_num(reinterpret_cast<STACK*>(s)); }
+#endif
/*
* Value of element n in the stack
*/
char *sk_value(STACK *s, int n);
+#if defined(OPENSSL_VERSION_NUMBER) && OPENSSL_VERSION_NUMBER >= 0x10000000L
+ /*
+ * Value of element n in the stack with OpenSSL 1.x
+ */
+ char *sk_value(void *s, int n) { return sk_value(reinterpret_cast<STACK*>(s), n); }
+#endif
/*
* Create a new stack
@@ -529,12 +558,26 @@ public:
*/
int sk_push(STACK *s, char *d);
+#if defined(OPENSSL_VERSION_NUMBER) && OPENSSL_VERSION_NUMBER >= 0x10000000L
+ /*
+ * Add an element to the stack with OpenSSL 1.x
+ */
+ int sk_push(void *s, void *d) { return sk_push(reinterpret_cast<STACK*>(s), reinterpret_cast<char*>(d)); }
+#endif
+
/*
* Duplicate the stack
*/
STACK *sk_dup(STACK *s);
+#if defined(OPENSSL_VERSION_NUMBER) && OPENSSL_VERSION_NUMBER >= 0x10000000L
+ /*
+ * Duplicate the stack with OpenSSL 1.x
+ */
+ STACK *sk_dup(void *s) { return sk_dup(reinterpret_cast<STACK*>(s)); }
+#endif
+
/*
* Convert an ASN1_INTEGER to its text form
|