Topic: AF_ALG breaks certificate verification on ARM32 (-155 error)
Hi,
I'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.
When I enable `--enable-afalg`, all certificate verification fails with error -155 (`ASN_SIG_CONFIRM_E`)
What we have:
- wolfSSL 5.8.4 (also tested 5.7.2)
- libcurl 8.18.0
- Linux with musl libc (Buildroot)
- hardware: Atmel AES via AF_ALG (`atmel-gcm-aes` driver)
Platform details:
- Microchip SAMA5D2 (ARM Cortex-A5)
- Linux 6.x, musl libc, Buildroot
Configure (minimal reproduction):
./configure --enable-curl --enable-afalgWhat happens
$ curl https://www.google.com
SSL_connect failed with error -155: ASN sig error, confirm failureThis affects every HTTPS site
Hardware AES is working if we skip the certificate verification
$ 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-aesThe AES interrupt count jumped from 3 to 57 during that connection. So AF_ALG AES-GCM is working for data encryption. It's only the certificate verification that breaks.
What I've tried (all fail with -155):
- Minimal config: just `--enable-curl --enable-afalg`
- wolfSSL 5.7.2 and 5.8.4
- SP math (default on ARM) vs TFM (`--enable-fastmath`)
- With and without `WOLFSSL_AFALG_HASH`
- libcurl 8.15.0 and 8.18.0
What works:
- `--enable-all` without `--enable-afalg` - certificates verify fine
- `--enable-curl` without `--enable-afalg` - certificates verify fine
- Basically anything WITHOUT `--enable-afalg`
Questions:
1. Has anyone successfully used `--enable-afalg` on ARM32 with certificate verification?
2. Is there a known issue with AF_ALG + curl on ARM?
3. Any suggestions for debugging this further?
I am keen to get hardware AES working since as we are pushing the boundaries of the CPU for our application.
Thanks for any help.