These are chat archives for IndySockets/Indy

28th
Apr 2016
davidpn
@davidpn
Apr 28 2016 04:58
haven't had any luck with loading custom-built OpenSSL. It involves renaming, which consequently means altering the OpenSSL build files due to dependencies. Our alternatives currently are: wait for BoringSSL support in Indy, have someone more knowledgeable work on custom building OpenSSL with new names (or learn it ourselves), or completely ditch Indy. One other thing - is it possible to do static linking for Android with Indy and OpenSSL?
PS: we may be dropping Indy for the "native" support in FMX anyway. I'd prefer to stick with Indy for my personal stuff, and I require SSL on Android for that
Remy Lebeau
@rlebeau
Apr 28 2016 16:33
Indy is not currently setup to support static linking of OpenSSL on any platform other than iOS (it has been requested on Windows, and now Android). If you manage to get viable static libs working, it should just be a matter of updating IdCompilerDefines.inc and IdSSLOpenSSLHeaders_static.pas accordingly to enable the STATICLOAD_OPENSSL conditional for Android.
Isaac Shapira
@Fresheyeball
Apr 28 2016 17:28
hello out there!
Remy Lebeau
@rlebeau
Apr 28 2016 17:29
hi Isaac
Isaac Shapira
@Fresheyeball
Apr 28 2016 17:29
So I'm trying to revive an delphi project at my company
and I'm a n00b and I'm not sure how dependencies work
some of the original source code uses DCPsha256
or rather sorry
uses IdHash
which I believe is in Indy
function SHA1(const source: string): string;
var
  _SHA1: TIdHashSHA1;
  _SHA1Hash: T5x4LongWordRecord;
begin
  _SHA1     := TIdHashSHA1.Create;
  _SHA1Hash := _SHA1.HashValue(source);
  result    := _SHA1.AsHex(_SHA1Hash);
end;
but the current version of Indy doesn't have a method called HashValue on TIdHashSHA1
how can I install the right version of Indy into the project?
or know which version to use?
Remy Lebeau
@rlebeau
Apr 28 2016 17:44
in this case, use HashStringAsHex() instead
result := _SHA1.HashStringAsHex(source);
and make sure IdHashSHA is in your uses clause
Isaac Shapira
@Fresheyeball
Apr 28 2016 17:46
Its there
I have IdHashSHA in uses
will HashStringAsHex have identical function to HashValue?
I assume I don't need the next line with AsHex?
Remy Lebeau
@rlebeau
Apr 28 2016 18:03
HashValue() would hash the string and then return the binary hash bytes, and then AsHex() would convert those bytes to a hex string. HashStringAsHex() does the same thing as a single method
also, you have a memory leak, you need to Free() the TIdHashSHA1 object
Isaac Shapira
@Fresheyeball
Apr 28 2016 19:07
@rlebeau ok cool!
thank you!
davidpn
@davidpn
Apr 28 2016 21:09
Thanks, Remy.. we might look at that as an option