浏览代码

Disable compilation of UOpenSSL unit when using CryptoLib4Pascal in GUI-Classic

PascalCoin 6 年之前
父节点
当前提交
feef09b697
共有 4 个文件被更改,包括 23 次插入6 次删除
  1. 6 1
      src/core/URPC.pas
  2. 6 2
      src/gui-classic/UFRMAbout.pas
  3. 7 1
      src/gui-classic/UFRMWallet.pas
  4. 4 2
      src/pascalcoin_wallet_classic.dpr

+ 6 - 1
src/core/URPC.pas

@@ -27,7 +27,10 @@ interface
 Uses UThread, ULog, UConst, UNode, UAccounts, UCrypto, UBlockChain,
 Uses UThread, ULog, UConst, UNode, UAccounts, UCrypto, UBlockChain,
   UNetProtocol, UOpTransaction, UWallet, UTime, UPCEncryption, UTxMultiOperation,
   UNetProtocol, UOpTransaction, UWallet, UTime, UPCEncryption, UTxMultiOperation,
   UJSONFunctions, classes, blcksock, synsock,
   UJSONFunctions, classes, blcksock, synsock,
-  IniFiles, Variants, math, UBaseTypes, UOpenSSL,
+  IniFiles, Variants, math, UBaseTypes,
+  {$IFDEF Use_OpenSSL}
+  UOpenSSL,
+  {$ENDIF}
   UPCOrderedLists, UPCDataTypes,
   UPCOrderedLists, UPCDataTypes,
   {$IFNDEF FPC}System.Generics.Collections{$ELSE}Generics.Collections{$ENDIF},
   {$IFNDEF FPC}System.Generics.Collections{$ELSE}Generics.Collections{$ENDIF},
   UNetProtection;
   UNetProtection;
@@ -3426,7 +3429,9 @@ begin
     GetResultObject.GetAsObject('netstats').GetAsVariant('tservers').Value:=TNetData.NetData.NetStatistics.TotalServersConnections;
     GetResultObject.GetAsObject('netstats').GetAsVariant('tservers').Value:=TNetData.NetData.NetStatistics.TotalServersConnections;
     GetResultObject.GetAsObject('netstats').GetAsVariant('breceived').Value:=TNetData.NetData.NetStatistics.BytesReceived;
     GetResultObject.GetAsObject('netstats').GetAsVariant('breceived').Value:=TNetData.NetData.NetStatistics.BytesReceived;
     GetResultObject.GetAsObject('netstats').GetAsVariant('bsend').Value:=TNetData.NetData.NetStatistics.BytesSend;
     GetResultObject.GetAsObject('netstats').GetAsVariant('bsend').Value:=TNetData.NetData.NetStatistics.BytesSend;
+    {$IFDEF Use_OpenSSL}
     GetResultObject.GetAsVariant('openssl').Value := IntToHex(OpenSSLVersion,8);
     GetResultObject.GetAsVariant('openssl').Value := IntToHex(OpenSSLVersion,8);
+    {$ENDIF}
     nsaarr := TNetData.NetData.NodeServersAddresses.GetValidNodeServers(true,20);
     nsaarr := TNetData.NetData.NodeServersAddresses.GetValidNodeServers(true,20);
     for i := low(nsaarr) to High(nsaarr) do begin
     for i := low(nsaarr) to High(nsaarr) do begin
       jso := GetResultObject.GetAsArray('nodeservers').GetAsObject(i);
       jso := GetResultObject.GetAsArray('nodeservers').GetAsObject(i);

+ 6 - 2
src/gui-classic/UFRMAbout.pas

@@ -63,7 +63,11 @@ uses
   ShellApi,
   ShellApi,
 {$ELSE}
 {$ELSE}
 {$ENDIF}
 {$ENDIF}
-  UFolderHelper, UConst, UNode, UOpenSSL;
+  UFolderHelper, UConst,
+{$IFDEF Use_OpenSSL}
+  UOpenSSL,
+{$ENDIF}
+  UNode;
 
 
 {$IFnDEF FPC}
 {$IFnDEF FPC}
   {$R *.dfm}
   {$R *.dfm}
@@ -73,7 +77,7 @@ uses
 
 
 procedure TFRMAbout.FormCreate(Sender: TObject);
 procedure TFRMAbout.FormCreate(Sender: TObject);
 begin
 begin
