Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Facing retransmission issue while adding delay in the server side in the DTLS implementation #4022

Open
SriSanthanaa opened this issue Apr 16, 2024 · 0 comments

Comments

@SriSanthanaa
Copy link

Botan version used: 2.19.3
We are trying to implement client server communication through DTLS protocol on top of botan library. In Botan::TLS::Callbacks tls_emit_data() we are inducing a delay of 5 seconds when the engine is server to test our implementation for the retransmission behavior. When we do this, the client is sending the ClientKeyExchange Flight before it receives ServerHelloDone flight from the server. We could also see partial read in the client side as server has sent ServerHello alone but not ServerHelloDone.

void
CallbacksPSK::tls_emit_data(uint8_t const buf[], size_t const length)
{
    if (nullptr == mEngine) {
        throw std::runtime_error("Null engine pointer!");
    }
   if(mEngine->mIsServer){
       sleep(5);  
   }
}

When we do this the handshake is not getting completed and the server is unable to process the request from client ands it throws an error:
terminate called after throwing an instance of 'Botan::Internal_Error'
what(): Internal error: TLS::Channel No write cipherstate for epoch 65535
Aborted (core dumped)

The same delay when we add it for client side the handshake is getting completed.

  1. Is this the right way to add delay?
  2. Is adding delay affects the handshake process ?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant