Topic: [SOLVED] BUFFER_ERROR with wolfSSL_connect on 32-bit Ubuntu-14.04
Hi All.
Initiallly, I connected my client using OpenSSL to our proprietary server, and all things were cool.
Now, we are trying to switch to wolfSSL, and followed the steps as per https://github.com/wolfSSL/wolfssl-exam … ient-tls.c , with important differences being ::
* We are not using client-certificate for authorization (just require TLS).
So, we have not added Load client certificates into WOLFSSL_CTX step.
* We have added the additional wolfSSL_CTX_set_verify(ssl, SSL_VERIFY_NONE, 0); before wolfSSL_connect
Just to clarify, our OpenSSL-client connects fine even without loading client-certificate, hence the avoidance of certificate-loading step.
Things proceed to some extent, but then the wolfSSL_connect step fails at line https://github.com/wolfSSL/wolfssl/blob … al.c#L9774
Following are the wolfSSL-logs, plus some of my custom-logs prepended with ==>
Also, I have added the parameter-values in the last log, that is causing the BUFFER_ERROR to be hit.
Entering [wolfSSL_Init]
Entering [wolfCrypt_Init]
Entering [WOLFSSL_CTX_new_ex]
Entering [wolfSSL_CertManagerNew]
Leaving [WOLFSSL_CTX_new] with return-code [0]
Entering [wolfSSL_CTX_set_verify]
Entering [SSL_new]
Leaving [SSL_new] with return-code [0]
Entering [SSL_connect()]
growing output buffer
Shrinking output buffer
connect state: CLIENT_HELLO_SENT
==> wanting [5] bytes
==> read [5] bytes
==> got success
growing input buffer
==> wanting [16384] bytes
==> read [8635] bytes
==> read [2880] bytes
==> read [2880] bytes
==> read [1989] bytes
==> got success
received record layer msg
Entering [DoHandShakeMsg()]
Entering [DoHandShakeMsgType]
processing server hello
Entering [VerifyClientSuite]
Leaving [DoHandShakeMsgType()] with return-code [0]
Leaving [DoHandShakeMsg()] with return-code [0]
More messages in record
received record layer msg
Entering [DoHandShakeMsg()]
Entering [DoHandShakeMsgType]
processing certificate
Entering [ProcessPeerCerts]
Loading peer's cert chain
Put another cert into chain
Put another cert into chain
Put another cert into chain
Entering [GetExplicitVersion]
Entering [GetSerialNumber]
Got Cert Header
Entering [GetAlgoId]
Entering [GetObjectId()]
Got Algo ID
Getting Cert Name
Getting Cert Name
Got Subject Name
Entering [GetAlgoId]
Entering [GetObjectId()]
Got Key
Parsed Past Key
Entering [DecodeCertExtensions]
Entering [GetObjectId()]
Entering [DecodeAuthKeyId]
Entering [GetObjectId()]
Entering [DecodeSubjKeyId]
Entering [GetObjectId()]
Entering [DecodeKeyUsage]
Entering [GetObjectId()]
Entering [DecodeBasicCaConstraint]
Entering [GetObjectId()]
Certificate Policy extension not supported yet.
Entering [GetObjectId()]
Entering [DecodeCrlDist]
Entering [GetObjectId()]
Entering [DecodeAuthInfo]
Entering [GetObjectId()]
Entering [GetAlgoId]
Entering [GetObjectId()]
Chain cert not verified by option, not adding as CA
Entering [GetExplicitVersion]
Entering [GetSerialNumber]
Got Cert Header
Entering [GetAlgoId]
Entering [GetObjectId()]
Got Algo ID
Getting Cert Name
Getting Cert Name
Got Subject Name
Entering [GetAlgoId]
Entering [GetObjectId()]
Got Key
Parsed Past Key
Entering [DecodeCertExtensions]
Entering [GetObjectId()]
Entering [DecodeAuthKeyId]
Entering [GetObjectId()]
Entering [DecodeSubjKeyId]
Entering [GetObjectId()]
Entering [DecodeKeyUsage]
Entering [GetObjectId()]
Entering [DecodeBasicCaConstraint]
Entering [GetObjectId()]
Entering [DecodeExtKeyUsage]
Entering [GetObjectId()]
Entering [GetObjectId()]
Entering [GetObjectId()]
Certificate Policy extension not supported yet.
Entering [GetObjectId()]
Entering [DecodeCrlDist]
Entering [GetObjectId()]
Entering [DecodeAuthInfo]
Entering [GetObjectId()]
Entering [GetObjectId()]
Entering [GetAlgoId]
Entering [GetObjectId()]
Chain cert not verified by option, not adding as CA
Verifying Peer's cert
Entering [GetExplicitVersion]
Entering [GetSerialNumber]
Got Cert Header
Entering [GetAlgoId]
Entering [GetObjectId()]
Got Algo ID
Getting Cert Name
Getting Cert Name
Got Subject Name
Entering [GetAlgoId]
Entering [GetObjectId()]
Got Key
Parsed Past Key
Entering [DecodeCertExtensions]
Entering [GetObjectId()]
Entering [DecodeAuthKeyId]
Entering [GetObjectId()]
Entering [DecodeSubjKeyId]
Entering [GetObjectId()]
Entering [DecodeKeyUsage]
Entering [GetObjectId()]
Entering [DecodeBasicCaConstraint]
Entering [GetObjectId()]
Entering [DecodeExtKeyUsage]
Entering [GetObjectId()]
Entering [GetObjectId()]
Entering [GetObjectId()]
Certificate Policy extension not supported yet.
Entering [GetObjectId()]
Entering [DecodeCrlDist]
Entering [GetObjectId()]
Entering [DecodeAuthInfo]
Entering [GetObjectId()]
Entering [GetObjectId()]
Entering [GetObjectId()]
Entering [DecodeAltNames]
Entering [GetAlgoId]
Entering [GetObjectId()]
Verified Peer's cert
Leaving [ProcessPeerCerts] with return-code [0]
Leaving [DoHandShakeMsgType()] with return-code [0]
Leaving [DoHandShakeMsg()] with return-code [0]
More messages in record
received record layer msg
Entering [DoHandShakeMsg()]
Entering [DoHandShakeMsgType]
processing server key exchange
Entering [DoServerKeyExchange]
Entering [RsaVerify]
Leaving [RsaVerify] with return-code [51]
Leaving [DoServerKeyExchange] with return-code [0]
Leaving [DoHandShakeMsgType()] with return-code [0]
Leaving [DoHandShakeMsg()] with return-code [0]
More messages in record
received record layer msg
Entering [DoHandShakeMsg()]
==> wanting [5] bytes
==> read [5] bytes
==> got success
==> wanting [119] bytes
==> read [119] bytes
==> got success
received record layer msg
Entering [DoHandShakeMsg()]
==> inputLength = [119], ssl->arrays->pendingMsgOffset = [11284], ssl->arrays->pendingMsgSz = [11399]
What am I missing?
Will be grateful for reply.
Thanks and Regards,
Ajay