<?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 — AF_ALG breaks certificate verification on ARM32 (-155 error)]]></title>
		<link>https://www.wolfssl.com/forums/topic2478-afalg-breaks-certificate-verification-on-arm32-155-error.html</link>
		<atom:link href="https://www.wolfssl.com/forums/feed-rss-topic2478.xml" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in AF_ALG breaks certificate verification on ARM32 (-155 error).]]></description>
		<lastBuildDate>Fri, 29 May 2026 01:30:51 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: AF_ALG breaks certificate verification on ARM32 (-155 error)]]></title>
			<link>https://www.wolfssl.com/forums/post8818.html#p8818</link>
			<description><![CDATA[<p><strong> 3. The AES-GCM data path itself works</strong></p><p>With peer verification disabled (`-d`), the same client completes a full TLS<br />session over AF_ALG and gets application data back:</p><div class="codebox"><pre><code>$ ./examples/client/client -h www.google.com -g -d -p 443
SSL cipher suite is TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
SSL connect ok, sending GET...
HTTP/1.0 200 OK</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (adolphson)]]></author>
			<pubDate>Fri, 29 May 2026 01:30:51 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post8818.html#p8818</guid>
		</item>
		<item>
			<title><![CDATA[Re: AF_ALG breaks certificate verification on ARM32 (-155 error)]]></title>
			<link>https://www.wolfssl.com/forums/post8817.html#p8817</link>
			<description><![CDATA[<p><strong>2. Bundled wolfSSL client (ruling out curl)</strong></p><p>I built the examples (`--enable-examples`) and ran your command directly, no curl involved:</p><div class="codebox"><pre><code>$ ./examples/client/client -h www.google.com -g -A ./certs/external/ca-google-root.pem -p 443
CRL callback url = http://crl.pki.goog/gsr1/gsr1.crl
wolfSSL_connect error -362, CRL missing, not loaded</code></pre></div><p>Adding `-C` to disable curl gives the same -155 as curl:</p><div class="codebox"><pre><code>$ ./examples/client/client -h www.google.com -g -A ./certs/external/ca-google-root.pem -C -p 443
wolfSSL_connect error -155, ASN sig error, confirm failure</code></pre></div><p>Same result whether `-A` is the single Google root or my full system CA bundle.<br />So the bundled client reproduces -155 — curl is not involved.</p>]]></description>
			<author><![CDATA[null@example.com (adolphson)]]></author>
			<pubDate>Fri, 29 May 2026 01:29:30 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post8817.html#p8817</guid>
		</item>
		<item>
			<title><![CDATA[Re: AF_ALG breaks certificate verification on ARM32 (-155 error)]]></title>
			<link>https://www.wolfssl.com/forums/post8816.html#p8816</link>
			<description><![CDATA[<p>Thanks Jacob. I ran both of your suggestions. Short version: the -155 is **not** the atmel-sha driver and **not** curl — it reproduces with the bundled `examples/client/client`, and it persists with the Atmel crypto disabled at the kernel level. Details below.</p><p><strong>1. Disabling atmel-sha (and atmel-aes) at the kernel level</strong></p><p>The atmel-sha crypto driver is built in, so there&#039;s no module to `rmmod`, but we can unbound it via sysfs. </p><br /><div class="codebox"><pre><code># sha256 providers by priority -- atmel-sha256 (hardware) wins at 300
$ grep -A4 &#039;^name *: sha256$&#039; /proc/crypto | grep -E &#039;driver|priority&#039;
driver       : atmel-sha256
priority     : 300
driver       : sha256-neon
priority     : 250
driver       : sha256-asm
priority     : 150
driver       : sha256-generic
priority     : 100


# Unbind atmel-sha -&gt; sha256-neon (software) becomes the active provider
$ echo f0028000.crypto &gt; /sys/bus/platform/drivers/atmel_sha/unbind
$ grep -A4 &#039;^name *: sha256$&#039; /proc/crypto | grep -E &#039;driver|priority&#039; | head -2
driver       : sha256-neon
priority     : 250


$ curl -v https://www.google.com
* SSL_connect failed with error -155: ASN sig error, confirm failure
curl: (35) SSL_connect failed with error -155: ASN sig error, confirm failure</code></pre></div><br /><p>The -155 persists with software SHA256. I then also unbound the AES engine:</p><div class="codebox"><pre><code>$ echo f002c000.crypto &gt; /sys/bus/platform/drivers/atmel_aes/unbind
$ curl -v https://www.google.com
curl: (35) SSL_connect failed with error -155: ASN sig error, confirm failure</code></pre></div><p>Still -155 with both SHA and AES in software. So the failure is independent of the Atmel hardware drivers.</p>]]></description>
			<author><![CDATA[null@example.com (adolphson)]]></author>
			<pubDate>Fri, 29 May 2026 01:26:41 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post8816.html#p8816</guid>
		</item>
		<item>
			<title><![CDATA[Re: AF_ALG breaks certificate verification on ARM32 (-155 error)]]></title>
			<link>https://www.wolfssl.com/forums/post8814.html#p8814</link>
			<description><![CDATA[<p>Thanks adolphson,</p><p>The testwolfcrypt shows SHA256 operations as passing. Is there something like `rmod atmel-sha` available to temporarily disable the atmel-sha crypto driver and fall back to software at the kernel level? This would help narrow it down to an issue in wolfSSL af_alg calls potentially with buffer alignment or a driver issue.</p><p>Also could you try the bundled wolfssl client example to rule out possible complications arising from cURL + wolfSSL?</p><div class="codebox"><pre><code>./examples/client/client -h www.google.com -g -A ./certs/external/ca-google-root.pem  -p 443</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Jacob)]]></author>
			<pubDate>Wed, 27 May 2026 06:32:47 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post8814.html#p8814</guid>
		</item>
		<item>
			<title><![CDATA[Re: AF_ALG breaks certificate verification on ARM32 (-155 error)]]></title>
			<link>https://www.wolfssl.com/forums/post8733.html#p8733</link>
			<description><![CDATA[<p>Hi Jacob,</p><p>Results of testwolfcrypt below:</p><div class="codebox"><pre><code>$ testwolfcrypt 
Math:     Multi-Precision: Wolf(SP) word-size=32 bits=3072 sp_int.c
------------------------------------------------------------------------------
 wolfSSL version 5.8.4
------------------------------------------------------------------------------
macro    test passed!
error    test passed!
MEMORY   test passed!
base64   test passed!
base16   test passed!
asn      test passed!
MD4      test passed!
SHA      test passed!
SHA-256  test passed!
SHA-384  test passed!
SHA-512  test passed!
SHA-512/224  test passed!
SHA-512/256  test passed!
RANDOM   test passed!
Hash     test passed!
HMAC-SHA test passed!
HMAC-SHA256 test passed!
HMAC-SHA384 test passed!
HMAC-SHA512 test passed!
HMAC-KDF    test passed!
SSH-KDF     test passed!
PRF         test passed!
TLSv1.2 KDF test passed!
TLSv1.3 KDF test passed!
GMAC     test failed!
 error L=17481
 [fiducial line numbers: 10443 30112 49891 62840]
Exiting main with return code: -1</code></pre></div><br /><p>In regards to WOLFSSL_AFALG_HASH, I modified the buildroot makefile to try and undefine it via CFLAGS</p><div class="codebox"><pre><code>WOLFSSL_CONF_ENV += CFLAGS=&quot;$(TARGET_CFLAGS) -UWOLFSSL_AFALG_HASH&quot;</code></pre></div><p>Thanks for you help.</p>]]></description>
			<author><![CDATA[null@example.com (adolphson)]]></author>
			<pubDate>Fri, 20 Feb 2026 00:35:01 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post8733.html#p8733</guid>
		</item>
		<item>
			<title><![CDATA[Re: AF_ALG breaks certificate verification on ARM32 (-155 error)]]></title>
			<link>https://www.wolfssl.com/forums/post8732.html#p8732</link>
			<description><![CDATA[<p>Hi adolphson,</p><p>Could you run ./wolfcrypt/test/testwolfcrypt to confirm if SHA256 hash operations are successful?</p><p>How did you test without WOLFSSL_AFALG_HASH, if building with ./configure was configure.ac altered and then ./configure regenerated?</p><p>wolfSSL,<br />Jacob</p>]]></description>
			<author><![CDATA[null@example.com (Jacob)]]></author>
			<pubDate>Thu, 19 Feb 2026 22:19:45 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post8732.html#p8732</guid>
		</item>
		<item>
			<title><![CDATA[AF_ALG breaks certificate verification on ARM32 (-155 error)]]></title>
			<link>https://www.wolfssl.com/forums/post8731.html#p8731</link>
			<description><![CDATA[<p>Hi,</p><p>I&#039;m trying to use wolfSSL with AF_ALG on an ARM32 platform (Microchip SAMA5D2, Cortex-A5) to get hardware-accelerated AES-GCM for TLS. The goal is to offload bulk encryption to hardware while keeping certificate verification in software.</p><p>When I enable `--enable-afalg`, all certificate verification fails with error -155 (`ASN_SIG_CONFIRM_E`)</p><p><strong>What we have:</strong><br />- wolfSSL 5.8.4 (also tested 5.7.2)<br />- libcurl 8.18.0<br />- Linux with musl libc (Buildroot)<br />- hardware: Atmel AES via AF_ALG (`atmel-gcm-aes` driver)</p><p><strong>Platform details:</strong><br />- Microchip SAMA5D2 (ARM Cortex-A5)<br />- Linux 6.x, musl libc, Buildroot</p><p><strong>Configure (minimal reproduction):</strong></p><div class="codebox"><pre><code>./configure --enable-curl --enable-afalg</code></pre></div><br /><p><strong>What happens</strong><br /></p><div class="codebox"><pre><code>$ curl https://www.google.com
SSL_connect failed with error -155: ASN sig error, confirm failure</code></pre></div><p>This affects every HTTPS site</p><p>Hardware AES is working if we skip the certificate verification </p><div class="codebox"><pre><code>$ grep -i aes /proc/interrupts
157:          3  atmel-aic5   9 Level     atmel-aes

$ curl -k https://www.google.com   # skip verification
(succeeds, returns HTTP 200)

$ grep -i aes /proc/interrupts
157:         57  atmel-aic5   9 Level     atmel-aes</code></pre></div><br /><p>The AES interrupt count jumped from 3 to 57 during that connection. So AF_ALG AES-GCM is working for data encryption. It&#039;s only the certificate verification that breaks.</p><p><strong>What I&#039;ve tried (all fail with -155)</strong>:<br />- Minimal config: just `--enable-curl --enable-afalg`<br />- wolfSSL 5.7.2 and 5.8.4<br />- SP math (default on ARM) vs TFM (`--enable-fastmath`)<br />- With and without `WOLFSSL_AFALG_HASH`<br />- libcurl 8.15.0 and 8.18.0</p><p><strong>What works:</strong><br />- `--enable-all` without `--enable-afalg` - certificates verify fine<br />- `--enable-curl` without `--enable-afalg` - certificates verify fine<br />- Basically anything WITHOUT `--enable-afalg`</p><p><strong>Questions:</strong><br />1. Has anyone successfully used `--enable-afalg` on ARM32 with certificate verification?<br />2. Is there a known issue with AF_ALG + curl on ARM?<br />3. Any suggestions for debugging this further?</p><p>I am keen to get hardware AES working since as we are pushing the boundaries of the CPU for our application.</p><p>Thanks for any help.</p>]]></description>
			<author><![CDATA[null@example.com (adolphson)]]></author>
			<pubDate>Thu, 19 Feb 2026 00:55:09 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post8731.html#p8731</guid>
		</item>
	</channel>
</rss>
