Welcome, Guest
You have to register before you can post on our site.

Username
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 86,236
» Latest member: bellawilliam1
» Forum threads: 2,413
» Forum posts: 11,329

Full Statistics

Online Users
There are currently 336 online users.
» 3 Member(s) | 330 Guest(s)
Applebot, Bing, Google, 68wincodes, bellawilliam1, vipwinvegas

Latest Threads
TIWjQDBGrid erratic behav...
Forum: IntraWeb General Discussion
Last Post: Fabrizio Conti
07-14-2026, 06:27 AM
» Replies: 6
» Views: 775
Need Help Integrating Mic...
Forum: IntraWeb General Discussion
Last Post: capheny
07-07-2026, 06:43 AM
» Replies: 0
» Views: 135
OpenSSL and concurrent re...
Forum: Indy
Last Post: kbriggs
07-05-2026, 02:41 PM
» Replies: 5
» Views: 452
Projeto Intraweb
Forum: IntraWeb General Discussion
Last Post: vonirpereira
07-03-2026, 06:51 PM
» Replies: 0
» Views: 181
Intraweb + Lazarus
Forum: IntraWeb Dúvidas Gerais
Last Post: vonirpereira
07-03-2026, 06:35 PM
» Replies: 0
» Views: 113
Image question on tiwjqdb...
Forum: IntraWeb General Discussion
Last Post: alex.trejo@tttnet.com.mx
07-01-2026, 12:19 AM
» Replies: 4
» Views: 4,378
CSS file not reloading af...
Forum: IntraWeb General Discussion
Last Post: Gustave
06-30-2026, 09:00 PM
» Replies: 0
» Views: 153
IW 16.2.0 Missing librari...
Forum: IntraWeb General Discussion
Last Post: Gregory_Twedt
06-24-2026, 04:40 AM
» Replies: 5
» Views: 934
VCL conversion
Forum: Delphi General Discussion
Last Post: tobenschain
06-20-2026, 05:00 AM
» Replies: 0
» Views: 171
TIWjQDBGrid changing UI
Forum: IntraWeb General Discussion
Last Post: BoostedCruiser
06-08-2026, 02:02 AM
» Replies: 36
» Views: 71,349

 
  Calling openssl from x64 application
Posted by: KeesVer - 05-16-2019, 12:13 PM - Forum: Indy - Replies (7)

Hello,

I'm calling openssl from Delphi (10.3.1) using the indy libraries. This works perfectly when using a 32 bit application. However when the application is compiled to 64 bits, I get an access violation on this line: rc := EVP_PKEY_set1_RSA(@key, FRSA);

I use dll's copied from https://indy.fulgan.com/SSL/

Any idea what is causing this?

I have attached a test application but you'll need a private key to use it (I can send a temporary key when needed)

Thanks,

Kees

Code:
function TOAuth1SignatureMethod_RSA_SHA1.Hash_HMAC_SHA1(const AData, AKey: string): string;
var
 buffer: TBytes;
 clean_key: string;
 mdLength: TIdC_UInt;
 mdctx: EVP_MD_CTX;
 outbuf: TBytes;
 KeyBuffer: pBIO;
 FRSA: PRSA;
 md: PEVP_MD;
 rc: Integer;
 key: EVP_PKEY;
 p: Integer;

