* print nicely, note that any non-supported versions
* sent by server will have been filtered out by now
*/
- if ((biom = BIO_new(BIO_s_mem())) == NULL
- || BIO_write(biom, rtval, rtlen) <= 0
+ if (rtlen > INT_MAX
+ || (biom = BIO_new(BIO_s_mem())) == NULL
+ || BIO_write(biom, rtval, (int)rtlen) <= 0
|| (es = OSSL_ECHSTORE_new(NULL, NULL)) == NULL
|| OSSL_ECHSTORE_read_echconfiglist(es, biom) != 1) {
BIO_printf(bio, "ECH: Error loading retry-configs\n");
BIO_printf(trc_out, "%s: blen is %lu\n", msg, (unsigned long)blen);
} else {
BIO_printf(trc_out, "%s (%lu)\n", msg, (unsigned long)blen);
- BIO_dump_indent(trc_out, buf, blen, 4);
+ BIO_dump_indent(trc_out, buf, (int)blen, 4);
}
} OSSL_TRACE_END(TLS);
return;
OSSL_HPKE_SUITE *suite)
{
int namematch = 0, nameoverride = 0, suitematch = 0, num, cind = 0;
- unsigned int csuite = 0, tsuite = 0, hnlen = 0;
+ unsigned int csuite = 0, tsuite = 0;
+ size_t hnlen = 0;
OSSL_ECHSTORE_ENTRY *lee = NULL, *tee = NULL;
OSSL_ECHSTORE *es = NULL;
char *hn = NULL;
size_t ossl_ech_calc_padding(SSL_CONNECTION *s, OSSL_ECHSTORE_ENTRY *ee,
size_t encoded_len)
{
- int length_of_padding = 0, length_with_snipadding = 0;
- int innersnipadding = 0, length_with_padding = 0;
+ size_t length_of_padding = 0, length_with_snipadding = 0;
+ size_t innersnipadding = 0, length_with_padding = 0;
size_t mnl = 0, isnilen = 0;
if (s == NULL || ee == NULL)
while (length_with_padding < OSSL_ECH_PADDING_TARGET)
length_with_padding += OSSL_ECH_PADDING_INCREMENT;
OSSL_TRACE_BEGIN(TLS) {
- BIO_printf(trc_out, "EAAE: padding: mnl: %zu, lws: %d "
- "lop: %d, clear_len (len with padding): %d, orig: %zu\n",
+ BIO_printf(trc_out, "EAAE: padding: mnl: %zu, lws: %zu "
+ "lop: %zu, clear_len (len with padding): %zu, orig: %zu\n",
mnl, length_with_snipadding, length_of_padding,
length_with_padding, encoded_len);
} OSSL_TRACE_END(TLS);
- return (size_t)length_with_padding;
+ return length_with_padding;
}
/*
ossl_ech_pbuf("cc: client_random", p, SSL3_RANDOM_SIZE);
# endif
if (EVP_PKEY_CTX_set1_hkdf_key(pctx, p, SSL3_RANDOM_SIZE) != 1
- || EVP_PKEY_CTX_set1_hkdf_salt(pctx, zeros, hashlen) != 1
+ || EVP_PKEY_CTX_set1_hkdf_salt(pctx, zeros, (int)hashlen) != 1
|| EVP_PKEY_derive(pctx, NULL, &retlen) != 1
|| hashlen != retlen
|| EVP_PKEY_derive(pctx, notsecret, &retlen) != 1) {
* say if extension at index |ind| in ext_defs is to be ECH compressed
* return 1 if this one is to be compressed, 0 if not, -1 for error
*/
-int ossl_ech_2bcompressed(int ind)
+int ossl_ech_2bcompressed(size_t ind)
{
- const int nexts = OSSL_NELEM(ext_defs);
+ const size_t nexts = OSSL_NELEM(ext_defs);
# ifdef DUPEMALL
return 0;
if (ossl_ech_2bcompressed(i) == pass)
continue;
/* stash index - needed for COMPRESS ECH handling */
- s->ext.ech.ext_ind = i;
+ s->ext.ech.ext_ind = (int)i;
#endif
/* Skip if not relevant for our context */
if (!should_add_extension(s, thisexd->context, context, max_version))