<!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></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">p11tool is able to display the PKCS#11 URI for an object with a CKA_ID longer than 42 bytes, but crashes when displaying the colon-delimited version.</p>
<p dir="auto">As far as I know, the PKCS#11 spec puts no limit on the size of a CKA_ID.</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">3.6.2-3.fc28</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 28</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">Steps to Reproduce:</p>
<ul dir="auto">
<li>Using some other tool, create an object with an pretty long CKA_ID. I triggered this with a 68 byte ID.</li>
<li>Invoke <code>p11tool --list-all</code> on the token.</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">$ p11tool --list-all 'pkcs11:model=SLB9670'Object 0:</span>
<span id="LC2" class="line" lang="plaintext">       URL: pkcs11:model=SLB9670;manufacturer=IFX;serial=;token=TPM2.0;id=%30%30%30%62%30%37%62%63%34%37%66%33%37%33%63%35%36%37%64%38%32%31%61%61%30%63%61%34%63%38%36%36%37%65%66%62%66%39%36%62%32%62%64%34%32%37%34%61%36%39%36%30%30%66%33%65%65%39%37%35%37%32%38%38%31%31%30%34;type=public</span>
<span id="LC3" class="line" lang="plaintext">       Type: Public key</span>
<span id="LC4" class="line" lang="plaintext">       Label: </span>
<span id="LC5" class="line" lang="plaintext">Error in pkcs11_list:333: The given memory buffer is too short to hold parameters.</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">Manually truncating the CKA_ID to 42 bytes with my PKCS#11 library, I can get it to print the ID out.</p>
<pre class="code highlight js-syntax-highlight plaintext" lang="plaintext" v-pre="true"><code></code></pre>

</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/520">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/b694854cbdf504a3fbcc46d903d8131e/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/520"}}</script>
</p>
</div>
</body>
</html>