View | Details | Raw Unified | Return to bug 229030 | Differences between
and this patch

Collapse All | Expand All

(-)Makefile (-1 / +6 lines)
Lines 3-8 Link Here
3
3
4
PORTNAME=	botan
4
PORTNAME=	botan
5
DISTVERSION=	1.10.17
5
DISTVERSION=	1.10.17
6
PORTREVISION=	1
6
CATEGORIES=	security
7
CATEGORIES=	security
7
MASTER_SITES=	http://botan.randombit.net/releases/
8
MASTER_SITES=	http://botan.randombit.net/releases/
8
PKGNAMESUFFIX=	110
9
PKGNAMESUFFIX=	110
Lines 24-34 Link Here
24
CONFIGURE_SCRIPT=	configure.py
25
CONFIGURE_SCRIPT=	configure.py
25
CONFIGURE_ARGS=	--prefix=${PREFIX} --cc ${CHOSEN_COMPILER_TYPE} \
26
CONFIGURE_ARGS=	--prefix=${PREFIX} --cc ${CHOSEN_COMPILER_TYPE} \
26
		--with-tr1-implementation=system --with-bzip2 --with-zlib
27
		--with-tr1-implementation=system --with-bzip2 --with-zlib
27
MAKE_ARGS=	CXX="${CXX}" LIB_OPT="${CXXFLAGS}"
28
MAKE_ARGS=	CXX="${CXX}" CHECK_OPT="${CXXFLAGS}" LIB_OPT="${CXXFLAGS}"
28
USE_LDCONFIG=	yes
29
USE_LDCONFIG=	yes
29
PLIST_FILES=	bin/botan-config-1.10 lib/libbotan-1.10.a lib/libbotan-1.10.so lib/libbotan-1.10.so.1 \
30
PLIST_FILES=	bin/botan-config-1.10 lib/libbotan-1.10.a lib/libbotan-1.10.so lib/libbotan-1.10.so.1 \
30
		lib/libbotan-1.10.so.1.17 libdata/pkgconfig/botan-1.10.pc
31
		lib/libbotan-1.10.so.1.17 libdata/pkgconfig/botan-1.10.pc
31
SHEBANG_FILES=	configure.py
32
SHEBANG_FILES=	configure.py
33
TEST_TARGET=	check
32
34
33
DOCSDIR=	${PREFIX}/share/doc/${PORTNAME}-${PORTVERSION}
35
DOCSDIR=	${PREFIX}/share/doc/${PORTNAME}-${PORTVERSION}
34
PORTDOCS=	*
36
PORTDOCS=	*
Lines 57-60 Link Here
57
post-install:
59
post-install:
58
	@(cd "${STAGEDIR}${PREFIX}"; ${FIND} -s include/botan-1.10 -not -type d) >> ${TMPPLIST}
60
	@(cd "${STAGEDIR}${PREFIX}"; ${FIND} -s include/botan-1.10 -not -type d) >> ${TMPPLIST}
59
61
62
post-test:
63
	cd ${WRKSRC} && ${SETENV} LD_LIBRARY_PATH="." ./check --test
64
60
.include <bsd.port.post.mk>
65
.include <bsd.port.post.mk>
(-)files/extra-patch-openssl11 (-32 / +37 lines)
Lines 1-4 Link Here
1
--- src/engine/openssl/ossl_bc.cpp.orig	2018-10-15 00:16:53 UTC
1
--- src/engine/openssl/ossl_bc.cpp.orig	2017-10-02 06:00:00 UTC
2
+++ src/engine/openssl/ossl_bc.cpp
2
+++ src/engine/openssl/ossl_bc.cpp
3
@@ -8,10 +8,6 @@
3
@@ -8,10 +8,6 @@
4
 #include <botan/internal/openssl_engine.h>
4
 #include <botan/internal/openssl_engine.h>
