Skip to content

Commit c728254

Browse files
authored
Merge pull request #10 from cubesql/feature/openssl-1.1.1s
OpenSSL 1.1.1s
2 parents dbe350c + 8353569 commit c728254

File tree

14 files changed

+156
-71
lines changed

14 files changed

+156
-71
lines changed

App.rbbas

Lines changed: 79 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -41,52 +41,52 @@ Inherits Application
4141

4242
#tag MenuHandler
4343
Function AboutBox() As Boolean Handles AboutBox.Action
44-
AboutBoxWindow.Show
45-
Return True
46-
44+
AboutBoxWindow.Show
45+
Return True
46+
4747
End Function
4848
#tag EndMenuHandler
4949

5050
#tag MenuHandler
5151
Function ServerConnect() As Boolean Handles ServerConnect.Action
52-
ConnectWindow.Show
53-
Return True
54-
52+
ConnectWindow.Show
53+
Return True
54+
5555
End Function
5656
#tag EndMenuHandler
5757

5858
#tag MenuHandler
5959
Function ServerGetaDeveloperKey() As Boolean Handles ServerGetaDeveloperKey.Action
60-
ShowURL "https://www.sqlabs.com/cubesql_devkey.php"
61-
Return True
62-
60+
ShowURL "https://www.sqlabs.com/cubesql_devkey.php"
61+
Return True
62+
6363
End Function
6464
#tag EndMenuHandler
6565

6666

6767
#tag Method, Flags = &h21
6868
Private Function GetErrorDesc(err As RuntimeException) As String
69-
If err IsA NilObjectException then
70-
return "Nil Object Exception"
71-
elseif err IsA OutOfBoundsException then
72-
return "Out of Bounds"
73-
elseif err IsA TypeMismatchException then
74-
return "Type Mismatch"
75-
elseif err IsA illegalCastException then
76-
return "llegal Cast"
77-
elseif err IsA InvalidParentException then
78-
return "Invalid Parent"
79-
elseif err IsA KeyNotFoundException then
80-
return "Key Not Found Exception"
81-
elseif err IsA OutOfMemoryException then
82-
return "Out Of Memory"
83-
elseif err IsA StackOverflowException then
84-
return "Stack Overflow"
85-
elseif err IsA ThreadAlreadyRunningException then
86-
return "Thread Already Running"
87-
else
88-
return "Unknown error"
89-
end if
69+
If err IsA NilObjectException Then
70+
Return "Nil Object Exception"
71+
ElseIf err IsA OutOfBoundsException Then
72+
Return "Out of Bounds"
73+
ElseIf err IsA TypeMismatchException Then
74+
Return "Type Mismatch"
75+
ElseIf err IsA illegalCastException Then
76+
Return "llegal Cast"
77+
ElseIf err IsA InvalidParentException Then
78+
Return "Invalid Parent"
79+
ElseIf err IsA KeyNotFoundException Then
80+
Return "Key Not Found Exception"
81+
ElseIf err IsA OutOfMemoryException Then
82+
Return "Out Of Memory"
83+
ElseIf err IsA StackOverflowException Then
84+
Return "Stack Overflow"
85+
ElseIf err IsA ThreadAlreadyRunningException Then
86+
Return "Thread Already Running"
87+
Else
88+
Return "Unknown error"
89+
End If
9090

9191

9292
End Function
@@ -95,43 +95,67 @@ Inherits Application
9595
#tag Method, Flags = &h21
9696
Private Function GetLinuxLibrary(psName As String) As FolderItem
9797
#If TargetLinux Then
98-
Dim systemLibs_Folders() As String
99-
Dim systemLibs_Filenames() As String
98+
Dim sLibraryFolders() As String
99+
Dim sLibraryFilenames() As String
100+
101+
'OpenSSL Versions: CubeSQLPlugin supports OpenSSL 1.1 and older
102+
'1st: try to find OpenSSL 1.1 from the system
103+
sLibraryFilenames.Append(psName + ".so.1.1")
104+
'2nd: try to find older OpenSSL versions from the system
105+
sLibraryFilenames.Append(psName + ".so.1.0.2")
106+
sLibraryFilenames.Append(psName + ".so.1.0.0")
107+
sLibraryFilenames.Append(psName + ".so.0.9.8")
108+
'3rd: this is usually a symlink and might point to a version not supported by CubeSQLPlugin
109+
sLibraryFilenames.Append(psName + ".so")
100110

