Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

Commit 2cb9b25

Browse files
committed
[[ Bug 13270 ]] Include weak linking of libopenssl in dbmysql on mobile.
1 parent 9d90a5f commit 2cb9b25

File tree

5 files changed

+99
-9
lines changed

5 files changed

+99
-9
lines changed

docs/notes/bugfix-13270.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# SSL doesn't work with MySQL driver on Android and iOS.
2+
SSL will now be available on the mobile platforms - make sure you include 'Encryption' in standalone settings to take advantage of this feature.

revdb/Android.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ LOCAL_C_INCLUDES := \
7676

7777
LOCAL_CPPFLAGS += -frtti -fexceptions
7878

79-
LOCAL_STATIC_LIBRARIES := libexternal libmysql
79+
LOCAL_STATIC_LIBRARIES := libexternal libmysql libopenssl
8080

8181
LOCAL_LDLIBS += -lz \
8282
$(call host-path,$(ANDROID_NDK)/sources/cxx-stl/gnu-libstdc++/libs/$(TARGET_ARCH_ABI)/libstdc++.a)

revdb/revdb-mobile.xcodeproj/project.pbxproj

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
/* Begin PBXBuildFile section */
1010
4D379C0E17141EF400B9037C /* libsqlite.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 4D379BC017141E0900B9037C /* libsqlite.a */; };
1111
4D379C0F17141EFF00B9037C /* libmysql.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 4D379BB617141DFE00B9037C /* libmysql.a */; };
12+
4D72497119AC8543000573EB /* libopensslmobile.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 4D72496E19AC852C000573EB /* libopensslmobile.a */; };
1213
4DA0BA4212E841CF00B4F692 /* database.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4DA0BA3F12E841CF00B4F692 /* database.cpp */; };
1314
4DA0BA4312E841CF00B4F692 /* dbdrivercommon.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4DA0BA4012E841CF00B4F692 /* dbdrivercommon.cpp */; };
1415
4DA0BA4412E841CF00B4F692 /* revdb.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4DA0BA4112E841CF00B4F692 /* revdb.cpp */; };
@@ -71,6 +72,20 @@
7172
remoteGlobalIDString = 4D7EFD7912E72ABA00D67888;
7273
remoteInfo = mysql;
7374
};
75+
4D72496D19AC852C000573EB /* PBXContainerItemProxy */ = {
76+
isa = PBXContainerItemProxy;
77+
containerPortal = 4D72496819AC852C000573EB /* libopenssl-mobile.xcodeproj */;
78+
proxyType = 2;
79+
remoteGlobalIDString = 4DD3E0181040BB5D00CAC7EF;
80+
remoteInfo = opensslmobile;
81+
};
82+
4D72496F19AC852C000573EB /* PBXContainerItemProxy */ = {
83+
isa = PBXContainerItemProxy;
84+
containerPortal = 4D72496819AC852C000573EB /* libopenssl-mobile.xcodeproj */;
85+
proxyType = 2;
86+
remoteGlobalIDString = 4DBF5ABF1802C0E7009CAB2E;
87+
remoteInfo = revsecurity;
88+
};
7489
4DA0B9E512E8416E00B4F692 /* PBXContainerItemProxy */ = {
7590
isa = PBXContainerItemProxy;
7691
containerPortal = 4DA0B9E112E8416E00B4F692 /* libexternal-mobile.xcodeproj */;
@@ -91,6 +106,7 @@
91106
4D08A42C138FFCCD0081F990 /* revdb.ios */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = revdb.ios; sourceTree = "<group>"; };
92107
4D08A42D138FFCE60081F990 /* dbsqlite.ios */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = dbsqlite.ios; sourceTree = "<group>"; };
93108
4D08A42E138FFD090081F990 /* dbmysql.ios */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = dbmysql.ios; sourceTree = "<group>"; };
109+
4D72496819AC852C000573EB /* libopenssl-mobile.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = "libopenssl-mobile.xcodeproj"; path = "../thirdparty/libopenssl/libopenssl-mobile.xcodeproj"; sourceTree = "<group>"; };
94110
4D7EFD6312E72A5A00D67888 /* Debug Mobile.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = "Debug Mobile.xcconfig"; path = "../rules/Debug Mobile.xcconfig"; sourceTree = SOURCE_ROOT; };
95111
4D7EFD6412E72A5A00D67888 /* Release Mobile.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = "Release Mobile.xcconfig"; path = "../rules/Release Mobile.xcconfig"; sourceTree = SOURCE_ROOT; };
96112
4D7EFD6512E72A5A00D67888 /* Global Mobile.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = "Global Mobile.xcconfig"; path = "../rules/Global Mobile.xcconfig"; sourceTree = SOURCE_ROOT; };
@@ -139,6 +155,7 @@
139155
files = (
140156
4DA0BD1712E879F100B4F692 /* libexternal.a in Frameworks */,
141157
4D379C0F17141EFF00B9037C /* libmysql.a in Frameworks */,
158+
4D72497119AC8543000573EB /* libopensslmobile.a in Frameworks */,
142159
);
143160
runOnlyForDeploymentPostprocessing = 0;
144161
};
@@ -161,6 +178,15 @@
161178
name = Products;
162179
sourceTree = "<group>";
163180
};
181+
4D72496919AC852C000573EB /* Products */ = {
182+
isa = PBXGroup;
183+
children = (
184+
4D72496E19AC852C000573EB /* libopensslmobile.a */,
185+
4D72497019AC852C000573EB /* librevsecurity.a */,
186+
);
187+
name = Products;
188+
sourceTree = "<group>";
189+
};
164190
4D7EFD3812E72A1C00D67888 = {
165191
isa = PBXGroup;
166192
children = (
@@ -197,6 +223,7 @@
197223
4DA0B9D312E8415600B4F692 /* References */ = {
198224
isa = PBXGroup;
199225
children = (
226+
4D72496819AC852C000573EB /* libopenssl-mobile.xcodeproj */,
200227
4DA0BD3212E87A1C00B4F692 /* libmysql-mobile.xcodeproj */,
201228
4DA0BA9312E842FA00B4F692 /* libsqlite-mobile.xcodeproj */,
202229
4DA0B9E112E8416E00B4F692 /* libexternal-mobile.xcodeproj */,
@@ -323,6 +350,8 @@
323350
/* Begin PBXProject section */
324351
4D7EFD3A12E72A1C00D67888 /* Project object */ = {
325352
isa = PBXProject;
353+
attributes = {
354+
};
326355
buildConfigurationList = 4D7EFD3D12E72A1C00D67888 /* Build configuration list for PBXProject "revdb-mobile" */;
327356
compatibilityVersion = "Xcode 3.2";
328357
developmentRegion = English;
@@ -345,6 +374,10 @@
345374
ProductGroup = 4D379BB217141DFE00B9037C /* Products */;
346375
ProjectRef = 4DA0BD3212E87A1C00B4F692 /* libmysql-mobile.xcodeproj */;
347376
},
377+
{
378+
ProductGroup = 4D72496919AC852C000573EB /* Products */;
379+
ProjectRef = 4D72496819AC852C000573EB /* libopenssl-mobile.xcodeproj */;
380+
},
348381
{
349382
ProductGroup = 4D379BBC17141E0900B9037C /* Products */;
350383
ProjectRef = 4DA0BA9312E842FA00B4F692 /* libsqlite-mobile.xcodeproj */;
@@ -374,6 +407,20 @@
374407
remoteRef = 4D379BBF17141E0900B9037C /* PBXContainerItemProxy */;
375408
sourceTree = BUILT_PRODUCTS_DIR;
376409
};
410+
4D72496E19AC852C000573EB /* libopensslmobile.a */ = {
411+
isa = PBXReferenceProxy;
412+
fileType = archive.ar;
413+
path = libopensslmobile.a;
414+
remoteRef = 4D72496D19AC852C000573EB /* PBXContainerItemProxy */;
415+
sourceTree = BUILT_PRODUCTS_DIR;
416+
};
417+
4D72497019AC852C000573EB /* librevsecurity.a */ = {
418+
isa = PBXReferenceProxy;
419+
fileType = archive.ar;
420+
path = librevsecurity.a;
421+
remoteRef = 4D72496F19AC852C000573EB /* PBXContainerItemProxy */;
422+
sourceTree = BUILT_PRODUCTS_DIR;
423+
};
377424
4DA0B9E612E8416E00B4F692 /* libexternal.a */ = {
378425
isa = PBXReferenceProxy;
379426
fileType = archive.ar;

revdb/revdb.xcodeproj/project.pbxproj

Lines changed: 47 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
4D37B22017144D7000F54219 /* mysql_connection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4D004BB60BCF765200A70446 /* mysql_connection.cpp */; };
2626
4D51507B0BCF90F800F73C6E /* libexternal.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B55AFA1E0BCE905300E1F7F0 /* libexternal.a */; };
2727
4D51507E0BCF910700F73C6E /* database.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4D004BA30BCF765200A70446 /* database.cpp */; };
28+
4D72496419AC83AC000573EB /* libopenssl.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 4D72496119AC838C000573EB /* libopenssl.a */; };
2829
4D9B699117144A9F001349F2 /* CoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4D9BF5181714484E00B32D29 /* CoreServices.framework */; };
2930
4D9B6A2217144AA2001349F2 /* libpq.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 4D9D1F0F17142DD400BE4F14 /* libpq.a */; };
3031
4D9B6A2317144AA2001349F2 /* libexternal.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B55AFA1E0BCE905300E1F7F0 /* libexternal.a */; };
@@ -63,8 +64,6 @@
6364
4D9D1F3C1714313F00BE4F14 /* libexternal.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B55AFA1E0BCE905300E1F7F0 /* libexternal.a */; };
6465
4D9D1FFD1714315E00BE4F14 /* libmysql.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 4D9D1F1D17142DE800BE4F14 /* libmysql.a */; };
6566
4D9D1FFE1714316000BE4F14 /* libexternal.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B55AFA1E0BCE905300E1F7F0 /* libexternal.a */; };
66-
4D9D2013171431BA00BE4F14 /* libssl.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 4D9D2012171431BA00BE4F14 /* libssl.dylib */; };
67-
4D9D2017171431CD00BE4F14 /* libcrypto.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 4D9D2016171431CD00BE4F14 /* libcrypto.dylib */; };
6867
4D9D201A171431D600BE4F14 /* libz.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 4D9D1F1417142DDD00BE4F14 /* libz.a */; };
6968
4D9D201F1714325B00BE4F14 /* libpq.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 4D9D1F0F17142DD400BE4F14 /* libpq.a */; };
7069
4D9D20201714326100BE4F14 /* libexternal.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B55AFA1E0BCE905300E1F7F0 /* libexternal.a */; };
@@ -97,6 +96,20 @@
9796
/* End PBXBuildFile section */
9897

