<!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/mrpippy">Brendan Shanks</a>
commented:
</p>
<div style="">
<p dir="auto">I had requested this in a gnutls-help post last year, the Wine project currently uses GnuTLS to implement the Windows <a href="https://docs.microsoft.com/en-us/windows/win32/seccng/cng-portal" rel="nofollow noreferrer noopener" target="_blank">bcrypt/CNG</a> library and I'm looking to add support for DH.</p>
<p dir="auto">The kind of bcrypt API usage I’m looking to support is similar to this Windows sample code: <a href="https://github.com/microsoft/Windows-classic-samples/blob/master/Samples/Security/DhOakleyGroup1/cpp/DhOakleyGroup1.cpp#L192" rel="nofollow noreferrer noopener" target="_blank">https://github.com/microsoft/Windows-classic-samples/blob/master/Samples/Security/DhOakleyGroup1/cpp/DhOakleyGroup1.cpp#L192</a>. Generate a public/private key pair with provided DH parameters, then export the key, import a different public key, derive a secret key, etc.</p>
<p dir="auto">Although <code>_gnutls_dh_generate_key()</code> will generate the key pair with provided DH parameters, I think it would be cleaner (and more similar to our key generation code for other algorithms) to allow this from <code>gnutls_privkey_generate()</code>. Maybe a <code>GNUTLS_KEYGEN_</code> flag could be added so <code>gnutls_privkey_generate2()</code> would use DH params from a passed-in <code>gnutls_keygen_data_st</code>?</p>
<p dir="auto">I'm also not sure what functions would be used for the key derivation. For example, can PRF be used without a corresponding <code>gnutls_session_t</code>?</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/894#note_376177203">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/9ec23a3409dd586f5c152da16249edd1/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/894#note_376177203"}}</script>
</p>
</div>
</body>
</html>