101-
systemLibs_Filenames.Append(psName + ".so.1.1")
102-
systemLibs_Filenames.Append(psName + ".so.1.0.2")
103-
systemLibs_Filenames.Append(psName + ".so.1.0.0")
104-
systemLibs_Filenames.Append(psName + ".so.0.9.8")
105-
systemLibs_Filenames.Append(psName + ".so") 'is usually a symlink, but might point to non supported version by CubeSQLPlugin
111+
'OpenSSL Library location
112+
Try
113+
'1st: try OpenSSL manually added to this application
114+
Dim oSSLAdminPath As FolderItem = Prefs.SSLAdminPath
115+
If (oSSLAdminPath <> Nil) And oSSLAdminPath.Exists And oSSLAdminPath.Directory Then
116+
sLibraryFolders.Append(oSSLAdminPath.NativePath)
117+
End If
118+
119+
'2nd: try OpenSSL bundled with this application
120+
sLibraryFolders.Append(App.ExecutableFile.Parent.Child(App.ExecutableFile.Name + " Libs").NativePath)
121+
sLibraryFolders.Append(App.ExecutableFile.Parent.NativePath)
122+
Catch err As RuntimeException
123+
'ignore and continue
124+
End Try
106125

126+
'3rd: try to find OpenSSL on the system
107127
#If Target32Bit Then
108128
#If TargetARM Then
109-
systemLibs_Folders.Append("/lib/arm-linux-gnueabihf/")
110-
systemLibs_Folders.Append("/usr/lib/arm-linux-gnueabihf/")
129+
sLibraryFolders.Append("/lib/arm-linux-gnueabihf/")
130+
sLibraryFolders.Append("/usr/lib/arm-linux-gnueabihf/")
111131
#EndIf
112-
systemLibs_Folders.Append("/lib/i386-linux-gnu/")
113-
systemLibs_Folders.Append("/usr/lib/i386-linux-gnu/")
114-
systemLibs_Folders.Append("/lib32/")
115-
systemLibs_Folders.Append("/usr/lib32/")
132+
sLibraryFolders.Append("/lib/i386-linux-gnu/")
133+
sLibraryFolders.Append("/usr/lib/i386-linux-gnu/")
134+
sLibraryFolders.Append("/lib32/")
135+
sLibraryFolders.Append("/usr/lib32/")
116136
#EndIf
117137
#If Target64Bit Then
118138
#If TargetARM Then
119139
#Pragma Error "SSL Library locations has not been implemented yet for this BuildTarget"
120140
#EndIf
121-
systemLibs_Folders.Append("/lib/x86_64-linux-gnu/")
122-
systemLibs_Folders.Append("/usr/lib/x86_64-linux-gnu/")
123-
systemLibs_Folders.Append("/lib64/")
124-
systemLibs_Folders.Append("/usr/lib64/")
141+
sLibraryFolders.Append("/lib/x86_64-linux-gnu/")
142+
sLibraryFolders.Append("/usr/lib/x86_64-linux-gnu/")
143+
sLibraryFolders.Append("/lib64/")
144+
sLibraryFolders.Append("/usr/lib64/")
125145
#EndIf
126146

127-
systemLibs_Folders.Append("/lib/")
128-
systemLibs_Folders.Append("/usr/lib/")
147+
sLibraryFolders.Append("/lib/")
148+
sLibraryFolders.Append("/usr/lib/")
129149

