Jump to content

Angus Robertson

Members
  • Content Count

    1731
  • Joined

  • Last visited

  • Days Won

    33

Posts posted by Angus Robertson


  1. Look in the TIcsFtpMulti  component to see how it logs using the OnResponse and OnDisplayFile. events. 

     

    As Francois suggests, you can build the OverbyteIcsXferTst sample that uses that component, check it yourself, then get your client to transfer the same file on their system with it, to see if it fails.  How large or small is this file?  The sample creates a log file.

     

    Angus

     

     


  2. Someone else mentioned a similar bug recently, but can not find the message. 

     

    I fixed a bug calculating the speed of zero second FTP transfers 15 years ago that resulted in a similar error, but this would not happen with more recent releases.

     

    ICS does have a n TicsLogger component that developers can add to their applications, but it is primarily for internal debugging of SSL applications, older components needed to be updated to log events and that was never done consistently.  Newer components like TIcsFtpMulti  and TSslHttpRest have ProgressEvent or OnHttpRestProg events,  and LogLevel or DebugLevel properties that can be used for screen display and file logging. 

     

    If you continue using the older TFtpCli component you will need to add logging the onFtpClientDisplay and OnFtpResponse events to log the FTP protocol commands and responses so you can see at which point the error is happening.

     

    Angus

     


  3. The main issue is you rarely want to put a lot of data into a memo, you can not view it while being received since it is updated so often, unless you only want to see the last few lines or are receiving data slowly, like alarm signals or something.  

     

    The most efficient way to update a log window is to write data for display to a buffer (simple string is fine) and then use a timer in the application to empty the buffer to the TMemo every one to two seconds, which is about as often you can see it. 

     

    That is exactly what more recent ICS samples do, like OverbyteIcsHttpRestTst1.pas, the AddLog proc builds the line and writes a file, the TimerLogTimer event updates the TMemo.   In some applications I simply discard most of the log lines if there are hundreds arriving each second.  

     

    Angus

     


  4. Most ICS applications do not use threads so synchronise is not needed,  However receiving data is blocked while you do anything in the OnDataAvailable event so not a good idea to update a memo if you are expecting to receive a lot of data. 

     

    Angus

     


  5. IcsLogger output is intended for internal debugging of ICS components, not end user applications, and is always used with extra logging in the application.  So I have no idea what components you are using, with what IP addresses, ports or protocols, nor which of the numerous ways you have setup the module. 

     

    If you have setup the module as an SSL TCP client, you need an SSL/TLS certificate for the ICS SSL server or it will not start.  It is more normal to set-up IOT modules as servers, so you contact them, but then they need a certificate.  

     

    Suggest you read my earlier message again.

     

    Angus


  6. Rather than looking at OverbyteIcsSimpleSslServer and OverbyteIcsSimpleSslClient. which I assumed you wanted to talk to each other,. I suggest you look at OverbyteIcsIpStmLogTst instead, which can be configured as a server or client and handles all the SSL stuff for you, just setting SslCliSecurity or SslSrvSecurity as I mentioned above from combo boxes.  You should be able to talk to your Ethernet module with the demo. It does not support SSL client certificates, but you probably don't need them.

     

    Angus

     


  7. The declaration for sslSecLevel128bits has the comment 'RSA/DH keys=>3072, ECC=>256, FS forced, no TLS/1.0' which means you SSL/TLS certificate must have an RSA key length of 3,072 or later or EC-256.  You probably have a common RSA 2,048 bit certificate. 

     

    In recent version of ICS with modern components, you generally don't set the OpenSSL security level, instead you set the client or server security level SslCliSecurity or SslSrvSecurity which set the ciphers, TLS version and security level for various scenarios.

     

    Angus

     


  8. If you have already parsed the XML, and can compose the exact signed content, the ICS function IcsAsymVerifyDigest will verify with a private key and the hash digest, there are other function to create the digest with a private key and for HMAC signing with a shared secret. 

     

    ICS will only work with specific OpenSSL versions it understands, and currently supports three major version, soon to be four when OpenSSL 3.0 enters beta next month.

     

    You could probably embed the DLLs as a resource, unpack to tempdir and open them there, but I'm not planning anything like that.

     

    There is an open source code signing project using OpenSSL https://github.com/mtrojnar/osslsigncode but it's 5,000 lines of C code and not trivial, Microsoft has made code signing quite complicated.  If anyone has built a Windows binary, I'd love to play with it.

     

    Angus

     


  9. I'd need to do more reading on XAdES to see what real cryptography is involved, but I've just finished updating the ICS Jose unit to handle signing and verification using JWK, JWS and JWT which involves hash digests, private and public RSA/EC keys and is used for REST APIs like Let's Encrypt, Google and Microsoft.  Anything using XML will be an older generation and should be easy to support in ICS, if there is a demand. 

     

    Angus

     


  10. I made a mistake word wrapping one of the bad certificates and lost a character, when corrected it reads correctly with ICS and OpenSSL.

     

    It is frustrating OpenSSL does not handle unwrapped certificates consistently and I've raised that as an issue.

     

    But Michal can fix his original problem by ensuring the files are created according to the RFC with 64 character long lines, they are from some source other than ICS.   In theory I could word wrap them, but I think I'll just add a better error if OpenSSL fails. 

     

    Angus

     

     


  11. The original certificates are unwrapped base64 and that is how I tested them. however I manually line wrapped them for the OpenSSL mailing list since email does like 2,500 long lines. 

     

    When I rest them line wrapped, my latest ICS says 'Reading X509 Base64 certificate: Error Cert 1 - error:09091064:PEM routines:PEM_read_bio_ex:bad base64 decode' for the bad certificate and the asn1parase command works for the OK certificate and gives a real error for the bad one.

     

    I'll fix ICS to reject unwrapped certificates since OpenSSL can not reliably handle them. 

     

    Angus

×