This PR is to address the issue reported in ZD#16867.
This issue occurs because the index value, which is initialized to point to the signature part of the data, is pointing after the signature part, resulting in a buffer error(-1004). This index value must be initialized correctly.
This failure occurs when the server host key algorithm is RSA.
How to reproduce the issue:
configure wolfSSH with following options
./configure --enable-debug --enable-sftp CFLAGS="-DWOLFSSH_YES_SSH_RSA_SHA1"
comment out ID_ECDSA_SHA2_NISTP256 entry from cannedKeyAlgoClient[].
This is to ensure that only rsa-sha2-256 and ssh-rsa are listed in the Server-host-key algorithm list. The WOLFSSH_NO_ECDSA macro could not be used because it would generate a build error.
build and run echoserver as a sever and run wolfsftp with -u jill -P upthehill
wolfsftp prints out " connect error: CLIENT_KEXDH_INIt_SENT, -1004"
This PR is to address the issue reported in ZD#16867.
This issue occurs because the index value, which is initialized to point to the signature part of the data, is pointing after the signature part, resulting in a buffer error(-1004). This index value must be initialized correctly. This failure occurs when the server host key algorithm is RSA.
How to reproduce the issue: