aboutsummaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2022-09-29 15:33:20 +0200
committerRichard Levitte <levitte@openssl.org>2022-10-05 14:02:03 +0200
commit79c8dcf3985a7b75eac8e53eb8652728af6c5d3d (patch)
tree9bdbc3d39d7165024fbc22971ccc9713e86ca544 /util
parente077455e9e57ed4ee4676996b4a9aa11df6327a6 (diff)
downloadopenssl-79c8dcf3985a7b75eac8e53eb8652728af6c5d3d.tar.gz
Add {lib}_R_{lib}_LIB, for our engines and other "external" modules
Engines lacked the possibility to refer to themselves in this form: WHATEVERerr(WHATEVER_F_SOMETHING, WHATEVER_R_WHATEVER_LIB); This little change makes that possible, and gets used in e_capi. Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Hugo Landau <hlandau@openssl.org> (Merged from https://github.com/openssl/openssl/pull/19301)
Diffstat (limited to 'util')
-rwxr-xr-xutil/mkerr.pl10
1 files changed, 9 insertions, 1 deletions
diff --git a/util/mkerr.pl b/util/mkerr.pl
index 861b613b0d..dd462769fb 100755
--- a/util/mkerr.pl
+++ b/util/mkerr.pl
@@ -1,5 +1,5 @@
#! /usr/bin/env perl
-# Copyright 1999-2021 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 1999-2022 The OpenSSL Project Authors. All Rights Reserved.
#
# Licensed under the Apache License 2.0 (the "License"). You may not use
# this file except in compliance with the License. You can obtain a copy
@@ -450,6 +450,7 @@ EOF
} else {
print OUT <<"EOF";
# define ${lib}err(f, r) ERR_${lib}_error(0, (r), OPENSSL_FILE, OPENSSL_LINE)
+# define ERR_R_${lib}_LIB ERR_${lib}_lib()
EOF
if ( ! $static ) {
@@ -629,6 +630,13 @@ ${st}void ERR_${lib}_error(int function, int reason, const char *file, int line)
ERR_raise(lib_code, reason);
ERR_set_debug(file, line, NULL);
}
+
+${st}int ERR_${lib}_lib(void)
+{
+ if (lib_code == 0)
+ lib_code = ERR_get_next_error_library();
+ return lib_code;
+}
EOF
}