Skip to content

Commit 211da00

Browse files
committed
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 <[email protected]> Reviewed-by: Paul Dale <[email protected]> (Merged from openssl#9285)
1 parent 66e2dbc commit 211da00

File tree

13 files changed

+179
-417
lines changed

13 files changed

+179
-417
lines changed

CHANGES

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414

1515
*) Removed DES_check_key. Also removed OPENSSL_IMPLEMENT_GLOBAL,
1616
OPENSSL_GLOBAL_REF, OPENSSL_DECLARE_GLOBAL.
17+
Also removed "export var as function" capability; we do not export
18+
variables, only functions.
1719
[Rich Salz]
1820

1921
*) RC5_32_set_key has been changed to return an int type, with 0 indicating

Configurations/10-main.conf

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1274,7 +1274,6 @@ my %targets = (
12741274
shared_target => "win-shared", # meaningless except it gives Configure a hint
12751275
thread_scheme => "winthreads",
12761276
dso_scheme => "win32",
1277-
bn_ops => "EXPORT_VAR_AS_FN",
12781277
perl_platform => 'Windows::MSVC',
12791278
# additional parameter to build_scheme denotes install-path "flavour"
12801279
build_scheme => add("VC-common", { separator => undef }),
@@ -1426,7 +1425,6 @@ my %targets = (
14261425
threads("-D_MT")),
14271426
lib_cppflags => "-DL_ENDIAN",
14281427
ex_libs => add("-lws2_32 -lgdi32 -lcrypt32"),
1429-
bn_ops => "EXPORT_VAR_AS_FN",
14301428
thread_scheme => "winthreads",
14311429
dso_scheme => "win32",
14321430
shared_target => "mingw-shared",

Configurations/50-win-onecore.conf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ my %targets = (
4747
inherit_from => [ "VC-noCE-common" ],
4848
defines => add("_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE",
4949
"OPENSSL_SYS_WIN_CORE"),
50-
bn_ops => "BN_LLONG RC4_CHAR EXPORT_VAR_AS_FN",
50+
bn_ops => "BN_LLONG RC4_CHAR",
5151
lflags => add("/NODEFAULTLIB:kernel32.lib"),
5252
ex_libs => "onecore.lib",
5353
multilib => "-arm",
@@ -56,7 +56,7 @@ my %targets = (
5656
inherit_from => [ "VC-noCE-common" ],
5757
defines => add("_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE",
5858
"OPENSSL_SYS_WIN_CORE"),
59-
bn_ops => "SIXTY_FOUR_BIT RC4_CHAR EXPORT_VAR_AS_FN",
59+
bn_ops => "SIXTY_FOUR_BIT RC4_CHAR",
6060
lflags => add("/NODEFAULTLIB:kernel32.lib"),
6161
ex_libs => "onecore.lib",
6262
multilib => "-arm64",

Configurations/README

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -236,9 +236,6 @@ In each table entry, the following keys are significant:
236236
up of 'unsigned char's;
237237
RC4_INT RC4 key schedule is made
238238
up of 'unsigned int's;
239-
EXPORT_VAR_AS_FN for shared libraries,
240-
export vars as
241-
accessor functions.
242239

243240

244241
[1] as part of the target configuration, one can have a key called

Configure

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1456,15 +1456,13 @@ if (!$disabled{asm} && !$predefined_C{__MACH__} && $^O ne 'VMS') {
14561456
# Deal with bn_ops ###################################################
14571457

14581458
$config{bn_ll} =0;
1459-
$config{export_var_as_fn} =0;
14601459
my $def_int="unsigned int";
14611460
$config{rc4_int} =$def_int;
14621461
($config{b64l},$config{b64},$config{b32})=(0,0,1);
14631462

14641463
my $count = 0;
14651464
foreach (sort split(/\s+/,$target{bn_ops})) {
14661465
$count++ if /SIXTY_FOUR_BIT|SIXTY_FOUR_BIT_LONG|THIRTY_TWO_BIT/;
1467-
$config{export_var_as_fn}=1 if $_ eq 'EXPORT_VAR_AS_FN';
14681466
$config{bn_ll}=1 if $_ eq 'BN_LLONG';
14691467
$config{rc4_int}="unsigned char" if $_ eq 'RC4_CHAR';
14701468
($config{b64l},$config{b64},$config{b32})

include/openssl/asn1.h

Lines changed: 4 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -310,23 +310,6 @@ TYPEDEF_D2I2D_OF(void);
310310
*
311311
*/
312312

313-
# ifndef OPENSSL_EXPORT_VAR_AS_FUNCTION
314-
315-
/* ASN1_ITEM pointer exported type */
316-
typedef const ASN1_ITEM ASN1_ITEM_EXP;
317-
318-
/* Macro to obtain ASN1_ITEM pointer from exported type */
319-
# define ASN1_ITEM_ptr(iptr) (iptr)
320-
321-
/* Macro to include ASN1_ITEM pointer from base type */
322-
# define ASN1_ITEM_ref(iptr) (&(iptr##_it))
323-
324-
# define ASN1_ITEM_rptr(ref) (&(ref##_it))
325-
326-
# define DECLARE_ASN1_ITEM(name) \
327-
OPENSSL_EXTERN const ASN1_ITEM name##_it;
328-
329-
# else
330313

331314
/*
332315
* Platforms that can't easily handle shared global variables are declared as
@@ -337,18 +320,16 @@ typedef const ASN1_ITEM ASN1_ITEM_EXP;
337320
typedef const ASN1_ITEM *ASN1_ITEM_EXP (void);
338321

339322
/* Macro to obtain ASN1_ITEM pointer from exported type */
340-
# define ASN1_ITEM_ptr(iptr) (iptr())
323+
# define ASN1_ITEM_ptr(iptr) (iptr())
341324

342325
/* Macro to include ASN1_ITEM pointer from base type */
343-
# define ASN1_ITEM_ref(iptr) (iptr##_it)
326+
# define ASN1_ITEM_ref(iptr) (iptr##_it)
344327

345-
# define ASN1_ITEM_rptr(ref) (ref##_it())
328+
# define ASN1_ITEM_rptr(ref) (ref##_it())
346329

347-
# define DECLARE_ASN1_ITEM(name) \
330+
# define DECLARE_ASN1_ITEM(name) \
348331
const ASN1_ITEM * name##_it(void);
349332

350-
# endif
351-
352333
/* Parameters used by ASN1_STRING_print_ex() */
353334

354335
/*

include/openssl/asn1t.h

Lines changed: 8 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -25,44 +25,24 @@
2525
extern "C" {
2626
#endif
2727

28-
# ifndef OPENSSL_EXPORT_VAR_AS_FUNCTION
29-
30-
/* Macro to obtain ASN1_ADB pointer from a type (only used internally) */
31-
# define ASN1_ADB_ptr(iptr) ((const ASN1_ADB *)(iptr))
32-
33-
/* Macros for start and end of ASN1_ITEM definition */
34-
35-
# define ASN1_ITEM_start(itname) \
36-
const ASN1_ITEM itname##_it = {
37-
38-
# define static_ASN1_ITEM_start(itname) \
39-
static const ASN1_ITEM itname##_it = {
40-
41-
# define ASN1_ITEM_end(itname) \
42-
};
43-
44-
# else
45-
4628
/* Macro to obtain ASN1_ADB pointer from a type (only used internally) */
47-
# define ASN1_ADB_ptr(iptr) ((const ASN1_ADB *)((iptr)()))
29+
# define ASN1_ADB_ptr(iptr) ((const ASN1_ADB *)((iptr)()))
4830

4931
/* Macros for start and end of ASN1_ITEM definition */
5032

51-
# define ASN1_ITEM_start(itname) \
33+
# define ASN1_ITEM_start(itname) \
5234
const ASN1_ITEM * itname##_it(void) \
5335
{ \
5436
static const ASN1_ITEM local_it = {
5537

56-
# define static_ASN1_ITEM_start(itname) \
38+
# define static_ASN1_ITEM_start(itname) \
5739
static ASN1_ITEM_start(itname)
5840

59-
# define ASN1_ITEM_end(itname) \
41+
# define ASN1_ITEM_end(itname) \
6042
}; \
6143
return &local_it; \
6244
}
6345

64-
# endif
65-
6646
/* Macros to aid ASN1 template writing */
6747

6848
# define ASN1_ITEM_TEMPLATE(tname) \
@@ -335,13 +315,9 @@ extern "C" {
335315

336316
/* Any defined by macros: the field used is in the table itself */
337317

338-
# ifndef OPENSSL_EXPORT_VAR_AS_FUNCTION
339-
# define ASN1_ADB_OBJECT(tblname) { ASN1_TFLG_ADB_OID, -1, 0, #tblname, (const ASN1_ITEM *)&(tblname##_adb) }
340-
# define ASN1_ADB_INTEGER(tblname) { ASN1_TFLG_ADB_INT, -1, 0, #tblname, (const ASN1_ITEM *)&(tblname##_adb) }
341-
# else
342-
# define ASN1_ADB_OBJECT(tblname) { ASN1_TFLG_ADB_OID, -1, 0, #tblname, tblname##_adb }
343-
# define ASN1_ADB_INTEGER(tblname) { ASN1_TFLG_ADB_INT, -1, 0, #tblname, tblname##_adb }
344-
# endif
318+
# define ASN1_ADB_OBJECT(tblname) { ASN1_TFLG_ADB_OID, -1, 0, #tblname, tblname##_adb }
319+
# define ASN1_ADB_INTEGER(tblname) { ASN1_TFLG_ADB_INT, -1, 0, #tblname, tblname##_adb }
320+
345321
/* Plain simple type */
346322
# define ASN1_SIMPLE(stname, field, type) ASN1_EX_TYPE(0,0, stname, field, type)
347323
/* Embedded simple type */
@@ -421,23 +397,7 @@ extern "C" {
421397
# define ASN1_ADB(name) \
422398
static const ASN1_ADB_TABLE name##_adbtbl[]
423399

424-
# ifndef OPENSSL_EXPORT_VAR_AS_FUNCTION
425-
426-
# define ASN1_ADB_END(name, flags, field, adb_cb, def, none) \
427-
;\
428-
static const ASN1_ADB name##_adb = {\
429-
flags,\
430-
offsetof(name, field),\
431-
adb_cb,\
432-
name##_adbtbl,\
433-
sizeof(name##_adbtbl) / sizeof(ASN1_ADB_TABLE),\
434-
def,\
435-
none\
436-
}
437-
438-
# else
439-
440-
# define ASN1_ADB_END(name, flags, field, adb_cb, def, none) \
400+
# define ASN1_ADB_END(name, flags, field, adb_cb, def, none) \
441401
;\
442402
static const ASN1_ITEM *name##_adb(void) \
443403
{ \
@@ -455,8 +415,6 @@ extern "C" {
455415
} \
456416
void dummy_function(void)
457417

458-
# endif
459-
460418
# define ADB_ENTRY(val, template) {val, template}
461419

462420
# define ASN1_ADB_TEMPLATE(name) \

include/openssl/opensslconf.h.in

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,8 +165,6 @@ extern "C" {
165165
/* Generate 80386 code? */
166166
{- $config{processor} eq "386" ? "# define" : "# undef" -} I386_ONLY
167167

168-
{- $config{export_var_as_fn} ? "# define" : "# undef" -} OPENSSL_EXPORT_VAR_AS_FUNCTION
169-
170168
/*
171169
* The following are cipher-specific, but are part of the public API.
172170
*/

util/find-doc-nits

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,6 @@ sub parsenum()
266266
while ( <$IN> ) {
267267
next if /^#/;
268268
next if /\bNOEXIST\b/;
269-
next if /\bEXPORT_VAR_AS_FUNC\b/;
270269
my @fields = split();
271270
die "Malformed line $_"
272271
if scalar @fields != 2 && scalar @fields != 4;

0 commit comments

Comments
 (0)