summaryrefslogtreecommitdiff
path: root/debian/patches/strongswan-openssl-conflict.dpatch
blob: a26e080bbe7b8d1438a3b0e0f3b1d0e38eda39a7 (plain)
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
#! /bin/sh /usr/share/dpatch/dpatch-run
## strongswan-openssl-conflict.dpatch by David Smith <davidsmith@acm.org>
## adapted to dpatch format by Rene Mayrhofer
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: Rename AES_cbc_encrypt to ss_AES_cbc_encrypt to not conflict
## DP: with OpenSSL's function when using opencryptoki's TPM token.

@DPATCH@

--- a/src/libcrypto/libaes/aes_cbc.c
+++ b/src/libcrypto/libaes/aes_cbc.c
@@ -10,4 +10,4 @@ int AES_set_key(aes_context *aes_ctx, const u_int8_t *key, int keysize) {
 	aes_set_key(aes_ctx, key, keysize, 0);
 	return 1;	
 }
-CBC_IMPL_BLK16(AES_cbc_encrypt, aes_context, u_int8_t *, aes_encrypt, aes_decrypt);
+CBC_IMPL_BLK16(ss_AES_cbc_encrypt, aes_context, u_int8_t *, aes_encrypt, aes_decrypt);
--- a/src/pluto/alg/ike_alg_aes.c
+++ b/src/pluto/alg/ike_alg_aes.c
@@ -34,7 +34,7 @@ do_aes(u_int8_t *buf, size_t buf_len, u_int8_t *key, size_t key_size, u_int8_t *
 	memcpy(new_iv=iv_bak, (char*) buf + buf_len - AES_CBC_BLOCK_SIZE
 		, AES_CBC_BLOCK_SIZE);
 
-    AES_cbc_encrypt(&aes_ctx, buf, buf, buf_len, iv, enc);
+    ss_AES_cbc_encrypt(&aes_ctx, buf, buf, buf_len, iv, enc);
 
     if (enc)
 	new_iv = (char*) buf + buf_len-AES_CBC_BLOCK_SIZE;