-  lblBuild.Caption :=  'Build: '+CT_ClientAppVersion+' OpenSSL: '+IntToHex(OpenSSLVersion,8)+' Compiler: '{$IFDEF FPC}+'FPC'{$IFDEF CPU32}+' 32b'{$ELSE}+' 64b'{$ENDIF}{$ELSE}+'Delphi'{$IFDEF CPU32BITS}+' 32b'{$ELSE}+' 64b'{$ENDIF}{$ENDIF};
+  lblBuild.Caption :=  'Build: '+CT_ClientAppVersion+' OpenSSL: '+{$IFDEF Use_OpenSSL}IntToHex(OpenSSLVersion,8){$ELSE}'NONE'{$ENDIF}+' Compiler: '{$IFDEF FPC}+'FPC'{$IFDEF CPU32}+' 32b'{$ELSE}+' 64b'{$ENDIF}{$ELSE}+'Delphi'{$IFDEF CPU32BITS}+' 32b'{$ELSE}+' 64b'{$ENDIF}{$ENDIF};
   lblProtocolVersion.Caption := Format('BlockChain Protocol: %d (%d)  -  Net Protocol: %d (%d)',[TNode.Node.Bank.SafeBox.CurrentProtocol,CT_BlockChain_Protocol_Available,
   lblProtocolVersion.Caption := Format('BlockChain Protocol: %d (%d)  -  Net Protocol: %d (%d)',[TNode.Node.Bank.SafeBox.CurrentProtocol,CT_BlockChain_Protocol_Available,
     CT_NetProtocol_Version, CT_NetProtocol_Available]);
     CT_NetProtocol_Version, CT_NetProtocol_Available]);
 end;
 end;

+ 7 - 1
src/gui-classic/UFRMWallet.pas

@@ -322,7 +322,11 @@ implementation
   {$R *.lfm}
   {$R *.lfm}
 {$ENDIF}
 {$ENDIF}
 
 
-Uses UFolderHelper, UOpenSSL, UTime, UFileStorage,
+Uses UFolderHelper,
+{$IFDEF Use_OpenSSL}
+  UOpenSSL,
+{$ENDIF}
+  UTime, UFileStorage,
   UThread, UOpTransaction, UFRMPascalCoinWalletConfig,
   UThread, UOpTransaction, UFRMPascalCoinWalletConfig,
   UFRMOperationsExplorer,
   UFRMOperationsExplorer,
   {$IFDEF TESTNET}
   {$IFDEF TESTNET}
@@ -405,7 +409,9 @@ begin
   FIsActivated := true;
   FIsActivated := true;
   try
   try
     // Check OpenSSL dll
     // Check OpenSSL dll
+{$IFDEF Use_OpenSSL}
     if Not LoadSSLCrypt then raise Exception.Create('Cannot load '+SSL_C_LIB+#10+'To use this software make sure this file is available on you system or reinstall the application');
     if Not LoadSSLCrypt then raise Exception.Create('Cannot load '+SSL_C_LIB+#10+'To use this software make sure this file is available on you system or reinstall the application');
+{$ENDIF}
     TCrypto.InitCrypto;
     TCrypto.InitCrypto;
     // Read Wallet
     // Read Wallet
     Try
     Try

+ 4 - 2
src/pascalcoin_wallet_classic.dpr

@@ -15,19 +15,21 @@ uses
   Forms,
   Forms,
   UAccountKeyStorage in 'core\UAccountKeyStorage.pas',
   UAccountKeyStorage in 'core\UAccountKeyStorage.pas',
   UAccounts in 'core\UAccounts.pas',
   UAccounts in 'core\UAccounts.pas',
+  {$IFDEF Use_OpenSSL}
   UAES in 'core\UAES.pas',
   UAES in 'core\UAES.pas',
+  UECIES in 'core\UECIES.pas',
+  UOpenSSL in 'core\UOpenSSL.pas',
+  {$ENDIF}
   UBaseTypes in 'core\UBaseTypes.pas',
   UBaseTypes in 'core\UBaseTypes.pas',
   UBlockChain in 'core\UBlockChain.pas',
   UBlockChain in 'core\UBlockChain.pas',
   UChunk in 'core\UChunk.pas',
   UChunk in 'core\UChunk.pas',
   UConst in 'core\UConst.pas',
   UConst in 'core\UConst.pas',
   UCrypto in 'core\UCrypto.pas',
   UCrypto in 'core\UCrypto.pas',
-  UECIES in 'core\UECIES.pas',
   UFileStorage in 'core\UFileStorage.pas',
   UFileStorage in 'core\UFileStorage.pas',
   ULog in 'core\ULog.pas',
   ULog in 'core\ULog.pas',
   UNetProtection in 'core\UNetProtection.pas',
   UNetProtection in 'core\UNetProtection.pas',
   UNetProtocol in 'core\UNetProtocol.pas',
   UNetProtocol in 'core\UNetProtocol.pas',
   UNode in 'core\UNode.pas',
   UNode in 'core\UNode.pas',
-  UOpenSSL in 'core\UOpenSSL.pas',
   UOpTransaction in 'core\UOpTransaction.pas',
   UOpTransaction in 'core\UOpTransaction.pas',
   UPoolMinerThreads in 'core\UPoolMinerThreads.pas',
   UPoolMinerThreads in 'core\UPoolMinerThreads.pas',
   UPoolMining in 'core\UPoolMining.pas',
   UPoolMining in 'core\UPoolMining.pas',