<!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 class="details" style="font-style: italic; color: #777;">
<a href="https://gitlab.com/jjelen">Jakub Jelen</a> created an issue:
</p>
<div></div>
<h2 dir="auto">
<a id="user-content-description-of-problem" class="anchor" href="#description-of-problem" aria-hidden="true"></a>Description of problem:</h2>
<p dir="auto">Trying to list CK_EC_EDWARDS public key from PCKCS#11 module fails.</p>
<p dir="auto">The GnuTLS I am using is behaving like it would not know this key type (see the logs below).</p>
<h2 dir="auto">
<a id="user-content-version-of-gnutls-used" class="anchor" href="#version-of-gnutls-used" aria-hidden="true"></a>Version of gnutls used:</h2>
<p dir="auto"><code>gnutls-3.6.11-1.fc31.x86_64</code></p>
<h2 dir="auto">
<a id="user-content-distributor-of-gnutls-eg-ubuntu-fedora-rhel" class="anchor" href="#distributor-of-gnutls-eg-ubuntu-fedora-rhel" aria-hidden="true"></a>Distributor of gnutls (e.g., Ubuntu, Fedora, RHEL)</h2>
<p dir="auto">Fedora</p>
<h2 dir="auto">
<a id="user-content-how-reproducible" class="anchor" href="#how-reproducible" aria-hidden="true"></a>How reproducible:</h2>
<p dir="auto">deterministic</p>
<p dir="auto">Steps to Reproduce:</p>
<ul dir="auto">
<li>Build OpenSC with EdDSA support (or have different PKCS#11 module supporting ED keys -- softhsm)</li>
<li>Generate Ed25519 key pair in module (I used Nitrokey with GNUK applet and softhsm)</li>
<li>Try to list objects in the pkcs11 module</li>
</ul>
<h2 dir="auto">
<a id="user-content-actual-results" class="anchor" href="#actual-results" aria-hidden="true"></a>Actual results:</h2>
<pre class="code highlight js-syntax-highlight plaintext" lang="plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">$ PKCS11SPY=`realpath src/pkcs11/.libs/opensc-pkcs11.so` p11tool -d9999 --list-all --provider `realpath src/pkcs11/.libs/pkcs11-spy.so` "pkcs11:model=PKCS%2315%20emulated;manufacturer=OpenPGP%20project;serial=fffe43245521;token=OpenPGP%20card%20%28User%20PIN%29"</span>
<span id="LC2" class="line" lang="plaintext">...</span>
<span id="LC3" class="line" lang="plaintext">29: C_GetAttributeValue</span>
<span id="LC4" class="line" lang="plaintext">2020-02-26 09:54:01.479</span>
<span id="LC5" class="line" lang="plaintext">[in] hSession = 0x558b896d8650</span>
<span id="LC6" class="line" lang="plaintext">[in] hObject = 0x558b896d79f0</span>
<span id="LC7" class="line" lang="plaintext">[in] pTemplate[1]: </span>
<span id="LC8" class="line" lang="plaintext">    CKA_KEY_TYPE          00007ffd64a23988 / 8</span>
<span id="LC9" class="line" lang="plaintext">[out] pTemplate[1]: </span>
<span id="LC10" class="line" lang="plaintext">    CKA_KEY_TYPE          CKK_EC_EDWARDS     </span>
<span id="LC11" class="line" lang="plaintext">Returned:  0 CKR_OK</span>
<span id="LC12" class="line" lang="plaintext">|<2>| requested reading public key of unsupported type 64</span>
<span id="LC13" class="line" lang="plaintext">|<3>| ASSERT: pkcs11.c[pkcs11_read_pubkey]:1902</span>
<span id="LC14" class="line" lang="plaintext">|<3>| ASSERT: pkcs11.c[pkcs11_obj_import_pubkey]:1942</span>
<span id="LC15" class="line" lang="plaintext">|<3>| ASSERT: pkcs11.c[pkcs11_import_object]:2165</span></code></pre>
<h2 dir="auto">
<a id="user-content-expected-results" class="anchor" href="#expected-results" aria-hidden="true"></a>Expected results:</h2>
<p dir="auto">The EdDSA keys should be listed  as objects.</p>
<p dir="auto">If I see right, this functionality should be in since <a href="https://gitlab.com/gnutls/gnutls/-/commit/b2d8134916595b7be1f4ceb9bf1f3ce7fc09753d" data-original="b2d81349" data-link="false" data-link-reference="false" data-project="179611" data-commit="b2d8134916595b7be1f4ceb9bf1f3ce7fc09753d" data-reference-type="commit" data-container="body" data-placement="top" data-html="true" title="Merge branch 'tmp-eddsa-pkcs11' into 'master'" class="gfm gfm-commit has-tooltip">b2d81349</a> (~1 year ago), while my release is just 2 month old, but it does not look like working with softhsm2 nor with OpenSC (<a href="https://github.com/OpenSC/OpenSC/pull/1960" rel="nofollow noreferrer noopener" target="_blank">https://github.com/OpenSC/OpenSC/pull/1960</a>).</p>

</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/946">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/ff3644cf00338b8fa1e23d2e1bb76b83/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/946"}}</script>


</p>
</div>
</body>
</html>