Commit 11ac030faa for openssl.org

commit 11ac030faa0a6559ed63f09311db852ac6d11500
Author: Timo Keller <tkeller@linux.ibm.com>
Date:   Wed Aug 19 09:32:27 2026 +0200

    Fix compilation errors with Clang on s390x

    Signed-off-by: Timo Keller <tkeller@linux.ibm.com>
    Reviewed-by: Mounir Idrassi <mounir.idrassi@idrix.fr>
    Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
    Merge-date: Tue Sep 29 16:47:10 2026
    Merged-from: https://github.com/openssl/openssl/pull/31929

diff --git a/providers/implementations/ciphers/cipher_aes_hw_s390x.c b/providers/implementations/ciphers/cipher_aes_hw_s390x.c
index e9e81f4746..a0a83e62ad 100644
--- a/providers/implementations/ciphers/cipher_aes_hw_s390x.c
+++ b/providers/implementations/ciphers/cipher_aes_hw_s390x.c
@@ -852,9 +852,14 @@ static int cipher_hw_aes_xts_s390x_initkey(PROV_CIPHER_CTX *ctx,
 {
     PROV_AES_XTS_CTX *xctx = (PROV_AES_XTS_CTX *)ctx;
     S390X_KM_XTS_PARAMS *km = &xctx->plat.s390x.param.km;
-    unsigned int fc, offs;
+    unsigned int fc, offs = 0;
     unsigned int dec = 0;
-    int supported = 0;
+    /*
+     * S390X_CAPBIT(82) and S390X_CAPBIT(84) expand to (1ULL << 45) and
+     * (1ULL << 43) respectively — bits above bit 31.  A plain |int| would
+     * be truncated to zero by GCC.  Use uint64_t to preserve all 64 bits.
+     */
+    uint64_t supported = 0;

     if (key != NULL) {
         switch (keylen) {
@@ -876,7 +881,7 @@ static int cipher_hw_aes_xts_s390x_initkey(PROV_CIPHER_CTX *ctx,
     }

     if (fc != 0)
-        supported = (OPENSSL_s390xcap_P.km[1] && S390X_CAPBIT(fc));
+        supported = (OPENSSL_s390xcap_P.km[1] & S390X_CAPBIT(fc));
     if (!supported) {
         xctx->plat.s390x.fc = 0;
         xctx->plat.s390x.offset = 0;
@@ -930,11 +935,11 @@ const PROV_CIPHER_HW *ossl_prov_cipher_hw_aes_xts_s390x(size_t keybits)
 {
     switch (keybits) {
     case (128 * 2):
-        if (OPENSSL_s390xcap_P.km[1] && S390X_CAPBIT(S390X_XTS_AES_128_MSA10))
+        if (OPENSSL_s390xcap_P.km[1] & S390X_CAPBIT(S390X_XTS_AES_128_MSA10))
             return &aes_xts_s390x;
         break;
     case (256 * 2):
-        if (OPENSSL_s390xcap_P.km[1] && S390X_CAPBIT(S390X_XTS_AES_256_MSA10))
+        if (OPENSSL_s390xcap_P.km[1] & S390X_CAPBIT(S390X_XTS_AES_256_MSA10))
             return &aes_xts_s390x;
         break;
     default: