<!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>
<p dir="auto">4.5 can be fixed with the following patch. According to CMS spec BER is allowed there:</p>
<pre class="code highlight js-syntax-highlight diff" lang="diff" v-pre="true"><code><span id="LC1" class="line" lang="diff"><span class="gh">diff --git a/lib/x509/pkcs7.c b/lib/x509/pkcs7.c</span></span>
<span id="LC2" class="line" lang="diff"><span class="gh">index 955cb5ae9cce..e6e40ead26fb 100644</span></span>
<span id="LC3" class="line" lang="diff"><span class="gd">--- a/lib/x509/pkcs7.c</span></span>
<span id="LC4" class="line" lang="diff"><span class="gi">+++ b/lib/x509/pkcs7.c</span></span>
<span id="LC5" class="line" lang="diff"><span class="gu">@@ -111,7 +111,7 @@ static int _decode_pkcs7_signed_data(gnutls_pkcs7_t pkcs7)</span></span>
<span id="LC6" class="line" lang="diff"> </span>
<span id="LC7" class="line" lang="diff">        /* Try reading as octet string according to rfc5652. If that fails, attempt</span>
<span id="LC8" class="line" lang="diff">         * a raw read according to rfc2315 */</span>
<span id="LC9" class="line" lang="diff"><span class="gd">-       result = _gnutls_x509_read_string(c2, "encapContentInfo.eContent", &pkcs7->der_signed_data, ASN1_ETYPE_OCTET_STRING, 0);</span></span>
<span id="LC10" class="line" lang="diff"><span class="gi">+       result = _gnutls_x509_read_string(c2, "encapContentInfo.eContent", &pkcs7->der_signed_data, ASN1_ETYPE_OCTET_STRING, 1);</span></span>
<span id="LC11" class="line" lang="diff">        if (result < 0) {</span>
<span id="LC12" class="line" lang="diff">                result = _gnutls_x509_read_value(c2, "encapContentInfo.eContent", &pkcs7->der_signed_data);</span>
<span id="LC13" class="line" lang="diff">                if (result < 0) {</span></code></pre>
</div>


</div>
<div class="footer" style="margin-top: 10px;">
<p style="font-size: small; color: #777777;">

<br>
Reply to this email directly or <a href="https://gitlab.com/gnutls/gnutls/issues/612#note_116342741">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/d30df4a2d37600d7a651cbb9d288c07f/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/612#note_116342741"}}</script>
</p>
</div>
</body>
</html>