Lines 11-17 Link Here
11
 namespace Botan {
11
 namespace Botan {
12
 
12
 
13
 namespace {
13
 namespace {
14
@@ -44,7 +40,7 @@
14
@@ -44,7 +40,7 @@ class EVP_BlockCipher : public BlockCipher
15
       size_t block_sz;
15
       size_t block_sz;
16
       Key_Length_Specification cipher_key_spec;
16
       Key_Length_Specification cipher_key_spec;
17
       std::string cipher_name;
17
       std::string cipher_name;
Lines 20-68 Link Here
20
    };
20
    };
21
 
21
 
22
 /*
22
 /*
23
@@ -59,14 +55,14 @@
23
@@ -59,14 +55,15 @@ EVP_BlockCipher::EVP_BlockCipher(const EVP_CIPHER* alg
24
    if(EVP_CIPHER_mode(algo) != EVP_CIPH_ECB_MODE)
24
    if(EVP_CIPHER_mode(algo) != EVP_CIPH_ECB_MODE)
25
       throw Invalid_Argument("EVP_BlockCipher: Non-ECB EVP was passed in");
25
       throw Invalid_Argument("EVP_BlockCipher: Non-ECB EVP was passed in");
26
 
26
 
27
-   EVP_CIPHER_CTX_init(&encrypt);
27
-   EVP_CIPHER_CTX_init(&encrypt);
28
-   EVP_CIPHER_CTX_init(&decrypt);
28
-   EVP_CIPHER_CTX_init(&decrypt);
29
+   EVP_CIPHER_CTX_init(encrypt);
29
+   if ((encrypt = EVP_CIPHER_CTX_new()) == NULL)
30
+   EVP_CIPHER_CTX_init(decrypt);
30
+      throw Invalid_Argument("EVP_BlockCipher: EVP_CIPHER_CTX_new failed");
31
+   EVP_EncryptInit_ex(encrypt, algo, 0, 0, 0);
32
+   EVP_CIPHER_CTX_set_padding(encrypt, 0);
31
 
33
 
32
-   EVP_EncryptInit_ex(&encrypt, algo, 0, 0, 0);
34
-   EVP_EncryptInit_ex(&encrypt, algo, 0, 0, 0);
33
-   EVP_DecryptInit_ex(&decrypt, algo, 0, 0, 0);
35
-   EVP_DecryptInit_ex(&decrypt, algo, 0, 0, 0);
34
+   EVP_EncryptInit_ex(encrypt, algo, 0, 0, 0);
36
-
35
+   EVP_DecryptInit_ex(decrypt, algo, 0, 0, 0);
36
 
37
-   EVP_CIPHER_CTX_set_padding(&encrypt, 0);
37
-   EVP_CIPHER_CTX_set_padding(&encrypt, 0);
38
-   EVP_CIPHER_CTX_set_padding(&decrypt, 0);
38
-   EVP_CIPHER_CTX_set_padding(&decrypt, 0);
39
+   EVP_CIPHER_CTX_set_padding(encrypt, 0);
39
+   if ((decrypt = EVP_CIPHER_CTX_new()) == NULL)
40
+      throw Invalid_Argument("EVP_BlockCipher: EVP_CIPHER_CTX_new failed");
41
+   EVP_DecryptInit_ex(decrypt, algo, 0, 0, 0);
40
+   EVP_CIPHER_CTX_set_padding(decrypt, 0);
42
+   EVP_CIPHER_CTX_set_padding(decrypt, 0);
41
    }
43
    }
42
 
44
 
43
 /*
45
 /*
44
@@ -83,14 +79,14 @@
46
@@ -83,14 +80,15 @@ EVP_BlockCipher::EVP_BlockCipher(const EVP_CIPHER* alg
45
    if(EVP_CIPHER_mode(algo) != EVP_CIPH_ECB_MODE)
47
    if(EVP_CIPHER_mode(algo) != EVP_CIPH_ECB_MODE)
46
       throw Invalid_Argument("EVP_BlockCipher: Non-ECB EVP was passed in");
48
       throw Invalid_Argument("EVP_BlockCipher: Non-ECB EVP was passed in");
47
 
49
 
48
-   EVP_CIPHER_CTX_init(&encrypt);
50
-   EVP_CIPHER_CTX_init(&encrypt);
49
-   EVP_CIPHER_CTX_init(&decrypt);
51
-   EVP_CIPHER_CTX_init(&decrypt);
50
+   EVP_CIPHER_CTX_init(encrypt);
52
+   if ((encrypt = EVP_CIPHER_CTX_new()) == NULL)
51
+   EVP_CIPHER_CTX_init(decrypt);
53
+      throw Invalid_Argument("EVP_BlockCipher: EVP_CIPHER_CTX_new failed");
54
+   EVP_EncryptInit_ex(encrypt, algo, 0, 0, 0);
55
+   EVP_CIPHER_CTX_set_padding(encrypt, 0);
52
 
56
 
53
-   EVP_EncryptInit_ex(&encrypt, algo, 0, 0, 0);
57
-   EVP_EncryptInit_ex(&encrypt, algo, 0, 0, 0);
54
-   EVP_DecryptInit_ex(&decrypt, algo, 0, 0, 0);
58
-   EVP_DecryptInit_ex(&decrypt, algo, 0, 0, 0);
55
+   EVP_EncryptInit_ex(encrypt, algo, 0, 0, 0);
59
-
56
+   EVP_DecryptInit_ex(decrypt, algo, 0, 0, 0);
57
 
58
-   EVP_CIPHER_CTX_set_padding(&encrypt, 0);
60
-   EVP_CIPHER_CTX_set_padding(&encrypt, 0);
59
-   EVP_CIPHER_CTX_set_padding(&decrypt, 0);
61
-   EVP_CIPHER_CTX_set_padding(&decrypt, 0);
60
+   EVP_CIPHER_CTX_set_padding(encrypt, 0);
62
+   if ((decrypt = EVP_CIPHER_CTX_new()) == NULL)
63
+      throw Invalid_Argument("EVP_BlockCipher: EVP_CIPHER_CTX_new failed");
64
+   EVP_DecryptInit_ex(decrypt, algo, 0, 0, 0);
61
+   EVP_CIPHER_CTX_set_padding(decrypt, 0);
65
+   EVP_CIPHER_CTX_set_padding(decrypt, 0);
62
    }
66
    }
63
 
67
 
64
 /*
68
 /*
65
@@ -98,8 +94,8 @@
69
@@ -98,8 +96,8 @@ EVP_BlockCipher::EVP_BlockCipher(const EVP_CIPHER* alg
66
 */
70
 */
67
 EVP_BlockCipher::~EVP_BlockCipher()
71
 EVP_BlockCipher::~EVP_BlockCipher()
68
    {
72
    {
Lines 73-79 Link Here
73
    }
77
    }
74
 
78
 
75
 /*
79
 /*
76
@@ -109,7 +105,7 @@
80
@@ -109,7 +107,7 @@ void EVP_BlockCipher::encrypt_n(const byte in[], byte 
77
                                 size_t blocks) const
81
                                 size_t blocks) const
78
    {
82
    {
79
    int out_len = 0;
83
    int out_len = 0;
Lines 82-88 Link Here
82
    }
86
    }
83
 
87
 
84
 /*
88
 /*
85
@@ -119,7 +115,7 @@
89
@@ -119,7 +117,7 @@ void EVP_BlockCipher::decrypt_n(const byte in[], byte 
86
                                 size_t blocks) const
90
                                 size_t blocks) const
87
    {
91
    {
88
    int out_len = 0;
92
    int out_len = 0;
Lines 91-97 Link Here
91
    }
95
    }
92
 
96
 
93
 /*
97
 /*
94
@@ -134,19 +130,19 @@
98
@@ -134,19 +132,19 @@ void EVP_BlockCipher::key_schedule(const byte key[], s
95
       full_key += std::make_pair(key, 8);
99
       full_key += std::make_pair(key, 8);
96
       }
100
       }
97
    else
101
    else
Lines 117-123 Link Here
117
    }
121
    }
118
 
122
 
119
 /*
123
 /*
120
@@ -154,7 +150,7 @@
124
@@ -154,7 +152,7 @@ void EVP_BlockCipher::key_schedule(const byte key[], s
121
 */
125
 */
122
 BlockCipher* EVP_BlockCipher::clone() const
126
 BlockCipher* EVP_BlockCipher::clone() const
123
    {
127
    {
Lines 126-132 Link Here
126
                               cipher_name,
130
                               cipher_name,
127
                               cipher_key_spec.minimum_keylength(),
131
                               cipher_key_spec.minimum_keylength(),
128
                               cipher_key_spec.maximum_keylength(),
132
                               cipher_key_spec.maximum_keylength(),
129
@@ -166,16 +162,16 @@
133
@@ -166,16 +164,16 @@ BlockCipher* EVP_BlockCipher::clone() const
130
 */
134
 */
131
 void EVP_BlockCipher::clear()
135
 void EVP_BlockCipher::clear()
132
    {
136
    {
Lines 152-158 Link Here
152
    }
156
    }
153
 
157
 
154
 }
158
 }
155
--- src/engine/openssl/ossl_md.cpp.orig	2018-10-15 00:26:19 UTC
159
--- src/engine/openssl/ossl_md.cpp.orig	2017-10-02 06:00:00 UTC
156
+++ src/engine/openssl/ossl_md.cpp
160
+++ src/engine/openssl/ossl_md.cpp
157
@@ -8,10 +8,6 @@
161
@@ -8,10 +8,6 @@
158
 #include <botan/internal/openssl_engine.h>
162
 #include <botan/internal/openssl_engine.h>
Lines 165-171 Link Here
165
 namespace Botan {
169
 namespace Botan {
166
 
170
 
167
 namespace {
171
 namespace {
168
@@ -28,12 +24,12 @@
172
@@ -28,12 +24,12 @@ class EVP_HashFunction : public HashFunction
169
 
173
 
170
       size_t output_length() const
174
       size_t output_length() const
171
          {
175
          {
Lines 180-186 Link Here
180
          }
184
          }
181
 
185
 
182
       EVP_HashFunction(const EVP_MD*, const std::string&);
186
       EVP_HashFunction(const EVP_MD*, const std::string&);
183
@@ -44,7 +40,7 @@
187
@@ -44,7 +40,7 @@ class EVP_HashFunction : public HashFunction
184
 
188
 
185
       size_t block_size;
189
       size_t block_size;
186
       std::string algo_name;
190
       std::string algo_name;
Lines 189-195 Link Here
189
    };
193
    };
190
 
194
 
191
 /*
195
 /*
192
@@ -52,7 +48,7 @@
196
@@ -52,7 +48,7 @@ class EVP_HashFunction : public HashFunction
193
 */
197
 */
194
 void EVP_HashFunction::add_data(const byte input[], size_t length)
198
 void EVP_HashFunction::add_data(const byte input[], size_t length)
195
    {
199
    {
Lines 198-204 Link Here
198
    }
202
    }
199
 
203
 
200
 /*
204
 /*
201
@@ -60,9 +56,9 @@
205
@@ -60,9 +56,9 @@ void EVP_HashFunction::add_data(const byte input[], si
202
 */
206
 */
203
 void EVP_HashFunction::final_result(byte output[])
207
 void EVP_HashFunction::final_result(byte output[])
204
    {
208
    {
Lines 211-217 Link Here
211
    }
215
    }
212
 
216
 
213
 /*
217
 /*
214
@@ -70,8 +66,8 @@
218
@@ -70,8 +66,8 @@ void EVP_HashFunction::final_result(byte output[])
215
 */
219
 */
216
 void EVP_HashFunction::clear()
220
 void EVP_HashFunction::clear()
217
    {
221
    {
Lines 222-228 Link Here
222
    }
226
    }
223
 
227
 
224
 /*
228
 /*
225
@@ -79,7 +75,7 @@
229
@@ -79,7 +75,7 @@ void EVP_HashFunction::clear()
226
 */
230
 */
227
 HashFunction* EVP_HashFunction::clone() const
231
 HashFunction* EVP_HashFunction::clone() const
228
    {
232
    {
Lines 231-248 Link Here
231
    return new EVP_HashFunction(algo, name());
235
    return new EVP_HashFunction(algo, name());
232
    }
236
    }
233
 
237
 
234
@@ -90,8 +86,8 @@
238
@@ -90,8 +86,9 @@ EVP_HashFunction::EVP_HashFunction(const EVP_MD* algo,
235
                                    const std::string& name) :
239
                                    const std::string& name) :
236
    algo_name(name)
240
    algo_name(name)
237
    {
241
    {
238
-   EVP_MD_CTX_init(&md);
242
-   EVP_MD_CTX_init(&md);
239
-   EVP_DigestInit_ex(&md, algo, 0);
243
-   EVP_DigestInit_ex(&md, algo, 0);
240
+   EVP_MD_CTX_init(md);
244
+   if ((md = EVP_MD_CTX_new()) == NULL)
245
+     throw Invalid_Argument("EVP_HashFunction: EVP_MD_CTX_new failed");
241
+   EVP_DigestInit_ex(md, algo, 0);
246
+   EVP_DigestInit_ex(md, algo, 0);
242
    }
247
    }
243
 
248
 
244
 /*
249
 /*
245
@@ -99,7 +95,11 @@
250
@@ -99,7 +96,11 @@ EVP_HashFunction::EVP_HashFunction(const EVP_MD* algo,
246
 */
251
 */
247
 EVP_HashFunction::~EVP_HashFunction()
252
 EVP_HashFunction::~EVP_HashFunction()
248
    {
253
    {

Return to bug 229030