begin
 if not IdSSLOpenSSL.LoadOpenSSLLibrary then
   raise Exception.Create('LoadOpenSSLLibrary failed');

 // Load private key (key must include header and footer)
 //-----BEGIN PRIVATE KEY-----
 // ....
 // ....
 //-----END PRIVATE KEY-----

 p := AKey.IndexOf('-----END PRIVATE KEY-----');
 if p < 0 then
   raise Exception.Create('Private key error');

 clean_key := AKey.Substring(0, p + Length('-----END PRIVATE KEY-----'));
 buffer := TEncoding.ANSI.GetBytes(clean_key);
 KeyBuffer := BIO_new_mem_buf(buffer, Length(buffer));

 if KeyBuffer = nil then
   raise Exception.Create('RSA out of memory');

 try
   FRSA := PEM_read_bio_RSAPrivateKey(KeyBuffer, nil, nil, nil);
   if not Assigned(FRSA) then
     raise Exception.Create('Private key error');
 finally
   BIO_free(KeyBuffer);
 end;

 md := EVP_get_digestbyname('SHA1');

 rc := EVP_DigestInit(@mdctx, md);
 if rc <> 1 then
   raise Exception.Create('EVP_DigestInit failed: ' + rc.ToString);

 rc := EVP_PKEY_set1_RSA(@key, FRSA); <== Exception occurs here
 if rc <> 1 then
   raise Exception.Create('EVP_PKEY_set1_RSA failed: ' + rc.ToString);

 rc := EVP_DigestSignInit(@mdctx, nil, md, nil, @key);
 if rc <> 1 then
   raise Exception.Create('EVP_DigestSignInit failed: ' + rc.ToString);

 buffer := TEncoding.ANSI.GetBytes(AData);
 rc := EVP_DigestSignUpdate(@mdctx, buffer, Length(buffer));
 if rc <> 1 then
   raise Exception.Create('EVP_DigestSignUpdate failed: ' + rc.ToString);

 rc := EVP_DigestSignFinal(@mdctx, nil, @mdLength);
 if rc <> 1 then
   raise Exception.Create('EVP_DigestFinal failed: ' + rc.ToString);

 SetLength(outbuf, mdLength);
 rc := EVP_DigestSignFinal(@mdctx, PIdAnsiChar(@outbuf[0]), @mdLength);
 if rc <> 1 then
   raise Exception.Create('EVP_DigestFinal failed: ' + rc.ToString);

 //EVP_Cleanup();
 Result := TNetEncoding.Base64.EncodeBytesToString(outbuf);
 Result := Result.Replace(#13#10, '', [rfReplaceAll]);
end;



Attached Files
.zip   RESTDemo.zip (Size: 99.23 KB / Downloads: 8)
Print this item

  IWComboBox with Bootstrap style? How?
Posted by: ioan - 05-16-2019, 06:59 AM - Forum: IntraWeb General Discussion - No Replies

I tried "dropdown", "dropdown-menu" and doesn't work. Do I have to build the Combobox in code with "OnUnknownTag" to make it look good or there is a simpler way?

Found it, it's "form-control"

Print this item

  Client IP changing breaking security
Posted by: bob9999 - 05-12-2019, 09:03 PM - Forum: IntraWeb General Discussion - Replies (4)

Hi there.  I received a report of someone on the new Galaxy10 cell phone that is getting an error that the IP address is changing and they cannot establish a connection.  I had this once with an iPhone too.

My whole application is in SSL and the error message is "The IP you are using is different than the one that initiated the session.   Security check failed.  Please restart application."

Is there a way to loosen the security of the web application to allow the IP address to dynamically change?  I read on-line that the new Galaxy 10 has networking issues so this is probably a flawed product but I wanted to ask the technical question if we can do anything to compensate for this problem.

Cheers!



Attached Files Thumbnail(s)
   
Print this item

  Decode Base64 into Memo or file
Posted by: staff@ergosoft.it - 05-11-2019, 09:00 AM - Forum: IntraWeb General Discussion - Replies (11)

Hi,

I try to decode a string encoded in base64 into Memo o alternatively in a text file...

try this but not work...

Code:
var
   b : TBytes;
   testo : string;

begin
   ...
   b := TNetEncoding.Base64.DecodeStringToBytes(mystringencodedbase64);
   testo := TEncoding.ANSI.GetString(b);
   memo1.text := testo;

in memo is show symbol not my original string ....

thanks
Alessandro Romano

Print this item

  Tcontent Handler and notify errors to frontend
Posted by: cprmlao@hotmail.com - 05-09-2019, 10:28 PM - Forum: IntraWeb General Discussion - Replies (2)

I have a javascript code on frontend, where I call a content handler.  

When using TcontentHandlers, if the handler fail I need to inform the front end that an error occur.
The response of the handler is something as 

Code:
aReply.WriteString(here is the result);


But if there is an error, such as "400 error" or similar , how could I inform the frontend?
What could I put in writestring?

Luiz

Print this item

  ISAPI dll, IIS and exceptions
Posted by: msgopala - 05-09-2019, 05:02 PM - Forum: IntraWeb General Discussion - Replies (1)

Embarcadero® Delphi 10 Seattle Version 23.0.20618.2753 
Intraweb 15.0.14
TMS pack Pro
FastReport 5

The dll has been running on the serv er since April 20th with a few TMS component issues. Apart from that after there is one issue, there are sites trying to access files which are not where the dll is published resulting in 404 error and one of the dlls, which is an older isapi dll going down, which causes a domino effect. 

How can I stop this from happening. I have a robots.text in the same folder as the dll and have User-agent: * Disallow/ inside it. 


Thanks
* I tried googling before posting here and came up with nothing.

Print this item

  IW 15.0.21 vs RAD C++ 10.2 update 3
Posted by: duffo64 - 05-09-2019, 03:21 PM - Forum: IntraWeb General Discussion - Replies (4)

Sirs,

After 15.0.21 installation, as soon as I recompile an existing project (or create and run a new empty one) it fails:

Exception message : Error reading IWForm1.Width: Access violation at address 00B91998 in module 'Intraweb_15_D10_2.bpl'. Read of address 00000008
Exception class : EReadError

P.S.: trying an empty project with RAD C++ 10.3 update 1 works as expected

What happened ?_?

/Claudio

Print this item

  A couple of http.sys issues!
Posted by: TonyNZ - 05-09-2019, 09:38 AM - Forum: IntraWeb General Discussion - Replies (2)

A bit of background. I have, at a client's site, approx. 6 - 8 Intraweb SA servers running on a virtual Windows 2018 server (using http.sys and running on port 80). I have limited control over what the hosting crowd decide in terms of virus / malware / windows patch update timetables etc. The reason that multiple servers run on one VM is essentially related to costs to the client. Some of the Intraweb servers have 1,000 clients, others have 50! The reason they are SA (instead of a service) is simply to do with ease of monitoring them! Eventually I will develop a "monitoring app" that will tell if a server has stopped etc.

To the issues (and this is more a query if anyone else has struck these):

1) If one of the SA servers is down and a client tries to login they don't get an error. The simply get the login screen for one of the other SAs that is running. Which confuses the client! Is there a way of having a "default" SA server ... like a 404 page!

