From 4460f173ca442eb8a1473d73461007dd3bd9ab8a Mon Sep 17 00:00:00 2001 From: balazs Date: Tue, 24 May 2022 07:26:48 +0300 Subject: [PATCH] OpkMan: Switch to Openssl 1.1.1o --- .../onlinepackagemanager/opkman_const.pas | 8 +++--- .../opkman_optionsfrm.lfm | 2 +- .../onlinepackagemanager/opkman_updates.pas | 27 ++++--------------- 3 files changed, 11 insertions(+), 26 deletions(-) diff --git a/components/onlinepackagemanager/opkman_const.pas b/components/onlinepackagemanager/opkman_const.pas index 9dc2368ff7..7a6b7e0108 100644 --- a/components/onlinepackagemanager/opkman_const.pas +++ b/components/onlinepackagemanager/opkman_const.pas @@ -48,10 +48,12 @@ const cHelpPage_CreateRepositoryPackage = 'http://wiki.freepascal.org/Online_Package_Manager#Create_repository_package'; cHelpPage_CreateExternalJSON = 'http://wiki.freepascal.org/Online_Package_Manager#Create_JSON_for_updates'; {$ifdef win64} - cOpenSSLURL = 'http://packages.lazarus-ide.org/openssl-1.0.2j-x64_86-win64.zip'; + //cOpenSSLURL = 'http://packages.lazarus-ide.org/openssl-1.0.2j-x64_86-win64.zip'; + cOpenSSLURL = 'http://packages.lazarus-ide.org/openssl-1.1.1o-x64_86-win64.zip'; {$endif} {$ifdef win32} - cOpenSSLURL = 'http://packages.lazarus-ide.org/openssl-1.0.2j-i386-win32.zip'; + //cOpenSSLURL = 'http://packages.lazarus-ide.org/openssl-1.0.2j-i386-win32.zip'; + cOpenSSLURL = 'http://packages.lazarus-ide.org/openssl-1.1.1o-i386-win32.zip'; {$endif} cExtractDir = 'ExtractDir'; cSubmitURL_Zip = 'aHR0cDovL2xhemFydXNvcG0ub3JnL3ppcC5waHA='; @@ -536,7 +538,7 @@ resourcestring rsOpenSSLFrm_Bp_OKButton_Caption = 'Yes'; rsOpenSSLFrm_Bp_CancelButton_Caption = 'No'; rsOpenSSLFrm_chPermanent_Caption = 'Do not ask this question again'; - rsOpenSSLFrm_lbMessage1_Caption = 'In order to work properly, OPM needs the OpenSSL libraries: "libeay32.dll" and "ssleay32.dll"'; + rsOpenSSLFrm_lbMessage1_Caption = 'In order to work properly, OPM needs the OpenSSL libraries'; rsOpenSSLFrm_lbMessage2_Caption = 'Download these files from "https://packages.lazarus-ide.org/"?'; diff --git a/components/onlinepackagemanager/opkman_optionsfrm.lfm b/components/onlinepackagemanager/opkman_optionsfrm.lfm index b0b5701481..a69c4d4558 100644 --- a/components/onlinepackagemanager/opkman_optionsfrm.lfm +++ b/components/onlinepackagemanager/opkman_optionsfrm.lfm @@ -572,7 +572,7 @@ object OptionsFrm: TOptionsFrm BorderSpacing.Left = 10 BorderSpacing.Top = 10 BorderSpacing.Right = 10 - Caption = 'In order to work properly, OPM needs the OpenSSL libraries: "libeay32.dll" and "ssleay32.dll"' + Caption = 'In order to work properly, OPM needs the OpenSSL libraries' ChildSizing.LeftRightSpacing = 6 ChildSizing.EnlargeHorizontal = crsHomogenousChildResize ChildSizing.EnlargeVertical = crsHomogenousChildResize diff --git a/components/onlinepackagemanager/opkman_updates.pas b/components/onlinepackagemanager/opkman_updates.pas index 0fa62b3d13..ddc8de4cc0 100644 --- a/components/onlinepackagemanager/opkman_updates.pas +++ b/components/onlinepackagemanager/opkman_updates.pas @@ -36,7 +36,7 @@ uses opkman_serializablepackages, opkman_options, opkman_common, opkman_visualtree, opkman_OpenSSLfrm, {$IF FPC_FULLVERSION>=30200} - zipper, fphttpclient, opensslsockets; + zipper, fphttpclient, opensslsockets, openssl; {$ELSE} opkman_zip, opkman_httpclient; {$ENDIF} @@ -316,25 +316,6 @@ end; procedure TUpdates.CheckForOpenSSL; {$IFDEF MSWINDOWS} - function SystemFolder: String; - var - SysPath: WideString; - begin - SetLength({%H-}SysPath, Windows.MAX_PATH); - SetLength(SysPath, Windows.GetSystemDirectoryW(PWideChar(SysPath), Windows.MAX_PATH)); - Result := AppendPathDelim(String(SysPath)); - end; - - function IsOpenSSLAvailable: Boolean; - var - ParamPath, SysPath: String; - begin - ParamPath := ExtractFilePath(ParamStr(0)); - SysPath := SystemFolder; - Result := (FileExists(ParamPath + 'libeay32.dll') and FileExists(ParamPath + 'ssleay32.dll')) or - (FileExists(SysPath + 'libeay32.dll') and FileExists(SysPath + 'ssleay32.dll')); - end; - var ZipFile: String; UnZipper: TUnZipper; @@ -342,7 +323,8 @@ var {$ENDIF} begin {$IFDEF MSWINDOWS} - FOpenSSLAvailable := IsOpenSSLAvailable; + InitSSLInterface; + FOpenSSLAvailable := IsSSLloaded; if not FOpenSSLAvailable then begin case Options.OpenSSLDownloadType of @@ -387,7 +369,8 @@ begin UnZipper.Free; end; DeleteFile(ZipFile); - FOpenSSLAvailable := IsOpenSSLAvailable; + InitSSLInterface; + FOpenSSLAvailable := IsSSLloaded; end; end; end;