<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[wolfSSL - Embedded SSL Library — Issuer Key Hash not set before OCSP request]]></title>
		<link>https://www.wolfssl.com/forums/topic531-issuer-key-hash-not-set-before-ocsp-request.html</link>
		<atom:link href="https://www.wolfssl.com/forums/feed-rss-topic531.xml" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Issuer Key Hash not set before OCSP request.]]></description>
		<lastBuildDate>Tue, 25 Mar 2014 15:37:59 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Issuer Key Hash not set before OCSP request]]></title>
			<link>https://www.wolfssl.com/forums/post1601.html#p1601</link>
			<description><![CDATA[<p>Hi,</p><p>Thanks for the report.&nbsp; We&#039;ll look into this and get back to you.</p><p>Best Regards,<br />Chris</p>]]></description>
			<author><![CDATA[null@example.com (chrisc)]]></author>
			<pubDate>Tue, 25 Mar 2014 15:37:59 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post1601.html#p1601</guid>
		</item>
		<item>
			<title><![CDATA[Re: Issuer Key Hash not set before OCSP request]]></title>
			<link>https://www.wolfssl.com/forums/post1596.html#p1596</link>
			<description><![CDATA[<p>After a closer look I saw that the same thing which I try to do is done in the code above if <em>verify</em> is set to 1 (which is not the case if I want to do a stand-alone OCSP lookup via <em>CyaSSL_CertManagerCheckOCSP</em>).<br />So I changed the code that the verify-flag is not already validated within<br /></p><div class="codebox"><pre><code>if (verify &amp;&amp; type != CA_TYPE) {</code></pre></div><p>but rather inside the changed if-statement<br /></p><div class="codebox"><pre><code>if (type != CA_TYPE) {
    [...]
    if (ca) {
        [...]
        if (verify) {
            /* try to confirm/verify signature */
            [...]
        }
    }
}</code></pre></div><p>This way, the ca&#039;s public key hash is set for any cert which is not a CA itself, but verification itself is only done if the verify-flag is also set.</p><p>So, does this change to set the ca&#039;s public key hash every time, not only if <em>verify=1</em>, seem ok?</p><p>- Daniel</p>]]></description>
			<author><![CDATA[null@example.com (Zeddi)]]></author>
			<pubDate>Wed, 19 Mar 2014 07:18:11 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post1596.html#p1596</guid>
		</item>
		<item>
			<title><![CDATA[Issuer Key Hash not set before OCSP request]]></title>
			<link>https://www.wolfssl.com/forums/post1595.html#p1595</link>
			<description><![CDATA[<p>I&#039;ve tried verifying a certificate with the following function:<br /></p><div class="codebox"><pre><code>CyaSSL_CertManagerCheckOCSP</code></pre></div><p>I know that the certificate in question is valid and that the OpenSSL OCSP responder running here uses the correct CA certificate and knows the states of the certificates.</p><p>When trying to verify my cert, the responder stated that the certificate status is <em>unknown</em>.<br />After trying some more, I saw that the &quot;Issuer Key Hash&quot;-value in the OCSP request changed. This was due to this field not being set anywhere and thus pointing to some uninitialized value.</p><p>I&#039;ve now patched the function <em>ParseCertRelative </em>inside <em>ctaocrypt/src/asn.c</em> (CyaSSL embedded SSL v2.9.0) to set the &quot;Issuer Key Hash&quot;-field in the certificate which state is to be checked:<br /></p><div class="codebox"><pre><code>    if (verify &amp;&amp; type != CA_TYPE) {
        [...]
    } else if (type != CA_TYPE) {
        Signer* ca = NULL;
#ifndef NO_SKID
        if (cert-&gt;extAuthKeyIdSet)
            ca = GetCA(cm, cert-&gt;extAuthKeyId);
        if (ca == NULL)
            ca = GetCAByName(cm, cert-&gt;issuerHash);
#else /* NO_SKID */
        ca = GetCA(cm, cert-&gt;issuerHash);
#endif /* NO SKID */

        // Store Issuer Key Hash for later OCSP request
        memcpy(cert-&gt;issuerKeyHash, ca-&gt;subjectKeyIdHash, SHA_SIZE);
    }</code></pre></div><p>This way, the OCSP request has the correct &quot;Issuer Key Hash&quot; and the OCSP responder correctly responds &quot;good&quot; as certificate status.</p><p>Is this a bug or am I using the OCSP api wrong?</p><p>- Daniel</p>]]></description>
			<author><![CDATA[null@example.com (Zeddi)]]></author>
			<pubDate>Tue, 18 Mar 2014 14:17:59 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post1595.html#p1595</guid>
		</item>
	</channel>
</rss>
