Watch, Follow, &
Connect with Us
Public Report
Report From: Delphi-BCB/RTL/Delphi/Other Classes    [ Add a report in this area ]  
Report #:  103179   Status: Closed
TRSACypher.SSLErrorMessage returns garbage strings
Project:  Delphi Build #:  16.0.4358.45540
Version:    16.3 Submitted By:   Patrick van Logchem
Report Type:  Basic functionality failure Date Reported:  2/6/2012 3:12:51 AM
Severity:    Serious / Highly visible problem Last Updated: 9/5/2012 8:01:11 PM
Platform:    All platforms Internal Tracking #:   289794
Resolution: Fixed (Resolution Comments) Resolved in Build: : 17.0.4625.53395
Duplicate of:  None
Voting and Rating
Overall Rating: No Ratings Yet
0.00 out of 5
Total Votes: None
Description
TRSACypher.SSLErrorMessage returns garbage strings, since it interprets the output from ERR_error_string as Unicode, while the reference documentation seems to indicate the output is Ansi encoded (see http://www.openssl.org/docs/crypto/ERR_error_string.html# ).

Steps to Reproduce:
After a call to TRSACypher.LoadSSL, try : ShowMessage(TRSACypher.SSLErrorMessage), it currently returns garbage.

Replace the implementation with this to fix the issue :

class function TRSACypher.SSLErrorMessage: String;
var
  buff: array [0..1023] of AnsiChar; // BUGFIX: SSL Errors are ASCII text !
begin
  IPPeerProcs._ERR_error_string(IPPeerProcs._ERR_get_error(), @buff);

  Result := string(AnsiString(buff)); // BUGFIX: SSL Errors are ASCII text !
end;
Workarounds
None
Attachment
None
Comments

None

Server Response from: ETNACODE01