2) Shutting down one of these SA servers causes Windows Explorer to "lock up"! This is a bit difficult to explain ... but if you close the server and there is then no desktop response. I'm on a remote connection so I know that Windows hasn't locked ... I can still do file transfers etc. If you wait long enough (15 - 30 minutes) Windows does come back (sometimes with the "Explorer has stopped responding message") and you can recover, without a reboot etc. Of course I never have such an issue on my development computer. This may be related to running them as "application" as opposed to services.


Anyway just seeing if anyone else has had such issues.

Print this item

  New Userkit Release
Posted by: Quajak - 05-08-2019, 05:01 PM - Forum: COSMOS - No Replies

We have released a new user kit version. Download it here: https://github.com/CosmosOS/Cosmos/relea...t_20190508

This release includes the following:

  • Support for VS2019
  • CGS and Fat fixes
  • Added arithmetic overflow checks

Print this item

  How to handle exceptions TIdTcpServer, TIdTcpClient
Posted by: whitekn3 - 05-08-2019, 01:24 PM - Forum: Indy - Replies (2)

I recently took over development/maintenance on a project written in Builder C++ 6 and just converted to Indy 10.   Some quirky unexpected problems occurred that seem to be related to the error handling.  I am pretty much a novice when it comes to Indy so I'm struggling to figure it all out.

Web searches found several comments by RLebeau that said "let the server handle the exceptions".   I looked, but never found, for code samples that would clarify what he meant. 

In this case TIdTcpServer Execute calls DoPassthruServerExecute, which calls HandleFirstCallerMessage, both of which have try ... catch sections.  There is also a TIdTcpClient and a ReceiveThread (TThread, TIdContext which is passed the server context) that has a try .. catch block, and which catches EIdConnClosedGracefully.

I've attached a stripped down code that has all the essential code and error handling.  I would greatly appreciate it if someone could take a look at it and let me know if they see any obvious problems or design issues.

Thanks.

Print this item