diff --git a/meta-oe/recipes-support/pkcs11-provider/files/0001-Fix-i686-build-failures-in-cipher.c.patch b/meta-oe/recipes-support/pkcs11-provider/files/0001-Fix-i686-build-failures-in-cipher.c.patch
new file mode 100644
index 0000000000..479608b8f3
--- /dev/null
+++ b/meta-oe/recipes-support/pkcs11-provider/files/0001-Fix-i686-build-failures-in-cipher.c.patch
@@ -0,0 +1,62 @@
+From aec4fe7e3c4d18cd5d0f98168df5884a141c6b69 Mon Sep 17 00:00:00 2001
+From: Simo Sorce <simo@redhat.com>
+Date: Thu, 19 Feb 2026 16:08:56 -0500
+Subject: [PATCH] Fix i686 build failures in cipher.c
+
+Update AEAD functions to use CK_ULONG pointers for lengths and
+introduce a temporary size_t variable for OSSL_PARAM calls. This
+corrects pointer type mismatches that caused build failures in
+Fedora Rawhide i686 scratch builds.
+
+Upstream-Status: Backport [aec4fe7e3c4d18cd5d0f98168df5884a141c6b69]
+
+Signed-off-by: Simo Sorce <simo@redhat.com>
+---
+ src/cipher.c | 11 ++++++-----
+ 1 file changed, 6 insertions(+), 5 deletions(-)
+
+diff --git a/src/cipher.c b/src/cipher.c
+index faaa51b..4ccd3ad 100644
+--- a/src/cipher.c
++++ b/src/cipher.c
+@@ -867,7 +867,7 @@ static CK_RV tls_aead_get_data(CK_MECHANISM_PTR mech, data_buffer *explicitiv,
+ 
+ static CK_RV tls_pre_aead(struct p11prov_cipher_ctx *cctx,
+                           const unsigned char **in, size_t *inl,
+-                          unsigned char **out, size_t *outl)
++                          unsigned char **out, CK_ULONG *outl)
+ {
+     data_buffer iv = { 0 };
+     data_buffer tag = { 0 };
+@@ -906,7 +906,7 @@ static CK_RV tls_pre_aead(struct p11prov_cipher_ctx *cctx,
+ }
+ 
+ static CK_RV tls_post_aead(struct p11prov_cipher_ctx *cctx, unsigned char *out,
+-                           size_t *outl)
++                           CK_ULONG *outl)
+ {
+     data_buffer explicitiv = { 0 };
+     data_buffer tag = { 0 };
+@@ -1475,15 +1475,16 @@ static int p11prov_common_set_ctx_params(void *vctx, const OSSL_PARAM params[])
+                 return RET_OSSL_ERR;
+             }
+ 
+-            int ret = OSSL_PARAM_get_octet_string(
+-                p, (void **)&gcm->pIv, gcm->ulIvLen, &gcm->ulIvFixedBits);
++            size_t iv_size;
++            int ret = OSSL_PARAM_get_octet_string(p, (void **)&gcm->pIv,
++                                                  gcm->ulIvLen, &iv_size);
+             if (ret != RET_OSSL_OK || gcm->pIv == NULL) {
+                 P11PROV_raise(ctx->provctx, CKR_HOST_MEMORY,
+                               "Memory allocation failed");
+                 return RET_OSSL_ERR;
+             }
+ 
+-            gcm->ulIvFixedBits = BYTES_TO_BITS(gcm->ulIvFixedBits);
++            gcm->ulIvFixedBits = BYTES_TO_BITS(iv_size);
+             gcm->ivGenerator = CKG_GENERATE_COUNTER;
+         } else {
+             P11PROV_raise(ctx->provctx, CKR_MECHANISM_PARAM_INVALID,
+-- 
+2.47.3
+
diff --git a/meta-oe/recipes-support/pkcs11-provider/pkcs11-provider_1.2.bb b/meta-oe/recipes-support/pkcs11-provider/pkcs11-provider_1.2.bb
index 1bdb4445e5..d95706d9e3 100644
--- a/meta-oe/recipes-support/pkcs11-provider/pkcs11-provider_1.2.bb
+++ b/meta-oe/recipes-support/pkcs11-provider/pkcs11-provider_1.2.bb
@@ -19,6 +19,7 @@ SRCREV = "c7a5c8b62a0ff012b16574f01651254ef7e664ee"
 
 SRC_URI = "git://github.com/latchset/${BPN}.git;branch=main;protocol=https"
 
+SRC_URI += "file://0001-Fix-i686-build-failures-in-cipher.c.patch"
 
 inherit meson pkgconfig
 
