From: Tomas Mraz Date: Wed, 18 Feb 2026 14:09:11 +0000 (+0100) Subject: ECH: Use BIO_puts when appropriate X-Git-Tag: openssl-4.0.0-alpha1~233 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=dba0ecd3bf1348bb875637fe9a97144b89fcda2c;p=thirdparty%2Fopenssl.git ECH: Use BIO_puts when appropriate And also a few additional code cleanups. Reviewed-by: Nikola Pajkovsky Reviewed-by: Paul Dale Reviewed-by: Matt Caswell MergeDate: Fri Feb 20 10:11:20 2026 (Merged from https://github.com/openssl/openssl/pull/30066) --- diff --git a/apps/s_client.c b/apps/s_client.c index 1de9cde34dc..ab7718df70a 100644 --- a/apps/s_client.c +++ b/apps/s_client.c @@ -3602,7 +3602,7 @@ static void print_ech_retry_configs(BIO *bio, SSL *s) BIO *biom = NULL; if (SSL_ech_get1_retry_config(s, &rtval, &rtlen) != 1) { - BIO_printf(bio, "ECH: Error getting retry-configs\n"); + BIO_puts(bio, "ECH: Error getting retry-configs\n"); return; } /* @@ -3614,7 +3614,7 @@ static void print_ech_retry_configs(BIO *bio, SSL *s) || 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_puts(bio, "ECH: Error loading retry-configs\n"); goto end; } if (OSSL_ECHSTORE_num_entries(es, &cnt) != 1) diff --git a/apps/s_server.c b/apps/s_server.c index 0b6988b873c..ea6993a32b5 100644 --- a/apps/s_server.c +++ b/apps/s_server.c @@ -1594,7 +1594,7 @@ static int ech_load_dir(SSL_CTX *lctx, const char *thedir, && (es = OSSL_ECHSTORE_new(app_get0_libctx(), app_get0_propq())) == NULL) { - BIO_printf(bio_err, "internal error\n"); + BIO_puts(bio_err, "ECH: Internal error\n"); return 0; } while ((thisfile = OPENSSL_DIR_read(&d, thedir))) { @@ -1623,7 +1623,7 @@ static int ech_load_dir(SSL_CTX *lctx, const char *thedir, loaded++; } if (SSL_CTX_set1_echstore(lctx, es) != 1) { - BIO_printf(bio_err, "internal error\n"); + BIO_puts(bio_err, "ECH: Internal error\n"); return 0; } if (bio_s_out != NULL) @@ -2722,7 +2722,7 @@ int s_server_main(int argc, char *argv[]) if ((in = BIO_new_file(echkeyfile, "r")) == NULL || (es = OSSL_ECHSTORE_new(app_get0_libctx(), app_get0_propq())) - == 0 + == NULL || OSSL_ECHSTORE_read_pem(es, in, OSSL_ECH_FOR_RETRY) != 1 || SSL_CTX_set1_echstore(ctx, es) != 1) { BIO_printf(bio_err, "Failed reading: %s\n", echkeyfile);