From a79c076a712fe7914cbeb23afa39e4f260cea634 Mon Sep 17 00:00:00 2001 From: tb Date: Sat, 17 Dec 2022 21:59:39 +0000 Subject: [PATCH] Prepare to provide UI_null() xmlsec needs this, nothing else. Our linkers link libxmlsec1-openssl, only warns and since nothing uses this library in ports, this wasn't noticed for a long time. Reported by Thomas Mitterfellner ok jsing --- lib/libcrypto/hidden/openssl/ui.h | 3 ++- lib/libcrypto/ui/ui.h | 5 ++++- lib/libcrypto/ui/ui_null.c | 18 ++++++++++++++++++ 3 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 lib/libcrypto/ui/ui_null.c diff --git a/lib/libcrypto/hidden/openssl/ui.h b/lib/libcrypto/hidden/openssl/ui.h index 7ad9ca0285c..812714aa98c 100644 --- a/lib/libcrypto/hidden/openssl/ui.h +++ b/lib/libcrypto/hidden/openssl/ui.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ui.h,v 1.1 2022/11/12 13:16:10 beck Exp $ */ +/* $OpenBSD: ui.h,v 1.2 2022/12/17 21:59:39 tb Exp $ */ /* * Copyright (c) 2022 Bob Beck * @@ -48,6 +48,7 @@ LCRYPTO_USED(UI_get_default_method); LCRYPTO_USED(UI_get_method); LCRYPTO_USED(UI_set_method); LCRYPTO_USED(UI_OpenSSL); +LCRYPTO_USED(UI_null); LCRYPTO_USED(UI_create_method); LCRYPTO_USED(UI_destroy_method); LCRYPTO_USED(UI_method_set_opener); diff --git a/lib/libcrypto/ui/ui.h b/lib/libcrypto/ui/ui.h index 7755cf4a3af..ee27fd2a493 100644 --- a/lib/libcrypto/ui/ui.h +++ b/lib/libcrypto/ui/ui.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ui.h,v 1.14 2022/07/12 18:43:56 jsing Exp $ */ +/* $OpenBSD: ui.h,v 1.15 2022/12/17 21:59:39 tb Exp $ */ /* Written by Richard Levitte (richard@levitte.org) for the OpenSSL * project 2001. */ @@ -257,6 +257,9 @@ const UI_METHOD *UI_set_method(UI *ui, const UI_METHOD *meth); /* The method with all the built-in thingies */ UI_METHOD *UI_OpenSSL(void); +#if defined(LIBRESSL_INTERNAL) || defined(LIBRESSL_NEXT_API) +const UI_METHOD *UI_null(void); +#endif /* * ---------- For method writers ---------- diff --git a/lib/libcrypto/ui/ui_null.c b/lib/libcrypto/ui/ui_null.c new file mode 100644 index 00000000000..7bb7a90b2fb --- /dev/null +++ b/lib/libcrypto/ui/ui_null.c @@ -0,0 +1,18 @@ +/* $OpenBSD: ui_null.c,v 1.1 2022/12/17 21:59:39 tb Exp $ */ + +/* + * Written by Theo Buehler. Public domain. + */ + +#include "ui_local.h" + +static const UI_METHOD ui_null = { + .name = "OpenSSL NULL UI", +}; + +const UI_METHOD * +UI_null(void) +{ + return &ui_null; +} +LCRYPTO_ALIAS(UI_null) -- 2.20.1