130150
Dim oFile As FolderItem
131-
For Each sSystemLibsFolder As String In systemLibs_Folders
132-
For Each sSystemLibsFilename As String In systemLibs_Filenames
133-
oFile = GetFolderItem(sSystemLibsFolder + sSystemLibsFilename, FolderItem.PathTypeShell)
134-
If (oFile <> Nil) And (Not oFile.Directory) And oFile.Exists Then Return oFile
151+
For Each sSystemLibsFolder As String In sLibraryFolders
152+
For Each sSystemLibsFilename As String In sLibraryFilenames
153+
Try
154+
oFile = GetFolderItem(sSystemLibsFolder + sSystemLibsFilename, FolderItem.PathTypeShell)
155+
If (oFile <> Nil) And (Not oFile.Directory) And oFile.Exists Then Return oFile
156+
Catch err As RuntimeException
157+
'ignore and continue
158+
End Try
135159
Next
136160
Next
137161

@@ -149,7 +173,7 @@ Inherits Application
149173

150174
#If TargetMacOS Then
151175
'SSL Library is included in CubeSQLPlugin
152-
return
176+
Return
153177

154178
#ElseIf TargetWindows Then
155179
'Try to locate the SSL Library in these folders
@@ -194,6 +218,7 @@ Inherits Application
194218
#EndIf
195219

196220
If (SSLLibFile = Nil) Or (CryptoLibFile = Nil) Then Return
221+
If SSLLibFile.Directory Or CryptoLibFile.Directory Then Return
197222
If (Not SSLLibFile.Exists) Or (Not CryptoLibFile.Exists) Then Return
198223

199224
'set SSL Library for CubeSQLPlugin

Components/Modules/Prefs.rbbas

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -153,15 +153,15 @@ Protected Module Prefs
153153
Protected Function SSLAdminPath() As FolderItem
154154
// first check for a SSL folder next to executable
155155
Dim f As FolderItem = GetFolderItem("")
156-
if (f <> nil) then f = f.Child("SSL")
157-
if (f <> nil) and (f.Exists) then return f
156+
If (f <> Nil) Then f = f.Child("SSL")
157+
If (f <> Nil) And f.Directory And f.Exists Then Return f
158158

159159
// then lookup in ApplicationData folder
160160
f = SpecialFolder.ApplicationData
161-
if (f <> nil) then f = f.Child("cubeSQLAdmin SSL")
162-
if (f <> nil) and (f.Exists) then return f
161+
If (f <> Nil) Then f = f.Child("cubeSQLAdmin SSL")
162+
If (f <> Nil) And f.Directory And f.Exists Then Return f
163163

164-
return nil
164+
Return Nil
165165

166166
End Function
167167
#tag EndMethod
@@ -213,32 +213,39 @@ Protected Module Prefs
213213
Group="ID"
214214
InitialValue="2147483648"
215215
Type="Integer"
216+
EditorType=""
216217
#tag EndViewProperty
217218
#tag ViewProperty
218219
Name="Left"
219220
Visible=true
220221
Group="Position"
221222
InitialValue="0"
222223
Type="Integer"
224+
EditorType=""
223225
#tag EndViewProperty
224226
#tag ViewProperty
225227
Name="Name"
226228
Visible=true
227229
Group="ID"
230+
InitialValue=""
228231
Type="String"
232+
EditorType=""
229233
#tag EndViewProperty
230234
#tag ViewProperty
231235
Name="Super"
232236
Visible=true
233237
Group="ID"
238+
InitialValue=""
234239
Type="String"
240+
EditorType=""
235241
#tag EndViewProperty
236242
#tag ViewProperty
237243
Name="Top"
238244
Visible=true
239245
Group="Position"
240246
InitialValue="0"
241247
Type="Integer"
248+
EditorType=""
242249
#tag EndViewProperty
243250
#tag EndViewBehavior
244251
End Module

Others/Build Automation.rbbas

