mirror of
https://github.com/QuasarApp/openssl.git
synced 2025-04-30 19:54:39 +00:00
Remove EXPORT_VAR_AS_FUNC
We only export functions, not global, so remove the config option and some of the #ifdef stuff. Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/9285)
This commit is contained in:
parent
66e2dbc01c
commit
211da00b79
2
CHANGES
2
CHANGES
@ -14,6 +14,8 @@
|
|||||||
|
|
||||||
*) Removed DES_check_key. Also removed OPENSSL_IMPLEMENT_GLOBAL,
|
*) Removed DES_check_key. Also removed OPENSSL_IMPLEMENT_GLOBAL,
|
||||||
OPENSSL_GLOBAL_REF, OPENSSL_DECLARE_GLOBAL.
|
OPENSSL_GLOBAL_REF, OPENSSL_DECLARE_GLOBAL.
|
||||||
|
Also removed "export var as function" capability; we do not export
|
||||||
|
variables, only functions.
|
||||||
[Rich Salz]
|
[Rich Salz]
|
||||||
|
|
||||||
*) RC5_32_set_key has been changed to return an int type, with 0 indicating
|
*) RC5_32_set_key has been changed to return an int type, with 0 indicating
|
||||||
|
@ -1274,7 +1274,6 @@ my %targets = (
|
|||||||
shared_target => "win-shared", # meaningless except it gives Configure a hint
|
shared_target => "win-shared", # meaningless except it gives Configure a hint
|
||||||
thread_scheme => "winthreads",
|
thread_scheme => "winthreads",
|
||||||
dso_scheme => "win32",
|
dso_scheme => "win32",
|
||||||
bn_ops => "EXPORT_VAR_AS_FN",
|
|
||||||
perl_platform => 'Windows::MSVC',
|
perl_platform => 'Windows::MSVC',
|
||||||
# additional parameter to build_scheme denotes install-path "flavour"
|
# additional parameter to build_scheme denotes install-path "flavour"
|
||||||
build_scheme => add("VC-common", { separator => undef }),
|
build_scheme => add("VC-common", { separator => undef }),
|
||||||
@ -1426,7 +1425,6 @@ my %targets = (
|
|||||||
threads("-D_MT")),
|
threads("-D_MT")),
|
||||||
lib_cppflags => "-DL_ENDIAN",
|
lib_cppflags => "-DL_ENDIAN",
|
||||||
ex_libs => add("-lws2_32 -lgdi32 -lcrypt32"),
|
ex_libs => add("-lws2_32 -lgdi32 -lcrypt32"),
|
||||||
bn_ops => "EXPORT_VAR_AS_FN",
|
|
||||||
thread_scheme => "winthreads",
|
thread_scheme => "winthreads",
|
||||||
dso_scheme => "win32",
|
dso_scheme => "win32",
|
||||||
shared_target => "mingw-shared",
|
shared_target => "mingw-shared",
|
||||||
|
@ -47,7 +47,7 @@ my %targets = (
|
|||||||
inherit_from => [ "VC-noCE-common" ],
|
inherit_from => [ "VC-noCE-common" ],
|
||||||
defines => add("_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE",
|
defines => add("_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE",
|
||||||
"OPENSSL_SYS_WIN_CORE"),
|
"OPENSSL_SYS_WIN_CORE"),
|
||||||
bn_ops => "BN_LLONG RC4_CHAR EXPORT_VAR_AS_FN",
|
bn_ops => "BN_LLONG RC4_CHAR",
|
||||||
lflags => add("/NODEFAULTLIB:kernel32.lib"),
|
lflags => add("/NODEFAULTLIB:kernel32.lib"),
|
||||||
ex_libs => "onecore.lib",
|
ex_libs => "onecore.lib",
|
||||||
multilib => "-arm",
|
multilib => "-arm",
|
||||||
@ -56,7 +56,7 @@ my %targets = (
|
|||||||
inherit_from => [ "VC-noCE-common" ],
|
inherit_from => [ "VC-noCE-common" ],
|
||||||
defines => add("_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE",
|
defines => add("_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE",
|
||||||
"OPENSSL_SYS_WIN_CORE"),
|
"OPENSSL_SYS_WIN_CORE"),
|
||||||
bn_ops => "SIXTY_FOUR_BIT RC4_CHAR EXPORT_VAR_AS_FN",
|
bn_ops => "SIXTY_FOUR_BIT RC4_CHAR",
|
||||||
lflags => add("/NODEFAULTLIB:kernel32.lib"),
|
lflags => add("/NODEFAULTLIB:kernel32.lib"),
|
||||||
ex_libs => "onecore.lib",
|
ex_libs => "onecore.lib",
|
||||||
multilib => "-arm64",
|
multilib => "-arm64",
|
||||||
|
@ -236,9 +236,6 @@ In each table entry, the following keys are significant:
|
|||||||
up of 'unsigned char's;
|
up of 'unsigned char's;
|
||||||
RC4_INT RC4 key schedule is made
|
RC4_INT RC4 key schedule is made
|
||||||
up of 'unsigned int's;
|
up of 'unsigned int's;
|
||||||
EXPORT_VAR_AS_FN for shared libraries,
|
|
||||||
export vars as
|
|
||||||
accessor functions.
|
|
||||||
|
|
||||||
|
|
||||||
[1] as part of the target configuration, one can have a key called
|
[1] as part of the target configuration, one can have a key called
|
||||||
|
@ -1456,7 +1456,6 @@ if (!$disabled{asm} && !$predefined_C{__MACH__} && $^O ne 'VMS') {
|
|||||||
# Deal with bn_ops ###################################################
|
# Deal with bn_ops ###################################################
|
||||||
|
|
||||||
$config{bn_ll} =0;
|
$config{bn_ll} =0;
|
||||||
$config{export_var_as_fn} =0;
|
|
||||||
my $def_int="unsigned int";
|
my $def_int="unsigned int";
|
||||||
$config{rc4_int} =$def_int;
|
$config{rc4_int} =$def_int;
|
||||||
($config{b64l},$config{b64},$config{b32})=(0,0,1);
|
($config{b64l},$config{b64},$config{b32})=(0,0,1);
|
||||||
@ -1464,7 +1463,6 @@ $config{rc4_int} =$def_int;
|
|||||||
my $count = 0;
|
my $count = 0;
|
||||||
foreach (sort split(/\s+/,$target{bn_ops})) {
|
foreach (sort split(/\s+/,$target{bn_ops})) {
|
||||||
$count++ if /SIXTY_FOUR_BIT|SIXTY_FOUR_BIT_LONG|THIRTY_TWO_BIT/;
|
$count++ if /SIXTY_FOUR_BIT|SIXTY_FOUR_BIT_LONG|THIRTY_TWO_BIT/;
|
||||||
$config{export_var_as_fn}=1 if $_ eq 'EXPORT_VAR_AS_FN';
|
|
||||||
$config{bn_ll}=1 if $_ eq 'BN_LLONG';
|
$config{bn_ll}=1 if $_ eq 'BN_LLONG';
|
||||||
$config{rc4_int}="unsigned char" if $_ eq 'RC4_CHAR';
|
$config{rc4_int}="unsigned char" if $_ eq 'RC4_CHAR';
|
||||||
($config{b64l},$config{b64},$config{b32})
|
($config{b64l},$config{b64},$config{b32})
|
||||||
|
@ -310,23 +310,6 @@ TYPEDEF_D2I2D_OF(void);
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
# ifndef OPENSSL_EXPORT_VAR_AS_FUNCTION
|
|
||||||
|
|
||||||
/* ASN1_ITEM pointer exported type */
|
|
||||||
typedef const ASN1_ITEM ASN1_ITEM_EXP;
|
|
||||||
|
|
||||||
/* Macro to obtain ASN1_ITEM pointer from exported type */
|
|
||||||
# define ASN1_ITEM_ptr(iptr) (iptr)
|
|
||||||
|
|
||||||
/* Macro to include ASN1_ITEM pointer from base type */
|
|
||||||
# define ASN1_ITEM_ref(iptr) (&(iptr##_it))
|
|
||||||
|
|
||||||
# define ASN1_ITEM_rptr(ref) (&(ref##_it))
|
|
||||||
|
|
||||||
# define DECLARE_ASN1_ITEM(name) \
|
|
||||||
OPENSSL_EXTERN const ASN1_ITEM name##_it;
|
|
||||||
|
|
||||||
# else
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Platforms that can't easily handle shared global variables are declared as
|
* Platforms that can't easily handle shared global variables are declared as
|
||||||
@ -337,18 +320,16 @@ typedef const ASN1_ITEM ASN1_ITEM_EXP;
|
|||||||
typedef const ASN1_ITEM *ASN1_ITEM_EXP (void);
|
typedef const ASN1_ITEM *ASN1_ITEM_EXP (void);
|
||||||
|
|
||||||
/* Macro to obtain ASN1_ITEM pointer from exported type */
|
/* Macro to obtain ASN1_ITEM pointer from exported type */
|
||||||
# define ASN1_ITEM_ptr(iptr) (iptr())
|
# define ASN1_ITEM_ptr(iptr) (iptr())
|
||||||
|
|
||||||
/* Macro to include ASN1_ITEM pointer from base type */
|
/* Macro to include ASN1_ITEM pointer from base type */
|
||||||
# define ASN1_ITEM_ref(iptr) (iptr##_it)
|
# define ASN1_ITEM_ref(iptr) (iptr##_it)
|
||||||
|
|
||||||
# define ASN1_ITEM_rptr(ref) (ref##_it())
|
# define ASN1_ITEM_rptr(ref) (ref##_it())
|
||||||
|
|
||||||
# define DECLARE_ASN1_ITEM(name) \
|
# define DECLARE_ASN1_ITEM(name) \
|
||||||
const ASN1_ITEM * name##_it(void);
|
const ASN1_ITEM * name##_it(void);
|
||||||
|
|
||||||
# endif
|
|
||||||
|
|
||||||
/* Parameters used by ASN1_STRING_print_ex() */
|
/* Parameters used by ASN1_STRING_print_ex() */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -25,44 +25,24 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
# ifndef OPENSSL_EXPORT_VAR_AS_FUNCTION
|
|
||||||
|
|
||||||
/* Macro to obtain ASN1_ADB pointer from a type (only used internally) */
|
/* Macro to obtain ASN1_ADB pointer from a type (only used internally) */
|
||||||
# define ASN1_ADB_ptr(iptr) ((const ASN1_ADB *)(iptr))
|
# define ASN1_ADB_ptr(iptr) ((const ASN1_ADB *)((iptr)()))
|
||||||
|
|
||||||
/* Macros for start and end of ASN1_ITEM definition */
|
/* Macros for start and end of ASN1_ITEM definition */
|
||||||
|
|
||||||
# define ASN1_ITEM_start(itname) \
|
# define ASN1_ITEM_start(itname) \
|
||||||
const ASN1_ITEM itname##_it = {
|
|
||||||
|
|
||||||
# define static_ASN1_ITEM_start(itname) \
|
|
||||||
static const ASN1_ITEM itname##_it = {
|
|
||||||
|
|
||||||
# define ASN1_ITEM_end(itname) \
|
|
||||||
};
|
|
||||||
|
|
||||||
# else
|
|
||||||
|
|
||||||
/* Macro to obtain ASN1_ADB pointer from a type (only used internally) */
|
|
||||||
# define ASN1_ADB_ptr(iptr) ((const ASN1_ADB *)((iptr)()))
|
|
||||||
|
|
||||||
/* Macros for start and end of ASN1_ITEM definition */
|
|
||||||
|
|
||||||
# define ASN1_ITEM_start(itname) \
|
|
||||||
const ASN1_ITEM * itname##_it(void) \
|
const ASN1_ITEM * itname##_it(void) \
|
||||||
{ \
|
{ \
|
||||||
static const ASN1_ITEM local_it = {
|
static const ASN1_ITEM local_it = {
|
||||||
|
|
||||||
# define static_ASN1_ITEM_start(itname) \
|
# define static_ASN1_ITEM_start(itname) \
|
||||||
static ASN1_ITEM_start(itname)
|
static ASN1_ITEM_start(itname)
|
||||||
|
|
||||||
# define ASN1_ITEM_end(itname) \
|
# define ASN1_ITEM_end(itname) \
|
||||||
}; \
|
}; \
|
||||||
return &local_it; \
|
return &local_it; \
|
||||||
}
|
}
|
||||||
|
|
||||||
# endif
|
|
||||||
|
|
||||||
/* Macros to aid ASN1 template writing */
|
/* Macros to aid ASN1 template writing */
|
||||||
|
|
||||||
# define ASN1_ITEM_TEMPLATE(tname) \
|
# define ASN1_ITEM_TEMPLATE(tname) \
|
||||||
@ -335,13 +315,9 @@ extern "C" {
|
|||||||
|
|
||||||
/* Any defined by macros: the field used is in the table itself */
|
/* Any defined by macros: the field used is in the table itself */
|
||||||
|
|
||||||
# ifndef OPENSSL_EXPORT_VAR_AS_FUNCTION
|
# define ASN1_ADB_OBJECT(tblname) { ASN1_TFLG_ADB_OID, -1, 0, #tblname, tblname##_adb }
|
||||||
# define ASN1_ADB_OBJECT(tblname) { ASN1_TFLG_ADB_OID, -1, 0, #tblname, (const ASN1_ITEM *)&(tblname##_adb) }
|
# define ASN1_ADB_INTEGER(tblname) { ASN1_TFLG_ADB_INT, -1, 0, #tblname, tblname##_adb }
|
||||||
# define ASN1_ADB_INTEGER(tblname) { ASN1_TFLG_ADB_INT, -1, 0, #tblname, (const ASN1_ITEM *)&(tblname##_adb) }
|
|
||||||
# else
|
|
||||||
# define ASN1_ADB_OBJECT(tblname) { ASN1_TFLG_ADB_OID, -1, 0, #tblname, tblname##_adb }
|
|
||||||
# define ASN1_ADB_INTEGER(tblname) { ASN1_TFLG_ADB_INT, -1, 0, #tblname, tblname##_adb }
|
|
||||||
# endif
|
|
||||||
/* Plain simple type */
|
/* Plain simple type */
|
||||||
# define ASN1_SIMPLE(stname, field, type) ASN1_EX_TYPE(0,0, stname, field, type)
|
# define ASN1_SIMPLE(stname, field, type) ASN1_EX_TYPE(0,0, stname, field, type)
|
||||||
/* Embedded simple type */
|
/* Embedded simple type */
|
||||||
@ -421,23 +397,7 @@ extern "C" {
|
|||||||
# define ASN1_ADB(name) \
|
# define ASN1_ADB(name) \
|
||||||
static const ASN1_ADB_TABLE name##_adbtbl[]
|
static const ASN1_ADB_TABLE name##_adbtbl[]
|
||||||
|
|
||||||
# ifndef OPENSSL_EXPORT_VAR_AS_FUNCTION
|
# define ASN1_ADB_END(name, flags, field, adb_cb, def, none) \
|
||||||
|
|
||||||
# define ASN1_ADB_END(name, flags, field, adb_cb, def, none) \
|
|
||||||
;\
|
|
||||||
static const ASN1_ADB name##_adb = {\
|
|
||||||
flags,\
|
|
||||||
offsetof(name, field),\
|
|
||||||
adb_cb,\
|
|
||||||
name##_adbtbl,\
|
|
||||||
sizeof(name##_adbtbl) / sizeof(ASN1_ADB_TABLE),\
|
|
||||||
def,\
|
|
||||||
none\
|
|
||||||
}
|
|
||||||
|
|
||||||
# else
|
|
||||||
|
|
||||||
# define ASN1_ADB_END(name, flags, field, adb_cb, def, none) \
|
|
||||||
;\
|
;\
|
||||||
static const ASN1_ITEM *name##_adb(void) \
|
static const ASN1_ITEM *name##_adb(void) \
|
||||||
{ \
|
{ \
|
||||||
@ -455,8 +415,6 @@ extern "C" {
|
|||||||
} \
|
} \
|
||||||
void dummy_function(void)
|
void dummy_function(void)
|
||||||
|
|
||||||
# endif
|
|
||||||
|
|
||||||
# define ADB_ENTRY(val, template) {val, template}
|
# define ADB_ENTRY(val, template) {val, template}
|
||||||
|
|
||||||
# define ASN1_ADB_TEMPLATE(name) \
|
# define ASN1_ADB_TEMPLATE(name) \
|
||||||
|
@ -165,8 +165,6 @@ extern "C" {
|
|||||||
/* Generate 80386 code? */
|
/* Generate 80386 code? */
|
||||||
{- $config{processor} eq "386" ? "# define" : "# undef" -} I386_ONLY
|
{- $config{processor} eq "386" ? "# define" : "# undef" -} I386_ONLY
|
||||||
|
|
||||||
{- $config{export_var_as_fn} ? "# define" : "# undef" -} OPENSSL_EXPORT_VAR_AS_FUNCTION
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The following are cipher-specific, but are part of the public API.
|
* The following are cipher-specific, but are part of the public API.
|
||||||
*/
|
*/
|
||||||
|
@ -266,7 +266,6 @@ sub parsenum()
|
|||||||
while ( <$IN> ) {
|
while ( <$IN> ) {
|
||||||
next if /^#/;
|
next if /^#/;
|
||||||
next if /\bNOEXIST\b/;
|
next if /\bNOEXIST\b/;
|
||||||
next if /\bEXPORT_VAR_AS_FUNC\b/;
|
|
||||||
my @fields = split();
|
my @fields = split();
|
||||||
die "Malformed line $_"
|
die "Malformed line $_"
|
||||||
if scalar @fields != 2 && scalar @fields != 4;
|
if scalar @fields != 2 && scalar @fields != 4;
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -109,24 +109,20 @@ my $libname = platform->sharedname($name);
|
|||||||
my %OS_data = (
|
my %OS_data = (
|
||||||
solaris => { writer => \&writer_linux,
|
solaris => { writer => \&writer_linux,
|
||||||
sort => sorter_linux(),
|
sort => sorter_linux(),
|
||||||
platforms => { UNIX => 1,
|
platforms => { UNIX => 1 } },
|
||||||
EXPORT_VAR_AS_FUNCTION => 0 } },
|
|
||||||
linux => 'solaris', # alias
|
linux => 'solaris', # alias
|
||||||
"bsd-gcc" => 'solaris', # alias
|
"bsd-gcc" => 'solaris', # alias
|
||||||
aix => { writer => \&writer_aix,
|
aix => { writer => \&writer_aix,
|
||||||
sort => sorter_unix(),
|
sort => sorter_unix(),
|
||||||
platforms => { UNIX => 1,
|
platforms => { UNIX => 1 } },
|
||||||
EXPORT_VAR_AS_FUNCTION => 0 } },
|
|
||||||
VMS => { writer => \&writer_VMS,
|
VMS => { writer => \&writer_VMS,
|
||||||
sort => OpenSSL::Ordinals::by_number(),
|
sort => OpenSSL::Ordinals::by_number(),
|
||||||
platforms => { VMS => 1,
|
platforms => { VMS => 1 } },
|
||||||
EXPORT_VAR_AS_FUNCTION => 0 } },
|
|
||||||
vms => 'VMS', # alias
|
vms => 'VMS', # alias
|
||||||
WINDOWS => { writer => \&writer_windows,
|
WINDOWS => { writer => \&writer_windows,
|
||||||
sort => OpenSSL::Ordinals::by_name(),
|
sort => OpenSSL::Ordinals::by_name(),
|
||||||
platforms => { WIN32 => 1,
|
platforms => { WIN32 => 1,
|
||||||
_WIN32 => 1,
|
_WIN32 => 1 } },
|
||||||
EXPORT_VAR_AS_FUNCTION => 1 } },
|
|
||||||
windows => 'WINDOWS', # alias
|
windows => 'WINDOWS', # alias
|
||||||
WIN32 => 'WINDOWS', # alias
|
WIN32 => 'WINDOWS', # alias
|
||||||
win32 => 'WIN32', # alias
|
win32 => 'WIN32', # alias
|
||||||
|
@ -342,8 +342,6 @@ sub _parse_platforms {
|
|||||||
# if ($def =~ m{^__DragonFly__$}) { $platforms{$&} = $op; }
|
# if ($def =~ m{^__DragonFly__$}) { $platforms{$&} = $op; }
|
||||||
# if ($def =~ m{^__OpenBSD__$}) { $platforms{$&} = $op; }
|
# if ($def =~ m{^__OpenBSD__$}) { $platforms{$&} = $op; }
|
||||||
# if ($def =~ m{^__NetBSD__$}) { $platforms{$&} = $op; }
|
# if ($def =~ m{^__NetBSD__$}) { $platforms{$&} = $op; }
|
||||||
if ($def =~
|
|
||||||
m{^OPENSSL_(EXPORT_VAR_AS_FUNCTION)$}) { $platforms{$1} = $op; }
|
|
||||||
if ($def =~ m{^OPENSSL_SYS_}) { $platforms{$'} = $op; }
|
if ($def =~ m{^OPENSSL_SYS_}) { $platforms{$'} = $op; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -400,11 +400,7 @@ EOF
|
|||||||
{ regexp => qr/DECLARE_ASN1_ITEM<<<\((.*)\)>>>/,
|
{ regexp => qr/DECLARE_ASN1_ITEM<<<\((.*)\)>>>/,
|
||||||
massager => sub {
|
massager => sub {
|
||||||
return (<<"EOF");
|
return (<<"EOF");
|
||||||
#ifndef OPENSSL_EXPORT_VAR_AS_FUNCTION
|
|
||||||
OPENSSL_EXTERN const ASN1_ITEM *$1_it;
|
|
||||||
#else
|
|
||||||
const ASN1_ITEM *$1_it(void);
|
const ASN1_ITEM *$1_it(void);
|
||||||
#endif
|
|
||||||
EOF
|
EOF
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user