<!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=US-ASCII" http-equiv="Content-Type">
<title>
GitLab
</title>
<style>img {
max-width: 100%; height: auto;
}
</style>
</head>
<body>
<div class="content">
<p style="color: #777777;">
<a href="https://gitlab.com/dueno">Daiki Ueno</a>
commented on a
<a href="https://gitlab.com/gnutls/gnutls/issues/826#note_217655808">discussion</a>:
</p>
<div style="">
<p dir="auto">For (1) I think there are two approaches: put all callbacks in a struct, or define each callback separately. The former makes it clear that the caller must set all callbacks to use QUIC functionality, while the latter would provide future extensibility if more callbacks are needed. Since QUIC is not yet finalized, I am leaning towards the latter approach: for secret retrieval, maybe something like:</p>
<pre class="code highlight js-syntax-highlight c" lang="c" v-pre="true"><code><span id="LC1" class="line" lang="c"><span class="k">typedef</span> <span class="nf">void</span> <span class="p">(</span><span class="o">*</span><span class="n">gnutls_secret_hook_func</span><span class="p">)(</span><span class="n">gnutls_session_t</span> <span class="n">session</span><span class="p">,</span></span>
<span id="LC2" class="line" lang="c"> <span class="kt">unsigned</span> <span class="kt">int</span> <span class="n">epoch</span><span class="p">,</span></span>
<span id="LC3" class="line" lang="c"> <span class="kt">unsigned</span> <span class="kt">int</span> <span class="n">incoming</span><span class="p">,</span></span>
<span id="LC4" class="line" lang="c"> <span class="k">const</span> <span class="n">gnutls_datum_t</span> <span class="o">*</span><span class="n">secret</span><span class="p">);</span></span>
<span id="LC5" class="line" lang="c"></span>
<span id="LC6" class="line" lang="c"><span class="kt">void</span> <span class="nf">gnutls_set_secret_hook_function</span><span class="p">(</span><span class="n">gnutls_session_t</span> <span class="n">session</span><span class="p">,</span></span>
<span id="LC7" class="line" lang="c"> <span class="n">gnutls_secret_hook_func</span> <span class="n">func</span><span class="p">);</span></span></code></pre>
<p dir="auto">For (2), as GnuTLS supports keylog file:
<a href="https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/Key_Log_Format" rel="nofollow noreferrer noopener" target="_blank">https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/Key_Log_Format</a></p>
<p dir="auto">you could <code>git grep</code> with the label in the source code, e.g., "CLIENT_EARLY_TRAFFIC_SECRET".</p>
</div>
</div>
<div class="footer" style="margin-top: 10px;">
<p style="font-size: small; color: #777;">
—
<br>
Reply to this email directly or <a href="https://gitlab.com/gnutls/gnutls/issues/826#note_217655808">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/8c2afdbe9a7e529e1bedd82cada51c48/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/826#note_217655808"}}</script>
</p>
</div>
</body>
</html>