<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html lang="en">
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<title>
GitLab
</title>


<style>img {
max-width: 100%; height: auto;
}
</style>
</head>
<body>
<div class="content">
<div>
<p dir="auto">Hi. Attached is an example where the gnutls server is run, some junk message is sent to it and the server response if printed out. Unfortunately, despite my best attempts, I was not able to compile using the src/udp-serv.h headers and src/udp-serv.c which provides the <code>udp_server</code> method, method also used by gnutls-serv. Hence, I added a flag which switches between code for launching server via <code>udp_server</code> and via the <code>system</code> library function.</p>
<p dir="auto">The fix is rather simple, in <a href="https://gitlab.com/gnutls/gnutls/blob/master/src/udp-serv.c#L94">udp_server</a>, upon receiving a first message, check that the message is actually a CLIENT_HELLO before sending a HELLO_VERIFY_REQUEST.</p>
<p dir="auto">What I see as a problem architecturally is that the first step of DTLS lies outside of the handshake and has to be handled by applications that make use of gnutls libraries. It would be nice if there was a DTLS-specific library method which performed DTLS handshakes completely, including this first step.
<a href="https://gitlab.com/gnutls/gnutls/uploads/96b21f35a018933eb42e0946061750ff/hello-verify-test.c">hello-verify-test.c</a></p>
</div>


</div>
<div class="footer" style="margin-top: 10px;">
<p style="font-size: small; color: #777777;">

<br>
Reply to this email directly or <a href="https://gitlab.com/gnutls/gnutls/issues/632#note_121960413">view it on GitLab</a>.
<br>
You're receiving this email because of your account on gitlab.com.
If you'd like to receive fewer emails, you can
<a href="https://gitlab.com/sent_notifications/f98d618be7afa19de319b53956d776e7/unsubscribe">unsubscribe</a>
from this thread or
adjust your notification settings.
<script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","action":{"@type":"ViewAction","name":"View Issue","url":"https://gitlab.com/gnutls/gnutls/issues/632#note_121960413"}}</script>
</p>
</div>
</body>
</html>