<!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">GENERIC_ERROR (error code 6) returned on asn1_der_coding method</p>
<h2 dir="auto">
<a id="user-content-version-of-libtasn1-used" class="anchor" href="#version-of-libtasn1-used" aria-hidden="true"></a>Version of libtasn1 used:</h2>
<p dir="auto">1.4.13</p>
<h2 dir="auto">
<a id="user-content-distributor-of-libtasn1-eg-ubuntu-fedora-rhel" class="anchor" href="#distributor-of-libtasn1-eg-ubuntu-fedora-rhel" aria-hidden="true"></a>Distributor of libtasn1 (e.g., Ubuntu, Fedora, RHEL)</h2>
<p dir="auto"><a href="https://www.gnu.org/software/libtasn1/" rel="nofollow noreferrer noopener" target="_blank">https://www.gnu.org/software/libtasn1/</a></p>
<h2 dir="auto">
<a id="user-content-how-reproducible-always" class="anchor" href="#how-reproducible-always" aria-hidden="true"></a>How reproducible: Always</h2>
<p dir="auto">Steps to Reproduce:</p>
<ul dir="auto">
<li>one</li>
</ul>
<p dir="auto">ingest the following schema with asn1_parser2tree --> ASN1_SUCCESS:</p>
<pre class="code highlight js-syntax-highlight plaintext" lang="plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">Schema { }</span>
<span id="LC2" class="line" lang="plaintext"></span>
<span id="LC3" class="line" lang="plaintext">DEFINITIONS IMPLICIT TAGS ::=</span>
<span id="LC4" class="line" lang="plaintext"></span>
<span id="LC5" class="line" lang="plaintext">BEGIN</span>
<span id="LC6" class="line" lang="plaintext"></span>
<span id="LC7" class="line" lang="plaintext">Response ::= SEQUENCE {</span>
<span id="LC8" class="line" lang="plaintext">    a OCTET STRING (SIZE (2)),</span>
<span id="LC9" class="line" lang="plaintext">    b BOOLEAN,</span>
<span id="LC10" class="line" lang="plaintext">    c INTEGER,</span>
<span id="LC11" class="line" lang="plaintext">    d INTEGER</span>
<span id="LC12" class="line" lang="plaintext">}</span>
<span id="LC13" class="line" lang="plaintext"></span>
<span id="LC14" class="line" lang="plaintext">END</span></code></pre>
<ul dir="auto">
<li>two
populate the structure with asn1_write_value for each item, then print it with asn1_print_structure:</li>
</ul>
<pre class="code highlight js-syntax-highlight plaintext" lang="plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">name:Schema  type:DEFINITIONS  attr:IMPLICIT,</span>
<span id="LC2" class="line" lang="plaintext">  name:NULL  type:OBJ_ID</span>
<span id="LC3" class="line" lang="plaintext">  name:Response  type:SEQUENCE</span>
<span id="LC4" class="line" lang="plaintext">    name:a  type:OCT_STR  value:0100  attr:SIZE,</span>
<span id="LC5" class="line" lang="plaintext">      name:NULL  type:SIZE  value:2  attr:1_PARAM,</span>
<span id="LC6" class="line" lang="plaintext">    name:b  type:BOOLEAN  value:FALSE</span>
<span id="LC7" class="line" lang="plaintext">    name:c  type:INTEGER  value:0x05</span>
<span id="LC8" class="line" lang="plaintext">    name:d  type:INTEGER  value:0x03</span></code></pre>
<ul dir="auto">
<li>three
try to generate the corresponding DER using asn1_der_coding(..., "Schema", ..., ..., ...) --> error code 6: GENERIC_ERROR</li>
</ul>
<h2 dir="auto">
<a id="user-content-actual-results" class="anchor" href="#actual-results" aria-hidden="true"></a>Actual results:</h2>
<p dir="auto">GENERIC_ERROR</p>
<h2 dir="auto">
<a id="user-content-expected-results" class="anchor" href="#expected-results" aria-hidden="true"></a>Expected results:</h2>
<p dir="auto">DER encoded buffer or a meaningful error.</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/libtasn1/issues/5">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/fe855ec5319a4cf7aab65700fb688936/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/libtasn1/issues/5"}}</script>
</p>
</div>
</body>
</html>