Lines changed: 64 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,60 @@
11
#tag BuildAutomation
22
Begin BuildStepList Linux
3+
Begin IDEScriptBuildStep CopySSLLibs_Linux_Setup , AppliesTo = 0, Architecture = 0, Target = 0
4+
Select Case CurrentBuildTarget
5+
6+
Case 4 'Linux (32Bit, Intel)
7+
PropertyValue("CopySSLLibs_Linux_x86_32Bit.Applies To") = "0" 'Both: Debug and Release
8+
PropertyValue("CopySSLLibs_Linux_x86_64Bit.Applies To") = "3" 'None
9+
PropertyValue("CopySSLLibs_Linux_ARM_32Bit.Applies To") = "3" 'None
10+
11+
Case 17 'Linux (64Bit, Intel)
12+
PropertyValue("CopySSLLibs_Linux_x86_32Bit.Applies To") = "3" 'None
13+
PropertyValue("CopySSLLibs_Linux_x86_64Bit.Applies To") = "0" 'Both: Debug and Release
14+
PropertyValue("CopySSLLibs_Linux_ARM_32Bit.Applies To") = "3" 'None
15+
16+
Case 18 'Linux (32Bit, ARM)
17+
PropertyValue("CopySSLLibs_Linux_x86_32Bit.Applies To") = "3" 'None
18+
PropertyValue("CopySSLLibs_Linux_x86_64Bit.Applies To") = "3" 'None
19+
PropertyValue("CopySSLLibs_Linux_ARM_32Bit.Applies To") = "0" 'Both: Debug and Release
20+
21+
End Select
22+
End
323
Begin BuildProjectStep Build
424
End
25+
Begin CopyFilesBuildStep CopySSLLibs_Linux_x86_32Bit
26+
AppliesTo = 3
27+
Architecture = 1
28+
Target = 0
29+
Destination = 2
30+
Subdirectory =
31+
FolderItem = Li4vUmVzb3VyY2VzL1NTTC1MaWJyYXJpZXMvTGludXhfMzJCaXQvbGliY3J5cHRvLnNvLjEuMQ==
32+
FolderItem = Li4vUmVzb3VyY2VzL1NTTC1MaWJyYXJpZXMvTGludXhfMzJCaXQvbGlic3NsLnNvLjEuMQ==
33+
End
34+
Begin CopyFilesBuildStep CopySSLLibs_Linux_x86_64Bit
35+
AppliesTo = 3
36+
Architecture = 1
37+
Target = 0
38+
Destination = 2
39+
Subdirectory =
40+
FolderItem = Li4vUmVzb3VyY2VzL1NTTC1MaWJyYXJpZXMvTGludXhfNjRCaXQvbGliY3J5cHRvLnNvLjEuMQ==
41+
FolderItem = Li4vUmVzb3VyY2VzL1NTTC1MaWJyYXJpZXMvTGludXhfNjRCaXQvbGlic3NsLnNvLjEuMQ==
42+
End
43+
Begin CopyFilesBuildStep CopySSLLibs_Linux_ARM_32Bit
44+
AppliesTo = 3
45+
Architecture = 2
46+
Target = 0
47+
Destination = 2
48+
Subdirectory =
49+
FolderItem = Li4vUmVzb3VyY2VzL1NTTC1MaWJyYXJpZXMvTGludXhfQVJNMzJCaXQvbGliY3J5cHRvLnNvLjEuMQ==
50+
FolderItem = Li4vUmVzb3VyY2VzL1NTTC1MaWJyYXJpZXMvTGludXhfQVJNMzJCaXQvbGlic3NsLnNvLjEuMQ==
51+
End
52+
Begin IDEScriptBuildStep CopySSLLibs_Linux_Reset , AppliesTo = 0, Architecture = 0, Target = 0
53+
PropertyValue("CopySSLLibs_Linux_x86_32Bit.Applies To") = "3" 'None
54+
PropertyValue("CopySSLLibs_Linux_x86_64Bit.Applies To") = "3" 'None
55+
PropertyValue("CopySSLLibs_Linux_ARM_32Bit.Applies To") = "3" 'None
56+
57+
End
558
End
659
Begin BuildStepList Mac OS X
760
Begin BuildProjectStep Build
@@ -15,38 +68,38 @@
1568
Select Case CurrentBuildTarget
1669

