- if ($tag{'TRUE'} != -1) {
- if (/^\s*DECLARE_STACK_OF\s*\(\s*(\w*)\s*\)/) {
- next;
- } elsif (/^\s*DECLARE_ASN1_ENCODE_FUNCTIONS\s*\(\s*(\w*)\s*,\s*(\w*)\s*,\s*(\w*)\s*\)/) {
- $def .= "int d2i_$3(void);";
- $def .= "int i2d_$3(void);";
- # Variant for platforms that do not
- # have to access globale variables
- # in shared libraries through functions
- $def .=
- "#INFO:"
- .join(',',"!EXPORT_VAR_AS_FUNCTION",@current_platforms).":"
- .join(',',@current_algorithms).";";
- $def .= "OPENSSL_EXTERN int $2_it;";
- $def .=
- "#INFO:"
- .join(',',@current_platforms).":"
- .join(',',@current_algorithms).";";
- # Variant for platforms that have to
- # access globale variables in shared
- # libraries through functions
- &$make_variant("$2_it","$2_it",
- "EXPORT_VAR_AS_FUNCTION",
- "FUNCTION");
- next;
- } elsif (/^\s*DECLARE_ASN1_FUNCTIONS_fname\s*\(\s*(\w*)\s*,\s*(\w*)\s*,\s*(\w*)\s*\)/) {
- $def .= "int d2i_$3(void);";
- $def .= "int i2d_$3(void);";
- $def .= "int $3_free(void);";
- $def .= "int $3_new(void);";
- # Variant for platforms that do not
- # have to access globale variables
- # in shared libraries through functions
- $def .=
- "#INFO:"
- .join(',',"!EXPORT_VAR_AS_FUNCTION",@current_platforms).":"
- .join(',',@current_algorithms).";";
- $def .= "OPENSSL_EXTERN int $2_it;";
- $def .=
- "#INFO:"
- .join(',',@current_platforms).":"
- .join(',',@current_algorithms).";";
- # Variant for platforms that have to
- # access globale variables in shared
- # libraries through functions
- &$make_variant("$2_it","$2_it",
- "EXPORT_VAR_AS_FUNCTION",
- "FUNCTION");
- next;
- } elsif (/^\s*DECLARE_ASN1_FUNCTIONS\s*\(\s*(\w*)\s*\)/ ||
- /^\s*DECLARE_ASN1_FUNCTIONS_const\s*\(\s*(\w*)\s*\)/) {
- $def .= "int d2i_$1(void);";
- $def .= "int i2d_$1(void);";
- $def .= "int $1_free(void);";
- $def .= "int $1_new(void);";
- # Variant for platforms that do not
- # have to access globale variables
- # in shared libraries through functions
- $def .=
- "#INFO:"
- .join(',',"!EXPORT_VAR_AS_FUNCTION",@current_platforms).":"
- .join(',',@current_algorithms).";";
- $def .= "OPENSSL_EXTERN int $1_it;";
- $def .=
- "#INFO:"
- .join(',',@current_platforms).":"
- .join(',',@current_algorithms).";";
- # Variant for platforms that have to
- # access globale variables in shared
- # libraries through functions
- &$make_variant("$1_it","$1_it",
- "EXPORT_VAR_AS_FUNCTION",
- "FUNCTION");
- next;
- } elsif (/^\s*DECLARE_ASN1_ENCODE_FUNCTIONS_const\s*\(\s*(\w*)\s*,\s*(\w*)\s*\)/) {
- $def .= "int d2i_$2(void);";
- $def .= "int i2d_$2(void);";
- # Variant for platforms that do not
- # have to access globale variables
- # in shared libraries through functions
- $def .=
- "#INFO:"
- .join(',',"!EXPORT_VAR_AS_FUNCTION",@current_platforms).":"
- .join(',',@current_algorithms).";";
- $def .= "OPENSSL_EXTERN int $2_it;";
- $def .=
- "#INFO:"
- .join(',',@current_platforms).":"
- .join(',',@current_algorithms).";";
- # Variant for platforms that have to
- # access globale variables in shared
- # libraries through functions
- &$make_variant("$2_it","$2_it",
- "EXPORT_VAR_AS_FUNCTION",
- "FUNCTION");
- next;
- } elsif (/^\s*DECLARE_ASN1_FUNCTIONS_name\s*\(\s*(\w*)\s*,\s*(\w*)\s*\)/) {
- $def .= "int d2i_$2(void);";
- $def .= "int i2d_$2(void);";
- $def .= "int $2_free(void);";
- $def .= "int $2_new(void);";
- # Variant for platforms that do not
- # have to access globale variables
- # in shared libraries through functions
- $def .=
- "#INFO:"
- .join(',',"!EXPORT_VAR_AS_FUNCTION",@current_platforms).":"
- .join(',',@current_algorithms).";";
- $def .= "OPENSSL_EXTERN int $2_it;";
- $def .=
- "#INFO:"
- .join(',',@current_platforms).":"
- .join(',',@current_algorithms).";";
- # Variant for platforms that have to
- # access globale variables in shared
- # libraries through functions
- &$make_variant("$2_it","$2_it",
- "EXPORT_VAR_AS_FUNCTION",
- "FUNCTION");
- next;
- } elsif (/^\s*DECLARE_ASN1_ITEM\s*\(\s*(\w*)\s*\)/) {
- # Variant for platforms that do not
- # have to access globale variables
- # in shared libraries through functions
- $def .=
- "#INFO:"
- .join(',',"!EXPORT_VAR_AS_FUNCTION",@current_platforms).":"
- .join(',',@current_algorithms).";";
- $def .= "OPENSSL_EXTERN int $1_it;";
- $def .=
- "#INFO:"
- .join(',',@current_platforms).":"
- .join(',',@current_algorithms).";";
- # Variant for platforms that have to
- # access globale variables in shared
- # libraries through functions
- &$make_variant("$1_it","$1_it",
- "EXPORT_VAR_AS_FUNCTION",
- "FUNCTION");
- print STDERR "DEBUG: after make_variant: variant of $1_it = ",$variant{"$1_it"},"\n" if $debug;
- next;
- } elsif (/^\s*DECLARE_ASN1_SET_OF\s*\(\s*(\w*)\s*\)/) {
- next;
- } elsif (/^\s*DECLARE_PKCS12_STACK_OF\s*\(\s*(\w*)\s*\)/) {
- next;
- } elsif (/^DECLARE_PEM_rw\s*\(\s*(\w*)\s*,/ ||
- /^DECLARE_PEM_rw_cb\s*\(\s*(\w*)\s*,/ ) {
- # Things not in Win16
- $def .=
- "#INFO:"
- .join(',',"!WIN16",@current_platforms).":"
- .join(',',@current_algorithms).";";
- $def .= "int PEM_read_$1(void);";
- $def .= "int PEM_write_$1(void);";
- $def .=
- "#INFO:"
- .join(',',@current_platforms).":"
- .join(',',@current_algorithms).";";
- # Things that are everywhere
- $def .= "int PEM_read_bio_$1(void);";
- $def .= "int PEM_write_bio_$1(void);";
- next;
- } elsif (/^DECLARE_PEM_write\s*\(\s*(\w*)\s*,/ ||
- /^DECLARE_PEM_write_cb\s*\(\s*(\w*)\s*,/ ) {
- # Things not in Win16
- $def .=
- "#INFO:"
- .join(',',"!WIN16",@current_platforms).":"
- .join(',',@current_algorithms).";";
- $def .= "int PEM_write_$1(void);";
- $def .=
- "#INFO:"
- .join(',',@current_platforms).":"
- .join(',',@current_algorithms).";";
- # Things that are everywhere
- $def .= "int PEM_write_bio_$1(void);";
- next;
- } elsif (/^DECLARE_PEM_read\s*\(\s*(\w*)\s*,/ ||
- /^DECLARE_PEM_read_cb\s*\(\s*(\w*)\s*,/ ) {
- # Things not in Win16
- $def .=
- "#INFO:"
- .join(',',"!WIN16",@current_platforms).":"
- .join(',',@current_algorithms).";";
- $def .= "int PEM_read_$1(void);";
- $def .=
- "#INFO:"
- .join(',',@current_platforms).":"
- .join(',',@current_algorithms).";";
- # Things that are everywhere
- $def .= "int PEM_read_bio_$1(void);";
- next;
- } elsif (/^OPENSSL_DECLARE_GLOBAL\s*\(\s*(\w*)\s*,\s*(\w*)\s*\)/) {
- # Variant for platforms that do not
- # have to access globale variables
- # in shared libraries through functions
- $def .=
- "#INFO:"
- .join(',',"!EXPORT_VAR_AS_FUNCTION",@current_platforms).":"
- .join(',',@current_algorithms).";";
- $def .= "OPENSSL_EXTERN int _shadow_$2;";
- $def .=
- "#INFO:"
- .join(',',@current_platforms).":"
- .join(',',@current_algorithms).";";
- # Variant for platforms that have to
- # access globale variables in shared
- # libraries through functions
- &$make_variant("_shadow_$2","_shadow_$2",
- "EXPORT_VAR_AS_FUNCTION",
- "FUNCTION");
- print STDERR "DEBUG: after make_variant: variant of $1_it = ",$variant{"$1_it"},"\n" if $debug;
- } elsif ($tag{'CONST_STRICT'} != 1) {
+ if (/^\s*DECLARE_STACK_OF\s*\(\s*(\w*)\s*\)/) {
+ next;
+ } elsif (/^\s*DECLARE_PKCS12_STACK_OF\s*\(\s*(\w*)\s*\)/) {
+ next;
+ } elsif (/^\s*DECLARE_ASN1_SET_OF\s*\(\s*(\w*)\s*\)/) {
+ next;
+ } elsif (/^DECLARE_PEM_rw\s*\(\s*(\w*)\s*,/ ||
+ /^DECLARE_PEM_rw_cb\s*\(\s*(\w*)\s*,/ ) {
+ # Things not in Win16
+ $syms{"PEM_read_${1}"} = 1;
+ $platform{"PEM_read_${1}"} = "!WIN16";
+ $syms{"PEM_write_${1}"} = 1;
+ $platform{"PEM_write_${1}"} = "!WIN16";
+ # Things that are everywhere
+ $syms{"PEM_read_bio_${1}"} = 1;
+ $syms{"PEM_write_bio_${1}"} = 1;
+ if ($1 eq "RSAPrivateKey" ||
+ $1 eq "RSAPublicKey" ||
+ $1 eq "RSA_PUBKEY") {
+ $algorithm{"PEM_read_${1}"} = "RSA";
+ $algorithm{"PEM_write_${1}"} = "RSA";
+ $algorithm{"PEM_read_bio_${1}"} = "RSA";
+ $algorithm{"PEM_write_bio_${1}"} = "RSA";
+ }
+ elsif ($1 eq "DSAPrivateKey" ||
+ $1 eq "DSAparams" ||
+ $1 eq "RSA_PUBKEY") {
+ $algorithm{"PEM_read_${1}"} = "DSA";
+ $algorithm{"PEM_write_${1}"} = "DSA";
+ $algorithm{"PEM_read_bio_${1}"} = "DSA";
+ $algorithm{"PEM_write_bio_${1}"} = "DSA";
+ }
+ elsif ($1 eq "DHparams") {
+ $algorithm{"PEM_read_${1}"} = "DH";
+ $algorithm{"PEM_write_${1}"} = "DH";
+ $algorithm{"PEM_read_bio_${1}"} = "DH";
+ $algorithm{"PEM_write_bio_${1}"} = "DH";
+ }
+ } elsif (/^DECLARE_PEM_write\s*\(\s*(\w*)\s*,/ ||
+ /^DECLARE_PEM_write_cb\s*\(\s*(\w*)\s*,/ ) {
+ # Things not in Win16
+ $syms{"PEM_write_${1}"} = 1;
+ $platform{"PEM_write_${1}"} .= ",!WIN16";
+ # Things that are everywhere
+ $syms{"PEM_write_bio_${1}"} = 1;
+ if ($1 eq "RSAPrivateKey" ||
+ $1 eq "RSAPublicKey" ||
+ $1 eq "RSA_PUBKEY") {
+ $algorithm{"PEM_write_${1}"} = "RSA";
+ $algorithm{"PEM_write_bio_${1}"} = "RSA";
+ }
+ elsif ($1 eq "DSAPrivateKey" ||
+ $1 eq "DSAparams" ||
+ $1 eq "RSA_PUBKEY") {
+ $algorithm{"PEM_write_${1}"} = "DSA";
+ $algorithm{"PEM_write_bio_${1}"} = "DSA";
+ }
+ elsif ($1 eq "DHparams") {
+ $algorithm{"PEM_write_${1}"} = "DH";
+ $algorithm{"PEM_write_bio_${1}"} = "DH";
+ }
+ } elsif (/^DECLARE_PEM_read\s*\(\s*(\w*)\s*,/ ||
+ /^DECLARE_PEM_read_cb\s*\(\s*(\w*)\s*,/ ) {
+ # Things not in Win16
+ $syms{"PEM_read_${1}"} = 1;
+ $platform{"PEM_read_${1}"} .= ",!WIN16";
+ # Things that are everywhere
+ $syms{"PEM_read_bio_${1}"} = 1;
+ } elsif (
+ ($tag{'TRUE'} != -1)
+ && ($tag{'CONST_STRICT'} != 1)
+ )
+ {