diff options
author | marha <marha@users.sourceforge.net> | 2015-02-22 14:43:31 +0100 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2015-02-22 14:43:31 +0100 |
commit | c9aad1ae6227c434d480d1d3aa8eae3c3c910c18 (patch) | |
tree | 94b917df998c3d547e191b3b9c58bbffc616470e /openssl/util | |
parent | f1c2db43dcf35d2cf4715390bd2391c28e42a8c2 (diff) | |
download | vcxsrv-c9aad1ae6227c434d480d1d3aa8eae3c3c910c18.tar.gz vcxsrv-c9aad1ae6227c434d480d1d3aa8eae3c3c910c18.tar.bz2 vcxsrv-c9aad1ae6227c434d480d1d3aa8eae3c3c910c18.zip |
Upgraded to openssl-1.0.2
Diffstat (limited to 'openssl/util')
-rw-r--r-- | openssl/util/ck_errf.pl | 2 | ||||
-rwxr-xr-x | openssl/util/copy-if-different.pl | 78 | ||||
-rw-r--r-- | openssl/util/files.pl | 8 | ||||
-rwxr-xr-x | openssl/util/indent.pro | 751 | ||||
-rw-r--r-- | openssl/util/libeay.num | 102 | ||||
-rw-r--r-- | openssl/util/mk1mf.pl | 150 | ||||
-rwxr-xr-x | openssl/util/mkbuildinf.pl | 35 | ||||
-rw-r--r-- | openssl/util/mkdef.pl | 15 | ||||
-rw-r--r-- | openssl/util/mkerr.pl | 7 | ||||
-rw-r--r-- | openssl/util/mkstack.pl | 4 | ||||
-rwxr-xr-x | openssl/util/openssl-format-source | 148 | ||||
-rw-r--r-- | openssl/util/pl/BC-32.pl | 2 | ||||
-rw-r--r-- | openssl/util/pl/VC-32.pl | 34 | ||||
-rw-r--r-- | openssl/util/pl/netware.pl | 2 | ||||
-rw-r--r-- | openssl/util/pl/unix.pl | 351 | ||||
-rw-r--r-- | openssl/util/ssleay.num | 55 | ||||
-rwxr-xr-x | openssl/util/su-filter.pl | 260 |
17 files changed, 1945 insertions, 59 deletions
diff --git a/openssl/util/ck_errf.pl b/openssl/util/ck_errf.pl index f13af5c50..1a8665ab6 100644 --- a/openssl/util/ck_errf.pl +++ b/openssl/util/ck_errf.pl @@ -21,7 +21,7 @@ foreach $file (@ARGV) $func=""; while (<IN>) { - if (!/;$/ && /^([a-zA-Z].*[\s*])?([A-Za-z_0-9]+)\(.*[),]/) + if (!/;$/ && /^\**([a-zA-Z].*[\s*])?([A-Za-z_0-9]+)\(.*([),]|$)/) { /^([^()]*(\([^()]*\)[^()]*)*)\(/; $1 =~ /([A-Za-z_0-9]*)$/; diff --git a/openssl/util/copy-if-different.pl b/openssl/util/copy-if-different.pl new file mode 100755 index 000000000..ec99e084b --- /dev/null +++ b/openssl/util/copy-if-different.pl @@ -0,0 +1,78 @@ +#!/usr/local/bin/perl + +use strict; + +use Fcntl; + +# copy-if-different.pl + +# Copy to the destination if the source is not the same as it. + +my @filelist; + +foreach my $arg (@ARGV) { + $arg =~ s|\\|/|g; # compensate for bug/feature in cygwin glob... + foreach (glob $arg) + { + push @filelist, $_; + } +} + +my $fnum = @filelist; + +if ($fnum <= 1) + { + die "Need at least two filenames"; + } + +my $dest = pop @filelist; + +if ($fnum > 2 && ! -d $dest) + { + die "Destination must be a directory"; + } + +foreach (@filelist) + { + my $dfile; + if (-d $dest) + { + $dfile = $_; + $dfile =~ s|^.*[/\\]([^/\\]*)$|$1|; + $dfile = "$dest/$dfile"; + } + else + { + $dfile = $dest; + } + + my $buf; + if (-f $dfile) + { + sysopen(IN, $_, O_RDONLY|O_BINARY) || die "Can't Open $_"; + sysopen(OUT, $dfile, O_RDONLY|O_BINARY) + || die "Can't Open $dfile"; + while (sysread IN, $buf, 10240) + { + my $b2; + goto copy if !sysread(OUT, $b2, 10240) || $buf ne $b2; + } + goto copy if sysread(OUT, $buf, 1); + close(IN); + close(OUT); + print "NOT copying: $_ to $dfile\n"; + next; + } + copy: + sysopen(IN, $_, O_RDONLY|O_BINARY) || die "Can't Open $_"; + sysopen(OUT, $dfile, O_WRONLY|O_CREAT|O_TRUNC|O_BINARY) + || die "Can't Open $dfile"; + while (sysread IN, $buf, 10240) + { + syswrite(OUT, $buf, length($buf)); + } + close(IN); + close(OUT); + print "Copying: $_ to $dfile\n"; + } + diff --git a/openssl/util/files.pl b/openssl/util/files.pl index 41f033e3b..b15407f0c 100644 --- a/openssl/util/files.pl +++ b/openssl/util/files.pl @@ -4,6 +4,12 @@ # It is basically a list of all variables from the passed makefile # +while ($ARGV[0] =~ /^(\S+)\s*=(.*)$/) + { + $sym{$1} = $2; + shift; + } + $s=""; while (<>) { @@ -33,7 +39,7 @@ while (<>) $o =~ s/\s+/ /g; $o =~ s/\$[({]([^)}]+)[)}]/$sym{$1}/g; - $sym{$s}=$o; + $sym{$s}=$o if !exists $sym{$s}; } } diff --git a/openssl/util/indent.pro b/openssl/util/indent.pro new file mode 100755 index 000000000..e8714310c --- /dev/null +++ b/openssl/util/indent.pro @@ -0,0 +1,751 @@ +-bap +-bbo +-br +-brs +-c33 +-cd33 +-ce +-ci4 +-cli0 +-cp33 +-d0 +-di1 +-hnl +-i4 +-il1 +-ip0 +-l78 +-lp +-nbad +-nbc +-ncdb +-ncs +-nfc1 +-nfca +-npcs +-nprs +-npsl +-nsc +-ppi1 +-saf +-sai +-saw +-sob +-ss +-ts0 +-T ACCESS_DESCRIPTION +-T ADDED_OBJ +-T AEP_BBOOL +-T AEP_CHAR +-T AEP_CHAR_PTR +-T AEP_CONNECTION_ENTRY +-T AEP_CONNECTION_HNDL +-T AEP_CONNECTION_HNDL_PTR +-T AEP_FLAGS +-T AEP_RV +-T AEP_TRANSACTION_ID +-T AEP_TRANSACTION_ID_PTR +-T AEP_U16 +-T AEP_U32 +-T AEP_U32_PTR +-T AEP_U64_PTR +-T AEP_U8 +-T AEP_U8_PTR +-T AEP_VOID_PTR +-T AEP_VOID_PTR_PTR +-T AES_KEY +-T APP_INFO +-T ARGS +-T ASIdOrRange +-T ASIdOrRanges +-T ASIdentifierChoice +-T ASIdentifiers +-T ASN1_ADB +-T ASN1_ADB_TABLE +-T ASN1_AUX +-T ASN1_BIT_STRING +-T ASN1_BMPSTRING +-T ASN1_BOOLEAN +-T ASN1_COMPAT_FUNCS +-T ASN1_CTX +-T ASN1_ENCODING +-T ASN1_ENUMERATED +-T ASN1_EXTERN_FUNCS +-T ASN1_GENERALIZEDTIME +-T ASN1_GENERALSTRING +-T ASN1_IA5STRING +-T ASN1_INTEGER +-T ASN1_ITEM +-T ASN1_ITEM_EXP +-T ASN1_NULL +-T ASN1_OBJECT +-T ASN1_OCTET_STRING +-T ASN1_PCTX +-T ASN1_PRIMITIVE_FUNCS +-T ASN1_PRINTABLESTRING +-T ASN1_PRINT_ARG +-T ASN1_SCTX +-T ASN1_STREAM_ARG +-T ASN1_STRING +-T ASN1_STRING_TABLE +-T ASN1_T61STRING +-T ASN1_TEMPLATE +-T ASN1_TIME +-T ASN1_TLC +-T ASN1_TYPE +-T ASN1_UNIVERSALSTRING +-T ASN1_UTCTIME +-T ASN1_UTF8STRING +-T ASN1_VALUE +-T ASN1_VISIBLESTRING +-T ASN1_const_CTX +-T AUTHORITY_INFO_ACCESS +-T AUTHORITY_KEYID +-T BASIC_CONSTRAINTS +-T BF_KEY +-T BF_LONG +-T BIGNUM +-T BIO +-T BIO_ACCEPT +-T BIO_ASN1_BUF_CTX +-T BIO_ASN1_EX_FUNCS +-T BIO_B64_CTX +-T BIO_CONNECT +-T BIO_ENC_CTX +-T BIO_F_BUFFER_CTX +-T BIO_LINEBUFFER_CTX +-T BIO_METHOD +-T BIO_OK_CTX +-T BIO_SSL +-T BIT_STRING_BITNAME +-T BN_BLINDING +-T BN_CTX +-T BN_GENCB +-T BN_MONT_CTX +-T BN_POOL +-T BN_POOL_ITEM +-T BN_RECP_CTX +-T BN_STACK +-T BN_ULONG +-T BUF_MEM +-T BY_DIR +-T BY_DIR_ENTRY +-T BY_DIR_HASH +-T Bytef +-T CAMELLIA_KEY +-T CAST_KEY +-T CAST_LONG +-T CA_DB +-T CCM128_CONTEXT +-T CERT +-T CERTIFICATEPOLICIES +-T CERT_PKEY +-T CIPHER_ORDER +-T CMAC_CTX +-T CMS_AuthenticatedData +-T CMS_CertificateChoices +-T CMS_CompressedData +-T CMS_ContentInfo +-T CMS_DigestedData +-T CMS_EncapsulatedContentInfo +-T CMS_EncryptedContentInfo +-T CMS_EncryptedData +-T CMS_EnvelopedData +-T CMS_IssuerAndSerialNumber +-T CMS_KEKIdentifier +-T CMS_KEKRecipientInfo +-T CMS_KeyAgreeRecipientIdentifier +-T CMS_KeyAgreeRecipientInfo +-T CMS_KeyTransRecipientInfo +-T CMS_OriginatorIdentifierOrKey +-T CMS_OriginatorInfo +-T CMS_OriginatorPublicKey +-T CMS_OtherCertificateFormat +-T CMS_OtherKeyAttribute +-T CMS_OtherRecipientInfo +-T CMS_OtherRevocationInfoFormat +-T CMS_PasswordRecipientInfo +-T CMS_Receipt +-T CMS_ReceiptRequest +-T CMS_ReceiptsFrom +-T CMS_RecipientEncryptedKey +-T CMS_RecipientIdentifier +-T CMS_RecipientInfo +-T CMS_RecipientKeyIdentifier +-T CMS_RevocationInfoChoice +-T CMS_SignedData +-T CMS_SignerIdentifier +-T CMS_SignerInfo +-T COMP_CTX +-T COMP_METHOD +-T CONF +-T CONF_IMODULE +-T CONF_METHOD +-T CONF_MODULE +-T CONF_VALUE +-T CRYPTO_EX_DATA +-T CRYPTO_EX_DATA_FUNCS +-T CRYPTO_EX_DATA_IMPL +-T CRYPTO_EX_dup +-T CRYPTO_EX_dup +-T CRYPTO_EX_free +-T CRYPTO_EX_free +-T CRYPTO_EX_new +-T CRYPTO_EX_new +-T CRYPTO_MEM_LEAK_CB +-T CRYPTO_THREADID +-T CRYPTO_dynlock_value +-T DB_ATTR +-T DES_LONG +-T DES_cblock +-T DES_key_schedule +-T DH +-T DH_METHOD +-T DH_PKEY_CTX +-T DIST_POINT +-T DIST_POINT_NAME +-T DRBG_CTX +-T DSA +-T DSA_METHOD +-T DSA_SIG +-T DSO +-T DSO_FUNC_TYPE +-T DSO_MERGER_FUNC +-T DSO_METHOD +-T DSO_NAME_CONVERTER_FUNC +-T DSO_VMS_INTERNAL +-T DTLS1_BITMAP +-T DTLS1_RECORD_DATA +-T DTLS1_STATE +-T Dl_info +-T ECDH_DATA +-T ECDH_METHOD +-T ECDSA_DATA +-T ECDSA_METHOD +-T ECDSA_SIG +-T ECPARAMETERS +-T ECPKPARAMETERS +-T EC_EXTRA_DATA +-T EC_GROUP +-T EC_KEY +-T EC_METHOD +-T EC_POINT +-T EC_PRE_COMP +-T EC_PRIVATEKEY +-T EC_builtin_curve +-T EDIPARTYNAME +-T ENGINE +-T ENGINE_CIPHERS_PTR +-T ENGINE_CLEANUP_CB +-T ENGINE_CLEANUP_ITEM +-T ENGINE_CMD_DEFN +-T ENGINE_CTRL_FUNC_PTR +-T ENGINE_DIGESTS_PTR +-T ENGINE_GEN_FUNC_PTR +-T ENGINE_GEN_INT_FUNC_PTR +-T ENGINE_LOAD_KEY_PTR +-T ENGINE_PILE +-T ENGINE_PILE_DOALL +-T ENGINE_PKEY_ASN1_METHS_PTR +-T ENGINE_PKEY_METHS_PTR +-T ENGINE_SSL_CLIENT_CERT_PTR +-T ENGINE_TABLE +-T ENUMERATED_NAMES +-T ERR_FNS +-T ERR_STATE +-T ERR_STRING_DATA +-T ESS_CERT_ID +-T ESS_ISSUER_SERIAL +-T ESS_SIGNING_CERT +-T EVP_AES_HMAC_SHA1 +-T EVP_AES_HMAC_SHA256 +-T EVP_CIPHER +-T EVP_CIPHER_CTX +-T EVP_CIPHER_INFO +-T EVP_ENCODE_CTX +-T EVP_MD +-T EVP_MD_CTX +-T EVP_PBE_CTL +-T EVP_PBE_KEYGEN +-T EVP_PKEY +-T EVP_PKEY_ASN1_METHOD +-T EVP_PKEY_CTX +-T EVP_PKEY_METHOD +-T EVP_PKEY_gen_cb +-T EX_CLASS_ITEM +-T E_GMP_RSA_CTX +-T E_RSAX_MOD_CTX +-T FILE +-T F_DIGITALSIGNATUREVERIFY +-T F_PUBLICKEYEXTRACT +-T GCM128_CONTEXT +-T GENERAL_NAME +-T GENERAL_NAMES +-T GENERAL_SUBTREE +-T GEN_SESSION_CB +-T HASH_CTX +-T HEAPENTRY32 +-T HEAPLIST32 +-T HEARTBEAT_TEST_FIXTURE +-T HMAC_CTX +-T ICA_KEY_RSA_CRT +-T ICA_KEY_RSA_CRT_REC +-T ICA_KEY_RSA_MODEXPO +-T ICA_KEY_RSA_MODEXPO_REC +-T IDEA_KEY_SCHEDULE +-T IPAddrBlocks +-T IPAddressFamily +-T IPAddressOrRange +-T IPAddressOrRanges +-T ISSUING_DIST_POINT +-T JPAKE_CTX +-T JPAKE_STEP1 +-T JPAKE_STEP2 +-T JPAKE_STEP3A +-T JPAKE_STEP3B +-T JPAKE_STEP_PART +-T JPAKE_ZKP +-T KEY_TABLE_TYPE +-T KRB5_APREQBODY +-T KRB5_AUTHDATA +-T KRB5_AUTHENTBODY +-T KRB5_CHECKSUM +-T KRB5_ENCDATA +-T KRB5_ENCKEY +-T KRB5_PRINCNAME +-T KRB5_TKTBODY +-T KSSL_CTX +-T KSSL_ERR +-T LHASH +-T LHASH_COMP_FN_TYPE +-T LHASH_DOALL_ARG_FN_TYPE +-T LHASH_DOALL_FN_TYPE +-T LHASH_HASH_FN_TYPE +-T LHASH_NODE +-T LPDIR_CTX +-T LPHEAPENTRY32 +-T LPHEAPLIST32 +-T LPMODULEENTRY32 +-T LPMODULEENTRY32W +-T LPPROCESSENTRY32 +-T LPPROCESSENTRY32W +-T LPTHREADENTRY32 +-T LP_DIR_CTX +-T MD2_CTX +-T MD4_CTX +-T MD5_CTX +-T MDC2_CTX +-T MD_DATA +-T MEM +-T MEM_LEAK +-T MEM_OBJECT_DATA +-T MIME_HEADER +-T MIME_PARAM +-T MODULEENTRY32 +-T MODULEENTRY32W +-T MS_FAR +-T NAME_CONSTRAINTS +-T NAME_FUNCS +-T NBIO_TEST +-T NDEF_SUPPORT +-T NETSCAPE_CERT_SEQUENCE +-T NETSCAPE_ENCRYPTED_PKEY +-T NETSCAPE_PKEY +-T NETSCAPE_SPKAC +-T NETSCAPE_SPKI +-T NETSCAPE_X509 +-T NET_API_FUNCTION +-T NOTICEREF +-T OBJ_NAME +-T OCB128_CONTEXT +-T OCB_BLOCK +-T OCSP_BASICRESP +-T OCSP_CERTID +-T OCSP_CERTSTATUS +-T OCSP_CRLID +-T OCSP_ONEREQ +-T OCSP_REQINFO +-T OCSP_REQUEST +-T OCSP_REQ_CTX +-T OCSP_RESPBYTES +-T OCSP_RESPDATA +-T OCSP_RESPID +-T OCSP_RESPONSE +-T OCSP_REVOKEDINFO +-T OCSP_SERVICELOC +-T OCSP_SIGNATURE +-T OCSP_SINGLERESP +-T OCSP_TBLSTR +-T OPENSSL_BLOCK +-T OPENSSL_CSTRING +-T OPENSSL_DIR_CTX +-T OPENSSL_ITEM +-T OPENSSL_PSTRING +-T OPENSSL_STRING +-T OPENSSL_STRING +-T OTHERNAME +-T P256_POINT +-T P256_POINT_AFFINE +-T PBE2PARAM +-T PBEPARAM +-T PBKDF2PARAM +-T PCRYPTO_MEM_LEAK_CB +-T PEM_CTX +-T PEM_ENCODE_SEAL_CTX +-T PEM_USER +-T PHEAPENTRY32 +-T PHEAPLIST32 +-T PKCS12 +-T PKCS12_BAGS +-T PKCS12_SAFEBAG +-T PKCS7 +-T PKCS7_DIGEST +-T PKCS7_ENCRYPT +-T PKCS7_ENC_CONTENT +-T PKCS7_ENVELOPE +-T PKCS7_ISSUER_AND_SERIAL +-T PKCS7_RECIP_INFO +-T PKCS7_SIGNED +-T PKCS7_SIGNER_INFO +-T PKCS7_SIGN_ENVELOPE +-T PKCS8_PRIV_KEY_INFO +-T PKEY_USAGE_PERIOD +-T PMODULEENTRY32 +-T PMODULEENTRY32W +-T POLICYINFO +-T POLICYQUALINFO +-T POLICY_CONSTRAINTS +-T POLICY_MAPPING +-T POLICY_MAPPINGS +-T PPROCESSENTRY32 +-T PPROCESSENTRY32W +-T PRECOMP256_ROW +-T PROCESSENTRY32 +-T PROCESSENTRY32W +-T PROXY_CERT_INFO_EXTENSION +-T PROXY_POLICY +-T PTHREADENTRY32 +-T PW_CB_DATA +-T RAND_METHOD +-T RC2_KEY +-T RC4_KEY +-T RC5_32_KEY +-T RIPEMD160_CTX +-T RSA +-T RSA_METHOD +-T RSA_OAEP_PARAMS +-T RSA_PKEY_CTX +-T RSA_PSS_PARAMS +-T SCT +-T SEED_KEY_SCHEDULE +-T SESS_CERT +-T SHA256_CTX +-T SHA512_CTX +-T SHA_CTX +-T SRP_ARG +-T SRP_CLIENT_ARG +-T SRP_CTX +-T SRP_SERVER_ARG +-T SRP_VBASE +-T SRP_gN_cache +-T SRP_user_pwd +-T SRTP_PROTECTION_PROFILE +-T SSL +-T SSL2_STATE +-T SSL3_BUFFER +-T SSL3_BUF_FREELIST +-T SSL3_BUF_FREELIST_ENTRY +-T SSL3_COMP +-T SSL3_ENC_METHOD +-T SSL3_RECORD +-T SSL3_STATE +-T SSL_CIPHER +-T SSL_COMP +-T SSL_CONF_CTX +-T SSL_CTX +-T SSL_EXCERT +-T SSL_METHOD +-T SSL_SESSION +-T SSL_SESSION_ASN1 +-T STACK_OF +-T STORE +-T STORE_ATTR_INFO +-T STORE_ATTR_TYPES +-T STORE_CERTIFICATE_STATUS +-T STORE_CLEANUP_FUNC_PTR +-T STORE_CTRL_FUNC_PTR +-T STORE_END_OBJECT_FUNC_PTR +-T STORE_GENERATE_OBJECT_FUNC_PTR +-T STORE_GENERIC_FUNC_PTR +-T STORE_GET_OBJECT_FUNC_PTR +-T STORE_HANDLE_OBJECT_FUNC_PTR +-T STORE_INITIALISE_FUNC_PTR +-T STORE_METHOD +-T STORE_MODIFY_OBJECT_FUNC_PTR +-T STORE_NEXT_OBJECT_FUNC_PTR +-T STORE_OBJECT +-T STORE_OBJECT_TYPES +-T STORE_PARAM_TYPES +-T STORE_START_OBJECT_FUNC_PTR +-T STORE_STORE_OBJECT_FUNC_PTR +-T SW_ALGTYPE +-T SW_BYTE +-T SW_COMMAND_BITMAP +-T SW_COMMAND_CODE +-T SW_CONTEXT_HANDLE +-T SW_CRT +-T SW_DSA +-T SW_EXP +-T SW_LARGENUMBER +-T SW_NVDATA +-T SW_OSHANDLE +-T SW_PARAM +-T SW_STATE +-T SW_STATUS +-T SW_U16 +-T SW_U32 +-T SW_U64 +-T SXNET +-T SXNETID +-T TCHAR +-T TEST_INFO +-T THREADENTRY32 +-T TIMEOUT_PARAM +-T TLS_SESSION_TICKET_EXT +-T TLS_SIGALGS +-T TS_ACCURACY +-T TS_MSG_IMPRINT +-T TS_REQ +-T TS_RESP +-T TS_RESP_CTX +-T TS_STATUS_INFO +-T TS_TST_INFO +-T TS_VERIFY_CTX +-T TXT_DB +-T UI +-T UINT64 +-T UI_METHOD +-T UI_STRING +-T USERNOTICE +-T WCHAR +-T WHIRLPOOL_CTX +-T WINAPI +-T WSAAPI +-T X509 +-T X509V3_CONF_METHOD +-T X509V3_CTX +-T X509V3_EXT_D2I +-T X509V3_EXT_FREE +-T X509V3_EXT_I2D +-T X509V3_EXT_I2R +-T X509V3_EXT_I2S +-T X509V3_EXT_METHOD +-T X509V3_EXT_NEW +-T X509V3_EXT_R2I +-T X509V3_EXT_S2I +-T X509V3_EXT_V2I +-T X509_ALGOR +-T X509_ATTRIBUTE +-T X509_CERT_AUX +-T X509_CERT_FILE_CTX +-T X509_CERT_PAIR +-T X509_CINF +-T X509_CRL +-T X509_CRL_INFO +-T X509_CRL_METHOD +-T X509_EXTENSION +-T X509_INFO +-T X509_LOOKUP +-T X509_LOOKUP_METHOD +-T X509_NAME +-T X509_NAME_ENTRY +-T X509_OBJECT +-T X509_OBJECTS +-T X509_PKEY +-T X509_POLICY_CACHE +-T X509_POLICY_DATA +-T X509_POLICY_LEVEL +-T X509_POLICY_NODE +-T X509_POLICY_TREE +-T X509_PUBKEY +-T X509_PURPOSE +-T X509_REQ +-T X509_REQ_INFO +-T X509_REVOKED +-T X509_SIG +-T X509_STORE +-T X509_STORE_CTX +-T X509_TRUST +-T X509_VAL +-T X509_VERIFY_PARAM +-T X509_VERIFY_PARAM_ID +-T X9_62_CHARACTERISTIC_TWO +-T X9_62_CURVE +-T X9_62_FIELDID +-T X9_62_PENTANOMIAL +-T XTS128_CONTEXT +-T ZEN_MD_DATA +-T _LHASH +-T _STACK +-T __int64 +-T _ossl_old_des_cblock +-T asn1_ps_func +-T bio_dgram_data +-T bio_info_cb +-T char_io +-T conf_finish_func +-T conf_init_func +-T const_DES_cblock +-T d2i_of_void +-T des_cblock +-T dynamic_data_ctx +-T dynamic_fns +-T engine_table_doall_cb +-T i2d_of_void +-T int_dhx942_dh +-T nid_triple +-T pem_password_cb +-T pitem +-T piterator +-T pqueue_s +-T session_op +-T size_t +-T tag_exp_arg +-T testdata +-T time_t +-T time_t +-T u32 +-T u64 +-T u8 +-T v3_ext_ctx +-T v3_ext_method +-T STACK_OF_ACCESS_DESCRIPTION_ +-T STACK_OF_ASIdOrRange_ +-T STACK_OF_ASN1_ADB_TABLE_ +-T STACK_OF_ASN1_INTEGER_ +-T STACK_OF_ASN1_OBJECT_ +-T STACK_OF_ASN1_STRING_TABLE_ +-T STACK_OF_ASN1_TYPE_ +-T STACK_OF_ASN1_UTF8STRING_ +-T STACK_OF_ASN1_VALUE_ +-T STACK_OF_BIO_ +-T STACK_OF_BY_DIR_ENTRY_ +-T STACK_OF_BY_DIR_HASH_ +-T STACK_OF_CMS_CertificateChoices_ +-T STACK_OF_CMS_RecipientEncryptedKey_ +-T STACK_OF_CMS_RecipientInfo_ +-T STACK_OF_CMS_RevocationInfoChoice_ +-T STACK_OF_CMS_SignerInfo_ +-T STACK_OF_CONF_IMODULE_ +-T STACK_OF_CONF_MODULE_ +-T STACK_OF_CONF_VALUE_ +-T STACK_OF_CRYPTO_EX_DATA_FUNCS_ +-T STACK_OF_CRYPTO_dynlock_ +-T STACK_OF_DIST_POINT_ +-T STACK_OF_ENGINE_ +-T STACK_OF_ENGINE_CLEANUP_ITEM_ +-T STACK_OF_ESS_CERT_ID_ +-T STACK_OF_EVP_PBE_CTL_ +-T STACK_OF_EVP_PKEY_ASN1_METHOD_ +-T STACK_OF_EVP_PKEY_METHOD_ +-T STACK_OF_GENERAL_NAMES_ +-T STACK_OF_GENERAL_NAME_ +-T STACK_OF_GENERAL_SUBTREE_ +-T STACK_OF_IPAddressFamily_ +-T STACK_OF_IPAddressOrRange_ +-T STACK_OF_KRB5_APREQBODY_ +-T STACK_OF_KRB5_AUTHENTBODY_ +-T STACK_OF_KRB5_TKTBODY_ +-T STACK_OF_MEM_OBJECT_DATA_ +-T STACK_OF_MIME_HEADER_ +-T STACK_OF_MIME_PARAM_ +-T STACK_OF_NAME_FUNCS_ +-T STACK_OF_OCSP_CERTID_ +-T STACK_OF_OCSP_ONEREQ_ +-T STACK_OF_OCSP_RESPID_ +-T STACK_OF_OCSP_SINGLERESP_ +-T STACK_OF_OPENSSL_BLOCK_ +-T STACK_OF_OPENSSL_PSTRING_ +-T STACK_OF_OPENSSL_STRING_ +-T STACK_OF_PKCS12_SAFEBAG_ +-T STACK_OF_PKCS7_ +-T STACK_OF_PKCS7_RECIP_INFO_ +-T STACK_OF_PKCS7_SIGNER_INFO_ +-T STACK_OF_POLICYINFO_ +-T STACK_OF_POLICYQUALINFO_ +-T STACK_OF_POLICY_MAPPING_ +-T STACK_OF_Request_ +-T STACK_OF_SCT_ +-T STACK_OF_SRP_gN_ +-T STACK_OF_SRP_gN_cache_ +-T STACK_OF_SRP_user_pwd_ +-T STACK_OF_SRTP_PROTECTION_PROFILE_ +-T STACK_OF_SSL_CIPHER_ +-T STACK_OF_SSL_COMP_ +-T STACK_OF_STORE_ATTR_INFO_ +-T STACK_OF_STRING_ +-T STACK_OF_SXNETID_ +-T STACK_OF_SingleResponse_ +-T STACK_OF_UI_STRING_ +-T STACK_OF_X509V3_EXT_METHOD_ +-T STACK_OF_X509_ +-T STACK_OF_X509_ALGOR_ +-T STACK_OF_X509_ATTRIBUTE_ +-T STACK_OF_X509_CRL_ +-T STACK_OF_X509_EXTENSION_ +-T STACK_OF_X509_INFO_ +-T STACK_OF_X509_LOOKUP_ +-T STACK_OF_X509_NAME_ +-T STACK_OF_X509_NAME_ENTRY_ +-T STACK_OF_X509_OBJECT_ +-T STACK_OF_X509_POLICY_DATA_ +-T STACK_OF_X509_POLICY_NODE_ +-T STACK_OF_X509_PURPOSE_ +-T STACK_OF_X509_REVOKED_ +-T STACK_OF_X509_TRUST_ +-T STACK_OF_X509_VERIFY_PARAM_ +-T STACK_OF_nid_triple_ +-T STACK_OF_void_ +-T LHASH_OF_ADDED_OBJ_ +-T LHASH_OF_APP_INFO_ +-T LHASH_OF_CONF_VALUE_ +-T LHASH_OF_ENGINE_PILE_ +-T LHASH_OF_ERR_STATE_ +-T LHASH_OF_ERR_STRING_DATA_ +-T LHASH_OF_EX_CLASS_ITEM_ +-T LHASH_OF_FUNCTION_ +-T LHASH_OF_MEM_ +-T LHASH_OF_OBJ_NAME_ +-T LHASH_OF_OPENSSL_STRING_ +-T LHASH_OF_SSL_SESSION_ +-T LHASH_OF_STRING_ +-T clock_t +-T custom_ext_methods +-T hm_fragment +-T krb5_auth_context +-T krb5_authdata +-T KRB5_CALLCONV +-T krb5_ccache +-T krb5_context +-T krb5_creds +-T krb5_data +-T krb5_deltat +-T krb5_flags +-T krb5_int32 +-T krb5_keyblock +-T krb5_keytab +-T krb5_keytab_entry +-T krb5_octet +-T krb5_principal +-T krb5_principal_data +-T krb5_rcache +-T krb5_ticket +-T krb5_ticket_times +-T krb5_timestamp +-T record_pqueue +-T ssl_ctx_st +-T ssl_flag_tbl +-T ssl_st +-T ssl_trace_tbl +-T _stdcall +-T tls12_lookup diff --git a/openssl/util/libeay.num b/openssl/util/libeay.num index aa86b2b8b..4a11d7827 100644 --- a/openssl/util/libeay.num +++ b/openssl/util/libeay.num @@ -1807,6 +1807,7 @@ ASN1_UTCTIME_get 2350 NOEXIST::FUNCTION: X509_REQ_digest 2362 EXIST::FUNCTION:EVP X509_CRL_digest 2391 EXIST::FUNCTION:EVP d2i_ASN1_SET_OF_PKCS7 2397 NOEXIST::FUNCTION: +X509_ALGOR_cmp 2398 EXIST::FUNCTION: EVP_CIPHER_CTX_set_key_length 2399 EXIST::FUNCTION: EVP_CIPHER_CTX_ctrl 2400 EXIST::FUNCTION: BN_mod_exp_mont_word 2401 EXIST::FUNCTION: @@ -4280,7 +4281,7 @@ CRYPTO_ccm128_decrypt 4648 EXIST::FUNCTION: CRYPTO_ccm128_aad 4649 EXIST::FUNCTION: CRYPTO_gcm128_init 4650 EXIST::FUNCTION: CRYPTO_gcm128_decrypt 4651 EXIST::FUNCTION: -ENGINE_load_rsax 4652 EXIST::FUNCTION:ENGINE +ENGINE_load_rsax 4652 NOEXIST::FUNCTION: CRYPTO_gcm128_decrypt_ctr32 4653 EXIST::FUNCTION: CRYPTO_gcm128_encrypt_ctr32 4654 EXIST::FUNCTION: CRYPTO_gcm128_finish 4655 EXIST::FUNCTION: @@ -4312,3 +4313,102 @@ BIO_dgram_sctp_wait_for_dry 4679 EXIST::FUNCTION:SCTP BIO_s_datagram_sctp 4680 EXIST::FUNCTION:DGRAM,SCTP BIO_dgram_is_sctp 4681 EXIST::FUNCTION:SCTP BIO_dgram_sctp_notification_cb 4682 EXIST::FUNCTION:SCTP +i2d_DHxparams 4683 EXIST::FUNCTION:DH +EC_curve_nist2nid 4684 EXIST::FUNCTION:EC +DH_get_1024_160 4685 EXIST::FUNCTION:DH +PEM_write_DHxparams 4686 EXIST:!WIN16:FUNCTION:DH +d2i_DHxparams 4687 EXIST::FUNCTION:DH +EC_curve_nid2nist 4688 EXIST::FUNCTION:EC +DH_get_2048_256 4689 EXIST::FUNCTION:DH +PEM_write_bio_DHxparams 4690 EXIST::FUNCTION:DH +DH_get_2048_224 4691 EXIST::FUNCTION:DH +X509_chain_check_suiteb 4692 EXIST::FUNCTION: +X509_chain_up_ref 4693 EXIST::FUNCTION: +X509_VERIFY_PARAM_set1_ip_asc 4694 EXIST::FUNCTION: +X509_CRL_check_suiteb 4695 EXIST::FUNCTION: +X509_VERIFY_PARAM_set1_email 4696 EXIST::FUNCTION: +X509_check_email 4697 EXIST::FUNCTION: +X509_check_host 4698 EXIST::FUNCTION: +X509_check_ip_asc 4699 EXIST::FUNCTION: +X509_get0_signature 4700 EXIST::FUNCTION: +X509_get_signature_nid 4701 EXIST::FUNCTION: +X509_VERIFY_PARAM_set1_host 4702 EXIST::FUNCTION: +X509_VERIFY_PARAM_set1_ip 4703 EXIST::FUNCTION: +X509_check_ip 4704 EXIST::FUNCTION: +X509_STORE_set_lookup_crls_cb 4705 EXIST::FUNCTION: +X509_CRL_diff 4706 EXIST::FUNCTION: +X509_CRL_http_nbio 4707 EXIST::FUNCTION:EVP +OCSP_REQ_CTX_i2d 4708 EXIST::FUNCTION: +OCSP_REQ_CTX_get0_mem_bio 4709 EXIST::FUNCTION: +X509_STORE_CTX_get0_store 4710 EXIST::FUNCTION: +X509_REVOKED_dup 4711 EXIST::FUNCTION: +CMS_RecipientInfo_encrypt 4712 EXIST::FUNCTION:CMS +OCSP_REQ_CTX_http 4713 EXIST::FUNCTION: +OCSP_REQ_CTX_nbio 4714 EXIST::FUNCTION: +X509_http_nbio 4715 EXIST::FUNCTION:EVP +OCSP_set_max_response_length 4716 EXIST::FUNCTION: +OCSP_REQ_CTX_new 4717 EXIST::FUNCTION: +OCSP_REQ_CTX_nbio_d2i 4718 EXIST::FUNCTION: +EVP_aes_256_wrap 4719 EXIST::FUNCTION:AES +CRYPTO_128_wrap 4720 EXIST::FUNCTION: +RSA_OAEP_PARAMS_new 4721 EXIST::FUNCTION:RSA +CRYPTO_128_unwrap 4722 EXIST::FUNCTION: +ECDSA_METHOD_set_name 4723 EXIST::FUNCTION:ECDSA +CMS_RecipientInfo_kari_decrypt 4724 EXIST::FUNCTION:CMS +CMS_SignerInfo_get0_pkey_ctx 4725 EXIST::FUNCTION:CMS +ECDSA_METHOD_set_flags 4726 EXIST::FUNCTION:ECDSA +ECDSA_METHOD_set_sign_setup 4727 EXIST::FUNCTION:ECDSA +CMS_RecipientInfo_kari_orig_id_cmp 4728 EXIST:!VMS:FUNCTION:CMS +CMS_RecipInfo_kari_orig_id_cmp 4728 EXIST:VMS:FUNCTION:CMS +CMS_RecipientInfo_kari_get0_alg 4729 EXIST::FUNCTION:CMS +EVP_aes_192_wrap 4730 EXIST::FUNCTION:AES +EVP_aes_128_cbc_hmac_sha256 4731 EXIST::FUNCTION:AES,SHA256 +DH_compute_key_padded 4732 EXIST::FUNCTION:DH +ECDSA_METHOD_set_sign 4733 EXIST::FUNCTION:ECDSA +CMS_RecipientEncryptedKey_cert_cmp 4734 EXIST:!VMS:FUNCTION:CMS +CMS_RecipEncryptedKey_cert_cmp 4734 EXIST:VMS:FUNCTION:CMS +DH_KDF_X9_42 4735 EXIST::FUNCTION:DH +RSA_OAEP_PARAMS_free 4736 EXIST::FUNCTION:RSA +EVP_des_ede3_wrap 4737 EXIST::FUNCTION:DES +RSA_OAEP_PARAMS_it 4738 EXIST:!EXPORT_VAR_AS_FUNCTION:VARIABLE:RSA +RSA_OAEP_PARAMS_it 4738 EXIST:EXPORT_VAR_AS_FUNCTION:FUNCTION:RSA +ASN1_TIME_diff 4739 EXIST::FUNCTION: +EVP_aes_256_cbc_hmac_sha256 4740 EXIST::FUNCTION:AES,SHA256 +CMS_SignerInfo_get0_signature 4741 EXIST::FUNCTION:CMS +CMS_RecipientInfo_kari_get0_reks 4742 EXIST:!VMS:FUNCTION:CMS +CMS_RecipInfo_kari_get0_reks 4742 EXIST:VMS:FUNCTION:CMS +EVP_aes_128_wrap 4743 EXIST::FUNCTION:AES +CMS_SignerInfo_get0_md_ctx 4744 EXIST::FUNCTION:CMS +OPENSSL_gmtime_diff 4745 EXIST::FUNCTION: +CMS_RecipientInfo_kari_set0_pkey 4746 EXIST:!VMS:FUNCTION:CMS +CMS_RecipInfo_kari_set0_pkey 4746 EXIST:VMS:FUNCTION:CMS +i2d_RSA_OAEP_PARAMS 4747 EXIST::FUNCTION:RSA +d2i_RSA_OAEP_PARAMS 4748 EXIST::FUNCTION:RSA +ECDH_KDF_X9_62 4749 EXIST::FUNCTION:ECDH +CMS_RecipientInfo_kari_get0_ctx 4750 EXIST::FUNCTION:CMS +ECDSA_METHOD_new 4751 EXIST::FUNCTION:ECDSA +CMS_RecipientInfo_get0_pkey_ctx 4752 EXIST::FUNCTION:CMS +CMS_RecipientEncryptedKey_get0_id 4753 EXIST:!VMS:FUNCTION:CMS +CMS_RecipEncryptedKey_get0_id 4753 EXIST:VMS:FUNCTION:CMS +RSA_padding_check_PKCS1_OAEP_mgf1 4754 EXIST:!VMS:FUNCTION:RSA +RSA_pad_check_PKCS1_OAEP_mgf1 4754 EXIST:VMS:FUNCTION:RSA +ECDSA_METHOD_set_verify 4755 EXIST::FUNCTION:ECDSA +CMS_SharedInfo_encode 4756 EXIST::FUNCTION:CMS +RSA_padding_add_PKCS1_OAEP_mgf1 4757 EXIST::FUNCTION:RSA +CMS_RecipientInfo_kari_get0_orig_id 4758 EXIST:!VMS:FUNCTION:CMS +CMS_RecipInfo_kari_get0_orig_id 4758 EXIST:VMS:FUNCTION:CMS +ECDSA_METHOD_free 4759 EXIST::FUNCTION:ECDSA +X509_VERIFY_PARAM_get_count 4760 EXIST::FUNCTION: +X509_VERIFY_PARAM_get0_name 4761 EXIST::FUNCTION: +X509_VERIFY_PARAM_get0 4762 EXIST::FUNCTION: +X509V3_EXT_free 4763 EXIST::FUNCTION: +BIO_hex_string 4764 EXIST::FUNCTION: +X509_VERIFY_PARAM_set_hostflags 4765 EXIST::FUNCTION: +BUF_strnlen 4766 EXIST::FUNCTION: +X509_VERIFY_PARAM_get0_peername 4767 EXIST::FUNCTION: +ECDSA_METHOD_set_app_data 4768 EXIST::FUNCTION:ECDSA +sk_deep_copy 4769 EXIST::FUNCTION: +ECDSA_METHOD_get_app_data 4770 EXIST::FUNCTION:ECDSA +X509_VERIFY_PARAM_add1_host 4771 EXIST::FUNCTION: +EC_GROUP_get_mont_data 4772 EXIST::FUNCTION:EC +i2d_re_X509_tbs 4773 EXIST::FUNCTION: diff --git a/openssl/util/mk1mf.pl b/openssl/util/mk1mf.pl index f0c2df026..7d4491fae 100644 --- a/openssl/util/mk1mf.pl +++ b/openssl/util/mk1mf.pl @@ -2,8 +2,12 @@ # A bit of an evil hack but it post processes the file ../MINFO which # is generated by `make files` in the top directory. # This script outputs one mega makefile that has no shell stuff or any -# funny stuff -# +# funny stuff (if the target is not "copy"). +# If the target is "copy", then it tries to create a makefile that can be +# safely used with the -j flag and that is compatible with the top-level +# Makefile, in the sense that it uses the same options and assembler files etc. + +use Cwd; $INSTALLTOP="/usr/local/ssl"; $OPENSSLDIR="/usr/local/ssl"; @@ -28,6 +32,7 @@ my %mf_import = ( INSTALLTOP => \$INSTALLTOP, OPENSSLDIR => \$OPENSSLDIR, PLATFORM => \$mf_platform, + CC => \$mf_cc, CFLAG => \$mf_cflag, DEPFLAG => \$mf_depflag, CPUID_OBJ => \$mf_cpuid_asm, @@ -43,16 +48,18 @@ my %mf_import = ( RMD160_ASM_OBJ => \$mf_rmd_asm, WP_ASM_OBJ => \$mf_wp_asm, CMLL_ENC => \$mf_cm_asm, + MODES_ASM_OBJ => \$mf_modes_asm, + ENGINES_ASM_OBJ=> \$mf_engines_asm, BASEADDR => \$baseaddr, FIPSDIR => \$fipsdir, + EC_ASM => \$mf_ec_asm, ); - open(IN,"<Makefile") || die "unable to open Makefile!\n"; while(<IN>) { my ($mf_opt, $mf_ref); while (($mf_opt, $mf_ref) = each %mf_import) { - if (/^$mf_opt\s*=\s*(.*)$/) { + if (/^$mf_opt\s*=\s*(.*)$/ && !defined($$mfref)) { $$mf_ref = $1; } } @@ -83,7 +90,8 @@ $infile="MINFO"; "netware-libc", "CodeWarrior for NetWare - LibC - with WinSock Sockets", "netware-libc-bsdsock", "CodeWarrior for NetWare - LibC - with BSD Sockets", "default","cc under unix", - "auto", "auto detect from top level Makefile" + "auto", "auto detect from top level Makefile", + "copy", "copy from top level Makefile" ); $platform=""; @@ -162,7 +170,7 @@ $mkdir="-mkdir" unless defined $mkdir; $ranlib="echo ranlib"; $cc=(defined($VARS{'CC'}))?$VARS{'CC'}:'cc'; -$src_dir=(defined($VARS{'SRC'}))?$VARS{'SRC'}:'.'; +$src_dir=(defined($VARS{'SRC'}))?$VARS{'SRC'}: $platform eq 'copy' ? getcwd() : '.'; $bin_dir=(defined($VARS{'BIN'}))?$VARS{'BIN'}:''; # $bin_dir.=$o causes a core dump on my sparc :-( @@ -172,7 +180,8 @@ $NT=0; push(@INC,"util/pl","pl"); -if ($platform eq "auto") { +if ($platform eq "auto" || $platform eq 'copy') { + $orig_platform = $platform; $platform = $mf_platform; print STDERR "Imported platform $mf_platform\n"; } @@ -300,6 +309,11 @@ else ##else { $cflags="$c_flags$cflags" if ($c_flags ne ""); } +if ($orig_platform eq 'copy') { + $cflags = $mf_cflag; + $cc = $mf_cc; +} + $ex_libs="$l_flags$ex_libs" if ($l_flags ne ""); @@ -391,6 +405,14 @@ for (;;) } close(IN); +if ($orig_platform eq 'copy') + { + # Remove opensslconf.h so it doesn't get updated if we configure a + # different branch. + $exheader =~ s/[^ ]+\/opensslconf.h//; + $header =~ s/[^ ]+\/opensslconf.h//; + } + if ($shlib) { $extra_install= <<"EOF"; @@ -422,6 +444,7 @@ EOF } $defs= <<"EOF"; +# N.B. You MUST use -j on FreeBSD. # This makefile has been automatically generated from the OpenSSL distribution. # This single makefile will build the complete OpenSSL distribution and # by default leave the 'intertesting' output files in .${o}out and the stuff @@ -463,7 +486,7 @@ LINK=$link LFLAGS=$lflags RSC=$rsc -# The output directory for everything intersting +# The output directory for everything interesting OUT_D=$out_dir # The output directory for all the temporary muck TMP_D=$tmp_dir @@ -482,13 +505,14 @@ ASM=$bin_dir$asm # FIPS validated module and support file locations +E_PREMAIN_DSO=fips_premain_dso + FIPSDIR=$fipsdir BASEADDR=$baseaddr FIPSLIB_D=\$(FIPSDIR)${o}lib FIPS_PREMAIN_SRC=\$(FIPSLIB_D)${o}fips_premain.c O_FIPSCANISTER=\$(FIPSLIB_D)${o}fipscanister.lib FIPS_SHA1_EXE=\$(FIPSDIR)${o}bin${o}fips_standalone_sha1${exep} -E_PREMAIN_DSO=fips_premain_dso PREMAIN_DSO_EXE=\$(BIN_D)${o}fips_premain_dso$exep FIPSLINK=\$(PERL) \$(FIPSDIR)${o}bin${o}fipslink.pl @@ -563,8 +587,12 @@ $banner \$(INC_D): \$(MKDIR) \"\$(INC_D)\" +# This needs to be invoked once, when the makefile is first constructed, or +# after cleaning. +init: \$(TMP_D) \$(LIB_D) \$(INC_D) \$(INCO_D) \$(BIN_D) \$(TEST_D) headers + \$(PERL) \$(SRC_D)/util/copy-if-different.pl "\$(SRC_D)/crypto/opensslconf.h" "\$(INCO_D)/opensslconf.h" + headers: \$(HEADER) \$(EXHEADER) - @ lib: \$(LIBS_DEP) \$(E_SHLIB) @@ -582,11 +610,6 @@ install: all \$(CP) apps${o}openssl.cnf \"\$(OPENSSLDIR)\" $extra_install - -test: \$(T_EXE) - cd \$(BIN_D) - ..${o}ms${o}test - clean: \$(RM) \$(TMP_D)$o*.* @@ -594,8 +617,25 @@ vclean: \$(RM) \$(TMP_D)$o*.* \$(RM) \$(OUT_D)$o*.* +reallyclean: + \$(RM) -rf \$(TMP_D) + \$(RM) -rf \$(BIN_D) + \$(RM) -rf \$(TEST_D) + \$(RM) -rf \$(LIB_D) + \$(RM) -rf \$(INC_D) + +EOF + +if ($orig_platform ne 'copy') + { + $rules .= <<"EOF"; +test: \$(T_EXE) + cd \$(BIN_D) + ..${o}ms${o}test + EOF - + } + my $platform_cpp_symbol = "MK1MF_PLATFORM_$platform"; $platform_cpp_symbol =~ s/-/_/g; if (open(IN,"crypto/buildinf.h")) @@ -625,14 +665,14 @@ open (OUT,">>crypto/buildinf.h") || die "Can't open buildinf.h"; printf OUT <<EOF; #ifdef $platform_cpp_symbol /* auto-generated/updated by util/mk1mf.pl for crypto/cversion.c */ - #define CFLAGS "$cc $cflags" + #define CFLAGS "compiler: $cc $cflags" #define PLATFORM "$platform" EOF printf OUT " #define DATE \"%s\"\n", scalar gmtime(); printf OUT "#endif\n"; close(OUT); -# Strip of trailing ' ' +# Strip off trailing ' ' foreach (keys %lib_obj) { $lib_obj{$_}=&clean_up_ws($lib_obj{$_}); } $test=&clean_up_ws($test); $e_exe=&clean_up_ws($e_exe); @@ -662,21 +702,43 @@ if ($fips) { $rules.=&cc_compile_target("\$(OBJ_D)${o}\$(E_PREMAIN_DSO)$obj", "\$(FIPS_PREMAIN_SRC)", - "-DFINGERPRINT_PREMAIN_DSO_LOAD \$(SHLIB_CFLAGS)", ""); + "-DFINGERPRINT_PREMAIN_DSO_LOAD \$(APP_CFLAGS)", ""); $rules.=&do_link_rule("\$(PREMAIN_DSO_EXE)","\$(OBJ_D)${o}\$(E_PREMAIN_DSO)$obj \$(CRYPTOOBJ) \$(O_FIPSCANISTER)","","\$(EX_LIBS)", 1); } +sub fix_asm + { + my($asm, $dir) = @_; + + return '' if $asm eq ''; + + $asm = " $asm"; + $asm =~ s/\s+/ $dir\//g; + $asm =~ s/\.o//g; + $asm =~ s/^ //; + + return $asm . ' '; + } + +if ($orig_platform eq 'copy') { + $lib_obj{CRYPTO} .= fix_asm($mf_md5_asm, 'crypto/md5'); + $lib_obj{CRYPTO} .= fix_asm($mf_bn_asm, 'crypto/bn'); + # cpuid is included by the crypto dir + #$lib_obj{CRYPTO} .= fix_asm($mf_cpuid_asm, 'crypto'); + # AES asm files DON'T end up included by the aes dir itself + $lib_obj{CRYPTO} .= fix_asm($mf_aes_asm, 'crypto/aes'); + $lib_obj{CRYPTO} .= fix_asm($mf_sha_asm, 'crypto/sha'); + $lib_obj{CRYPTO} .= fix_asm($mf_engines_asm, 'engines'); + $lib_obj{CRYPTO} .= fix_asm($mf_rc4_asm, 'crypto/rc4'); + $lib_obj{CRYPTO} .= fix_asm($mf_modes_asm, 'crypto/modes'); + $lib_obj{CRYPTO} .= fix_asm($mf_ec_asm, 'crypto/ec'); +} + foreach (values %lib_nam) { $lib_obj=$lib_obj{$_}; local($slib)=$shlib; - if (($_ eq "SSL") && $no_ssl2 && $no_ssl3) - { - $rules.="\$(O_SSL):\n\n"; - next; - } - $defs.=&do_defs(${_}."OBJ",$lib_obj,"\$(OBJ_D)",$obj); $lib=($slib)?" \$(SHLIB_CFLAGS)".$shlib_ex_cflags{$_}:" \$(LIB_CFLAGS)"; $rules.=&do_compile_rule("\$(OBJ_D)",$lib_obj{$_},$lib); @@ -747,6 +809,8 @@ foreach (split(" ",$otherlibs)) $rules.=&do_link_rule("\$(BIN_D)$o\$(E_EXE)$exep","\$(E_OBJ)","\$(LIBS_DEP)","\$(L_LIBS) \$(EX_LIBS)", ($fips && !$shlib) ? 2 : 0); +$rules .= get_tests('test/Makefile') if $orig_platform eq 'copy'; + print $defs; if ($platform eq "linux-elf") { @@ -964,6 +1028,11 @@ sub do_compile_rule { $ret.=&Sasm_compile_target("$to${o}$n$obj",$s,$n); } + elsif (defined &special_compile_target and + ($s=special_compile_target($_))) + { + $ret.=$s; + } else { die "no rule for $_"; } } return($ret); @@ -974,6 +1043,10 @@ sub do_compile_rule sub perlasm_compile_target { my($target,$source,$bname)=@_; + + return platform_perlasm_compile_target($target, $source, $bname) + if defined &platform_perlasm_compile_target; + my($ret); $bname =~ s/(.*)\.[^\.]$/$1/; @@ -1005,9 +1078,13 @@ sub cc_compile_target $ex_flags.=" -DMK1MF_BUILD -D$platform_cpp_symbol" if ($source =~ /cversion/); $target =~ s/\//$o/g if $o ne "/"; $source =~ s/\//$o/g if $o ne "/"; - $srcd = "\$(SRC_D)$o" unless defined $srcd; + $srcd = "\$(SRC_D)$o" unless defined $srcd && $platform ne 'copy'; $ret ="$target: $srcd$source\n\t"; - $ret.="\$(CC) ${ofile}$target $ex_flags -c $srcd$source\n\n"; + $ret.="\$(CC)"; + $ret.= " -MMD" if $orig_platform eq "copy"; + $ret.= " ${ofile}$target $ex_flags -c $srcd$source\n\n"; + $target =~ s/\.o$/.d/; + $ret.=".sinclude \"$target\"\n\n" if $orig_platform eq "copy"; return($ret); } @@ -1072,17 +1149,22 @@ sub do_copy_rule if ($n =~ /bss_file/) { $pp=".c"; } else { $pp=$p; } - $ret.="$to${o}$n$pp: \$(SRC_D)$o$_$pp\n\t\$(CP) \"\$(SRC_D)$o$_$pp\" \"$to${o}$n$pp\"\n\n"; + $ret.="$to${o}$n$pp: \$(SRC_D)$o$_$pp\n\t\$(PERL) \$(SRC_D)${o}util${o}copy-if-different.pl \"\$(SRC_D)$o$_$pp\" \"$to${o}$n$pp\"\n\n"; } return($ret); } +# Options picked up from the OPTIONS line in the top level Makefile +# generated by Configure. + sub read_options { # Many options are handled in a similar way. In particular # no-xxx sets zero or more scalars to 1. - # Process these using a hash containing the option name and - # reference to the scalars to set. + # Process these using the %valid_options hash containing the option + # name and reference to the scalars to set. In some cases the option + # needs no special handling and can be ignored: this is done by + # setting the value to 0. my %valid_options = ( "no-rc2" => \$no_rc2, @@ -1116,11 +1198,12 @@ sub read_options "gaswin" => \$gaswin, "no-ssl2" => \$no_ssl2, "no-ssl3" => \$no_ssl3, + "no-ssl3-method" => 0, "no-tlsext" => \$no_tlsext, "no-srp" => \$no_srp, "no-cms" => \$no_cms, - "no-ec2m" => \$no_ec2m, "no-jpake" => \$no_jpake, + "no-ec2m" => \$no_ec2m, "no-ec_nistp_64_gcc_128" => 0, "no-err" => \$no_err, "no-sock" => \$no_sock, @@ -1151,9 +1234,12 @@ sub read_options "no-montasm" => 0, "no-shared" => 0, "no-store" => 0, - "no-unit-test" => 0, "no-zlib" => 0, "no-zlib-dynamic" => 0, + "no-ssl-trace" => 0, + "no-unit-test" => 0, + "no-libunbound" => 0, + "no-multiblock" => 0, "fips" => \$fips ); diff --git a/openssl/util/mkbuildinf.pl b/openssl/util/mkbuildinf.pl new file mode 100755 index 000000000..ffa8a3993 --- /dev/null +++ b/openssl/util/mkbuildinf.pl @@ -0,0 +1,35 @@ +#!/usr/local/bin/perl + +my ($cflags, $platform) = @ARGV; + +$cflags = "compiler: $cflags"; +$date = localtime(); +print <<"END_OUTPUT"; +#ifndef MK1MF_BUILD + /* auto-generated by util/mkbuildinf.pl for crypto/cversion.c */ + #define CFLAGS cflags + /* + * Generate CFLAGS as an array of individual characters. This is a + * workaround for the situation where CFLAGS gets too long for a C90 string + * literal + */ + static const char cflags[] = { +END_OUTPUT +my $ctr = 0; +foreach my $c (split //, $cflags) { + # Max 18 characters per line + if (($ctr++ % 18) == 0) { + if ($ctr != 1) { + print "\n"; + } + print " "; + } + print "'$c',"; +} +print <<"END_OUTPUT"; +'\\0' + }; + #define PLATFORM "platform: $platform" + #define DATE "built on: $date" +#endif +END_OUTPUT diff --git a/openssl/util/mkdef.pl b/openssl/util/mkdef.pl index 1eaa7b8ac..c57c7f748 100644 --- a/openssl/util/mkdef.pl +++ b/openssl/util/mkdef.pl @@ -107,6 +107,8 @@ my @known_algorithms = ( "RC2", "RC4", "RC5", "IDEA", "DES", "BF", "CAPIENG", # SSL v2 "SSL2", + # SSL v3 method + "SSL3_METHOD", # JPAKE "JPAKE", # NEXTPROTONEG @@ -119,8 +121,10 @@ my @known_algorithms = ( "RC2", "RC4", "RC5", "IDEA", "DES", "BF", "SCTP", # SRTP "SRTP", + # SSL TRACE + "SSL_TRACE", # Unit testing - "UNIT_TEST"); + "UNIT_TEST"); my $options=""; open(IN,"<Makefile") || die "unable to open Makefile!\n"; @@ -140,8 +144,8 @@ my $no_ec; my $no_ecdsa; my $no_ecdh; my $no_engine; my $no_hw; my $no_fp_api; my $no_static_engine=1; my $no_gmp; my $no_deprecated; my $no_rfc3779; my $no_psk; my $no_tlsext; my $no_cms; my $no_capieng; my $no_jpake; my $no_srp; my $no_ssl2; my $no_ec2m; my $no_nistp_gcc; -my $no_nextprotoneg; my $no_sctp; my $no_srtp; -my $no_unit_test; +my $no_nextprotoneg; my $no_sctp; my $no_srtp; my $no_ssl_trace; +my $no_unit_test; my $no_ssl3_method; my $fips; @@ -236,6 +240,8 @@ foreach (@ARGV, split(/ /, $options)) elsif (/^no-ec_nistp_64_gcc_128$/) { $no_nistp_gcc=1; } elsif (/^no-nextprotoneg$/) { $no_nextprotoneg=1; } elsif (/^no-ssl2$/) { $no_ssl2=1; } + elsif (/^no-ssl3-method$/) { $no_ssl3_method=1; } + elsif (/^no-ssl-trace$/) { $no_ssl_trace=1; } elsif (/^no-capieng$/) { $no_capieng=1; } elsif (/^no-jpake$/) { $no_jpake=1; } elsif (/^no-srp$/) { $no_srp=1; } @@ -839,6 +845,7 @@ sub do_defs $def .= "int PEM_write_bio_$1(void);"; next; } elsif (/^DECLARE_PEM_write\s*\(\s*(\w*)\s*,/ || + /^DECLARE_PEM_write_const\s*\(\s*(\w*)\s*,/ || /^DECLARE_PEM_write_cb\s*\(\s*(\w*)\s*,/ ) { # Things not in Win16 $def .= @@ -1208,6 +1215,8 @@ sub is_valid if ($keyword eq "EC_NISTP_64_GCC_128" && $no_nistp_gcc) { return 0; } if ($keyword eq "SSL2" && $no_ssl2) { return 0; } + if ($keyword eq "SSL3_METHOD" && $no_ssl3_method) { return 0; } + if ($keyword eq "SSL_TRACE" && $no_ssl_trace) { return 0; } if ($keyword eq "CAPIENG" && $no_capieng) { return 0; } if ($keyword eq "JPAKE" && $no_jpake) { return 0; } if ($keyword eq "SRP" && $no_srp) { return 0; } diff --git a/openssl/util/mkerr.pl b/openssl/util/mkerr.pl index ee23a8291..88388f532 100644 --- a/openssl/util/mkerr.pl +++ b/openssl/util/mkerr.pl @@ -14,6 +14,7 @@ my $pack_errcode; my $load_errcode; my $errcount; +my $year = (localtime)[5] + 1900; while (@ARGV) { my $arg = $ARGV[0]; @@ -250,7 +251,7 @@ while (($hdr, $lib) = each %libinc) if ($gotfile) { while(<IN>) { - if(/^\#define\s+(\S+)\s+(\S+)/) { + if(/^\#\s*define\s+(\S+)\s+(\S+)/) { $name = $1; $code = $2; next if $name =~ /^${lib}err/; @@ -391,7 +392,7 @@ foreach $lib (keys %csrc) } else { push @out, "/* ====================================================================\n", -" * Copyright (c) 2001-2011 The OpenSSL Project. All rights reserved.\n", +" * Copyright (c) 2001-$year The OpenSSL Project. All rights reserved.\n", " *\n", " * Redistribution and use in source and binary forms, with or without\n", " * modification, are permitted provided that the following conditions\n", @@ -576,7 +577,7 @@ EOF print OUT <<"EOF"; /* $cfile */ /* ==================================================================== - * Copyright (c) 1999-2011 The OpenSSL Project. All rights reserved. + * Copyright (c) 1999-$year The OpenSSL Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/openssl/util/mkstack.pl b/openssl/util/mkstack.pl index f708610a7..2bd96cd0c 100644 --- a/openssl/util/mkstack.pl +++ b/openssl/util/mkstack.pl @@ -90,6 +90,7 @@ while(<IN>) { #define sk_${type_thing}_set_cmp_func(st, cmp) SKM_sk_set_cmp_func($type_thing, (st), (cmp)) #define sk_${type_thing}_dup(st) SKM_sk_dup($type_thing, st) #define sk_${type_thing}_pop_free(st, free_func) SKM_sk_pop_free($type_thing, (st), (free_func)) +#define sk_${type_thing}_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy($type_thing, (st), (copy_func), (free_func)) #define sk_${type_thing}_shift(st) SKM_sk_shift($type_thing, (st)) #define sk_${type_thing}_pop(st) SKM_sk_pop($type_thing, (st)) #define sk_${type_thing}_sort(st) SKM_sk_sort($type_thing, (st)) @@ -108,7 +109,8 @@ EOF #define sk_${t1}_find(st, val) sk_find(CHECKED_STACK_OF($t1, st), CHECKED_PTR_OF($t2, val)) #define sk_${t1}_value(st, i) (($t1)sk_value(CHECKED_STACK_OF($t1, st), i)) #define sk_${t1}_num(st) SKM_sk_num($t1, st) -#define sk_${t1}_pop_free(st, free_func) sk_pop_free(CHECKED_STACK_OF($t1, st), CHECKED_SK_FREE_FUNC2($t1, free_func)) +#define sk_${t1}_pop_free(st, free_func) sk_pop_free(CHECKED_STACK_OF($t1, st), CHECKED_SK_FREE_FUNC($t2, free_func)) +#define sk_${t1}_deep_copy(st, copy_func, free_func) ((STACK_OF($t1) *)sk_deep_copy(CHECKED_STACK_OF($t1, st), CHECKED_SK_COPY_FUNC($t2, copy_func), CHECKED_SK_FREE_FUNC($t2, free_func))) #define sk_${t1}_insert(st, val, i) sk_insert(CHECKED_STACK_OF($t1, st), CHECKED_PTR_OF($t2, val), i) #define sk_${t1}_free(st) SKM_sk_free(${t1}, st) #define sk_${t1}_set(st, i, val) sk_set(CHECKED_STACK_OF($t1, st), i, CHECKED_PTR_OF($t2, val)) diff --git a/openssl/util/openssl-format-source b/openssl/util/openssl-format-source new file mode 100755 index 000000000..4e9014743 --- /dev/null +++ b/openssl/util/openssl-format-source @@ -0,0 +1,148 @@ +#!/bin/sh +# +# openssl-format-source +# - format source tree according to OpenSSL coding style using indent +# +# usage: +# openssl-format-source [-v] [-n] [file|directory] ... +# +# note: the indent options assume GNU indent v2.2.10 which was released +# Feb-2009 so if you have an older indent the options may not +# match what is expected +# +# any marked block comment blocks have to be moved to align manually after +# the reformatting has been completed as marking a block causes indent to +# not move it at all ... +# + +PATH=/usr/local/bin:/bin:/usr/bin:$PATH +export PATH +HERE="`dirname $0`" + +set -e + +if [ $# -eq 0 ]; then + echo "usage: $0 [-v] [-n] [-c] [sourcefile|sourcedir] ..." >&2 + exit 1 +fi + +VERBOSE=false +DONT=false +STOPARGS=false +COMMENTS=false +DEBUG="" + +# for this exercise, we want to force the openssl style, so we roll +# our own indent profile, which is at a well known location +INDENT_PROFILE="$HERE/indent.pro" +export INDENT_PROFILE +if [ ! -f "$INDENT_PROFILE" ]; then + echo "$0: unable to locate the openssl indent.pro file" >&2 + exit 1 +fi + +# Extra arguments; for adding the comment-formatting +INDENT_ARGS="" +for i +do + if [ "$STOPARGS" != "true" ]; then + case $i in + --) STOPARGS="true"; continue;; + -n) DONT="true"; continue;; + -v) VERBOSE="true"; + echo "INDENT_PROFILE=$INDENT_PROFILE"; + continue;; + -c) COMMENTS="true"; + INDENT_ARGS="-fc1 -fca -cdb -sc"; + continue;; + -nc) COMMENTS="true"; + continue;; + -d) DEBUG='eval tee "$j.pre" |' + continue;; + esac + fi + + if [ -d "$i" ]; then + LIST=`find "$i" -name '*.[ch]' -print` + else + if [ ! -f "$i" ]; then + echo "$0: source file not found: $i" >&2 + exit 1 + fi + LIST="$i" + fi + + for j in $LIST + do + # ignore symlinks - we only ever process the base file - so if we + # expand a directory tree we need to ignore any located symlinks + if [ -d "$i" ]; then + if [ -h "$j" ]; then + continue; + fi + fi + + if [ "$VERBOSE" = "true" ]; then + echo "$j" + fi + + if [ "$DONT" = "false" ]; then + tmp=$(mktemp /tmp/indent.XXXXXX) + trap 'rm -f "$tmp"' HUP INT TERM EXIT + + case `basename $j` in + # the list of files that indent is unable to handle correctly + # that we simply leave alone for manual formatting now + obj_dat.h|aes_core.c|aes_x86core.c|ecp_nistz256.c) + echo "skipping $j" + ;; + *) + if [ "$COMMENTS" = "true" ]; then + # we have to mark single line comments as /*- ...*/ to stop indent + # messing with them, run expand then indent as usual but with the + # the process-comments options and then undo that marking, and then + # finally re-run indent without process-comments so the marked-to- + # be-ignored comments we did automatically end up getting moved + # into the right possition within the code as indent leaves marked + # comments entirely untouched - we appear to have no way to avoid + # the double processing and get the desired output + cat "$j" | \ + expand | \ + perl -0 -np \ + -e 's/(\n#[ \t]*ifdef[ \t]+__cplusplus\n[^\n]*\n#[ \t]*endif\n)/\n\/**INDENT-OFF**\/$1\/**INDENT-ON**\/\n/g;' \ + -e 's/(\n\/\*\!)/\n\/**/g;' \ + -e 's/(STACK_OF|LHASH_OF)\(([^ \t,\)]+)\)( |\n)/$1_$2_$3/g;' \ + | \ + perl -np \ + -e 's/^([ \t]*)\/\*([ \t]+.*)\*\/[ \t]*$/if (length("$1$2")<75) {$c="-"}else{$c=""}; "$1\/*$c$2*\/"/e;' \ + -e 's/^\/\* ((Copyright|=|----).*)$/\/*-$1/;' \ + -e 's/^((DECLARE|IMPLEMENT)_(EXTERN_ASN1|ASN1|ADB|STACK_OF|PKCS12_STACK_OF).*)$/\/**INDENT-OFF**\/\n$1\n\/**INDENT-ON**\//;' \ + -e 's/^([ \t]*(make_dh|make_dh_bn|make_rfc5114_td)\(.*\)[ \t,]*)$/\/**INDENT-OFF**\/\n$1\n\/**INDENT-ON**\//;' \ + -e 's/^(ASN1_ADB_TEMPLATE\(.*)$/\/**INDENT-OFF**\/\n$1\n\/**INDENT-ON**\//;' \ + -e 's/^((ASN1|ADB)_.*_END\(.*[\){=,;]+[ \t]*)$/$1\n\/**INDENT-ON**\//;' \ + -e '/ASN1_(ITEM_ref|ITEM_ptr|ITEM_rptr|PCTX)/ || s/^((ASN1|ADB)_[^\*]*[){=,]+[ \t]*)$/\/**INDENT-OFF**\/\n$1/;' \ + -e 's/^(} (ASN1|ADB)_[^\*]*[\){=,;]+)$/$1\n\/**INDENT-ON**\//;' \ + | \ + $DEBUG indent $INDENT_ARGS | \ + perl -np \ + -e 's/^([ \t]*)\/\*-(.*)\*\/[ \t]*$/$1\/*$2*\//;' \ + -e 's/^\/\*-((Copyright|=|----).*)$/\/* $1/;' \ + | indent | \ + perl -0 -np \ + -e 's/\/\*\*INDENT-(ON|OFF)\*\*\/\n//g;' \ + | perl -np \ + -e 's/(STACK_OF|LHASH_OF)_([^ \t,]+)_( |\/)/$1($2)$3/g;' \ + -e 's/(STACK_OF|LHASH_OF)_([^ \t,]+)_$/$1($2)/g;' \ + | perl "$HERE"/su-filter.pl \ + > "$tmp" + else + expand "$j" | indent $INDENT_ARGS > "$tmp" + fi; + mv "$tmp" "$j" + ;; + esac + fi + done +done + + diff --git a/openssl/util/pl/BC-32.pl b/openssl/util/pl/BC-32.pl index b41bb45e8..ed28e65e6 100644 --- a/openssl/util/pl/BC-32.pl +++ b/openssl/util/pl/BC-32.pl @@ -18,7 +18,7 @@ $out_def="out32"; $tmp_def="tmp32"; $inc_def="inc32"; #enable max error messages, disable most common warnings -$cflags="-DWIN32_LEAN_AND_MEAN -q -w-ccc -w-rch -w-pia -w-aus -w-par -w-inl -c -tWC -tWM -DOPENSSL_SYSNAME_WIN32 -DL_ENDIAN -DDSO_WIN32 -D_stricmp=stricmp -D_strnicmp=strnicmp -D_timeb=timeb -D_ftime=ftime "; +$cflags="-DWIN32_LEAN_AND_MEAN -q -w-ccc -w-rch -w-pia -w-aus -w-par -w-inl -c -tWC -tWM -DOPENSSL_SYSNAME_WIN32 -DL_ENDIAN -DDSO_WIN32 -D_stricmp=stricmp -D_strnicmp=strnicmp "; if ($debug) { $cflags.="-Od -y -v -vi- -D_DEBUG"; diff --git a/openssl/util/pl/VC-32.pl b/openssl/util/pl/VC-32.pl index 3705fc73b..852eb30d0 100644 --- a/openssl/util/pl/VC-32.pl +++ b/openssl/util/pl/VC-32.pl @@ -46,7 +46,6 @@ if ($FLAVOR =~ /WIN64/) # $base_cflags= " $mf_cflag"; my $f = $shlib || $fips ?' /MD':' /MT'; - $lib_cflag='/Zl' if (!$shlib); # remove /DEFAULTLIBs from static lib $opt_cflags=$f.' /Ox'; $dbg_cflags=$f.'d /Od -DDEBUG -D_DEBUG'; $lflags="/nologo /subsystem:console /opt:ref"; @@ -89,7 +88,7 @@ elsif ($FLAVOR =~ /CE/) $wcetgt = $ENV{'TARGETCPU'}; # just shorter name... SWITCH: for($wcetgt) { /^X86/ && do { $wcecdefs.=" -Dx86 -D_X86_ -D_i386_ -Di_386_"; - $wcelflag.=" /machine:IX86"; last; }; + $wcelflag.=" /machine:X86"; last; }; /^ARMV4[IT]/ && do { $wcecdefs.=" -DARM -D_ARM_ -D$wcetgt"; $wcecdefs.=" -DTHUMB -D_THUMB_" if($wcetgt=~/T$/); $wcecdefs.=" -QRarch4T -QRinterwork-return"; @@ -114,25 +113,30 @@ elsif ($FLAVOR =~ /CE/) $wcelflag.=" /machine:$wcetgt"; last; }; } - $cc='$(CC)'; + $cc=($ENV{CC} or "cl"); $base_cflags=' /W3 /WX /GF /Gy /nologo -DUNICODE -D_UNICODE -DOPENSSL_SYSNAME_WINCE -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -DDSO_WIN32 -DNO_CHMOD -DOPENSSL_SMALL_FOOTPRINT'; $base_cflags.=" $wcecdefs"; $base_cflags.=' -I$(WCECOMPAT)/include' if (defined($ENV{'WCECOMPAT'})); $base_cflags.=' -I$(PORTSDK_LIBPATH)/../../include' if (defined($ENV{'PORTSDK_LIBPATH'})); - $opt_cflags=' /MC /O1i'; # optimize for space, but with intrinsics... - $dbg_cflags=' /MC /Od -DDEBUG -D_DEBUG'; + if (`$cc 2>&1` =~ /Version ([0-9]+)\./ && $1>=14) { + $base_cflags.=$shlib?' /MD':' /MT'; + } else { + $base_cflags.=' /MC'; + } + $opt_cflags=' /O1i'; # optimize for space, but with intrinsics... + $dbg_cflags=' /Od -DDEBUG -D_DEBUG'; $lflags="/nologo /opt:ref $wcelflag"; } else # Win32 { $base_cflags= " $mf_cflag"; my $f = $shlib || $fips ?' /MD':' /MT'; - $lib_cflag='/Zl' if (!$shlib); # remove /DEFAULTLIBs from static lib $ff = "/fixed"; $opt_cflags=$f.' /Ox /O2 /Ob2'; $dbg_cflags=$f.'d /Od -DDEBUG -D_DEBUG'; $lflags="/nologo /subsystem:console /opt:ref"; } +$lib_cflag='/Zl' if (!$shlib); # remove /DEFAULTLIBs from static lib $mlflags=''; $out_def ="out32"; $out_def.="dll" if ($shlib); @@ -165,14 +169,26 @@ $rsc="rc"; $efile="/out:"; $exep='.exe'; if ($no_sock) { $ex_libs=''; } -elsif ($FLAVOR =~ /CE/) { $ex_libs='winsock.lib'; } +elsif ($FLAVOR =~ /CE/) { $ex_libs='ws2.lib'; } else { $ex_libs='ws2_32.lib'; } if ($FLAVOR =~ /CE/) { - $ex_libs.=' $(WCECOMPAT)/lib/wcecompatex.lib' if (defined($ENV{'WCECOMPAT'})); + $ex_libs.=' crypt32.lib'; # for e_capi.c + if (defined($ENV{WCECOMPAT})) + { + $ex_libs.= ' $(WCECOMPAT)/lib'; + if (-f "$ENV{WCECOMPAT}/lib/$ENV{TARGETCPU}/wcecompatex.lib") + { + $ex_libs.='/$(TARGETCPU)/wcecompatex.lib'; + } + else + { + $ex_libs.='/wcecompatex.lib'; + } + } $ex_libs.=' $(PORTSDK_LIBPATH)/portlib.lib' if (defined($ENV{'PORTSDK_LIBPATH'})); - $ex_libs.=' /nodefaultlib:oldnames.lib coredll.lib corelibc.lib' if ($ENV{'TARGETCPU'} eq "X86"); + $ex_libs.=' /nodefaultlib coredll.lib corelibc.lib' if ($ENV{'TARGETCPU'} eq "X86"); } else { diff --git a/openssl/util/pl/netware.pl b/openssl/util/pl/netware.pl index c78bcfc87..fe80a9bb8 100644 --- a/openssl/util/pl/netware.pl +++ b/openssl/util/pl/netware.pl @@ -212,7 +212,7 @@ else # Turned off the "possible" warnings ( -w nopossible ). Metrowerks # complained a lot about various stuff. May want to turn back # on for further development. - $cflags.=" -nostdinc -ir crypto -ir engines -ir apps -I$include_path \\ + $cflags.=" -nostdinc -ir crypto -ir ssl -ir engines -ir apps -I$include_path \\ -msgstyle gcc -align 4 -processor pentium -char unsigned \\ -w on -w nolargeargs -w nopossible -w nounusedarg -w nounusedexpr \\ -w noimplicitconv -relax_pointers -nosyspath -maxerrors 20"; diff --git a/openssl/util/pl/unix.pl b/openssl/util/pl/unix.pl index 146611ad9..82f1aa76e 100644 --- a/openssl/util/pl/unix.pl +++ b/openssl/util/pl/unix.pl @@ -26,11 +26,12 @@ else { $cflags="-O"; } } $obj='.o'; +$asm_suffix='.s'; $ofile='-o '; # EXE linking stuff $link='${CC}'; -$lflags='${CFLAGS}'; +$lflags='${CFLAG}'; $efile='-o '; $exep=''; $ex_libs=""; @@ -53,6 +54,94 @@ $des_enc_src=""; $bf_enc_obj=""; $bf_enc_src=""; +%perl1 = ( + 'md5-x86_64' => 'crypto/md5', + 'x86_64-mont' => 'crypto/bn', + 'x86_64-mont5' => 'crypto/bn', + 'x86_64-gf2m' => 'crypto/bn', + 'modexp512-x86_64' => 'crypto/bn', + 'aes-x86_64' => 'crypto/aes', + 'vpaes-x86_64' => 'crypto/aes', + 'bsaes-x86_64' => 'crypto/aes', + 'aesni-x86_64' => 'crypto/aes', + 'aesni-sha1-x86_64' => 'crypto/aes', + 'sha1-x86_64' => 'crypto/sha', + 'e_padlock-x86_64' => 'engines', + 'rc4-x86_64' => 'crypto/rc4', + 'rc4-md5-x86_64' => 'crypto/rc4', + 'ghash-x86_64' => 'crypto/modes', + 'aesni-gcm-x86_64' => 'crypto/modes', + 'aesni-sha256-x86_64' => 'crypto/aes', + 'rsaz-x86_64' => 'crypto/bn', + 'rsaz-avx2' => 'crypto/bn', + 'aesni-mb-x86_64' => 'crypto/aes', + 'sha1-mb-x86_64' => 'crypto/sha', + 'sha256-mb-x86_64' => 'crypto/sha', + 'ecp_nistz256-x86_64' => 'crypto/ec', + ); + +# If I were feeling more clever, these could probably be extracted +# from makefiles. +sub platform_perlasm_compile_target + { + local($target, $source, $bname) = @_; + + for $p (keys %perl1) + { + if ($target eq "\$(OBJ_D)/$p.o") + { + return << "EOF"; +\$(TMP_D)/$p.s: $perl1{$p}/asm/$p.pl + \$(PERL) $perl1{$p}/asm/$p.pl \$(PERLASM_SCHEME) > \$@ +EOF + } + } + if ($target eq '$(OBJ_D)/x86_64cpuid.o') + { + return << 'EOF'; +$(TMP_D)/x86_64cpuid.s: crypto/x86_64cpuid.pl + $(PERL) crypto/x86_64cpuid.pl $(PERLASM_SCHEME) > $@ +EOF + } + elsif ($target eq '$(OBJ_D)/sha256-x86_64.o') + { + return << 'EOF'; +$(TMP_D)/sha256-x86_64.s: crypto/sha/asm/sha512-x86_64.pl + $(PERL) crypto/sha/asm/sha512-x86_64.pl $(PERLASM_SCHEME) $@ +EOF + } + elsif ($target eq '$(OBJ_D)/sha512-x86_64.o') + { + return << 'EOF'; +$(TMP_D)/sha512-x86_64.s: crypto/sha/asm/sha512-x86_64.pl + $(PERL) crypto/sha/asm/sha512-x86_64.pl $(PERLASM_SCHEME) $@ +EOF + } + elsif ($target eq '$(OBJ_D)/sha512-x86_64.o') + { + return << 'EOF'; +$(TMP_D)/sha512-x86_64.s: crypto/sha/asm/sha512-x86_64.pl + $(PERL) crypto/sha/asm/sha512-x86_64.pl $(PERLASM_SCHEME) $@ +EOF + } + + die $target; + } + +sub special_compile_target + { + local($target) = @_; + + if ($target eq 'crypto/bn/x86_64-gcc') + { + return << "EOF"; +\$(TMP_D)/x86_64-gcc.o: crypto/bn/asm/x86_64-gcc.c + \$(CC) \$(CFLAGS) -c -o \$@ crypto/bn/asm/x86_64-gcc.c +EOF + } + return undef; + } + sub do_lib_rule { local($obj,$target,$name,$shlib)=@_; @@ -72,7 +161,7 @@ sub do_link_rule { local($target,$files,$dep_libs,$libs)=@_; local($ret,$_); - + $file =~ s/\//$o/g if $o ne '/'; $n=&bname($target); $ret.="$target: $files $dep_libs\n"; @@ -93,4 +182,262 @@ sub which } } +sub fixtests + { + my ($str, $tests) = @_; + + foreach my $t (keys %$tests) + { + $str =~ s/(\.\/)?\$\($t\)/\$(TEST_D)\/$tests->{$t}/g; + } + + return $str; + } + +sub fixdeps + { + my ($str, $fakes) = @_; + + my @t = split(/\s+/, $str); + $str = ''; + foreach my $t (@t) + { + $str .= ' ' if $str ne ''; + if (exists($fakes->{$t})) + { + $str .= $fakes->{$t}; + next; + } + if ($t =~ /^[^\/]+$/) + { + $str .= '$(TEST_D)/' . $t; + } + else + { + $str .= $t; + } + } + + return $str; + } + +sub fixrules + { + my ($str) = @_; + + # Compatible with -j... + $str =~ s/^(\s+@?)/$1cd \$(TEST_D) && /; + return $str; + + # Compatible with not -j. + my @t = split("\n", $str); + $str = ''; + my $prev; + foreach my $t (@t) + { + $t =~ s/^\s+//; + if (!$prev) + { + if ($t =~ /^@/) + { + $t =~ s/^@/\@cd \$(TEST_D) && /; + } + elsif ($t !~ /^\s*#/) + { + $t = 'cd $(TEST_D) && ' . $t; + } + } + $str .= "\t$t\n"; + $prev = $t =~/\\$/; + } + return $str; +} + +sub copy_scripts + { + my ($sed, $src, @targets) = @_; + + my $s = ''; + foreach my $t (@targets) + { + # Copy first so we get file modes... + $s .= "\$(TEST_D)/$t: \$(SRC_D)/$src/$t\n\tcp \$(SRC_D)/$src/$t \$(TEST_D)/$t\n"; + $s .= "\tsed -e 's/\\.\\.\\/apps/..\\/\$(OUT_D)/' -e 's/\\.\\.\\/util/..\\/\$(TEST_D)/' < \$(SRC_D)/$src/$t > \$(TEST_D)/$t\n" if $sed; + $s .= "\n"; + } + return $s; + } + +sub get_tests + { + my ($makefile) = @_; + + open(M, $makefile) || die "Can't open $makefile: $!"; + my %targets; + my %deps; + my %tests; + my %alltests; + my %fakes; + while (my $line = <M>) + { + chomp $line; + while ($line =~ /^(.*)\\$/) + { + $line = $1 . <M>; + } + + if ($line =~ /^alltests:(.*)$/) + { + my @t = split(/\s+/, $1); + foreach my $t (@t) + { + $targets{$t} = ''; + $alltests{$t} = undef; + } + } + + if (($line =~ /^(?<t>\S+):(?<d>.*)$/ && exists $targets{$1}) + || $line =~ /^(?<t>test_(ss|gen) .*):(?<d>.*)/) + { + my $t = $+{t}; + my $d = $+{d}; + # If there are multiple targets stupid FreeBSD make runs the + # rules once for each dependency that matches one of the + # targets. Running the same rule twice concurrently causes + # breakage, so replace with a fake target. + if ($t =~ /\s/) + { + ++$fake; + my @targets = split /\s+/, $t; + $t = "_fake$fake"; + foreach my $f (@targets) + { + $fakes{$f} = $t; + } + } + $deps{$t} = $d; + $deps{$t} =~ s/#.*$//; + for (;;) + { + $line = <M>; + chomp $line; + last if $line eq ''; + $targets{$t} .= "$line\n"; + } + next; + } + + if ($line =~ /^(\S+TEST)=\s*(\S+)$/) + { + $tests{$1} = $2; + next; + } + } + + delete $alltests{test_jpake} if $no_jpake; + delete $targets{test_ige} if $no_ige; + delete $alltests{test_md2} if $no_md2; + delete $alltests{test_rc5} if $no_rc5; + + my $tests; + foreach my $t (keys %tests) + { + $tests .= "$t = $tests{$t}\n"; + } + + my $each; + foreach my $t (keys %targets) + { + next if $t eq ''; + + my $d = $deps{$t}; + $d =~ s/\.\.\/apps/\$(BIN_D)/g; + $d =~ s/\.\.\/util/\$(TEST_D)/g; + $d = fixtests($d, \%tests); + $d = fixdeps($d, \%fakes); + + my $r = $targets{$t}; + $r =~ s/\.\.\/apps/..\/\$(BIN_D)/g; + $r =~ s/\.\.\/util/..\/\$(TEST_D)/g; + $r =~ s/\.\.\/(\S+)/\$(SRC_D)\/$1/g; + $r = fixrules($r); + + next if $r eq ''; + + $t =~ s/\s+/ \$(TEST_D)\//g; + + $each .= "$t: test_scripts $d\n\t\@echo '$t test started'\n$r\t\@echo '$t test done'\n\n"; + } + + # FIXME: Might be a clever way to figure out what needs copying + my @copies = ( 'bctest', + 'testgen', + 'cms-test.pl', + 'tx509', + 'test.cnf', + 'testenc', + 'tocsp', + 'testca', + 'CAss.cnf', + 'testtsa', + 'CAtsa.cnf', + 'Uss.cnf', + 'P1ss.cnf', + 'P2ss.cnf', + 'tcrl', + 'tsid', + 'treq', + 'tpkcs7', + 'tpkcs7d', + 'testcrl.pem', + 'testx509.pem', + 'v3-cert1.pem', + 'v3-cert2.pem', + 'testreq2.pem', + 'testp7.pem', + 'pkcs7-1.pem', + 'trsa', + 'testrsa.pem', + 'testsid.pem', + 'testss', + 'testssl', + 'testsslproxy', + 'serverinfo.pem', + ); + my $copies = copy_scripts(1, 'test', @copies); + $copies .= copy_scripts(0, 'test', ('smcont.txt')); + + my @utils = ( 'shlib_wrap.sh', + 'opensslwrap.sh', + ); + $copies .= copy_scripts(1, 'util', @utils); + + my @apps = ( 'CA.sh', + 'openssl.cnf', + 'server2.pem', + ); + $copies .= copy_scripts(1, 'apps', @apps); + + $copies .= copy_scripts(1, 'crypto/evp', ('evptests.txt')); + + $scripts = "test_scripts: \$(TEST_D)/CA.sh \$(TEST_D)/opensslwrap.sh \$(TEST_D)/openssl.cnf \$(TEST_D)/shlib_wrap.sh ocsp smime\n"; + $scripts .= "\nocsp:\n\tcp -R test/ocsp-tests \$(TEST_D)\n"; + $scripts .= "\smime:\n\tcp -R test/smime-certs \$(TEST_D)\n"; + + my $all = 'test:'; + foreach my $t (keys %alltests) + { + if (exists($fakes{$t})) + { + $all .= " $fakes{$t}"; + } + else + { + $all .= " $t"; + } + } + + return "$scripts\n$copies\n$tests\n$all\n\n$each"; + } + 1; diff --git a/openssl/util/ssleay.num b/openssl/util/ssleay.num index dd21e9577..5a8991350 100644 --- a/openssl/util/ssleay.num +++ b/openssl/util/ssleay.num @@ -101,9 +101,9 @@ SSLv23_server_method 112 EXIST::FUNCTION:RSA SSLv2_client_method 113 EXIST::FUNCTION:RSA,SSL2 SSLv2_method 114 EXIST::FUNCTION:RSA,SSL2 SSLv2_server_method 115 EXIST::FUNCTION:RSA,SSL2 -SSLv3_client_method 116 EXIST::FUNCTION: -SSLv3_method 117 EXIST::FUNCTION: -SSLv3_server_method 118 EXIST::FUNCTION: +SSLv3_client_method 116 EXIST::FUNCTION:SSL3_METHOD +SSLv3_method 117 EXIST::FUNCTION:SSL3_METHOD +SSLv3_server_method 118 EXIST::FUNCTION:SSL3_METHOD d2i_SSL_SESSION 119 EXIST::FUNCTION: i2d_SSL_SESSION 120 EXIST::FUNCTION: BIO_f_ssl 121 EXIST::FUNCTION:BIO @@ -316,8 +316,55 @@ SSL_CTX_set_next_protos_adv_cb 355 EXIST:VMS:FUNCTION:NEXTPROTONEG SSL_get0_next_proto_negotiated 356 EXIST::FUNCTION:NEXTPROTONEG SSL_get_selected_srtp_profile 357 EXIST::FUNCTION:SRTP SSL_CTX_set_tlsext_use_srtp 358 EXIST::FUNCTION:SRTP -SSL_select_next_proto 359 EXIST::FUNCTION:NEXTPROTONEG +SSL_select_next_proto 359 EXIST::FUNCTION:TLSEXT SSL_get_srtp_profiles 360 EXIST::FUNCTION:SRTP SSL_CTX_set_next_proto_select_cb 361 EXIST:!VMS:FUNCTION:NEXTPROTONEG SSL_CTX_set_next_proto_sel_cb 361 EXIST:VMS:FUNCTION:NEXTPROTONEG SSL_SESSION_get_compress_id 362 EXIST::FUNCTION: +SSL_get0_param 363 EXIST::FUNCTION: +SSL_CTX_get0_privatekey 364 EXIST::FUNCTION: +SSL_get_shared_sigalgs 365 EXIST::FUNCTION:TLSEXT +SSL_CONF_CTX_finish 366 EXIST::FUNCTION: +DTLS_method 367 EXIST::FUNCTION: +DTLS_client_method 368 EXIST::FUNCTION: +SSL_CIPHER_standard_name 369 EXIST::FUNCTION:SSL_TRACE +SSL_set_alpn_protos 370 EXIST::FUNCTION: +SSL_CTX_set_srv_supp_data 371 NOEXIST::FUNCTION: +SSL_CONF_cmd_argv 372 EXIST::FUNCTION: +DTLSv1_2_server_method 373 EXIST::FUNCTION: +SSL_COMP_set0_compression_methods 374 EXIST:!VMS:FUNCTION:COMP +SSL_COMP_set0_compress_methods 374 EXIST:VMS:FUNCTION:COMP +SSL_CTX_set_cert_cb 375 EXIST::FUNCTION: +SSL_CTX_add_client_custom_ext 376 EXIST::FUNCTION:TLSEXT +SSL_is_server 377 EXIST::FUNCTION: +SSL_CTX_get0_param 378 EXIST::FUNCTION: +SSL_CONF_cmd 379 EXIST::FUNCTION: +SSL_CTX_get_ssl_method 380 EXIST::FUNCTION: +SSL_CONF_CTX_set_ssl_ctx 381 EXIST::FUNCTION: +SSL_CIPHER_find 382 EXIST::FUNCTION: +SSL_CTX_use_serverinfo 383 EXIST::FUNCTION:TLSEXT +DTLSv1_2_client_method 384 EXIST::FUNCTION: +SSL_get0_alpn_selected 385 EXIST::FUNCTION: +SSL_CONF_CTX_clear_flags 386 EXIST::FUNCTION: +SSL_CTX_set_alpn_protos 387 EXIST::FUNCTION: +SSL_CTX_add_server_custom_ext 389 EXIST::FUNCTION:TLSEXT +SSL_CTX_get0_certificate 390 EXIST::FUNCTION: +SSL_CTX_set_alpn_select_cb 391 EXIST::FUNCTION: +SSL_CONF_cmd_value_type 392 EXIST::FUNCTION: +SSL_set_cert_cb 393 EXIST::FUNCTION: +SSL_get_sigalgs 394 EXIST::FUNCTION:TLSEXT +SSL_CONF_CTX_set1_prefix 395 EXIST::FUNCTION: +SSL_CONF_CTX_new 396 EXIST::FUNCTION: +SSL_CONF_CTX_set_flags 397 EXIST::FUNCTION: +SSL_CONF_CTX_set_ssl 398 EXIST::FUNCTION: +SSL_check_chain 399 EXIST::FUNCTION:TLSEXT +SSL_certs_clear 400 EXIST::FUNCTION: +SSL_CONF_CTX_free 401 EXIST::FUNCTION: +SSL_trace 402 EXIST::FUNCTION:SSL_TRACE +SSL_CTX_set_cli_supp_data 403 NOEXIST::FUNCTION: +DTLSv1_2_method 404 EXIST::FUNCTION: +DTLS_server_method 405 EXIST::FUNCTION: +SSL_CTX_use_serverinfo_file 406 EXIST::FUNCTION:STDIO,TLSEXT +SSL_COMP_free_compression_methods 407 EXIST:!VMS:FUNCTION:COMP +SSL_COMP_free_compress_methods 407 EXIST:VMS:FUNCTION:COMP +SSL_extension_supported 409 EXIST::FUNCTION:TLSEXT diff --git a/openssl/util/su-filter.pl b/openssl/util/su-filter.pl new file mode 100755 index 000000000..8975af64f --- /dev/null +++ b/openssl/util/su-filter.pl @@ -0,0 +1,260 @@ +#!/usr/bin/env perl +# +# su-filter.pl +# +use strict; + +my $in_su = 0; +my $indent = 0; +my $out; +my $braces = 0; +my $arrcnt; +my $data; +my $tststr; +my $incomm = 0; + +while(<>) { + $tststr = $_; + $incomm++ while $tststr =~ /\/\*/g; + $incomm-- while $tststr =~ /\*\//g; + + if($in_su == 1) { + if(/}(.*);/) { + $out .= $_; + do_output($out); + $in_su = 0; + } elsif(/^ *\} [^\s]+(\[\d*\])* = \{/) { + $tststr = $1; + $arrcnt = 0; + $arrcnt++ while $tststr =~ /\[/g; + $in_su++; + $braces = 1; + /^(.* = \{)(.*)$/; + $data = $2; + $out .= $1."\n"; + } else { + $out .= $_; + } + } elsif($in_su == 2) { + $data .= $_; + if(/};$/) { + #$data = "\n$data"; + $data =~ s/\n */\n/g; + $data =~ s/};\n?//s; + my @strucdata = structureData($data); + $out .= displayData($indent, 0, \@strucdata); + $out .= "\n$indent};\n"; + do_output($out); + $in_su = 0; + } + } elsif($incomm <= 0 && /( *)(static )?(const )?(union|struct) ([^\s]+ )?\{/) { + $in_su = 1; + $indent = $1; + $out = $_; + next; + } else { + do_output($_); + } +} + + +sub structureData { + my $data = $_[0]; + my @datalist = split(/(\{|\}|,|"|#|\n|\/\*|\*\/|\(|\))/, $data); + my $item; + my $dataitem = ""; + my @struclist = (); + my $substruc; + my $inquote = 0; + my $inbrace = 0; + my $preproc = 0; + my $comment = 0; + my $inparen = 0; + + + foreach $item (@datalist) { + if($comment) { + if($item eq "*/") { + $comment = 0; + $dataitem .= "*/"; + push @struclist, $dataitem; + $dataitem = ""; + next; + } + $dataitem .= $item; + next; + } + if($inquote) { + $dataitem .= $item; + if($item eq "\"") { + $inquote--; + } + next; + } + if($preproc) { + if($item eq "\n") { + $preproc = 0; + push @struclist, $dataitem; + $dataitem = ""; + next; + } + $dataitem .= $item; + next; + } + if($inbrace) { + if($item eq "}") { + $inbrace --; + + if(!$inbrace) { + $substruc = structureData($dataitem); + $dataitem = $substruc; + next; + } + } elsif($item eq "{") { + $inbrace++; + } elsif ($item eq "\"") { + $inquote++; + } + $dataitem .= $item; + next; + } + if($inparen) { + if($item eq ")") { + $inparen--; + } + $dataitem .= $item; + next; + } + if($item eq "\n") { + next; + } + if($item eq "#") { + $preproc = 1; + push @struclist, $dataitem; + $dataitem = "#"; + next; + } + if($item eq "/*") { + $comment = 1; + push @struclist, $dataitem; + $dataitem= "/*"; + next; + } + if($item eq "\"") { + $dataitem .= $item; + $inquote++; + next; + } + if($item eq "{") { + $inbrace++; + next; + } + if($item eq ",") { + push @struclist, $dataitem; + $dataitem = ""; + next; + } + if($item eq "(") { + $dataitem .= $item; + $inparen++; + next; + } + if($item =~ /^\s*$/) { + next; + } + if(ref $dataitem eq 'ARRAY') { + push @struclist, $dataitem; + $dataitem = ""; + } + $dataitem .= $item; + } + push @struclist, $dataitem; + return \@struclist; +} + +sub displayData { + my $indent = shift; + my $depth = shift; + my $data = shift; + my $item; + my $out = ""; + my $currline = ""; + my $first = 1; + my $prevpreproc = 0; + my $prevcomment = 0; + + foreach $item (@{$data}) { + if($item =~ /^\/\*/) { + #Comment + $item =~ s/\n/\n$indent/g; + if($out =~ /\n\s*$/s) { + $out .= $item."\n".$indent; + } else { + $out .= "\n".$indent.$item."\n".$indent; + } + $currline = $indent; + $prevcomment = 1; + next; + } + $item =~ s/^\s+//; + if($item =~ /^#/) { + #Pre-processor directive + if($out =~ /\n\s*$/s) { + $out =~ s/\n\s*$/\n/; + $out .= $item."\n".$indent; + } else { + $out .= "\n".$item."\n".$indent; + } + $currline = $indent; + $prevpreproc = 1; + next; + } + if($first) { + $first = 0; + if($depth != 0) { + $out .= $indent; + $currline = $indent; + } + } else { + if(!$prevpreproc && !$prevcomment) { + $out .= ", "; + $currline .= ", "; + if($depth == 1) { + $out .= "\n"; + $currline = ""; + } + if($depth == 1) { + $out .= $indent; + $currline .= $indent; + } + } + + } + $prevpreproc = 0; + $prevcomment = 0; + + if (ref $item eq 'ARRAY') { + if($depth == 0) { + $out .= displayData("$indent ", $depth+1, $item); + } else { + $out .= "{\n".displayData("$indent ", $depth+1, $item)."\n".$indent."}"; + $currline = $indent."}"; + } + } else { + if(length $currline.$item > 79) { + $currline = $indent; + $out .= "\n$indent"; + } + $out .= $item; + $currline .= $item; + } + } + return $out; +} + +sub do_output { + my $out = shift; + # Strip any trailing whitespace + $out =~ s/\s+\n/\n/g; + print $out; +} |