Skip to content

Commit fc49a4f

Browse files
committed
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. Signed-off-by: Simo Sorce <simo@redhat.com>
1 parent c7a5c8b commit fc49a4f

File tree

2 files changed

+26
-4
lines changed

2 files changed

+26
-4
lines changed

serv.out

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
Using default temp DH parameters
2+
ACCEPT
3+
ERROR
4+
40A7FDD0F97F0000:error:0680007B:asn1 encoding routines:ASN1_get_object:header too long:crypto/asn1/asn1_lib.c:105:
5+
40A7FDD0F97F0000:error:06800066:asn1 encoding routines:asn1_check_tlen:bad object header:crypto/asn1/tasn_dec.c:1176:
6+
40A7FDD0F97F0000:error:0688010A:asn1 encoding routines:asn1_d2i_ex_primitive:nested asn1 error:crypto/asn1/tasn_dec.c:752:
7+
40A7FDD0F97F0000:error:0A0C0103:SSL routines:ssl_handshake_hash:internal error:ssl/ssl_lib.c:5834:
8+
shutting down SSL
9+
CONNECTION CLOSED
10+
0 items in the session cache
11+
0 client connects (SSL_connect())
12+
0 client renegotiates (SSL_connect())
13+
0 client connects that finished
14+
1 server accepts (SSL_accept())
15+
0 server renegotiates (SSL_accept())
16+
0 server accepts that finished
17+
0 session cache hits
18+
0 session cache misses
19+
0 session cache timeouts
20+
0 callback cache hits
21+
0 cache full overflows (128 allowed)

src/cipher.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -867,7 +867,7 @@ static CK_RV tls_aead_get_data(CK_MECHANISM_PTR mech, data_buffer *explicitiv,
867867

868868
static CK_RV tls_pre_aead(struct p11prov_cipher_ctx *cctx,
869869
const unsigned char **in, size_t *inl,
870-
unsigned char **out, size_t *outl)
870+
unsigned char **out, CK_ULONG *outl)
871871
{
872872
data_buffer iv = { 0 };
873873
data_buffer tag = { 0 };
@@ -906,7 +906,7 @@ static CK_RV tls_pre_aead(struct p11prov_cipher_ctx *cctx,
906906
}
907907

908908
static CK_RV tls_post_aead(struct p11prov_cipher_ctx *cctx, unsigned char *out,
909-
size_t *outl)
909+
CK_ULONG *outl)
910910
{
911911
data_buffer explicitiv = { 0 };
912912
data_buffer tag = { 0 };
@@ -1475,15 +1475,16 @@ static int p11prov_common_set_ctx_params(void *vctx, const OSSL_PARAM params[])
14751475
return RET_OSSL_ERR;
14761476
}
14771477

1478+
size_t iv_size;
14781479
int ret = OSSL_PARAM_get_octet_string(
1479-
p, (void **)&gcm->pIv, gcm->ulIvLen, &gcm->ulIvFixedBits);
1480+
p, (void **)&gcm->pIv, gcm->ulIvLen, &iv_size);
14801481
if (ret != RET_OSSL_OK || gcm->pIv == NULL) {
14811482
P11PROV_raise(ctx->provctx, CKR_HOST_MEMORY,
14821483
"Memory allocation failed");
14831484
return RET_OSSL_ERR;
14841485
}
14851486

1486-
gcm->ulIvFixedBits = BYTES_TO_BITS(gcm->ulIvFixedBits);
1487+
gcm->ulIvFixedBits = BYTES_TO_BITS(iv_size);
14871488
gcm->ivGenerator = CKG_GENERATE_COUNTER;
14881489
} else {
14891490
P11PROV_raise(ctx->provctx, CKR_MECHANISM_PARAM_INVALID,

0 commit comments

Comments
 (0)