From 07cb660d0a2f8acefd3816d5394e4d833ca399af Mon Sep 17 00:00:00 2001 From: tb Date: Sat, 22 Apr 2023 20:50:26 +0000 Subject: [PATCH] Fix UTF-8 issuer printing If no field separator is specified, default to using the comma plus space separation, unless the compat flag is set. Fixes an a bug with printing issuers and other things that contain UTF-8 Reported by Jean-Luc Duprat The very simple fix ix is a joint effort by Henson and Levitte Fixes libressl/portable issue #845 ok jsing --- usr.bin/openssl/apps.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/usr.bin/openssl/apps.c b/usr.bin/openssl/apps.c index 592a68980a2..f5f1248c078 100644 --- a/usr.bin/openssl/apps.c +++ b/usr.bin/openssl/apps.c @@ -1,4 +1,4 @@ -/* $OpenBSD: apps.c,v 1.63 2023/04/14 15:27:13 tb Exp $ */ +/* $OpenBSD: apps.c,v 1.64 2023/04/22 20:50:26 tb Exp $ */ /* * Copyright (c) 2014 Joel Sing * @@ -933,7 +933,11 @@ set_name_ex(unsigned long *flags, const char *arg) {"ca_default", XN_FLAG_MULTILINE, 0xffffffffL}, {NULL, 0, 0} }; - return set_multi_opts(flags, arg, ex_tbl); + if (!set_multi_opts(flags, arg, ex_tbl)) + return 0; + if (*flags != XN_FLAG_COMPAT && (*flags & XN_FLAG_SEP_MASK) == 0) + *flags |= XN_FLAG_SEP_CPLUS_SPC; + return 1; } int -- 2.20.1