9998
/* Begin PBXContainerItemProxy section */
99+
4D72496019AC838C000573EB /* PBXContainerItemProxy */ = {
100+
isa = PBXContainerItemProxy;
101+
containerPortal = 4D72495B19AC838C000573EB /* libopenssl.xcodeproj */;
102+
proxyType = 2;
103+
remoteGlobalIDString = D2AAC046055464E500DB518D;
104+
remoteInfo = openssl;
105+
};
106+
4D72496219AC838C000573EB /* PBXContainerItemProxy */ = {
107+
isa = PBXContainerItemProxy;
108+
containerPortal = 4D72495B19AC838C000573EB /* libopenssl.xcodeproj */;
109+
proxyType = 2;
110+
remoteGlobalIDString = 4DBF57C11801A14C009CAB2E;
111+
remoteInfo = revsecurity;
112+
};
100113
4D9B6A3B17144B3D001349F2 /* PBXContainerItemProxy */ = {
101114
isa = PBXContainerItemProxy;
102115
containerPortal = 4D6758CF0A79F96300FA96D2 /* Project object */;
@@ -319,6 +332,7 @@
319332
4D6758E00A79F97300FA96D2 /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = ../rules/Debug.xcconfig; sourceTree = SOURCE_ROOT; };
320333
4D6758E30A79F97300FA96D2 /* Release.xcconfig */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = ../rules/Release.xcconfig; sourceTree = SOURCE_ROOT; };
321334
4D6758FE0A79F9A400FA96D2 /* revdb.bundle */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = revdb.bundle; sourceTree = BUILT_PRODUCTS_DIR; };
335+
4D72495B19AC838C000573EB /* libopenssl.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = libopenssl.xcodeproj; path = ../thirdparty/libopenssl/libopenssl.xcodeproj; sourceTree = "<group>"; };
322336
4D9B68CE171449D2001349F2 /* server-dbpostgresql.dylib */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.dylib"; includeInIndex = 0; path = "server-dbpostgresql.dylib"; sourceTree = BUILT_PRODUCTS_DIR; };
323337
4D9BF4D61714479600B32D29 /* server-revdb.dylib */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.dylib"; includeInIndex = 0; path = "server-revdb.dylib"; sourceTree = BUILT_PRODUCTS_DIR; };
324338
4D9BF4DD171447A000B32D29 /* server-dbsqlite.dylib */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.dylib"; includeInIndex = 0; path = "server-dbsqlite.dylib"; sourceTree = BUILT_PRODUCTS_DIR; };
@@ -431,8 +445,7 @@
431445
4D9D1FFD1714315E00BE4F14 /* libmysql.a in Frameworks */,
432446
4D9D1FFE1714316000BE4F14 /* libexternal.a in Frameworks */,
433447
4D9D201A171431D600BE4F14 /* libz.a in Frameworks */,
434-
4D9D2013171431BA00BE4F14 /* libssl.dylib in Frameworks */,
435-
4D9D2017171431CD00BE4F14 /* libcrypto.dylib in Frameworks */,
448+
4D72496419AC83AC000573EB /* libopenssl.a in Frameworks */,
436449
4D37B17B17144D6100F54219 /* CoreServices.framework in Frameworks */,
437450
);
438451
runOnlyForDeploymentPostprocessing = 0;
@@ -487,6 +500,7 @@
487500
4D6758E40A79F97700FA96D2 /* Projects */ = {
488501
isa = PBXGroup;
489502
children = (
503+
4D72495B19AC838C000573EB /* libopenssl.xcodeproj */,
490504
4DE672500C43F3470084FE0B /* libiodbc.xcodeproj */,
491505
4DE66E940C43BAC30084FE0B /* libpq.xcodeproj */,
492506
4DE66B360C4393D70084FE0B /* libz.xcodeproj */,
@@ -567,6 +581,15 @@
567581
name = Sources;
568582
sourceTree = "<group>";
569583
};
584+
4D72495C19AC838C000573EB /* Products */ = {
585+
isa = PBXGroup;
586+
children = (
587+
4D72496119AC838C000573EB /* libopenssl.a */,
588+
4D72496319AC838C000573EB /* revsecurity.dylib */,
589+
);
590+
name = Products;
591+
sourceTree = "<group>";
592+
};
570593
4D9D1F0317142DCB00BE4F14 /* Products */ = {
571594
isa = PBXGroup;
572595
children = (
@@ -852,6 +875,8 @@
852875
/* Begin PBXProject section */
853876
4D6758CF0A79F96300FA96D2 /* Project object */ = {
854877
isa = PBXProject;
878+
attributes = {
879+
};
855880
buildConfigurationList = 4D6758D00A79F96300FA96D2 /* Build configuration list for PBXProject "revdb" */;
856881
compatibilityVersion = "Xcode 3.2";
857882
developmentRegion = English;
@@ -878,6 +903,10 @@
878903
ProductGroup = 4D9D1F1917142DE800BE4F14 /* Products */;
879904
ProjectRef = 4DE66ABA0C438EAD0084FE0B /* libmysql.xcodeproj */;
880905
},
906+
{
907+
ProductGroup = 4D72495C19AC838C000573EB /* Products */;
908+
ProjectRef = 4D72495B19AC838C000573EB /* libopenssl.xcodeproj */;
909+
},
881910
{
882911
ProductGroup = 4D9D1F0B17142DD400BE4F14 /* Products */;
883912
ProjectRef = 4DE66E940C43BAC30084FE0B /* libpq.xcodeproj */;
@@ -908,6 +937,20 @@
908937
/* End PBXProject section */
909938

910939
/* Begin PBXReferenceProxy section */
940+
4D72496119AC838C000573EB /* libopenssl.a */ = {
941+
isa = PBXReferenceProxy;
942+
fileType = archive.ar;
943+
path = libopenssl.a;
944+
remoteRef = 4D72496019AC838C000573EB /* PBXContainerItemProxy */;
945+
sourceTree = BUILT_PRODUCTS_DIR;
946+
};
947+
4D72496319AC838C000573EB /* revsecurity.dylib */ = {
948+
isa = PBXReferenceProxy;
949+
fileType = "compiled.mach-o.dylib";
950+
path = revsecurity.dylib;
951+
remoteRef = 4D72496219AC838C000573EB /* PBXContainerItemProxy */;
952+
sourceTree = BUILT_PRODUCTS_DIR;
953+
};
911954
4D9D1F0717142DCB00BE4F14 /* libiodbc.a */ = {
912955
isa = PBXReferenceProxy;
913956
fileType = archive.ar;

revdb/src/mysql_connection.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ along with LiveCode. If not see <http://www.gnu.org/licenses/>. */
1717
#include "dbmysql.h"
1818
static bool s_ssl_loaded = false;
1919

20-
#if (defined(_WINDOWS) || defined(_LINUX)) && !defined(_SERVER)
20+
#if !defined(_SERVER)
2121
extern "C" int initialise_weak_link_crypto(void);
2222
extern "C" int initialise_weak_link_ssl(void);
2323
bool load_ssl_library()
@@ -29,7 +29,7 @@ bool load_ssl_library()
2929

3030
return s_ssl_loaded;
3131
}
32-
#elif defined(_MACOSX) || defined(_SERVER)
32+
#elif defined(_SERVER)
3333
bool load_ssl_library()
3434
{
3535
return true;
@@ -96,13 +96,11 @@ Bool DBConnection_MYSQL::connect(char **args, int numargs)
9696
else
9797
t_use_ssl = 0;
9898

99-
#ifndef _MOBILE
10099
if (t_use_ssl && !load_ssl_library())
101100
{
102101
errorMessageSet("Unable to load SSL library");
103102
return false;
104103
}
105-
#endif
106104

107105
//initialize mysql data structure for connection
108106
if (!mysql_init(getMySQL()))

0 commit comments

Comments
 (0)