1770
Case 3 'Windows 32Bit
18-
PropertyValue("CopySSLLibs_Windows_32Bit.Applies To") = "0" 'Both: Debug and Release
19-
PropertyValue("CopySSLLibs_Windows_64Bit.Applies To") = "3" 'None
71+
PropertyValue("CopySSLLibs_Windows_x86_32Bit.Applies To") = "0" 'Both: Debug and Release
72+
PropertyValue("CopySSLLibs_Windows_x86_64Bit.Applies To") = "3" 'None
2073

2174
Case 19 'Windows 64Bit
22-
PropertyValue("CopySSLLibs_Windows_32Bit.Applies To") = "3" 'None
23-
PropertyValue("CopySSLLibs_Windows_64Bit.Applies To") = "0" 'Both: Debug and Release
75+
PropertyValue("CopySSLLibs_Windows_x86_32Bit.Applies To") = "3" 'None
76+
PropertyValue("CopySSLLibs_Windows_x86_64Bit.Applies To") = "0" 'Both: Debug and Release
2477

2578
End Select
2679
End
2780
Begin BuildProjectStep Build
2881
End
29-
Begin CopyFilesBuildStep CopySSLLibs_Windows_32Bit
82+
Begin CopyFilesBuildStep CopySSLLibs_Windows_x86_32Bit
3083
AppliesTo = 3
31-
Architecture = 0
84+
Architecture = 1
3285
Target = 0
3386
Destination = 2
3487
Subdirectory =
3588
FolderItem = Li4vUmVzb3VyY2VzL1NTTC1MaWJyYXJpZXMvV2luZG93c18zMkJpdC9saWJjcnlwdG8tMV8xLmRsbA==
3689
FolderItem = Li4vUmVzb3VyY2VzL1NTTC1MaWJyYXJpZXMvV2luZG93c18zMkJpdC9saWJzc2wtMV8xLmRsbA==
3790
End
38-
Begin CopyFilesBuildStep CopySSLLibs_Windows_64Bit
91+
Begin CopyFilesBuildStep CopySSLLibs_Windows_x86_64Bit
3992
AppliesTo = 3
40-
Architecture = 0
93+
Architecture = 1
4194
Target = 0
42-
Destination = 0
95+
Destination = 2
4396
Subdirectory =
4497
FolderItem = Li4vUmVzb3VyY2VzL1NTTC1MaWJyYXJpZXMvV2luZG93c182NEJpdC9saWJjcnlwdG8tMV8xLXg2NC5kbGw=
4598
FolderItem = Li4vUmVzb3VyY2VzL1NTTC1MaWJyYXJpZXMvV2luZG93c182NEJpdC9saWJzc2wtMV8xLXg2NC5kbGw=
4699
End
47100
Begin IDEScriptBuildStep CopySSLLibs_Windows_Reset , AppliesTo = 0, Architecture = 0, Target = 0
48-
PropertyValue("CopySSLLibs_Windows_32Bit.Applies To") = "3" 'None
49-
PropertyValue("CopySSLLibs_Windows_64Bit.Applies To") = "3" 'None
101+
PropertyValue("CopySSLLibs_Windows_x86_32Bit.Applies To") = "3" 'None
102+
PropertyValue("CopySSLLibs_Windows_x86_64Bit.Applies To") = "3" 'None
50103

51104
End
52105
End
3.19 MB
Binary file not shown.
701 KB
Binary file not shown.
3.24 MB
Binary file not shown.
690 KB
Binary file not shown.
2.48 MB
Binary file not shown.
529 KB
Binary file not shown.
1.47 KB
Binary file not shown.

0 commit comments

Comments
 (0)