From de8f24ea083384bb66b32ec105dc4743c5663cdf Mon Sep 17 00:00:00 2001 From: beck <> Date: Wed, 29 Sep 1999 04:37:45 +0000 Subject: OpenSSL 0.9.4 merge --- src/lib/libcrypto/util/add_cr.pl | 2 +- src/lib/libcrypto/util/ck_errf.pl | 3 +- src/lib/libcrypto/util/clean-depend.pl | 38 ++ src/lib/libcrypto/util/deleof.pl | 2 +- src/lib/libcrypto/util/do_ms.sh | 8 +- src/lib/libcrypto/util/domd | 11 + src/lib/libcrypto/util/err-ins.pl | 2 +- src/lib/libcrypto/util/files.pl | 2 +- src/lib/libcrypto/util/libeay.num | 789 ++++++++++++++++++++++++++++++++- src/lib/libcrypto/util/mk1mf.pl | 316 ++++++++----- src/lib/libcrypto/util/mkdef.pl | 444 ++++++++++++------- src/lib/libcrypto/util/mkdir-p.pl | 33 ++ src/lib/libcrypto/util/mkerr.pl | 503 +++++++++++++++++++++ src/lib/libcrypto/util/mkfiles.pl | 110 +++++ src/lib/libcrypto/util/mklink.pl | 55 +++ src/lib/libcrypto/util/mklink.sh | 35 -- src/lib/libcrypto/util/perlpath.pl | 9 +- src/lib/libcrypto/util/pl/BC-16.pl | 14 +- src/lib/libcrypto/util/pl/BC-32.pl | 153 +++---- src/lib/libcrypto/util/pl/Mingw32.pl | 79 ++++ src/lib/libcrypto/util/pl/Mingw32f.pl | 73 +++ src/lib/libcrypto/util/pl/VC-16.pl | 14 +- src/lib/libcrypto/util/pl/VC-32.pl | 33 +- src/lib/libcrypto/util/pl/linux.pl | 16 +- src/lib/libcrypto/util/pl/ultrix.pl | 38 ++ src/lib/libcrypto/util/pl/unix.pl | 23 +- src/lib/libcrypto/util/point.sh | 4 +- src/lib/libcrypto/util/ranlib.sh | 23 - src/lib/libcrypto/util/sep_lib.sh | 3 - src/lib/libcrypto/util/sp-diff.pl | 2 +- src/lib/libcrypto/util/src-dep.pl | 2 +- src/lib/libcrypto/util/ssldir.pl | 52 --- src/lib/libcrypto/util/ssleay.num | 61 +++ src/lib/libcrypto/util/tab_num.pl | 2 +- src/lib/libcrypto/util/up_ver.pl | 79 ---- src/lib/libcrypto/util/x86asm.sh | 4 +- 36 files changed, 2438 insertions(+), 599 deletions(-) create mode 100644 src/lib/libcrypto/util/clean-depend.pl create mode 100644 src/lib/libcrypto/util/domd create mode 100644 src/lib/libcrypto/util/mkdir-p.pl create mode 100644 src/lib/libcrypto/util/mkerr.pl create mode 100644 src/lib/libcrypto/util/mkfiles.pl create mode 100644 src/lib/libcrypto/util/mklink.pl delete mode 100644 src/lib/libcrypto/util/mklink.sh create mode 100644 src/lib/libcrypto/util/pl/Mingw32.pl create mode 100644 src/lib/libcrypto/util/pl/Mingw32f.pl create mode 100644 src/lib/libcrypto/util/pl/ultrix.pl delete mode 100644 src/lib/libcrypto/util/ranlib.sh delete mode 100644 src/lib/libcrypto/util/ssldir.pl delete mode 100644 src/lib/libcrypto/util/up_ver.pl (limited to 'src/lib/libcrypto/util') diff --git a/src/lib/libcrypto/util/add_cr.pl b/src/lib/libcrypto/util/add_cr.pl index ddd6d61e2d..c7b62c11ec 100644 --- a/src/lib/libcrypto/util/add_cr.pl +++ b/src/lib/libcrypto/util/add_cr.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/local/bin/perl # # This adds a copyright message to a souce code file. # It also gets the file name correct. diff --git a/src/lib/libcrypto/util/ck_errf.pl b/src/lib/libcrypto/util/ck_errf.pl index c5764e40df..7a24d6c5a2 100644 --- a/src/lib/libcrypto/util/ck_errf.pl +++ b/src/lib/libcrypto/util/ck_errf.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/local/bin/perl # # This is just a quick script to scan for cases where the 'error' # function name in a XXXerr() macro is wrong. @@ -40,5 +40,6 @@ foreach $file (@ARGV) # print "$func:$1\n"; } } + close(IN); } diff --git a/src/lib/libcrypto/util/clean-depend.pl b/src/lib/libcrypto/util/clean-depend.pl new file mode 100644 index 0000000000..af676af751 --- /dev/null +++ b/src/lib/libcrypto/util/clean-depend.pl @@ -0,0 +1,38 @@ +#!/usr/local/bin/perl -w +# Clean the dependency list in a makefile of standard includes... +# Written by Ben Laurie 19 Jan 1999 + +use strict; + +while() { + print; + last if /^# DO NOT DELETE THIS LINE/; +} + +my %files; + +while() { + my ($file,$deps)=/^(.*): (.*)$/; + next if !defined $deps; + my @deps=split ' ',$deps; + @deps=grep(!/^\/usr\/include/,@deps); + @deps=grep(!/^\/usr\/lib\/gcc-lib/,@deps); + push @{$files{$file}},@deps; +} + +my $file; +foreach $file (sort keys %files) { + my $len=0; + my $dep; + foreach $dep (sort @{$files{$file}}) { + $len=0 if $len+length($dep)+1 >= 80; + if($len == 0) { + print "\n$file:"; + $len=length($file)+1; + } + print " $dep"; + $len+=length($dep)+1; + } +} + +print "\n"; diff --git a/src/lib/libcrypto/util/deleof.pl b/src/lib/libcrypto/util/deleof.pl index 04f30f0e47..155acd88ff 100644 --- a/src/lib/libcrypto/util/deleof.pl +++ b/src/lib/libcrypto/util/deleof.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/local/bin/perl while (<>) { diff --git a/src/lib/libcrypto/util/do_ms.sh b/src/lib/libcrypto/util/do_ms.sh index f498d842b7..515b074cff 100644 --- a/src/lib/libcrypto/util/do_ms.sh +++ b/src/lib/libcrypto/util/do_ms.sh @@ -5,11 +5,13 @@ PATH=util:../util:$PATH -# perl util/mk1mf.pl VC-MSDOS no-sock >ms/msdos.mak +# perl util/mk1mf.pl no-sock VC-MSDOS >ms/msdos.mak # perl util/mk1mf.pl VC-W31-32 >ms/w31.mak -perl util/mk1mf.pl VC-WIN16 dll >ms/w31dll.mak +perl util/mk1mf.pl dll VC-WIN16 >ms/w31dll.mak # perl util/mk1mf.pl VC-WIN32 >ms/nt.mak -perl util/mk1mf.pl VC-WIN32 dll >ms/ntdll.mak +perl util/mk1mf.pl dll VC-WIN32 >ms/ntdll.mak +perl util/mk1mf.pl Mingw32 >ms/mingw32.mak +perl util/mk1mf.pl Mingw32-files >ms/mingw32f.mak perl util/mkdef.pl 16 libeay > ms/libeay16.def perl util/mkdef.pl 32 libeay > ms/libeay32.def diff --git a/src/lib/libcrypto/util/domd b/src/lib/libcrypto/util/domd new file mode 100644 index 0000000000..324051f60b --- /dev/null +++ b/src/lib/libcrypto/util/domd @@ -0,0 +1,11 @@ +#!/bin/sh +# Do a makedepend, only leave out the standard headers +# Written by Ben Laurie 19 Jan 1999 + +TOP=$1 +shift + +cp Makefile.ssl Makefile.save +makedepend -f Makefile.ssl $@ +$TOP/util/clean-depend.pl < Makefile.ssl > Makefile.new +mv Makefile.new Makefile.ssl diff --git a/src/lib/libcrypto/util/err-ins.pl b/src/lib/libcrypto/util/err-ins.pl index db1bb48275..31b70df8d0 100644 --- a/src/lib/libcrypto/util/err-ins.pl +++ b/src/lib/libcrypto/util/err-ins.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/local/bin/perl # # tack error codes onto the end of a file # diff --git a/src/lib/libcrypto/util/files.pl b/src/lib/libcrypto/util/files.pl index bf3b7effdc..41f033e3b9 100644 --- a/src/lib/libcrypto/util/files.pl +++ b/src/lib/libcrypto/util/files.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/local/bin/perl # # used to generate the file MINFO for use by util/mk1mf.pl # It is basically a list of all variables from the passed makefile diff --git a/src/lib/libcrypto/util/libeay.num b/src/lib/libcrypto/util/libeay.num index fcaf254287..59c2040a29 100644 --- a/src/lib/libcrypto/util/libeay.num +++ b/src/lib/libcrypto/util/libeay.num @@ -580,7 +580,7 @@ X509_NAME_oneline 585 X509_NAME_print 586 X509_NAME_set 587 X509_OBJECT_free_contents 588 -X509_OBJECT_retrive_by_subject 589 +X509_OBJECT_retrieve_by_subject 589 X509_OBJECT_up_ref_count 590 X509_PKEY_free 591 X509_PKEY_new 592 @@ -695,12 +695,12 @@ a2i_ASN1_INTEGER 700 a2i_ASN1_STRING 701 asn1_Finish 702 asn1_GetSequence 703 -bn_div64 704 +bn_div_words 704 bn_expand2 705 bn_mul_add_words 706 bn_mul_words 707 -bn_qadd 708 -bn_qsub 709 +BN_uadd 708 +BN_usub 709 bn_sqr_words 710 crypt 711 d2i_ASN1_BIT_STRING 712 @@ -1063,3 +1063,784 @@ EVP_rc5_32_12_16_cfb 1088 EVP_rc5_32_12_16_ecb 1089 EVP_rc5_32_12_16_ofb 1090 asn1_add_error 1091 +d2i_ASN1_BMPSTRING 1092 +i2d_ASN1_BMPSTRING 1093 +BIO_f_ber 1094 +BN_init 1095 +COMP_CTX_new 1096 +COMP_CTX_free 1097 +COMP_CTX_compress_block 1098 +COMP_CTX_expand_block 1099 +X509_STORE_CTX_get_ex_new_index 1100 +OBJ_NAME_add 1101 +BIO_socket_nbio 1102 +EVP_rc2_64_cbc 1103 +OBJ_NAME_cleanup 1104 +OBJ_NAME_get 1105 +OBJ_NAME_init 1106 +OBJ_NAME_new_index 1107 +OBJ_NAME_remove 1108 +BN_MONT_CTX_copy 1109 +BIO_new_socks4a_connect 1110 +BIO_s_socks4a_connect 1111 +PROXY_set_connect_mode 1112 +RAND_SSLeay 1113 +RAND_set_rand_method 1114 +RSA_memory_lock 1115 +bn_sub_words 1116 +bn_mul_normal 1117 +bn_mul_comba8 1118 +bn_mul_comba4 1119 +bn_sqr_normal 1120 +bn_sqr_comba8 1121 +bn_sqr_comba4 1122 +bn_cmp_words 1123 +bn_mul_recursive 1124 +bn_mul_part_recursive 1125 +bn_sqr_recursive 1126 +bn_mul_low_normal 1127 +BN_RECP_CTX_init 1128 +BN_RECP_CTX_new 1129 +BN_RECP_CTX_free 1130 +BN_RECP_CTX_set 1131 +BN_mod_mul_reciprocal 1132 +BN_mod_exp_recp 1133 +BN_div_recp 1134 +BN_CTX_init 1135 +BN_MONT_CTX_init 1136 +RAND_get_rand_method 1137 +PKCS7_add_attribute 1138 +PKCS7_add_signed_attribute 1139 +PKCS7_digest_from_attributes 1140 +PKCS7_get_attribute 1141 +PKCS7_get_issuer_and_serial 1142 +PKCS7_get_signed_attribute 1143 +COMP_compress_block 1144 +COMP_expand_block 1145 +COMP_rle 1146 +COMP_zlib 1147 +ms_time_diff 1148 +ms_time_new 1149 +ms_time_free 1150 +ms_time_cmp 1151 +ms_time_get 1152 +PKCS7_set_attributes 1153 +PKCS7_set_signed_attributes 1154 +X509_ATTRIBUTE_create 1155 +X509_ATTRIBUTE_dup 1156 +ASN1_GENERALIZEDTIME_check 1157 +ASN1_GENERALIZEDTIME_print 1158 +ASN1_GENERALIZEDTIME_set 1159 +ASN1_GENERALIZEDTIME_set_string 1160 +ASN1_TIME_print 1161 +BASIC_CONSTRAINTS_free 1162 +BASIC_CONSTRAINTS_new 1163 +ERR_load_X509V3_strings 1164 +NETSCAPE_CERT_SEQUENCE_free 1165 +NETSCAPE_CERT_SEQUENCE_new 1166 +OBJ_txt2obj 1167 +PEM_read_NETSCAPE_CERT_SEQUENCE 1168 +PEM_read_bio_NETSCAPE_CERT_SEQUENCE 1169 +PEM_write_NETSCAPE_CERT_SEQUENCE 1170 +PEM_write_bio_NETSCAPE_CERT_SEQUENCE 1171 +X509V3_EXT_add 1172 +X509V3_EXT_add_alias 1173 +X509V3_EXT_add_conf 1174 +X509V3_EXT_cleanup 1175 +X509V3_EXT_conf 1176 +X509V3_EXT_conf_nid 1177 +X509V3_EXT_get 1178 +X509V3_EXT_get_nid 1179 +X509V3_EXT_print 1180 +X509V3_EXT_print_fp 1181 +X509V3_add_standard_extensions 1182 +X509V3_add_value 1183 +X509V3_add_value_bool 1184 +X509V3_add_value_int 1185 +X509V3_conf_free 1186 +X509V3_get_value_bool 1187 +X509V3_get_value_int 1188 +X509V3_parse_list 1189 +d2i_ASN1_GENERALIZEDTIME 1190 +d2i_ASN1_TIME 1191 +d2i_BASIC_CONSTRAINTS 1192 +d2i_NETSCAPE_CERT_SEQUENCE 1193 +d2i_ext_ku 1194 +ext_ku_free 1195 +ext_ku_new 1196 +i2d_ASN1_GENERALIZEDTIME 1197 +i2d_ASN1_TIME 1198 +i2d_BASIC_CONSTRAINTS 1199 +i2d_NETSCAPE_CERT_SEQUENCE 1200 +i2d_ext_ku 1201 +EVP_MD_CTX_copy 1202 +i2d_ASN1_ENUMERATED 1203 +d2i_ASN1_ENUMERATED 1204 +ASN1_ENUMERATED_set 1205 +ASN1_ENUMERATED_get 1206 +BN_to_ASN1_ENUMERATED 1207 +ASN1_ENUMERATED_to_BN 1208 +i2a_ASN1_ENUMERATED 1209 +a2i_ASN1_ENUMERATED 1210 +i2d_GENERAL_NAME 1211 +d2i_GENERAL_NAME 1212 +GENERAL_NAME_new 1213 +GENERAL_NAME_free 1214 +GENERAL_NAMES_new 1215 +GENERAL_NAMES_free 1216 +d2i_GENERAL_NAMES 1217 +i2d_GENERAL_NAMES 1218 +i2v_GENERAL_NAMES 1219 +i2s_ASN1_OCTET_STRING 1220 +s2i_ASN1_OCTET_STRING 1221 +X509V3_EXT_check_conf 1222 +hex_to_string 1223 +string_to_hex 1224 +des_ede3_cbcm_encrypt 1225 +RSA_padding_add_PKCS1_OAEP 1226 +RSA_padding_check_PKCS1_OAEP 1227 +X509_CRL_print_fp 1228 +X509_CRL_print 1229 +i2v_GENERAL_NAME 1230 +v2i_GENERAL_NAME 1231 +i2d_PKEY_USAGE_PERIOD 1232 +d2i_PKEY_USAGE_PERIOD 1233 +PKEY_USAGE_PERIOD_new 1234 +PKEY_USAGE_PERIOD_free 1235 +v2i_GENERAL_NAMES 1236 +i2s_ASN1_INTEGER 1237 +X509V3_EXT_d2i 1238 +name_cmp 1239 +str_dup 1240 +i2s_ASN1_ENUMERATED 1241 +i2s_ASN1_ENUMERATED_TABLE 1242 +BIO_s_log 1243 +BIO_f_reliable 1244 +PKCS7_dataFinal 1245 +PKCS7_dataDecode 1246 +X509V3_EXT_CRL_add_conf 1247 +BN_set_params 1248 +BN_get_params 1249 +BIO_get_ex_num 1250 +BIO_set_ex_free_func 1251 +EVP_ripemd160 1252 +ASN1_TIME_set 1253 +i2d_AUTHORITY_KEYID 1254 +d2i_AUTHORITY_KEYID 1255 +AUTHORITY_KEYID_new 1256 +AUTHORITY_KEYID_free 1257 +ASN1_seq_unpack 1258 +ASN1_seq_pack 1259 +ASN1_unpack_string 1260 +ASN1_pack_string 1261 +PKCS12_pack_safebag 1262 +PKCS12_MAKE_KEYBAG 1263 +PKCS8_encrypt 1264 +PKCS12_MAKE_SHKEYBAG 1265 +PKCS12_pack_p7data 1266 +PKCS12_pack_p7encdata 1267 +PKCS12_add_localkeyid 1268 +PKCS12_add_friendlyname_asc 1269 +PKCS12_add_friendlyname_uni 1270 +PKCS12_get_friendlyname 1271 +PKCS12_pbe_crypt 1272 +PKCS12_decrypt_d2i 1273 +PKCS12_i2d_encrypt 1274 +PKCS12_init 1275 +PKCS12_key_gen_asc 1276 +PKCS12_key_gen_uni 1277 +PKCS12_gen_mac 1278 +PKCS12_verify_mac 1279 +PKCS12_set_mac 1280 +PKCS12_setup_mac 1281 +asc2uni 1282 +uni2asc 1283 +i2d_PKCS12_BAGS 1284 +PKCS12_BAGS_new 1285 +d2i_PKCS12_BAGS 1286 +PKCS12_BAGS_free 1287 +i2d_PKCS12 1288 +d2i_PKCS12 1289 +PKCS12_new 1290 +PKCS12_free 1291 +i2d_PKCS12_MAC_DATA 1292 +PKCS12_MAC_DATA_new 1293 +d2i_PKCS12_MAC_DATA 1294 +PKCS12_MAC_DATA_free 1295 +i2d_PKCS12_SAFEBAG 1296 +PKCS12_SAFEBAG_new 1297 +d2i_PKCS12_SAFEBAG 1298 +PKCS12_SAFEBAG_free 1299 +ERR_load_PKCS12_strings 1300 +PKCS12_PBE_add 1301 +PKCS8_add_keyusage 1302 +PKCS12_get_attr_gen 1303 +PKCS12_parse 1304 +PKCS12_create 1305 +i2d_PKCS12_bio 1306 +i2d_PKCS12_fp 1307 +d2i_PKCS12_bio 1308 +d2i_PKCS12_fp 1309 +i2d_PBEPARAM 1310 +PBEPARAM_new 1311 +d2i_PBEPARAM 1312 +PBEPARAM_free 1313 +i2d_PKCS8_PRIV_KEY_INFO 1314 +PKCS8_PRIV_KEY_INFO_new 1315 +d2i_PKCS8_PRIV_KEY_INFO 1316 +PKCS8_PRIV_KEY_INFO_free 1317 +EVP_PKCS82PKEY 1318 +EVP_PKEY2PKCS8 1319 +PKCS8_set_broken 1320 +EVP_PBE_ALGOR_CipherInit 1321 +EVP_PBE_alg_add 1322 +PKCS5_pbe_set 1323 +EVP_PBE_cleanup 1324 +i2d_SXNET 1325 +d2i_SXNET 1326 +SXNET_new 1327 +SXNET_free 1328 +i2d_SXNETID 1329 +d2i_SXNETID 1330 +SXNETID_new 1331 +SXNETID_free 1332 +DSA_SIG_new 1333 +DSA_SIG_free 1334 +DSA_do_sign 1335 +DSA_do_verify 1336 +d2i_DSA_SIG 1337 +i2d_DSA_SIG 1338 + +i2d_ASN1_VISIBLESTRING 1339 +d2i_ASN1_VISIBLESTRING 1340 +i2d_ASN1_UTF8STRING 1341 +d2i_ASN1_UTF8STRING 1342 +i2d_DIRECTORYSTRING 1343 +d2i_DIRECTORYSTRING 1344 +i2d_DISPLAYTEXT 1345 +d2i_DISPLAYTEXT 1346 +sk_X509_NAME_new 1347 +sk_X509_NAME_new_null 1348 +sk_X509_NAME_free 1349 +sk_X509_NAME_num 1350 +sk_X509_NAME_value 1351 +sk_X509_NAME_set 1352 +sk_X509_NAME_zero 1353 +sk_X509_NAME_push 1354 +sk_X509_NAME_pop 1355 +sk_X509_NAME_find 1356 +sk_X509_NAME_delete 1357 +sk_X509_NAME_delete_ptr 1358 +sk_X509_NAME_set_cmp_func 1359 +sk_X509_NAME_dup 1360 +sk_X509_NAME_pop_free 1361 +sk_X509_NAME_shift 1362 +sk_X509_new 1363 +sk_X509_new_null 1364 +sk_X509_free 1365 +sk_X509_num 1366 +sk_X509_value 1367 +sk_X509_set 1368 +sk_X509_zero 1369 +sk_X509_push 1370 +sk_X509_pop 1371 +sk_X509_find 1372 +sk_X509_delete 1373 +sk_X509_delete_ptr 1374 +sk_X509_set_cmp_func 1375 +sk_X509_dup 1376 +sk_X509_pop_free 1377 +sk_X509_shift 1378 +d2i_ASN1_SET_OF_X509 1379 +i2d_ASN1_SET_OF_X509 1380 +sk_X509_ATTRIBUTE_new 1381 +sk_X509_ATTRIBUTE_new_null 1382 +sk_X509_ATTRIBUTE_free 1383 +sk_X509_ATTRIBUTE_num 1384 +sk_X509_ATTRIBUTE_value 1385 +sk_X509_ATTRIBUTE_set 1386 +sk_X509_ATTRIBUTE_zero 1387 +sk_X509_ATTRIBUTE_push 1388 +sk_X509_ATTRIBUTE_pop 1389 +sk_X509_ATTRIBUTE_find 1390 +sk_X509_ATTRIBUTE_delete 1391 +sk_X509_ATTRIBUTE_delete_ptr 1392 +sk_X509_ATTRIBUTE_set_cmp_func 1393 +sk_X509_ATTRIBUTE_dup 1394 +sk_X509_ATTRIBUTE_pop_free 1395 +sk_X509_ATTRIBUTE_shift 1396 +i2d_PBKDF2PARAM 1397 +PBKDF2PARAM_new 1398 +d2i_PBKDF2PARAM 1399 +PBKDF2PARAM_free 1400 +i2d_PBE2PARAM 1401 +PBE2PARAM_new 1402 +d2i_PBE2PARAM 1403 +PBE2PARAM_free 1404 +sk_GENERAL_NAME_new 1405 +sk_GENERAL_NAME_new_null 1406 +sk_GENERAL_NAME_free 1407 +sk_GENERAL_NAME_num 1408 +sk_GENERAL_NAME_value 1409 +sk_GENERAL_NAME_set 1410 +sk_GENERAL_NAME_zero 1411 +sk_GENERAL_NAME_push 1412 +sk_GENERAL_NAME_pop 1413 +sk_GENERAL_NAME_find 1414 +sk_GENERAL_NAME_delete 1415 +sk_GENERAL_NAME_delete_ptr 1416 +sk_GENERAL_NAME_set_cmp_func 1417 +sk_GENERAL_NAME_dup 1418 +sk_GENERAL_NAME_pop_free 1419 +sk_GENERAL_NAME_shift 1420 +d2i_ASN1_SET_OF_GENERAL_NAME 1421 +i2d_ASN1_SET_OF_GENERAL_NAME 1422 +sk_SXNETID_new 1423 +sk_SXNETID_new_null 1424 +sk_SXNETID_free 1425 +sk_SXNETID_num 1426 +sk_SXNETID_value 1427 +sk_SXNETID_set 1428 +sk_SXNETID_zero 1429 +sk_SXNETID_push 1430 +sk_SXNETID_pop 1431 +sk_SXNETID_find 1432 +sk_SXNETID_delete 1433 +sk_SXNETID_delete_ptr 1434 +sk_SXNETID_set_cmp_func 1435 +sk_SXNETID_dup 1436 +sk_SXNETID_pop_free 1437 +sk_SXNETID_shift 1438 +d2i_ASN1_SET_OF_SXNETID 1439 +i2d_ASN1_SET_OF_SXNETID 1440 +sk_POLICYQUALINFO_new 1441 +sk_POLICYQUALINFO_new_null 1442 +sk_POLICYQUALINFO_free 1443 +sk_POLICYQUALINFO_num 1444 +sk_POLICYQUALINFO_value 1445 +sk_POLICYQUALINFO_set 1446 +sk_POLICYQUALINFO_zero 1447 +sk_POLICYQUALINFO_push 1448 +sk_POLICYQUALINFO_pop 1449 +sk_POLICYQUALINFO_find 1450 +sk_POLICYQUALINFO_delete 1451 +sk_POLICYQUALINFO_delete_ptr 1452 +sk_POLICYQUALINFO_set_cmp_func 1453 +sk_POLICYQUALINFO_dup 1454 +sk_POLICYQUALINFO_pop_free 1455 +sk_POLICYQUALINFO_shift 1456 +d2i_ASN1_SET_OF_POLICYQUALINFO 1457 +i2d_ASN1_SET_OF_POLICYQUALINFO 1458 +sk_POLICYINFO_new 1459 +sk_POLICYINFO_new_null 1460 +sk_POLICYINFO_free 1461 +sk_POLICYINFO_num 1462 +sk_POLICYINFO_value 1463 +sk_POLICYINFO_set 1464 +sk_POLICYINFO_zero 1465 +sk_POLICYINFO_push 1466 +sk_POLICYINFO_pop 1467 +sk_POLICYINFO_find 1468 +sk_POLICYINFO_delete 1469 +sk_POLICYINFO_delete_ptr 1470 +sk_POLICYINFO_set_cmp_func 1471 +sk_POLICYINFO_dup 1472 +sk_POLICYINFO_pop_free 1473 +sk_POLICYINFO_shift 1474 +d2i_ASN1_SET_OF_POLICYINFO 1475 +i2d_ASN1_SET_OF_POLICYINFO 1476 +SXNET_add_id_asc 1477 +SXNET_add_id_ulong 1478 +SXNET_add_id_INTEGER 1479 +SXNET_get_id_asc 1480 +SXNET_get_id_ulong 1481 +SXNET_get_id_INTEGER 1482 +X509V3_set_conf_lhash 1483 +i2d_CERTIFICATEPOLICIES 1484 +CERTIFICATEPOLICIES_new 1485 +CERTIFICATEPOLICIES_free 1486 +d2i_CERTIFICATEPOLICIES 1487 +i2d_POLICYINFO 1488 +POLICYINFO_new 1489 +d2i_POLICYINFO 1490 +POLICYINFO_free 1491 +i2d_POLICYQUALINFO 1492 +POLICYQUALINFO_new 1493 +d2i_POLICYQUALINFO 1494 +POLICYQUALINFO_free 1495 +i2d_USERNOTICE 1496 +USERNOTICE_new 1497 +d2i_USERNOTICE 1498 +USERNOTICE_free 1499 +i2d_NOTICEREF 1500 +NOTICEREF_new 1501 +d2i_NOTICEREF 1502 +NOTICEREF_free 1503 +X509V3_get_string 1504 +X509V3_get_section 1505 +X509V3_string_free 1506 +X509V3_section_free 1507 +X509V3_set_ctx 1508 +s2i_ASN1_INTEGER 1509 +CRYPTO_set_locked_mem_functions 1510 +CRYPTO_get_locked_mem_functions 1511 +CRYPTO_malloc_locked 1512 +CRYPTO_free_locked 1513 +BN_mod_exp2_mont 1514 +ERR_get_error_line_data 1515 +ERR_peek_error_line_data 1516 +PKCS12_PBE_keyivgen 1517 +X509_ALGOR_dup 1518 +sk_DIST_POINT_new 1519 +sk_DIST_POINT_new_null 1520 +sk_DIST_POINT_free 1521 +sk_DIST_POINT_num 1522 +sk_DIST_POINT_value 1523 +sk_DIST_POINT_set 1524 +sk_DIST_POINT_zero 1525 +sk_DIST_POINT_push 1526 +sk_DIST_POINT_pop 1527 +sk_DIST_POINT_find 1528 +sk_DIST_POINT_delete 1529 +sk_DIST_POINT_delete_ptr 1530 +sk_DIST_POINT_set_cmp_func 1531 +sk_DIST_POINT_dup 1532 +sk_DIST_POINT_pop_free 1533 +sk_DIST_POINT_shift 1534 +d2i_ASN1_SET_OF_DIST_POINT 1535 +i2d_ASN1_SET_OF_DIST_POINT 1536 +i2d_CRL_DIST_POINTS 1537 +CRL_DIST_POINTS_new 1538 +CRL_DIST_POINTS_free 1539 +d2i_CRL_DIST_POINTS 1540 +i2d_DIST_POINT 1541 +DIST_POINT_new 1542 +d2i_DIST_POINT 1543 +DIST_POINT_free 1544 +i2d_DIST_POINT_NAME 1545 +DIST_POINT_NAME_new 1546 +DIST_POINT_NAME_free 1547 +d2i_DIST_POINT_NAME 1548 +X509V3_add_value_uchar 1549 +sk_X509_INFO_new 1550 +sk_X509_EXTENSION_new 1551 +sk_X509_NAME_ENTRY_unshift 1552 +sk_ASN1_TYPE_value 1553 +sk_X509_EXTENSION_find 1554 +d2i_ASN1_SET_OF_X509_ATTRIBUTE 1555 +sk_ASN1_TYPE_pop 1556 +sk_X509_EXTENSION_set_cmp_func 1557 +sk_ASN1_TYPE_new_null 1558 +sk_X509_NAME_ENTRY_delete 1559 +i2d_ASN1_SET_OF_ASN1_TYPE 1560 +sk_X509_NAME_ENTRY_dup 1561 +sk_X509_unshift 1562 +sk_X509_NAME_unshift 1563 +sk_ASN1_TYPE_num 1564 +sk_X509_EXTENSION_new_null 1565 +sk_X509_INFO_value 1566 +d2i_ASN1_SET_OF_X509_EXTENSION 1567 +sk_X509_INFO_delete_ptr 1568 +sk_X509_NAME_ENTRY_new 1569 +sk_DIST_POINT_insert 1570 +sk_ASN1_TYPE_set_cmp_func 1571 +sk_X509_EXTENSION_value 1572 +sk_DIST_POINT_unshift 1573 +d2i_ASN1_SET_OF_X509_NAME_ENTRY 1574 +sk_X509_INFO_pop 1575 +sk_X509_EXTENSION_pop 1576 +sk_X509_NAME_ENTRY_shift 1577 +sk_X509_INFO_num 1578 +sk_X509_EXTENSION_num 1579 +sk_X509_INFO_pop_free 1580 +sk_POLICYQUALINFO_unshift 1581 +sk_POLICYINFO_unshift 1582 +sk_X509_NAME_ENTRY_new_null 1583 +sk_X509_NAME_ENTRY_pop 1584 +sk_X509_ATTRIBUTE_unshift 1585 +sk_X509_NAME_ENTRY_num 1586 +sk_GENERAL_NAME_unshift 1587 +sk_X509_INFO_free 1588 +d2i_ASN1_SET_OF_ASN1_TYPE 1589 +sk_X509_INFO_insert 1590 +sk_X509_NAME_ENTRY_value 1591 +sk_POLICYQUALINFO_insert 1592 +sk_ASN1_TYPE_set 1593 +sk_X509_EXTENSION_delete_ptr 1594 +sk_X509_INFO_unshift 1595 +sk_ASN1_TYPE_unshift 1596 +sk_ASN1_TYPE_free 1597 +sk_ASN1_TYPE_delete_ptr 1598 +sk_ASN1_TYPE_pop_free 1599 +sk_X509_EXTENSION_unshift 1600 +sk_X509_EXTENSION_pop_free 1601 +sk_X509_NAME_ENTRY_set_cmp_func 1602 +sk_ASN1_TYPE_insert 1603 +sk_X509_NAME_ENTRY_free 1604 +sk_SXNETID_insert 1605 +sk_X509_NAME_insert 1606 +sk_X509_insert 1607 +sk_X509_INFO_delete 1608 +sk_X509_INFO_set_cmp_func 1609 +sk_X509_ATTRIBUTE_insert 1610 +sk_X509_INFO_zero 1611 +sk_X509_INFO_set 1612 +sk_X509_EXTENSION_set 1613 +sk_X509_EXTENSION_free 1614 +i2d_ASN1_SET_OF_X509_ATTRIBUTE 1615 +sk_SXNETID_unshift 1616 +sk_X509_INFO_push 1617 +sk_X509_EXTENSION_insert 1618 +sk_X509_INFO_new_null 1619 +sk_ASN1_TYPE_dup 1620 +sk_X509_INFO_find 1621 +sk_POLICYINFO_insert 1622 +sk_ASN1_TYPE_zero 1623 +i2d_ASN1_SET_OF_X509_EXTENSION 1624 +sk_X509_NAME_ENTRY_set 1625 +sk_ASN1_TYPE_push 1626 +sk_X509_NAME_ENTRY_insert 1627 +sk_ASN1_TYPE_new 1628 +sk_GENERAL_NAME_insert 1629 +sk_ASN1_TYPE_shift 1630 +sk_ASN1_TYPE_delete 1631 +sk_X509_NAME_ENTRY_pop_free 1632 +i2d_ASN1_SET_OF_X509_NAME_ENTRY 1633 +sk_X509_NAME_ENTRY_zero 1634 +sk_ASN1_TYPE_find 1635 +sk_X509_NAME_ENTRY_delete_ptr 1636 +sk_X509_NAME_ENTRY_push 1637 +sk_X509_EXTENSION_zero 1638 +sk_X509_INFO_shift 1639 +sk_X509_INFO_dup 1640 +sk_X509_EXTENSION_dup 1641 +sk_X509_EXTENSION_delete 1642 +sk_X509_EXTENSION_shift 1643 +sk_X509_EXTENSION_push 1644 +sk_X509_NAME_ENTRY_find 1645 +X509V3_EXT_i2d 1646 +X509V3_EXT_val_prn 1647 +X509V3_EXT_add_list 1648 +EVP_CIPHER_type 1649 +EVP_PBE_CipherInit 1650 +X509V3_add_value_bool_nf 1651 +d2i_ASN1_UINTEGER 1652 +sk_value 1653 +sk_num 1654 +sk_set 1655 +sk_X509_REVOKED_set_cmp_func 1656 +sk_X509_REVOKED_unshift 1657 +sk_X509_REVOKED_dup 1658 +sk_X509_REVOKED_free 1659 +sk_X509_REVOKED_new 1660 +i2d_ASN1_SET_OF_X509_REVOKED 1661 +sk_X509_REVOKED_shift 1662 +sk_X509_REVOKED_delete_ptr 1663 +sk_X509_REVOKED_pop_free 1664 +sk_X509_REVOKED_insert 1665 +sk_X509_REVOKED_zero 1666 +sk_X509_REVOKED_pop 1667 +sk_X509_REVOKED_value 1668 +sk_X509_REVOKED_num 1669 +sk_X509_REVOKED_push 1670 +sk_sort 1671 +sk_X509_REVOKED_find 1672 +sk_X509_REVOKED_delete 1673 +d2i_ASN1_SET_OF_X509_REVOKED 1674 +sk_X509_REVOKED_new_null 1675 +sk_X509_REVOKED_set 1676 +sk_X509_ALGOR_new 1677 +sk_X509_CRL_set_cmp_func 1678 +sk_X509_CRL_set 1679 +sk_X509_ALGOR_unshift 1680 +sk_X509_CRL_free 1681 +i2d_ASN1_SET_OF_X509_ALGOR 1682 +sk_X509_ALGOR_pop 1683 +sk_X509_CRL_unshift 1684 +i2d_ASN1_SET_OF_X509_CRL 1685 +sk_X509_ALGOR_num 1686 +sk_X509_CRL_insert 1687 +sk_X509_CRL_pop_free 1688 +sk_X509_CRL_delete_ptr 1689 +sk_X509_ALGOR_insert 1690 +sk_X509_CRL_dup 1691 +sk_X509_CRL_zero 1692 +sk_X509_CRL_new 1693 +sk_X509_CRL_push 1694 +sk_X509_ALGOR_new_null 1695 +d2i_ASN1_SET_OF_X509_ALGOR 1696 +sk_X509_CRL_shift 1697 +sk_X509_CRL_find 1698 +sk_X509_CRL_delete 1699 +sk_X509_ALGOR_free 1700 +sk_X509_ALGOR_delete 1701 +d2i_ASN1_SET_OF_X509_CRL 1702 +sk_X509_ALGOR_delete_ptr 1703 +sk_X509_CRL_pop 1704 +sk_X509_ALGOR_set 1705 +sk_X509_CRL_num 1706 +sk_X509_CRL_value 1707 +sk_X509_ALGOR_shift 1708 +sk_X509_ALGOR_zero 1709 +sk_X509_CRL_new_null 1710 +sk_X509_ALGOR_push 1711 +sk_X509_ALGOR_value 1712 +sk_X509_ALGOR_find 1713 +sk_X509_ALGOR_set_cmp_func 1714 +sk_X509_ALGOR_dup 1715 +sk_X509_ALGOR_pop_free 1716 +sk_PKCS7_SIGNER_INFO_new 1717 +sk_PKCS7_SIGNER_INFO_zero 1718 +sk_PKCS7_SIGNER_INFO_unshift 1719 +sk_PKCS7_RECIP_INFO_dup 1720 +sk_PKCS7_SIGNER_INFO_insert 1721 +sk_PKCS7_SIGNER_INFO_push 1722 +i2d_ASN1_SET_OF_PKCS7_SIGNER_INFO 1723 +sk_PKCS7_RECIP_INFO_new 1724 +sk_X509_LOOKUP_new_null 1725 +sk_PKCS7_SIGNER_INFO_find 1726 +sk_PKCS7_SIGNER_INFO_set_cmp_func 1727 +sk_X509_LOOKUP_zero 1728 +sk_PKCS7_RECIP_INFO_shift 1729 +sk_PKCS7_RECIP_INFO_new_null 1730 +sk_PKCS7_SIGNER_INFO_shift 1731 +sk_PKCS7_SIGNER_INFO_pop 1732 +sk_PKCS7_SIGNER_INFO_pop_free 1733 +sk_X509_LOOKUP_push 1734 +sk_X509_LOOKUP_dup 1735 +sk_PKCS7_SIGNER_INFO_num 1736 +sk_X509_LOOKUP_find 1737 +i2d_ASN1_SET_OF_PKCS7_RECIP_INFO 1738 +sk_X509_LOOKUP_new 1739 +sk_PKCS7_SIGNER_INFO_delete 1740 +sk_PKCS7_RECIP_INFO_set_cmp_func 1741 +sk_PKCS7_SIGNER_INFO_delete_ptr 1742 +sk_PKCS7_RECIP_INFO_pop 1743 +sk_X509_LOOKUP_insert 1744 +sk_PKCS7_RECIP_INFO_value 1745 +sk_PKCS7_RECIP_INFO_num 1746 +sk_PKCS7_SIGNER_INFO_value 1747 +d2i_ASN1_SET_OF_PKCS7_SIGNER_INFO 1748 +sk_X509_LOOKUP_pop 1749 +sk_X509_LOOKUP_num 1750 +sk_X509_LOOKUP_delete 1751 +sk_PKCS7_RECIP_INFO_free 1752 +d2i_ASN1_SET_OF_PKCS7_RECIP_INFO 1753 +sk_PKCS7_SIGNER_INFO_set 1754 +sk_X509_LOOKUP_pop_free 1755 +sk_X509_LOOKUP_shift 1756 +sk_X509_LOOKUP_unshift 1757 +sk_PKCS7_SIGNER_INFO_new_null 1758 +sk_PKCS7_RECIP_INFO_delete_ptr 1759 +sk_PKCS7_RECIP_INFO_pop_free 1760 +sk_PKCS7_RECIP_INFO_insert 1761 +sk_PKCS7_SIGNER_INFO_free 1762 +sk_PKCS7_RECIP_INFO_set 1763 +sk_PKCS7_RECIP_INFO_zero 1764 +sk_X509_LOOKUP_value 1765 +sk_PKCS7_RECIP_INFO_push 1766 +sk_PKCS7_RECIP_INFO_unshift 1767 +sk_X509_LOOKUP_set_cmp_func 1768 +sk_X509_LOOKUP_free 1769 +sk_PKCS7_SIGNER_INFO_dup 1770 +sk_X509_LOOKUP_delete_ptr 1771 +sk_X509_LOOKUP_set 1772 +sk_PKCS7_RECIP_INFO_find 1773 +sk_PKCS7_RECIP_INFO_delete 1774 +PKCS5_PBE_add 1775 +PEM_write_bio_PKCS8 1776 +i2d_PKCS8_fp 1777 +PEM_read_bio_PKCS8_PRIV_KEY_INFO 1778 +d2i_PKCS8_bio 1779 +d2i_PKCS8_PRIV_KEY_INFO_fp 1780 +PEM_write_bio_PKCS8_PRIV_KEY_INFO 1781 +PEM_read_PKCS8 1782 +d2i_PKCS8_PRIV_KEY_INFO_bio 1783 +d2i_PKCS8_fp 1784 +PEM_write_PKCS8 1785 +PEM_read_PKCS8_PRIV_KEY_INFO 1786 +PEM_read_bio_PKCS8 1787 +PEM_write_PKCS8_PRIV_KEY_INFO 1788 +PKCS5_PBE_keyivgen 1789 +i2d_PKCS8_bio 1790 +i2d_PKCS8_PRIV_KEY_INFO_fp 1791 +i2d_PKCS8_PRIV_KEY_INFO_bio 1792 +BIO_s_bio 1793 +PKCS5_pbe2_set 1794 +PKCS5_PBKDF2_HMAC_SHA1 1795 +PKCS5_v2_PBE_keyivgen 1796 +PEM_write_bio_PKCS8PrivateKey 1797 +PEM_write_PKCS8PrivateKey 1798 +BIO_ctrl_get_read_request 1799 +BIO_ctrl_pending 1800 +BIO_ctrl_wpending 1801 +BIO_new_bio_pair 1802 +BIO_ctrl_get_write_guarantee 1803 +CRYPTO_num_locks 1804 +CONF_load_bio 1805 +CONF_load_fp 1806 +sk_CONF_VALUE_delete 1807 +sk_CONF_VALUE_pop 1808 +sk_CONF_VALUE_num 1809 +sk_CONF_VALUE_pop_free 1810 +sk_CONF_VALUE_free 1811 +sk_CONF_VALUE_shift 1812 +sk_CONF_VALUE_unshift 1813 +sk_CONF_VALUE_value 1814 +sk_CONF_VALUE_set 1815 +sk_CONF_VALUE_zero 1816 +sk_CONF_VALUE_push 1817 +sk_CONF_VALUE_delete_ptr 1818 +sk_CONF_VALUE_find 1819 +sk_CONF_VALUE_set_cmp_func 1820 +sk_CONF_VALUE_new_null 1821 +sk_CONF_VALUE_dup 1822 +sk_CONF_VALUE_insert 1823 +sk_CONF_VALUE_new 1824 +sk_ASN1_OBJECT_find 1825 +sk_ASN1_OBJECT_pop_free 1826 +sk_ASN1_OBJECT_dup 1827 +sk_ASN1_OBJECT_delete_ptr 1828 +sk_ASN1_OBJECT_new 1829 +sk_ASN1_OBJECT_unshift 1830 +sk_ASN1_OBJECT_delete 1831 +sk_ASN1_OBJECT_shift 1832 +sk_ASN1_OBJECT_pop 1833 +sk_ASN1_OBJECT_num 1834 +sk_ASN1_OBJECT_value 1835 +sk_ASN1_OBJECT_new_null 1836 +i2d_ASN1_SET_OF_ASN1_OBJECT 1837 +sk_ASN1_OBJECT_free 1838 +sk_ASN1_OBJECT_set 1839 +sk_ASN1_OBJECT_set_cmp_func 1840 +sk_ASN1_OBJECT_zero 1841 +sk_ASN1_OBJECT_insert 1842 +sk_ASN1_OBJECT_push 1843 +d2i_ASN1_SET_OF_ASN1_OBJECT 1844 +PKCS7_signatureVerify 1845 +RSA_set_method 1846 +RSA_get_method 1847 +RSA_get_default_method 1848 +sk_CONF_VALUE_sort 1849 +sk_X509_REVOKED_sort 1850 +sk_X509_ATTRIBUTE_sort 1851 +sk_X509_INFO_sort 1852 +sk_POLICYINFO_sort 1853 +sk_GENERAL_NAME_sort 1854 +sk_X509_sort 1855 +sk_X509_NAME_sort 1856 +sk_ASN1_TYPE_sort 1857 +sk_X509_ALGOR_sort 1858 +sk_PKCS7_RECIP_INFO_sort 1859 +sk_X509_NAME_ENTRY_sort 1860 +sk_X509_EXTENSION_sort 1861 +sk_SXNETID_sort 1862 +sk_ASN1_OBJECT_sort 1863 +sk_PKCS7_SIGNER_INFO_sort 1864 +sk_X509_LOOKUP_sort 1865 +sk_POLICYQUALINFO_sort 1866 +sk_X509_CRL_sort 1867 +sk_DIST_POINT_sort 1868 +RSA_check_key 1869 +OBJ_obj2txt 1870 +DSA_dup_DH 1871 diff --git a/src/lib/libcrypto/util/mk1mf.pl b/src/lib/libcrypto/util/mk1mf.pl index 149a0f4f80..6fbf3ceca6 100644 --- a/src/lib/libcrypto/util/mk1mf.pl +++ b/src/lib/libcrypto/util/mk1mf.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/local/bin/perl # 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 @@ -6,82 +6,59 @@ # $INSTALLTOP="/usr/local/ssl"; +$OPTIONS=""; +$ssl_version=""; + +open(IN,") { + $ssl_version=$1 if (/^VERSION=(.*)$/); + $OPTIONS=$1 if (/^OPTIONS=(.*)$/); + $INSTALLTOP=$1 if (/^INSTALLTOP=(.*$)/); +} +close(IN); -$ssl_version="0.8.2"; +die "Makefile.ssl is not the toplevel Makefile!\n" if $ssl_version eq ""; $infile="MINFO"; %ops=( - "VC-WIN32", "Microsoft Visual C++ 4.[01] - Windows NT [34].x", + "VC-WIN32", "Microsoft Visual C++ [4-6] - Windows NT or 9X", + "VC-NT", "Microsoft Visual C++ [4-6] - Windows NT ONLY", "VC-W31-16", "Microsoft Visual C++ 1.52 - Windows 3.1 - 286", "VC-WIN16", "Alias for VC-W31-32", "VC-W31-32", "Microsoft Visual C++ 1.52 - Windows 3.1 - 386+", "VC-MSDOS","Microsoft Visual C++ 1.52 - MSDOS", - "BC-NT", "Borland C++ 4.5 - Windows NT - PROBABLY NOT WORKING", + "Mingw32", "GNU C++ - Windows NT or 9x", + "Mingw32-files", "Create files with DOS copy ...", + "BC-NT", "Borland C++ 4.5 - Windows NT", "BC-W31", "Borland C++ 4.5 - Windows 3.1 - PROBABLY NOT WORKING", "BC-MSDOS","Borland C++ 4.5 - MSDOS", "linux-elf","Linux elf", + "ultrix-mips","DEC mips ultrix", "FreeBSD","FreeBSD distribution", "default","cc under unix", ); -$type=""; +$platform=""; foreach (@ARGV) { - if (/^no-rc2$/) { $no_rc2=1; } - elsif (/^no-rc4$/) { $no_rc4=1; } - elsif (/^no-rc5$/) { $no_rc5=1; } - elsif (/^no-idea$/) { $no_idea=1; } - elsif (/^no-des$/) { $no_des=1; } - elsif (/^no-bf$/) { $no_bf=1; } - elsif (/^no-cast$/) { $no_cast=1; } - elsif (/^no-md2$/) { $no_md2=1; } - elsif (/^no-md5$/) { $no_md5=1; } - elsif (/^no-sha$/) { $no_sha=1; } - elsif (/^no-sha1$/) { $no_sha1=1; } - elsif (/^no-rmd160$/) { $no_rmd160=1; } - elsif (/^no-mdc2$/) { $no_mdc2=1; } - elsif (/^no-patents$/) { $no_rc2=$no_rc4=$no_rc5=$no_idea=$no_rsa=1; } - elsif (/^no-rsa$/) { $no_rsa=1; } - elsif (/^no-dsa$/) { $no_dsa=1; } - elsif (/^no-dh$/) { $no_dh=1; } - elsif (/^no-asm$/) { $no_asm=1; } - elsif (/^no-ssl2$/) { $no_ssl2=1; } - elsif (/^no-ssl3$/) { $no_ssl3=1; } - elsif (/^no-err$/) { $no_err=1; } - elsif (/^no-sock$/) { $no_sock=1; } - - elsif (/^just-ssl$/) { $no_rc2=$no_idea=$no_des=$no_bf=$no_cast=1; - $no_md2=$no_sha=$no_mdc2=$no_dsa=$no_dh=1; - $no_ssl2=$no_err=1; } - - elsif (/^rsaref$/) { $rsaref=1; } - elsif (/^gcc$/) { $gcc=1; } - elsif (/^debug$/) { $debug=1; } - elsif (/^shlib$/) { $shlib=1; } - elsif (/^dll$/) { $shlib=1; } - elsif (/^([^=]*)=(.*)$/){ $VARS{$1}=$2; } - elsif (/^-[lL].*$/) { $l_flags.="$_ "; } - elsif ((!/^-help/) && (!/^-h/) && (!/^-\?/) && /^-.*$/) - { $c_flags.="$_ "; } - else + if (!&read_options && !defined($ops{$_})) { - if (!defined($ops{$_})) - { - print STDERR "unknown option - $_\n"; - print STDERR "usage: perl mk1mf.pl [system] [options]\n"; - print STDERR "\nwhere [system] can be one of the following\n"; - foreach $i (sort keys %ops) - { printf STDERR "\t%-10s\t%s\n",$i,$ops{$i}; } - print STDERR <<"EOF"; + print STDERR "unknown option - $_\n"; + print STDERR "usage: perl mk1mf.pl [options] [system]\n"; + print STDERR "\nwhere [system] can be one of the following\n"; + foreach $i (sort keys %ops) + { printf STDERR "\t%-10s\t%s\n",$i,$ops{$i}; } + print STDERR <<"EOF"; and [options] can be one of - no-md2 no-md5 no-sha no-sha1 no-mdc2 no-rmd160 - Skip this digest + no-md2 no-md5 no-sha no-mdc2 no-ripemd - Skip this digest no-rc2 no-rc4 no-idea no-des no-bf no-cast - Skip this symetric cipher no-rc5 no-rsa no-dsa no-dh - Skip this public key cipher no-ssl2 no-ssl3 - Skip this version of SSL just-ssl - remove all non-ssl keys/digest no-asm - No x86 asm + nasm - Use NASM for x86 asm no-socks - No socket code no-err - No error strings dll/shlib - Build shared libraries (MS) @@ -96,15 +73,18 @@ TMP=tmpdir OUT=outdir SRC=srcdir BIN=binpath INC=header-outdir CC=C-compiler - - extra 'cc' flags, added (MS), or replace (unix) EOF - exit(1); - } - $type=$_; + exit(1); } + $platform=$_; + } +foreach (split / /, $OPTIONS) + { + print STDERR "unknown option - $_\n" if !&read_options; } $no_mdc2=1 if ($no_des); -$no_ssl3=1 if ($no_md5 || $no_sha1); +$no_ssl3=1 if ($no_md5 || $no_sha); $no_ssl3=1 if ($no_rsa && $no_dh); $no_ssl2=1 if ($no_md5 || $no_rsa); @@ -114,6 +94,7 @@ $out_def="out"; $inc_def="outinc"; $tmp_def="tmp"; +$mkdir="mkdir"; ($ssl,$crypto)=("ssl","crypto"); $RSAglue="RSAglue"; @@ -125,62 +106,79 @@ $bin_dir=(defined($VARS{'BIN'}))?$VARS{'BIN'}:''; # $bin_dir.=$o causes a core dump on my sparc :-( +$NT=0; + push(@INC,"util/pl","pl"); -if ($type eq "VC-MSDOS") +if ($platform eq "VC-MSDOS") { $asmbits=16; $msdos=1; require 'VC-16.pl'; } -elsif ($type eq "VC-W31-16") +elsif ($platform eq "VC-W31-16") { $asmbits=16; $msdos=1; $win16=1; require 'VC-16.pl'; } -elsif (($type eq "VC-W31-32") || ($type eq "VC-WIN16")) +elsif (($platform eq "VC-W31-32") || ($platform eq "VC-WIN16")) { $asmbits=32; $msdos=1; $win16=1; require 'VC-16.pl'; } -elsif (($type eq "VC-WIN32") || ($type eq "VC-NT")) +elsif (($platform eq "VC-WIN32") || ($platform eq "VC-NT")) { + $NT = 1 if $platform eq "VC-NT"; require 'VC-32.pl'; } -elsif ($type eq "BC-NT") +elsif ($platform eq "Mingw32") + { + require 'Mingw32.pl'; + } +elsif ($platform eq "Mingw32-files") + { + require 'Mingw32f.pl'; + } +elsif ($platform eq "BC-NT") { $bc=1; require 'BC-32.pl'; } -elsif ($type eq "BC-W31") +elsif ($platform eq "BC-W31") { $bc=1; $msdos=1; $w16=1; require 'BC-16.pl'; } -elsif ($type eq "BC-Q16") +elsif ($platform eq "BC-Q16") { $msdos=1; $w16=1; $shlib=0; $qw=1; require 'BC-16.pl'; } -elsif ($type eq "BC-MSDOS") +elsif ($platform eq "BC-MSDOS") { $asmbits=16; $msdos=1; require 'BC-16.pl'; } -elsif ($type eq "FreeBSD") +elsif ($platform eq "FreeBSD") { require 'unix.pl'; $cflags='-DTERMIO -D_ANSI_SOURCE -O2 -fomit-frame-pointer'; } -elsif ($type eq "linux-elf") +elsif ($platform eq "linux-elf") { require "unix.pl"; require "linux.pl"; $unix=1; } +elsif ($platform eq "ultrix-mips") + { + require "unix.pl"; + require "ultrix.pl"; + $unix=1; + } else { require "unix.pl"; @@ -203,9 +201,9 @@ $cflags.=" -DNO_MD2" if $no_md2; $cflags.=" -DNO_MD5" if $no_md5; $cflags.=" -DNO_SHA" if $no_sha; $cflags.=" -DNO_SHA1" if $no_sha1; -$cflags.=" -DNO_RMD160" if $no_rmd160; +$cflags.=" -DNO_RIPEMD" if $no_rmd160; $cflags.=" -DNO_MDC2" if $no_mdc2; -$cflags.=" -DNO_BLOWFISH" if $no_bf; +$cflags.=" -DNO_BF" if $no_bf; $cflags.=" -DNO_CAST" if $no_cast; $cflags.=" -DNO_DES" if $no_des; $cflags.=" -DNO_RSA" if $no_rsa; @@ -223,14 +221,9 @@ else { $cflags="$c_flags$cflags" if ($c_flags ne ""); } $ex_libs="$l_flags$ex_libs" if ($l_flags ne ""); -if ($ranlib ne "") - { - $ranlib="\$(SRC_D)$o$ranlib"; - } - if ($msdos) { - $banner ="\t\@echo Make sure you have run 'perl Configure $type' in the\n"; + $banner ="\t\@echo Make sure you have run 'perl Configure $platform' in the\n"; $banner.="\t\@echo top level directory, if you don't have perl, you will\n"; $banner.="\t\@echo need to probably edit crypto/bn/bn.h, check the\n"; $banner.="\t\@echo documentation for details.\n"; @@ -242,8 +235,8 @@ $link="$bin_dir$link" if ($link !~ /^\$/); $INSTALLTOP =~ s|/|$o|g; $defs= <<"EOF"; -# This makefile has been automatically generated from the SSLeay distribution. -# This single makefile will build the complete SSLeay distribution and +# 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 # that needs deleting in .${o}tmp. # The file was generated by running 'make makefile.one', which @@ -258,6 +251,7 @@ $defs= <<"EOF"; INSTALLTOP=$INSTALLTOP # Set your compiler options +PLATFORM=$platform CC=$bin_dir${cc} CFLAG=$cflags APP_CFLAG=$app_cflag @@ -269,18 +263,16 @@ SHLIB_EX_OBJ=$shlib_ex_obj # be added EX_LIBS=$ex_libs -# The SSLeay directory +# The OpenSSL directory SRC_D=$src_dir LINK=$link LFLAGS=$lflags -BN_MULW_OBJ=$bn_mulw_obj -BN_MULW_SRC=$bn_mulw_src +BN_ASM_OBJ=$bn_asm_obj +BN_ASM_SRC=$bn_asm_src DES_ENC_OBJ=$des_enc_obj DES_ENC_SRC=$des_enc_src -DES_CRYPT_OBJ=$des_crypt_obj -DES_CRYPT_SRC=$des_crypt_src BF_ENC_OBJ=$bf_enc_obj BF_ENC_SRC=$bf_enc_src CAST_ENC_OBJ=$cast_enc_obj @@ -302,11 +294,12 @@ OUT_D=$out_dir TMP_D=$tmp_dir # The output directory for the header files INC_D=$inc_dir +INCO_D=$inc_dir${o}openssl CP=$cp RM=$rm RANLIB=$ranlib -MKDIR=mkdir +MKDIR=$mkdir MKLIB=$bin_dir$mklib MLFLAGS=$mlflags ASM=$bin_dir$asm @@ -315,7 +308,7 @@ ASM=$bin_dir$asm # You should not need to touch anything below this point ###################################################### -E_EXE=ssleay +E_EXE=openssl SSL=$ssl CRYPTO=$crypto RSAGLUE=$RSAglue @@ -323,6 +316,9 @@ RSAGLUE=$RSAglue # BIN_D - Binary output directory # TEST_D - Binary test file output directory # LIB_D - library output directory +# Note: if you change these point to different directories then uncomment out +# the lines around the 'NB' comment below. +# BIN_D=\$(OUT_D) TEST_D=\$(OUT_D) LIB_D=\$(OUT_D) @@ -337,8 +333,8 @@ O_CRYPTO= \$(LIB_D)$o$plib\$(CRYPTO)$shlibp O_RSAGLUE= \$(LIB_D)$o$plib\$(RSAGLUE)$libp SO_SSL= $plib\$(SSL)$so_shlibp SO_CRYPTO= $plib\$(CRYPTO)$so_shlibp -L_SSL= \$(LIB_D)$o\$(SSL)$libp -L_CRYPTO= \$(LIB_D)$o\$(CRYPTO)$libp +L_SSL= \$(LIB_D)$o$plib\$(SSL)$libp +L_CRYPTO= \$(LIB_D)$o$plib\$(CRYPTO)$libp L_LIBS= \$(L_SSL) \$(L_CRYPTO) #L_LIBS= \$(O_SSL) \$(O_RSAGLUE) -lrsaref \$(O_CRYPTO) @@ -357,23 +353,26 @@ LIBS_DEP=\$(O_CRYPTO) \$(O_RSAGLUE) \$(O_SSL) EOF $rules=<<"EOF"; -all: banner \$(TMP_D) \$(BIN_D) \$(TEST_D) \$(LIB_D) \$(INC_D) headers lib exe +all: banner \$(TMP_D) \$(BIN_D) \$(TEST_D) \$(LIB_D) \$(INCO_D) headers lib exe banner: $banner \$(TMP_D): \$(MKDIR) \$(TMP_D) - -\$(BIN_D): - \$(MKDIR) \$(BIN_D) - -\$(TEST_D): - \$(MKDIR) \$(TEST_D) +# NB: uncomment out these lines if BIN_D, TEST_D and LIB_D are different +#\$(BIN_D): +# \$(MKDIR) \$(BIN_D) +# +#\$(TEST_D): +# \$(MKDIR) \$(TEST_D) \$(LIB_D): \$(MKDIR) \$(LIB_D) +\$(INCO_D): \$(INC_D) + \$(MKDIR) \$(INCO_D) + \$(INC_D): \$(MKDIR) \$(INC_D) @@ -387,8 +386,9 @@ install: \$(MKDIR) \$(INSTALLTOP) \$(MKDIR) \$(INSTALLTOP)${o}bin \$(MKDIR) \$(INSTALLTOP)${o}include + \$(MKDIR) \$(INSTALLTOP)${o}include${o}openssl \$(MKDIR) \$(INSTALLTOP)${o}lib - \$(CP) \$(INC_D)${o}*.\[ch\] \$(INSTALLTOP)${o}include + \$(CP) \$(INCO_D)${o}*.\[ch\] \$(INSTALLTOP)${o}include${o}openssl \$(CP) \$(BIN_D)$o\$(E_EXE)$exep \$(INSTALLTOP)${o}bin \$(CP) \$(O_SSL) \$(INSTALLTOP)${o}lib \$(CP) \$(O_CRYPTO) \$(INSTALLTOP)${o}lib @@ -401,6 +401,42 @@ vclean: \$(RM) \$(OUT_D)$o*.* EOF + +my $platform_cpp_symbol = "MK1MF_PLATFORM_$platform"; +$platform_cpp_symbol =~ s/-/_/g; +if (open(IN,"crypto/buildinf.h")) + { + # Remove entry for this platform in existing file buildinf.h. + + my $old_buildinf_h = ""; + while () + { + if (/^\#ifdef $platform_cpp_symbol$/) + { + while () { last if (/^\#endif/); } + } + else + { + $old_buildinf_h .= $_; + } + } + close(IN); + + open(OUT,">crypto/buildinf.h") || die "Can't open buildinf.h"; + print OUT $old_buildinf_h; + close(OUT); + } + +open (OUT,">>crypto/buildinf.h") || die "Can't open buildinf.h"; +printf OUT <) { + $options=$1 if (/^OPTIONS=(.*)$/); +} +close(IN); + +foreach (@ARGV, split(/ /, $options)) { - $NT=1 if $_ eq "32"; - $NT=0 if $_ eq "16"; + $W32=1 if $_ eq "32"; + $W32=0 if $_ eq "16"; + if($_ eq "NT") { + $W32 = 1; + $NT = 1; + } $do_ssl=1 if $_ eq "ssleay"; + $do_ssl=1 if $_ eq "ssl"; $do_crypto=1 if $_ eq "libeay"; + $do_crypto=1 if $_ eq "crypto"; + $do_update=1 if $_ eq "update"; + $rsaref=1 if $_ eq "rsaref"; + + if (/^no-rc2$/) { $no_rc2=1; } + elsif (/^no-rc4$/) { $no_rc4=1; } + elsif (/^no-rc5$/) { $no_rc5=1; } + elsif (/^no-idea$/) { $no_idea=1; } + elsif (/^no-des$/) { $no_des=1; } + elsif (/^no-bf$/) { $no_bf=1; } + elsif (/^no-cast$/) { $no_cast=1; } + elsif (/^no-md2$/) { $no_md2=1; } + elsif (/^no-md5$/) { $no_md5=1; } + elsif (/^no-sha$/) { $no_sha=1; } + elsif (/^no-ripemd$/) { $no_ripemd=1; } + elsif (/^no-mdc2$/) { $no_mdc2=1; } + elsif (/^no-rsa$/) { $no_rsa=1; } + elsif (/^no-dsa$/) { $no_dsa=1; } + elsif (/^no-dh$/) { $no_dh=1; } + elsif (/^no-hmac$/) { $no_hmac=1; } } if (!$do_ssl && !$do_crypto) { - print STDERR "usage: $0 ( ssl | crypto ) [ 16 | 32 ]\n"; + print STDERR "usage: $0 ( ssl | crypto ) [ 16 | 32 | NT ] [rsaref]\n"; exit(1); } %ssl_list=&load_numbers($ssl_num); +$max_ssl = $max_num; %crypto_list=&load_numbers($crypto_num); +$max_crypto = $max_num; $ssl="ssl/ssl.h"; $crypto ="crypto/crypto.h"; -$crypto.=" crypto/des/des.h"; -$crypto.=" crypto/idea/idea.h"; -$crypto.=" crypto/rc4/rc4.h"; -$crypto.=" crypto/rc5/rc5.h"; -$crypto.=" crypto/rc2/rc2.h"; -$crypto.=" crypto/bf/blowfish.h"; -$crypto.=" crypto/cast/cast.h"; -$crypto.=" crypto/md2/md2.h"; -$crypto.=" crypto/md5/md5.h"; -$crypto.=" crypto/mdc2/mdc2.h"; -$crypto.=" crypto/sha/sha.h"; -$crypto.=" crypto/ripemd/ripemd.h"; +$crypto.=" crypto/des/des.h" unless $no_des; +$crypto.=" crypto/idea/idea.h" unless $no_idea; +$crypto.=" crypto/rc4/rc4.h" unless $no_rc4; +$crypto.=" crypto/rc5/rc5.h" unless $no_rc5; +$crypto.=" crypto/rc2/rc2.h" unless $no_rc2; +$crypto.=" crypto/bf/blowfish.h" unless $no_bf; +$crypto.=" crypto/cast/cast.h" unless $no_cast; +$crypto.=" crypto/md2/md2.h" unless $no_md2; +$crypto.=" crypto/md5/md5.h" unless $no_md5; +$crypto.=" crypto/mdc2/mdc2.h" unless $no_mdc2; +$crypto.=" crypto/sha/sha.h" unless $no_sha; +$crypto.=" crypto/ripemd/ripemd.h" unless $no_ripemd; $crypto.=" crypto/bn/bn.h"; -$crypto.=" crypto/rsa/rsa.h"; -$crypto.=" crypto/dsa/dsa.h"; -$crypto.=" crypto/dh/dh.h"; +$crypto.=" crypto/rsa/rsa.h" unless $no_rsa; +$crypto.=" crypto/dsa/dsa.h" unless $no_dsa; +$crypto.=" crypto/dh/dh.h" unless $no_dh; +$crypto.=" crypto/hmac/hmac.h" unless $no_hmac; $crypto.=" crypto/stack/stack.h"; $crypto.=" crypto/buffer/buffer.h"; @@ -63,182 +107,255 @@ $crypto.=" crypto/asn1/asn1.h"; $crypto.=" crypto/asn1/asn1_mac.h"; $crypto.=" crypto/err/err.h"; $crypto.=" crypto/pkcs7/pkcs7.h"; +$crypto.=" crypto/pkcs12/pkcs12.h"; $crypto.=" crypto/x509/x509.h"; $crypto.=" crypto/x509/x509_vfy.h"; +$crypto.=" crypto/x509v3/x509v3.h"; $crypto.=" crypto/rand/rand.h"; -$crypto.=" crypto/hmac/hmac.h"; +$crypto.=" crypto/comp/comp.h"; +$crypto.=" crypto/tmdiff.h"; + +@ssl_func = &do_defs("SSLEAY", $ssl); +@crypto_func = &do_defs("LIBEAY", $crypto); + + +if ($do_update) { + +if ($do_ssl == 1) { + open(OUT, ">>$ssl_num"); + &update_numbers(*OUT,"SSLEAY",*ssl_list,$max_ssl, @ssl_func); + close OUT; +} -$match{'NOPROTO'}=1; -$match2{'PERL5'}=1; +if($do_crypto == 1) { + open(OUT, ">>$crypto_num"); + &update_numbers(*OUT,"LIBEAY",*crypto_list,$max_crypto, @crypto_func); + close OUT; +} -&print_def_file(*STDOUT,"SSLEAY",*ssl_list,&do_defs("SSLEAY",$ssl)) - if $do_ssl == 1; +} else { + + &print_def_file(*STDOUT,"SSLEAY",*ssl_list,@ssl_func) + if $do_ssl == 1; + + &print_def_file(*STDOUT,"LIBEAY",*crypto_list,@crypto_func) + if $do_crypto == 1; + +} -&print_def_file(*STDOUT,"LIBEAY",*crypto_list,&do_defs("LIBEAY",$crypto)) - if $do_crypto == 1; sub do_defs - { - local($name,$files)=@_; - local(@ret); +{ + my($name,$files)=@_; + my @ret; + my %funcs; - $off=-1; foreach $file (split(/\s+/,$files)) { -# print STDERR "reading $file\n"; open(IN,"<$file") || die "unable to open $file:$!\n"; - $depth=0; - $pr=-1; - @np=""; - $/=undef; - $a=; - while (($i=index($a,"/*")) >= 0) - { - $j=index($a,"*/"); - break unless ($j >= 0); - $a=substr($a,0,$i).substr($a,$j+2); - # print "$i $j\n"; + + my $line = "", $def= ""; + my %tag = ( + FreeBSD => 0, + NOPROTO => 0, + WIN16 => 0, + PERL5 => 0, + _WINDLL => 0, + NO_FP_API => 0, + CONST_STRICT => 0, + TRUE => 1, + ); + while() { + last if (/BEGIN ERROR CODES/); + if ($line ne '') { + $_ = $line . $_; + $line = ''; } - foreach (split("\n",$a)) - { - if (/^\#\s*ifndef (.*)/) - { + + if (/\\$/) { + $line = $_; + next; + } + + $cpp = 1 if /^#.*ifdef.*cplusplus/; + if ($cpp) { + $cpp = 0 if /^#.*endif/; + next; + } + + s/\/\*.*?\*\///gs; # ignore comments + s/{[^{}]*}//gs; # ignore {} blocks + if (/^\#\s*ifndef (.*)/) { push(@tag,$1); $tag{$1}=-1; next; - } - elsif (/^\#\s*if !defined\(([^\)]+)\)/) - { + } elsif (/^\#\s*if !defined\(([^\)]+)\)/) { push(@tag,$1); $tag{$1}=-1; next; - } - elsif (/^\#\s*ifdef (.*)/) - { + } elsif (/^\#\s*ifdef (.*)/) { push(@tag,$1); $tag{$1}=1; next; - } - elsif (/^\#\s*if defined(.*)/) - { + } elsif (/^\#\s*if defined(.*)/) { push(@tag,$1); $tag{$1}=1; next; - } - elsif (/^\#\s*endif/) - { + } elsif (/^\#\s*endif/) { $tag{$tag[$#tag]}=0; pop(@tag); next; - } - elsif (/^\#\s*else/) - { - $t=$tag[$#tag]; + } elsif (/^\#\s*else/) { + my $t=$tag[$#tag]; $tag{$t}= -$tag{$t}; next; + } elsif (/^\#\s*if\s+1/) { + # Dummy tag + push(@tag,"TRUE"); + $tag{"TRUE"}=1; + next; + } elsif (/^\#/) { + next; + } + if ($safe_stack_def && + /^\s*DECLARE_STACK_OF\s*\(\s*(\w*)\s*\)/) { + $funcs{"sk_${1}_new"} = 1; + $funcs{"sk_${1}_new_null"} = 1; + $funcs{"sk_${1}_free"} = 1; + $funcs{"sk_${1}_num"} = 1; + $funcs{"sk_${1}_value"} = 1; + $funcs{"sk_${1}_set"} = 1; + $funcs{"sk_${1}_zero"} = 1; + $funcs{"sk_${1}_push"} = 1; + $funcs{"sk_${1}_unshift"} = 1; + $funcs{"sk_${1}_find"} = 1; + $funcs{"sk_${1}_delete"} = 1; + $funcs{"sk_${1}_delete_ptr"} = 1; + $funcs{"sk_${1}_insert"} = 1; + $funcs{"sk_${1}_set_cmp_func"} = 1; + $funcs{"sk_${1}_dup"} = 1; + $funcs{"sk_${1}_pop_free"} = 1; + $funcs{"sk_${1}_shift"} = 1; + $funcs{"sk_${1}_pop"} = 1; + $funcs{"sk_${1}_sort"} = 1; + } elsif ($safe_stack_def && + /^\s*DECLARE_ASN1_SET_OF\s*\(\s*(\w*)\s*\)/) { + $funcs{"d2i_ASN1_SET_OF_${1}"} = 1; + $funcs{"i2d_ASN1_SET_OF_${1}"} = 1; + } elsif (/^DECLARE_PEM_rw\s*\(\s*(\w*)\s*,/ || + /^DECLARE_PEM_rw_cb\s*\(\s*(\w*)\s*,/ ) { + if($W32) { + $funcs{"PEM_read_${1}"} = 1; + $funcs{"PEM_write_${1}"} = 1; } -#printf STDERR "$_\n%2d %2d %2d %2d %2d $NT\n", -#$tag{'NOPROTO'},$tag{'FreeBSD'},$tag{'WIN16'},$tag{'PERL5'},$tag{'NO_FP_API'}; - - $t=undef; - if (/^extern .*;$/) - { $t=&do_extern($name,$_); } - elsif ( ($tag{'NOPROTO'} == 1) && + $funcs{"PEM_read_bio_${1}"} = 1; + $funcs{"PEM_write_bio_${1}"} = 1; + } elsif ( ($tag{'FreeBSD'} != 1) && - (($NT && ($tag{'WIN16'} != 1)) || - (!$NT && ($tag{'WIN16'} != -1))) && + ($tag{'CONST_STRICT'} != 1) && + (($W32 && ($tag{'WIN16'} != 1)) || + (!$W32 && ($tag{'WIN16'} != -1))) && ($tag{'PERL5'} != 1) && # ($tag{'_WINDLL'} != -1) && - ((!$NT && $tag{'_WINDLL'} != -1) || - ($NT && $tag{'_WINDLL'} != 1)) && - ((($tag{'NO_FP_API'} != 1) && $NT) || - (($tag{'NO_FP_API'} != -1) && !$NT))) - { $t=&do_line($name,$_); } - else - { $t=undef; } - if (($t ne undef) && (!$done{$name,$t})) + ((!$W32 && $tag{'_WINDLL'} != -1) || + ($W32 && $tag{'_WINDLL'} != 1)) && + ((($tag{'NO_FP_API'} != 1) && $W32) || + (($tag{'NO_FP_API'} != -1) && !$W32))) { - $done{$name,$t}++; - push(@ret,$t); -#printf STDERR "one:$t\n" if $t =~ /BIO_/; + if (/{|\/\*/) { # } + $line = $_; + } else { + $def .= $_; + } } } close(IN); + + foreach (split /;/, $def) { + s/^[\n\s]*//g; + s/[\n\s]*$//g; + next if(/typedef\W/); + next if(/EVP_bf/ and $no_bf); + next if(/EVP_cast/ and $no_cast); + next if(/EVP_des/ and $no_des); + next if(/EVP_dss/ and $no_dsa); + next if(/EVP_idea/ and $no_idea); + next if(/EVP_md2/ and $no_md2); + next if(/EVP_md5/ and $no_md5); + next if(/EVP_rc2/ and $no_rc2); + next if(/EVP_rc4/ and $no_rc4); + next if(/EVP_rc5/ and $no_rc5); + next if(/EVP_ripemd/ and $no_ripemd); + next if(/EVP_sha/ and $no_sha); + if (/\(\*(\w*)\([^\)]+/) { + $funcs{$1} = 1; + } elsif (/\w+\W+(\w+)\W*\(\s*\)$/s) { + # K&R C + next; + } elsif (/\w+\W+\w+\W*\(.*\)$/s) { + while (not /\(\)$/s) { + s/[^\(\)]*\)$/\)/s; + s/\([^\(\)]*\)\)$/\)/s; + } + s/\(void\)//; + /(\w+)\W*\(\)/s; + $funcs{$1} = 1; + } elsif (/\(/ and not (/=/)) { + print STDERR "File $file: cannot parse: $_;\n"; + } } - return(@ret); } -sub do_line - { - local($file,$_)=@_; - local($n); - - return(undef) if /^$/; - return(undef) if /^\s/; -#printf STDERR "two:$_\n" if $_ =~ /BIO_/; - if (/(CRYPTO_get_locking_callback)/) - { return($1); } - elsif (/(CRYPTO_get_id_callback)/) - { return($1); } - elsif (/(CRYPTO_get_add_lock_callback)/) - { return($1); } - elsif (/(SSL_CTX_get_verify_callback)/) - { return($1); } - elsif (/(SSL_get_info_callback)/) - { return($1); } - elsif ((!$NT) && /(ERR_load_CRYPTO_strings)/) - { return("ERR_load_CRYPTOlib_strings"); } - elsif (!$NT && /BIO_s_file/) - { return(undef); } - elsif (!$NT && /BIO_new_file/) - { return(undef); } - elsif (!$NT && /BIO_new_fp/) - { return(undef); } - elsif ($NT && /BIO_s_file_internal/) - { return(undef); } - elsif ($NT && /BIO_new_file_internal/) - { return(undef); } - elsif ($NT && /BIO_new_fp_internal/) - { return(undef); } - else - { - /\s\**(\S+)\s*\(/; - return($1); + # Prune the returned functions + + delete $funcs{"SSL_add_dir_cert_subjects_to_stack"}; + delete $funcs{"des_crypt"}; + delete $funcs{"RSA_PKCS1_RSAref"} unless $rsaref; + + if($W32) { + delete $funcs{"BIO_s_file_internal"}; + delete $funcs{"BIO_new_file_internal"}; + delete $funcs{"BIO_new_fp_internal"}; + } else { + if(exists $funcs{"ERR_load_CRYPTO_strings"}) { + delete $funcs{"ERR_load_CRYPTO_strings"}; + $funcs{"ERR_load_CRYPTOlib_strings"} = 1; } + delete $funcs{"BIO_s_file"}; + delete $funcs{"BIO_new_file"}; + delete $funcs{"BIO_new_fp"}; + } + if (!$NT) { + delete $funcs{"BIO_s_log"}; } -sub do_extern - { - local($file,$_)=@_; - local($n); + push @ret, keys %funcs; - /\s\**(\S+);$/; - return($1); - } + return(@ret); +} sub print_def_file - { - local(*OUT,$name,*nums,@functions)=@_; - local($n)=1; +{ + (*OUT,my $name,*nums,@functions)=@_; + my $n =1; - if ($NT) + if ($W32) { $name.="32"; } else { $name.="16"; } print OUT <<"EOF"; ; -; Definition file for the DDL version of the $name library from SSLeay +; Definition file for the DLL version of the $name library from OpenSSL ; LIBRARY $name -DESCRIPTION 'SSLeay $name - eay\@cryptsoft.com' +DESCRIPTION 'OpenSSL $name - http://www.openssl.org/' EOF - if (!$NT) - { + if (!$W32) { print <<"EOF"; CODE PRELOAD MOVEABLE DATA PRELOAD MOVEABLE SINGLE @@ -249,7 +366,7 @@ HEAPSIZE 4096 STACKSIZE 8192 EOF - } + } print "EXPORTS\n"; @@ -258,35 +375,52 @@ EOF (@r)=grep(!/^SSLeay/,@functions); @functions=((sort @e),(sort @r)); - foreach $func (@functions) - { - if (!defined($nums{$func})) - { - printf STDERR "$func does not have a number assigned\n"; - } - else - { + foreach $func (@functions) { + if (!defined($nums{$func})) { + printf STDERR "$func does not have a number assigned\n" + if(!$do_update); + } else { $n=$nums{$func}; - printf OUT " %s%-35s@%d\n",($NT)?"":"_",$func,$n; - } + printf OUT " %s%-40s@%d\n",($W32)?"":"_",$func,$n; } - printf OUT "\n"; } + printf OUT "\n"; +} sub load_numbers - { - local($name)=@_; - local($j,@a,%ret); +{ + my($name)=@_; + my(@a,%ret); + + $max_num = 0; open(IN,"<$name") || die "unable to open $name:$!\n"; - while () - { + while () { chop; s/#.*$//; next if /^\s*$/; @a=split; $ret{$a[0]}=$a[1]; - } + $max_num = $a[1] if $a[1] > $max_num; + } close(IN); return(%ret); +} + +sub update_numbers +{ + (*OUT,$name,*nums,my $start_num, my @functions)=@_; + my $new_funcs = 0; + print STDERR "Updating $name\n"; + foreach $func (@functions) { + if (!exists $nums{$func}) { + $new_funcs++; + printf OUT "%s%-40s%d\n","",$func, ++$start_num; + } + } + if($new_funcs) { + print STDERR "$new_funcs New Functions added\n"; + } else { + print STDERR "No New Functions Added\n"; } +} diff --git a/src/lib/libcrypto/util/mkdir-p.pl b/src/lib/libcrypto/util/mkdir-p.pl new file mode 100644 index 0000000000..6c69c2daa4 --- /dev/null +++ b/src/lib/libcrypto/util/mkdir-p.pl @@ -0,0 +1,33 @@ +#!/usr/local/bin/perl + +# mkdir-p.pl + +# On some systems, the -p option to mkdir (= also create any missing parent +# directories) is not available. + +my $arg; + +foreach $arg (@ARGV) { + &do_mkdir_p($arg); +} + + +sub do_mkdir_p { + local($dir) = @_; + + $dir =~ s|/*\Z(?!\n)||s; + + if (-d $dir) { + return; + } + + if ($dir =~ m|[^/]/|s) { + local($parent) = $dir; + $parent =~ s|[^/]*\Z(?!\n)||s; + + do_mkdir_p($parent); + } + + mkdir($dir, 0777) || die "Cannot create directory $dir: $!\n"; + print "created directory `$dir'\n"; +} diff --git a/src/lib/libcrypto/util/mkerr.pl b/src/lib/libcrypto/util/mkerr.pl new file mode 100644 index 0000000000..4b3bccb13e --- /dev/null +++ b/src/lib/libcrypto/util/mkerr.pl @@ -0,0 +1,503 @@ +#!/usr/local/bin/perl -w + +my $config = "crypto/err/openssl.ec"; +my $debug = 0; +my $rebuild = 0; +my $static = 1; +my $recurse = 0; +my $reindex = 0; +my $dowrite = 0; + + +while (@ARGV) { + my $arg = $ARGV[0]; + if($arg eq "-conf") { + shift @ARGV; + $config = shift @ARGV; + } elsif($arg eq "-debug") { + $debug = 1; + shift @ARGV; + } elsif($arg eq "-rebuild") { + $rebuild = 1; + shift @ARGV; + } elsif($arg eq "-recurse") { + $recurse = 1; + shift @ARGV; + } elsif($arg eq "-reindex") { + $reindex = 1; + shift @ARGV; + } elsif($arg eq "-nostatic") { + $static = 0; + shift @ARGV; + } elsif($arg eq "-write") { + $dowrite = 1; + shift @ARGV; + } else { + last; + } +} + +if($recurse) { + @source = (, , ,, ); +} else { + @source = @ARGV; +} + +# Read in the config file + +open(IN, "<$config") || die "Can't open config file $config"; + +# Parse config file + +while() +{ + if(/^L\s+(\S+)\s+(\S+)\s+(\S+)/) { + $hinc{$1} = $2; + $cskip{$3} = $1; + if($3 ne "NONE") { + $csrc{$1} = $3; + $fmax{$1} = 99; + $rmax{$1} = 99; + $fnew{$1} = 0; + $rnew{$1} = 0; + } + } elsif (/^F\s+(\S+)/) { + # Add extra function with $1 + } elsif (/^R\s+(\S+)\s+(\S+)/) { + $rextra{$1} = $2; + $rcodes{$1} = $2; + } +} + +close IN; + +# Scan each header file in turn and make a list of error codes +# and function names + +while (($lib, $hdr) = each %hinc) +{ + next if($hdr eq "NONE"); + print STDERR "Scanning header file $hdr\n" if $debug; + open(IN, "<$hdr") || die "Can't open Header file $hdr\n"; + my $line = "", $def= ""; + while() { + last if(/BEGIN\s+ERROR\s+CODES/); + if ($line ne '') { + $_ = $line . $_; + $line = ''; + } + + if (/\\$/) { + $line = $_; + next; + } + + $cpp = 1 if /^#.*ifdef.*cplusplus/; # skip "C" declaration + if ($cpp) { + $cpp = 0 if /^#.*endif/; + next; + } + + next if (/^#/); # skip preprocessor directives + + s/\/\*.*?\*\///gs; # ignore comments + s/{[^{}]*}//gs; # ignore {} blocks + + if (/{|\/\*/) { # Add a } so editor works... + $line = $_; + } else { + $def .= $_; + } + } + + foreach (split /;/, $def) { + s/^[\n\s]*//g; + s/[\n\s]*$//g; + next if(/typedef\W/); + if (/\(\*(\w*)\([^\)]+/) { + my $name = $1; + $name =~ tr/[a-z]/[A-Z]/; + $ftrans{$name} = $1; + } elsif (/\w+\W+(\w+)\W*\(\s*\)$/s){ + # K&R C + next ; + } elsif (/\w+\W+\w+\W*\(.*\)$/s) { + while (not /\(\)$/s) { + s/[^\(\)]*\)$/\)/s; + s/\([^\(\)]*\)\)$/\)/s; + } + s/\(void\)//; + /(\w+)\W*\(\)/s; + my $name = $1; + $name =~ tr/[a-z]/[A-Z]/; + $ftrans{$name} = $1; + } elsif (/\(/ and not (/=/ or /DECLARE_STACK/)) { + print STDERR "Header $hdr: cannot parse: $_;\n"; + } + } + + next if $reindex; + + # Scan function and reason codes and store them: keep a note of the + # maximum code used. + + while() { + if(/^#define\s+(\S+)\s+(\S+)/) { + $name = $1; + $code = $2; + unless($name =~ /^${lib}_([RF])_(\w+)$/) { + print STDERR "Invalid error code $name\n"; + next; + } + if($1 eq "R") { + $rcodes{$name} = $code; + if(!(exists $rextra{$name}) && + ($code > $rmax{$lib}) ) { + $rmax{$lib} = $code; + } + } else { + if($code > $fmax{$lib}) { + $fmax{$lib} = $code; + } + $fcodes{$name} = $code; + } + } + } + close IN; +} + +# Scan each C source file and look for function and reason codes +# This is done by looking for strings that "look like" function or +# reason codes: basically anything consisting of all upper case and +# numerics which has _F_ or _R_ in it and which has the name of an +# error library at the start. This seems to work fine except for the +# oddly named structure BIO_F_CTX which needs to be ignored. +# If a code doesn't exist in list compiled from headers then mark it +# with the value "X" as a place holder to give it a value later. +# Store all function and reason codes found in %ufcodes and %urcodes +# so all those unreferenced can be printed out. + + +foreach $file (@source) { + # Don't parse the error source file. + next if exists $cskip{$file}; + open(IN, "<$file") || die "Can't open source file $file\n"; + while() { + if(/(([A-Z0-9]+)_F_([A-Z0-9_]+))/) { + next unless exists $csrc{$2}; + next if($1 eq "BIO_F_BUFFER_CTX"); + $ufcodes{$1} = 1; + if(!exists $fcodes{$1}) { + $fcodes{$1} = "X"; + $fnew{$2}++; + } + $notrans{$1} = 1 unless exists $ftrans{$3}; + } + if(/(([A-Z0-9]+)_R_[A-Z0-9_]+)/) { + next unless exists $csrc{$2}; + $urcodes{$1} = 1; + if(!exists $rcodes{$1}) { + $rcodes{$1} = "X"; + $rnew{$2}++; + } + } + } + close IN; +} + +# Now process each library in turn. + +foreach $lib (keys %csrc) +{ + my $hfile = $hinc{$lib}; + my $cfile = $csrc{$lib}; + if(!$fnew{$lib} && !$rnew{$lib}) { + print STDERR "$lib:\t\tNo new error codes\n"; + next unless $rebuild; + } else { + print STDERR "$lib:\t\t$fnew{$lib} New Functions,"; + print STDERR " $rnew{$lib} New Reasons.\n"; + next unless $dowrite; + } + + # If we get here then we have some new error codes so we + # need to rebuild the header file and C file. + + # Make a sorted list of error and reason codes for later use. + + my @function = sort grep(/^${lib}_/,keys %fcodes); + my @reasons = sort grep(/^${lib}_/,keys %rcodes); + + # Rewrite the header file + + open(IN, "<$hfile") || die "Can't Open Header File $hfile\n"; + + # Copy across the old file + while() { + push @out, $_; + last if (/BEGIN ERROR CODES/); + } + close IN; + + open (OUT, ">$hfile") || die "Can't Open File $hfile for writing\n"; + + print OUT @out; + undef @out; + print OUT <<"EOF"; +/* The following lines are auto generated by the script mkerr.pl. Any changes + * made after this point may be overwritten when the script is next run. + */ + +/* Error codes for the $lib functions. */ + +/* Function codes. */ +EOF + + foreach $i (@function) { + $z=6-int(length($i)/8); + if($fcodes{$i} eq "X") { + $fcodes{$i} = ++$fmax{$lib}; + print STDERR "New Function code $i\n" if $debug; + } + printf OUT "#define $i%s $fcodes{$i}\n","\t" x $z; + } + + print OUT "\n/* Reason codes. */\n"; + + foreach $i (@reasons) { + $z=6-int(length($i)/8); + if($rcodes{$i} eq "X") { + $rcodes{$i} = ++$rmax{$lib}; + print STDERR "New Reason code $i\n" if $debug; + } + printf OUT "#define $i%s $rcodes{$i}\n","\t" x $z; + } + print OUT <<"EOF"; + +#ifdef __cplusplus +} +#endif +#endif + +EOF + close OUT; + + # Rewrite the C source file containing the error details. + + my $hincf; + if($static) { + $hfile =~ /([^\/]+)$/; + $hincf = ""; + } else { + $hincf = "\"$hfile\""; + } + + + open (OUT,">$cfile") || die "Can't open $cfile for writing"; + + print OUT <<"EOF"; +/* $cfile */ +/* ==================================================================== + * Copyright (c) 1999 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 + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * openssl-core\@OpenSSL.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + * + * This product includes cryptographic software written by Eric Young + * (eay\@cryptsoft.com). This product includes software written by Tim + * Hudson (tjh\@cryptsoft.com). + * + */ + +/* NOTE: this file was auto generated by the mkerr.pl script: any changes + * made to it will be overwritten when the script next updates this file. + */ + +#include +#include +#include $hincf + +/* BEGIN ERROR CODES */ +#ifndef NO_ERR +static ERR_STRING_DATA ${lib}_str_functs[]= + { +EOF + # Add each function code: if a function name is found then use it. + foreach $i (@function) { + my $fn; + $i =~ /^${lib}_F_(\S+)$/; + $fn = $1; + if(exists $ftrans{$fn}) { + $fn = $ftrans{$fn}; + } + print OUT "{ERR_PACK(0,$i,0),\t\"$fn\"},\n"; + } + print OUT <<"EOF"; +{0,NULL} + }; + +static ERR_STRING_DATA ${lib}_str_reasons[]= + { +EOF + # Add each reason code. + foreach $i (@reasons) { + my $rn; + my $nspc = 0; + $i =~ /^${lib}_R_(\S+)$/; + $rn = $1; + $rn =~ tr/_[A-Z]/ [a-z]/; + $nspc = 40 - length($i) unless length($i) > 40; + $nspc = " " x $nspc; + print OUT "{${i}${nspc},\"$rn\"},\n"; + } +if($static) { + print OUT <<"EOF"; +{0,NULL} + }; + +#endif + +void ERR_load_${lib}_strings(void) + { + static int init=1; + + if (init) + { + init=0; +#ifndef NO_ERR + ERR_load_strings(ERR_LIB_${lib},${lib}_str_functs); + ERR_load_strings(ERR_LIB_${lib},${lib}_str_reasons); +#endif + + } + } +EOF +} else { + print OUT <<"EOF"; +{0,NULL} + }; + +#endif + +#ifdef ${lib}_LIB_NAME +static ERR_STRING_DATA ${lib}_lib_name[]= + { +{0 ,${lib}_LIB_NAME}, +{0,NULL} + }; +#endif + + +int ${lib}_lib_error_code=0; + +void ERR_load_${lib}_strings(void) + { + static int init=1; + + if (${lib}_lib_error_code == 0) + ${lib}_lib_error_code=ERR_get_next_error_library(); + + if (init) + { + init=0; +#ifndef NO_ERR + ERR_load_strings(${lib}_lib_error_code,${lib}_str_functs); + ERR_load_strings(${lib}_lib_error_code,${lib}_str_reasons); +#endif + +#ifdef ${lib}_LIB_NAME + ${lib}_lib_name->error = ERR_PACK(${lib}_lib_error_code,0,0); + ERR_load_strings(0,${lib}_lib_name); +#endif; + } + } + +void ERR_${lib}_error(int function, int reason, char *file, int line) + { + if (${lib}_lib_error_code == 0) + ${lib}_lib_error_code=ERR_get_next_error_library(); + ERR_PUT_error(${lib}_lib_error_code,function,reason,file,line); + } +EOF + +} + + close OUT; + +} + +if($debug && defined(%notrans)) { + print STDERR "The following function codes were not translated:\n"; + foreach(sort keys %notrans) + { + print STDERR "$_\n"; + } +} + +# Make a list of unreferenced function and reason codes + +foreach (keys %fcodes) { + push (@funref, $_) unless exists $ufcodes{$_}; +} + +foreach (keys %rcodes) { + push (@runref, $_) unless exists $urcodes{$_}; +} + +if($debug && defined(@funref) ) { + print STDERR "The following function codes were not referenced:\n"; + foreach(sort @funref) + { + print STDERR "$_\n"; + } +} + +if($debug && defined(@runref) ) { + print STDERR "The following reason codes were not referenced:\n"; + foreach(sort @runref) + { + print STDERR "$_\n"; + } +} diff --git a/src/lib/libcrypto/util/mkfiles.pl b/src/lib/libcrypto/util/mkfiles.pl new file mode 100644 index 0000000000..6fa424bd19 --- /dev/null +++ b/src/lib/libcrypto/util/mkfiles.pl @@ -0,0 +1,110 @@ +#!/usr/local/bin/perl +# +# This is a hacked version of files.pl for systems that can't do a 'make files'. +# Do a perl util/mkminfo.pl >MINFO to build MINFO +# Written by Steve Henson 1999. + +# List of directories to process + +my @dirs = ( +".", +"crypto", +"crypto/md2", +"crypto/md5", +"crypto/sha", +"crypto/mdc2", +"crypto/hmac", +"crypto/ripemd", +"crypto/des", +"crypto/rc2", +"crypto/rc4", +"crypto/rc5", +"crypto/idea", +"crypto/bf", +"crypto/cast", +"crypto/bn", +"crypto/rsa", +"crypto/dsa", +"crypto/dh", +"crypto/buffer", +"crypto/bio", +"crypto/stack", +"crypto/lhash", +"crypto/rand", +"crypto/err", +"crypto/objects", +"crypto/evp", +"crypto/asn1", +"crypto/pem", +"crypto/x509", +"crypto/x509v3", +"crypto/conf", +"crypto/txt_db", +"crypto/pkcs7", +"crypto/pkcs12", +"crypto/comp", +"ssl", +"rsaref", +"apps", +"test", +"tools" +); + +foreach (@dirs) { + &files_dir ($_, "Makefile.ssl"); +} + +exit(0); + +sub files_dir +{ +my ($dir, $makefile) = @_; + +my %sym; + +open (IN, "$dir/$makefile") || die "Can't open $dir/$makefile"; + +my $s=""; + +while () + { + chop; + s/#.*//; + if (/^(\S+)\s*=\s*(.*)$/) + { + $o=""; + ($s,$b)=($1,$2); + for (;;) + { + if ($b =~ /\\$/) + { + chop($b); + $o.=$b." "; + $b=; + chop($b); + } + else + { + $o.=$b." "; + last; + } + } + $o =~ s/^\s+//; + $o =~ s/\s+$//; + $o =~ s/\s+/ /g; + + $o =~ s/\$[({]([^)}]+)[)}]/$sym{$1}/g; + $sym{$s}=$o; + } + } + +print "RELATIVE_DIRECTORY=$dir\n"; + +foreach (sort keys %sym) + { + print "$_=$sym{$_}\n"; + } +print "RELATIVE_DIRECTORY=\n"; + +close (IN); +} diff --git a/src/lib/libcrypto/util/mklink.pl b/src/lib/libcrypto/util/mklink.pl new file mode 100644 index 0000000000..de555820ec --- /dev/null +++ b/src/lib/libcrypto/util/mklink.pl @@ -0,0 +1,55 @@ +#!/usr/local/bin/perl + +# mklink.pl + +# The first command line argument is a non-empty relative path +# specifying the "from" directory. +# Each other argument is a file name not containing / and +# names a file in the current directory. +# +# For each of these files, we create in the "from" directory a link +# of the same name pointing to the local file. +# +# We assume that the directory structure is a tree, i.e. that it does +# not contain symbolic links and that the parent of / is never referenced. +# Apart from this, this script should be able to handle even the most +# pathological cases. + +my $from = shift; +my @files = @ARGV; + +my @from_path = split(/\//, $from); +my $pwd = `pwd`; +chop($pwd); +my @pwd_path = split(/\//, $pwd); + +my @to_path = (); + +my $dirname; +foreach $dirname (@from_path) { + + # In this loop, @to_path always is a relative path from + # @pwd_path (interpreted is an absolute path) to the original pwd. + + # At the end, @from_path (as a relative path from the original pwd) + # designates the same directory as the absolute path @pwd_path, + # which means that @to_path then is a path from there to the original pwd. + + next if ($dirname eq "" || $dirname eq "."); + + if ($dirname eq "..") { + @to_path = (pop(@pwd_path), @to_path); + } else { + @to_path = ("..", @to_path); + push(@pwd_path, $dirname); + } +} + +my $to = join('/', @to_path); + +my $file; +foreach $file (@files) { +# print "ln -s $to/$file $from/$file\n"; + symlink("$to/$file", "$from/$file"); + print $file . " => $from/$file\n"; +} diff --git a/src/lib/libcrypto/util/mklink.sh b/src/lib/libcrypto/util/mklink.sh deleted file mode 100644 index 1e052ed6ee..0000000000 --- a/src/lib/libcrypto/util/mklink.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/sh -# -# A bit of an ugly shell script used to actually 'link' files. -# Used by 'make links' -# - -PATH=$PATH:.:util:../util:../../util -export PATH - -from=$1 -shift - -here=`pwd` -tmp=`dirname $from` -while [ "$tmp"x != "x" -a "$tmp"x != ".x" ] -do - t=`basename $here` - here=`dirname $here` - to="/$t$to" - tmp=`dirname $tmp` -done -to=..$to - -#echo from=$from -#echo to =$to -#exit 1 - -if [ "$*"x != "x" ]; then - for i in $* - do - /bin/rm -f $from/$i - point.sh $to/$i $from/$i - done -fi -exit 0; diff --git a/src/lib/libcrypto/util/perlpath.pl b/src/lib/libcrypto/util/perlpath.pl index 9e57e10ad4..a1f236bd98 100644 --- a/src/lib/libcrypto/util/perlpath.pl +++ b/src/lib/libcrypto/util/perlpath.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/local/bin/perl # # modify the '#!/usr/local/bin/perl' # line in all scripts that rely on perl. @@ -17,7 +17,12 @@ sub wanted @a=; close(IN); - $a[0]="#!$ARGV[0]/perl\n"; + if (-d $ARGV[0]) { + $a[0]="#!$ARGV[0]/perl\n"; + } + else { + $a[0]="#!$ARGV[0]\n"; + } # Playing it safe... $new="$_.new"; diff --git a/src/lib/libcrypto/util/pl/BC-16.pl b/src/lib/libcrypto/util/pl/BC-16.pl index 7c3fdb68f4..6c6df4fe0b 100644 --- a/src/lib/libcrypto/util/pl/BC-16.pl +++ b/src/lib/libcrypto/util/pl/BC-16.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/local/bin/perl # VCw16lib.pl - the file for Visual C++ 1.52b for windows, static libraries # @@ -66,18 +66,18 @@ $asm='bcc -c -B -Tml'; $afile='/o'; if ($no_asm) { - $bn_mulw_obj=''; - $bn_mulw_src=''; + $bn_asm_obj=''; + $bn_asm_src=''; } elsif ($asmbits == 32) { - $bn_mulw_obj='crypto\bn\asm\x86w32.obj'; - $bn_mulw_src='crypto\bn\asm\x86w32.asm'; + $bn_asm_obj='crypto\bn\asm\x86w32.obj'; + $bn_asm_src='crypto\bn\asm\x86w32.asm'; } else { - $bn_mulw_obj='crypto\bn\asm\x86w16.obj'; - $bn_mulw_src='crypto\bn\asm\x86w16.asm'; + $bn_asm_obj='crypto\bn\asm\x86w16.obj'; + $bn_asm_src='crypto\bn\asm\x86w16.asm'; } sub do_lib_rule diff --git a/src/lib/libcrypto/util/pl/BC-32.pl b/src/lib/libcrypto/util/pl/BC-32.pl index 3898d16f61..09c45a21a6 100644 --- a/src/lib/libcrypto/util/pl/BC-32.pl +++ b/src/lib/libcrypto/util/pl/BC-32.pl @@ -1,102 +1,121 @@ -#!/usr/bin/perl -# VCw16lib.pl - the file for Visual C++ 1.52b for windows, static libraries +#!/usr/local/bin/perl +# Borland C++ builder 3 and 4 -- Janez Jere # +$ssl= "ssleay32"; +$crypto="libeay32"; +$RSAref="RSAref32"; + $o='\\'; $cp='copy'; $rm='del'; # C compiler stuff $cc='bcc32'; - +$lflags="-ap -Tpe -x -Gn "; +$mlflags=''; + +$out_def="out32"; +$tmp_def="tmp32"; +$inc_def="inc32"; +#enable max error messages, disable most common warnings +$cflags="-DWIN32_LEAN_AND_MEAN -j255 -w-aus -w-par -w-inl -c -tWC -tWM -DWINDOWS -DWIN32 -DL_ENDIAN "; if ($debug) - { $op="-v "; } -else { $op="-O "; } - -$cflags="-d $op -DL_ENDIAN "; -# I add the stack opt -$base_lflags="-c"; -$lflags="$base_lflags"; - -$cflags.=" -DWINDOWS -DWIN32"; -$app_cflag="-WC"; -$lib_cflag="-WC"; -$lflags.=" -Tpe"; - -if ($shlib) - { - $mlflags="$base_lflags -Tpe"; # stack if defined in .def file - $libs="libw ldllcew"; - } +{ + $cflags.="-Od -y -v -vi- -D_DEBUG"; + $mlflags.=' '; +} else - { $mlflags=''; } +{ + $cflags.="-O2 -ff -fp"; +} $obj='.obj'; $ofile="-o"; # EXE linking stuff -$link="tlink32"; +$link="ilink32"; $efile=""; $exep='.exe'; -$ex_libs="CW32.LIB IMPORT32.LIB"; -$ex_libs.=$no_sock?"":" wsock32.lib"; -$shlib_ex_obj="" if $shlib; -$app_ex_obj="C0X32.OBJ"; +if ($no_sock) + { $ex_libs=""; } +else { $ex_libs="cw32mt.lib import32.lib"; } # static library stuff -$mklib='tlib'; +$mklib='tlib /P64'; $ranlib=''; $plib=""; $libp=".lib"; $shlibp=($shlib)?".dll":".lib"; $lfile=''; -$asm='ml /Cp /c /Cx'; +$shlib_ex_obj=""; +$app_ex_obj="c0x32.obj"; + +$asm='n_o_T_a_s_m'; +$asm.=" /Zi" if $debug; $afile='/Fo'; -if ($noasm) + +$bn_mulw_obj=''; +$bn_mulw_src=''; +$des_enc_obj=''; +$des_enc_src=''; +$bf_enc_obj=''; +$bf_enc_src=''; + +if (!$no_asm) { - $bn_mulw_obj=''; - $bn_mulw_src=''; + $bn_mulw_obj='crypto\bn\asm\bn-win32.obj'; + $bn_mulw_src='crypto\bn\asm\bn-win32.asm'; + $des_enc_obj='crypto\des\asm\d-win32.obj crypto\des\asm\y-win32.obj'; + $des_enc_src='crypto\des\asm\d-win32.asm crypto\des\asm\y-win32.asm'; + $bf_enc_obj='crypto\bf\asm\b-win32.obj'; + $bf_enc_src='crypto\bf\asm\b-win32.asm'; + $cast_enc_obj='crypto\cast\asm\c-win32.obj'; + $cast_enc_src='crypto\cast\asm\c-win32.asm'; + $rc4_enc_obj='crypto\rc4\asm\r4-win32.obj'; + $rc4_enc_src='crypto\rc4\asm\r4-win32.asm'; + $rc5_enc_obj='crypto\rc5\asm\r5-win32.obj'; + $rc5_enc_src='crypto\rc5\asm\r5-win32.asm'; + $md5_asm_obj='crypto\md5\asm\m5-win32.obj'; + $md5_asm_src='crypto\md5\asm\m5-win32.asm'; + $sha1_asm_obj='crypto\sha\asm\s1-win32.obj'; + $sha1_asm_src='crypto\sha\asm\s1-win32.asm'; + $rmd160_asm_obj='crypto\ripemd\asm\rm-win32.obj'; + $rmd160_asm_src='crypto\ripemd\asm\rm-win32.asm'; + $cflags.=" -DBN_ASM -DMD5_ASM -DSHA1_ASM -DRMD160_ASM"; } -else + +if ($shlib) { - $bn_mulw_obj='crypto\bn\asm\x86b32.obj'; - $bn_mulw_src='crypto\bn\asm\x86m32.asm'; + $mlflags.=" $lflags /dll"; +# $cflags =~ s| /MD| /MT|; + $lib_cflag=" /GD -D_WINDLL -D_DLL"; + $out_def="out32dll"; + $tmp_def="tmp32dll"; } sub do_lib_rule { - local($target,$name,$shlib)=@_; + local($objs,$target,$name,$shlib)=@_; local($ret,$Name); $taget =~ s/\//$o/g if $o ne '/'; ($Name=$name) =~ tr/a-z/A-Z/; - $ret.="$target: \$(${Name}OBJ)\n"; - $ret.="\t\$(RM) \$(O_$Name)\n"; - - # Due to a pathetic line length limit, I unwrap the args. - local($lib_names)=""; - local($dll_names)=""; - foreach $_ (sort split(/\s+/,$Vars{"${Name}OBJ"})) - { - $lib_names.=" +$_ &\n"; - $dll_names.=" $_\n"; - } - +# $target="\$(LIB_D)$o$target"; + $ret.="$target: $objs\n"; if (!$shlib) { - $ret.="\t\$(MKLIB) $target & <<|\n$lib_names\n,\n|\n"; + # $ret.="\t\$(RM) \$(O_$Name)\n"; + $ret.="\techo LIB $<\n"; + $ret.="\t\$(MKLIB) $lfile$target \$(addprefix +, $objs)\n"; } else { - # $(SHLIB_EX_OBJ) - local($ex)=($Name eq "SSL")?' $(L_CRYPTO) winsock':""; - $ret.="\t\$(LINK) \$(MLFLAGS) @&&|\n"; - $ret.=$dll_names; - $ret.="\n $target\n\n $ex $libs\nms$o${name}16.def;\n|\n"; - ($out_lib=$target) =~ s/O_/L_/; - $ret.="\timplib /nowep $out_lib $target\n\n"; + local($ex)=($target =~ /O_SSL/)?' $(L_CRYPTO)':''; + $ex.=' wsock32.lib gdi32.lib'; + $ret.="\t\$(LINK) \$(MLFLAGS) $efile$target /def:ms/${Name}.def @<<\n \$(SHLIB_EX_OBJ) $objs $ex\n<<\n"; } $ret.="\n"; return($ret); @@ -105,30 +124,12 @@ sub do_lib_rule sub do_link_rule { local($target,$files,$dep_libs,$libs)=@_; - local($ret,$f,$_,@f); + local($ret,$_); $file =~ s/\//$o/g if $o ne '/'; $n=&bname($targer); $ret.="$target: $files $dep_libs\n"; - $ret.=" \$(LINK) @&&|"; - - # Due to a pathetic line length limit, I have to unwrap the args. - $r=" \$(LFLAGS) "; - if ($files =~ /\(([^)]*)\)$/) - { - @a=('$(APP_EX_OBJ)'); - push(@a,sort split(/\s+/,$Vars{$1})); - foreach $_ (@a) - { - $ret.="\n $r $_ +"; - $r=""; - } - chop($ret); - $ret.="\n"; - } - else - { $ret.="\n $r \$(APP_EX_OBJ) $files\n"; } - $ret.=" $target\n\n $libs\n\n|\n\n"; + $ret.="\t\$(LINK) \$(LFLAGS) $files \$(APP_EX_OBJ), $target,, $libs\n\n"; return($ret); } diff --git a/src/lib/libcrypto/util/pl/Mingw32.pl b/src/lib/libcrypto/util/pl/Mingw32.pl new file mode 100644 index 0000000000..84c2a22db3 --- /dev/null +++ b/src/lib/libcrypto/util/pl/Mingw32.pl @@ -0,0 +1,79 @@ +#!/usr/local/bin/perl +# +# Mingw32.pl -- Mingw32 with GNU cp (Mingw32f.pl uses DOS tools) +# + +$o='/'; +$cp='cp'; +$rm='rem'; # use 'rm -f' if using GNU file utilities +$mkdir='gmkdir'; + +# gcc wouldn't accept backslashes in paths +#$o='\\'; +#$cp='copy'; +#$rm='del'; + +# C compiler stuff + +$cc='gcc'; +if ($debug) + { $cflags="-g2 -ggdb"; } +else + { $cflags="-DL_ENDIAN -fomit-frame-pointer -O3 -m486 -Wall"; } + +$obj='.o'; +$ofile='-o '; + +# EXE linking stuff +$link='${CC}'; +$lflags='${CFLAGS}'; +$efile='-o '; +$exep=''; +$ex_libs="-lwsock32 -lgdi32"; + +# static library stuff +$mklib='ar r'; +$mlflags=''; +$ranlib='ranlib'; +$plib='lib'; +$libp=".a"; +$shlibp=".a"; +$lfile=''; + +$asm='as'; +$afile='-o '; +$bn_asm_obj=""; +$bn_asm_src=""; +$des_enc_obj=""; +$des_enc_src=""; +$bf_enc_obj=""; +$bf_enc_src=""; + +sub do_lib_rule + { + local($obj,$target,$name,$shlib)=@_; + local($ret,$_,$Name); + + $target =~ s/\//$o/g if $o ne '/'; + $target="$target"; + ($Name=$name) =~ tr/a-z/A-Z/; + + $ret.="$target: \$(${Name}OBJ)\n"; + $ret.="\t\$(RM) $target\n"; + $ret.="\t\$(MKLIB) $target \$(${Name}OBJ)\n"; + $ret.="\t\$(RANLIB) $target\n\n"; + } + +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"; + $ret.="\t\$(LINK) ${efile}$target \$(LFLAGS) $files $libs\n\n"; + return($ret); + } +1; + diff --git a/src/lib/libcrypto/util/pl/Mingw32f.pl b/src/lib/libcrypto/util/pl/Mingw32f.pl new file mode 100644 index 0000000000..a53c537646 --- /dev/null +++ b/src/lib/libcrypto/util/pl/Mingw32f.pl @@ -0,0 +1,73 @@ +#!/usr/local/bin/perl +# +# Mingw32f.pl -- copy files; Mingw32.pl is needed to do the compiling. +# + +$o='\\'; +$cp='copy'; +$rm='del'; + +# C compiler stuff + +$cc='gcc'; +if ($debug) + { $cflags="-g2 -ggdb"; } +else + { $cflags="-O3 -fomit-frame-pointer"; } + +$obj='.o'; +$ofile='-o '; + +# EXE linking stuff +$link='${CC}'; +$lflags='${CFLAGS}'; +$efile='-o '; +$exep=''; +$ex_libs="-lwsock32 -lgdi32"; + +# static library stuff +$mklib='ar r'; +$mlflags=''; +$ranlib='ranlib'; +$plib='lib'; +$libp=".a"; +$shlibp=".a"; +$lfile=''; + +$asm='as'; +$afile='-o '; +$bn_asm_obj=""; +$bn_asm_src=""; +$des_enc_obj=""; +$des_enc_src=""; +$bf_enc_obj=""; +$bf_enc_src=""; + +sub do_lib_rule + { + local($obj,$target,$name,$shlib)=@_; + local($ret,$_,$Name); + + $target =~ s/\//$o/g if $o ne '/'; + $target="$target"; + ($Name=$name) =~ tr/a-z/A-Z/; + + $ret.="$target: \$(${Name}OBJ)\n"; + $ret.="\t\$(RM) $target\n"; + $ret.="\t\$(MKLIB) $target \$(${Name}OBJ)\n"; + $ret.="\t\$(RANLIB) $target\n\n"; + } + +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"; + $ret.="\t\$(LINK) ${efile}$target \$(LFLAGS) $files $libs\n\n"; + return($ret); + } +1; + diff --git a/src/lib/libcrypto/util/pl/VC-16.pl b/src/lib/libcrypto/util/pl/VC-16.pl index a6e6c0241c..a5079d4ca7 100644 --- a/src/lib/libcrypto/util/pl/VC-16.pl +++ b/src/lib/libcrypto/util/pl/VC-16.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/local/bin/perl # VCw16lib.pl - the file for Visual C++ 1.52b for windows, static libraries # @@ -84,8 +84,8 @@ $lfile=''; $asm='ml /Cp /c /Cx'; $afile='/Fo'; -$bn_mulw_obj=''; -$bn_mulw_src=''; +$bn_asm_obj=''; +$bn_asm_src=''; $des_enc_obj=''; $des_enc_src=''; $bf_enc_obj=''; @@ -95,13 +95,13 @@ if (!$no_asm) { if ($asmbits == 32) { - $bn_mulw_obj='crypto\bn\asm\x86w32.obj'; - $bn_mulw_src='crypto\bn\asm\x86w32.asm'; + $bn_asm_obj='crypto\bn\asm\x86w32.obj'; + $bn_asm_src='crypto\bn\asm\x86w32.asm'; } else { - $bn_mulw_obj='crypto\bn\asm\x86w16.obj'; - $bn_mulw_src='crypto\bn\asm\x86w16.asm'; + $bn_asm_obj='crypto\bn\asm\x86w16.obj'; + $bn_asm_src='crypto\bn\asm\x86w16.asm'; } } diff --git a/src/lib/libcrypto/util/pl/VC-32.pl b/src/lib/libcrypto/util/pl/VC-32.pl index 701e282c33..6db1c9fe23 100644 --- a/src/lib/libcrypto/util/pl/VC-32.pl +++ b/src/lib/libcrypto/util/pl/VC-32.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/local/bin/perl # VCw32lib.pl - the file for Visual C++ 4.[01] for windows NT, static libraries # @@ -7,7 +7,7 @@ $crypto="libeay32"; $RSAref="RSAref32"; $o='\\'; -$cp='copy'; +$cp='copy nul+'; # Timestamps get stuffed otherwise $rm='del'; # C compiler stuff @@ -22,10 +22,11 @@ $inc_def="inc32"; if ($debug) { - $cflags=" /MDd /W3 /WX /Zi /Yd /Od /nologo -DWINDOWS -DWIN32 -D_DEBUG -DL_ENDIAN"; + $cflags=" /MDd /W3 /WX /Zi /Yd /Od /nologo -DWINDOWS -DWIN32 -D_DEBUG -DL_ENDIAN -DWIN32_LEAN_AND_MEAN -DDEBUG"; $lflags.=" /debug"; $mlflags.=' /debug'; } +$cflags .= " -DWINNT" if $NT == 1; $obj='.obj'; $ofile="/Fo"; @@ -48,13 +49,17 @@ $lfile='/out:'; $shlib_ex_obj=""; $app_ex_obj="setargv.obj"; - -$asm='ml /Cp /coff /c /Cx'; -$asm.=" /Zi" if $debug; -$afile='/Fo'; - -$bn_mulw_obj=''; -$bn_mulw_src=''; +if ($nasm) { + $asm='nasmw -f win32'; + $afile='-o '; +} else { + $asm='ml /Cp /coff /c /Cx'; + $asm.=" /Zi" if $debug; + $afile='/Fo'; +} + +$bn_asm_obj=''; +$bn_asm_src=''; $des_enc_obj=''; $des_enc_src=''; $bf_enc_obj=''; @@ -62,8 +67,8 @@ $bf_enc_src=''; if (!$no_asm) { - $bn_mulw_obj='crypto\bn\asm\bn-win32.obj'; - $bn_mulw_src='crypto\bn\asm\bn-win32.asm'; + $bn_asm_obj='crypto\bn\asm\bn-win32.obj'; + $bn_asm_src='crypto\bn\asm\bn-win32.asm'; $des_enc_obj='crypto\des\asm\d-win32.obj crypto\des\asm\y-win32.obj'; $des_enc_src='crypto\des\asm\d-win32.asm crypto\des\asm\y-win32.asm'; $bf_enc_obj='crypto\bf\asm\b-win32.obj'; @@ -92,6 +97,8 @@ if ($shlib) $tmp_def="tmp32dll"; } +$cflags.=" /Fd$out_def"; + sub do_lib_rule { local($objs,$target,$name,$shlib)=@_; @@ -110,7 +117,7 @@ sub do_lib_rule else { local($ex)=($target =~ /O_SSL/)?' $(L_CRYPTO)':''; - $ex.=' wsock32.lib gdi32.lib'; + $ex.=' wsock32.lib gdi32.lib advapi32.lib'; $ret.="\t\$(LINK) \$(MLFLAGS) $efile$target /def:ms/${Name}.def @<<\n \$(SHLIB_EX_OBJ) $objs $ex\n<<\n"; } $ret.="\n"; diff --git a/src/lib/libcrypto/util/pl/linux.pl b/src/lib/libcrypto/util/pl/linux.pl index 2b13da1bfc..a8cfdc578a 100644 --- a/src/lib/libcrypto/util/pl/linux.pl +++ b/src/lib/libcrypto/util/pl/linux.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/local/bin/perl # # linux.pl - the standard unix makefile stuff. # @@ -17,8 +17,8 @@ else if (!$no_asm) { - $bn_mulw_obj='$(OBJ_D)/bn86-elf.o'; - $bn_mulw_src='crypto/bn/asm/bn86unix.cpp'; + $bn_asm_obj='$(OBJ_D)/bn86-elf.o'; + $bn_asm_src='crypto/bn/asm/bn86unix.cpp'; $des_enc_obj='$(OBJ_D)/dx86-elf.o $(OBJ_D)/yx86-elf.o'; $des_enc_src='crypto/des/asm/dx86unix.cpp crypto/des/asm/yx86unix.cpp'; $bf_enc_obj='$(OBJ_D)/bx86-elf.o'; @@ -27,8 +27,12 @@ if (!$no_asm) $cast_enc_src='crypto/cast/asm/cx86unix.cpp'; $rc4_enc_obj='$(OBJ_D)/rx86-elf.o'; $rc4_enc_src='crypto/rc4/asm/rx86unix.cpp'; + $rc5_enc_obj='$(OBJ_D)/r586-elf.o'; + $rc5_enc_src='crypto/rc5/asm/r586unix.cpp'; $md5_asm_obj='$(OBJ_D)/mx86-elf.o'; $md5_asm_src='crypto/md5/asm/mx86unix.cpp'; + $rmd160_asm_obj='$(OBJ_D)/rm86-elf.o'; + $rmd160_asm_src='crypto/ripemd/asm/rm86unix.cpp'; $sha1_asm_obj='$(OBJ_D)/sx86-elf.o'; $sha1_asm_src='crypto/sha/asm/sx86unix.cpp'; $cflags.=" -DBN_ASM -DMD5_ASM -DSHA1_ASM"; @@ -51,9 +55,9 @@ sub do_shlib_rule $target =~ s/\//$o/g if $o ne '/'; ($Name=$name) =~ tr/a-z/A-Z/; - $ret.="\$(LIB_D)$o$target: \$(${Name}OBJ)\n"; - $ret.="\t\$(RM) \$(LIB_D)$o$target\n"; - $ret.="\tgcc \${CFLAGS} -shared -Wl,-soname,$target -o \$(LIB_D)$o$target \$(${Name}OBJ)\n"; + $ret.="$target: \$(${Name}OBJ)\n"; + $ret.="\t\$(RM) target\n"; + $ret.="\tgcc \${CFLAGS} -shared -Wl,-soname,$target -o $target \$(${Name}OBJ)\n"; ($t=$target) =~ s/(^.*)\/[^\/]*$/$1/; if ($so_name ne "") { diff --git a/src/lib/libcrypto/util/pl/ultrix.pl b/src/lib/libcrypto/util/pl/ultrix.pl new file mode 100644 index 0000000000..ea370c71f9 --- /dev/null +++ b/src/lib/libcrypto/util/pl/ultrix.pl @@ -0,0 +1,38 @@ +#!/usr/local/bin/perl +# +# linux.pl - the standard unix makefile stuff. +# + +$o='/'; +$cp='/bin/cp'; +$rm='/bin/rm -f'; + +# C compiler stuff + +$cc='cc'; +if ($debug) + { $cflags="-g -DREF_CHECK -DCRYPTO_MDEBUG"; } +else + { $cflags="-O2"; } + +$cflags.=" -std1 -DL_ENDIAN"; + +if (!$no_asm) + { + $bn_asm_obj='$(OBJ_D)/mips1.o'; + $bn_asm_src='crypto/bn/asm/mips1.s'; + } + +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"; + $ret.="\t\$(LINK) ${efile}$target \$(LFLAGS) $files $libs\n\n"; + return($ret); + } + +1; diff --git a/src/lib/libcrypto/util/pl/unix.pl b/src/lib/libcrypto/util/pl/unix.pl index ab4978fd20..146611ad99 100644 --- a/src/lib/libcrypto/util/pl/unix.pl +++ b/src/lib/libcrypto/util/pl/unix.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/local/bin/perl # # unix.pl - the standard unix makefile stuff. # @@ -38,7 +38,7 @@ $ex_libs=""; # static library stuff $mklib='ar r'; $mlflags=''; -$ranlib='util/ranlib.sh'; +$ranlib=&which("ranlib") or $ranlib="true"; $plib='lib'; $libp=".a"; $shlibp=".a"; @@ -46,8 +46,8 @@ $lfile=''; $asm='as'; $afile='-o '; -$bn_mulw_obj=""; -$bn_mulw_src=""; +$bn_asm_obj=""; +$bn_asm_src=""; $des_enc_obj=""; $des_enc_src=""; $bf_enc_obj=""; @@ -59,7 +59,7 @@ sub do_lib_rule local($ret,$_,$Name); $target =~ s/\//$o/g if $o ne '/'; - $target="\$(LIB_D)$o$target"; + $target="$target"; ($Name=$name) =~ tr/a-z/A-Z/; $ret.="$target: \$(${Name}OBJ)\n"; @@ -80,4 +80,17 @@ sub do_link_rule return($ret); } +sub which + { + my ($name)=@_; + my $path; + foreach $path (split /:/, $ENV{PATH}) + { + if (-x "$path/$name") + { + return "$path/$name"; + } + } + } + 1; diff --git a/src/lib/libcrypto/util/point.sh b/src/lib/libcrypto/util/point.sh index 92c12e8282..47543c88e2 100644 --- a/src/lib/libcrypto/util/point.sh +++ b/src/lib/libcrypto/util/point.sh @@ -1,4 +1,6 @@ #!/bin/sh -/bin/rm -f $2 +rm -f $2 ln -s $1 $2 +echo "$2 => $1" + diff --git a/src/lib/libcrypto/util/ranlib.sh b/src/lib/libcrypto/util/ranlib.sh deleted file mode 100644 index 543f712c6b..0000000000 --- a/src/lib/libcrypto/util/ranlib.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/sh - -cwd=`pwd` -cd /tmp - -if [ -s /bin/ranlib ] ; then - RL=/bin/ranlib -else if [ -s /usr/bin/ranlib ] ; then - RL=/usr/bin/ranlib -fi -fi - -if [ "x$RL" != "x" ] -then - case "$1" in - /*) - $RL "$1" - ;; - *) - $RL "$cwd/$1" - ;; - esac -fi diff --git a/src/lib/libcrypto/util/sep_lib.sh b/src/lib/libcrypto/util/sep_lib.sh index 2348db874e..34c2c9f8ba 100644 --- a/src/lib/libcrypto/util/sep_lib.sh +++ b/src/lib/libcrypto/util/sep_lib.sh @@ -21,9 +21,6 @@ do /bin/rm -f *.old /bin/mv Makefile.uni Makefile - cp $cwd/util/ranlib.sh . - chmod +x ranlib.sh - if [ -d asm ]; then mkdir asm/perlasm cp $cwd/crypto/perlasm/*.pl asm/perlasm diff --git a/src/lib/libcrypto/util/sp-diff.pl b/src/lib/libcrypto/util/sp-diff.pl index 2c88336858..f81e50201b 100644 --- a/src/lib/libcrypto/util/sp-diff.pl +++ b/src/lib/libcrypto/util/sp-diff.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/local/bin/perl # # This file takes as input, the files that have been output from # ssleay speed. diff --git a/src/lib/libcrypto/util/src-dep.pl b/src/lib/libcrypto/util/src-dep.pl index 91242f7bb6..ad997e4746 100644 --- a/src/lib/libcrypto/util/src-dep.pl +++ b/src/lib/libcrypto/util/src-dep.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/local/bin/perl # we make up an array of # $file{function_name}=filename; diff --git a/src/lib/libcrypto/util/ssldir.pl b/src/lib/libcrypto/util/ssldir.pl deleted file mode 100644 index 10584686da..0000000000 --- a/src/lib/libcrypto/util/ssldir.pl +++ /dev/null @@ -1,52 +0,0 @@ -#!/usr/bin/perl - -$#ARGV == 0 || die "usage: ssldir.pl /new/path\n"; -@files=('crypto/cryptlib.h', - 'Makefile.ssl', - 'tools/c_rehash', - 'util/mk1mf.pl', - ); - -%cryptlib=( - '\sX509_CERT_AREA\s',"#define X509_CERT_AREA\t\t".'"%s"', - '\sX509_CERT_DIR\s', "#define X509_CERT_DIR\t\t".'"%s/certs"', - '\sX509_CERT_FILE\s', "#define X509_CERT_FILE\t\t".'"%s/cert.pem"', - '\sX509_PRIVATE_DIR\s',"#define X509_PRIVATE_DIR\t".'"%s/private"', - ); - -%Makefile_ssl=( - '^INSTALLTOP=','INSTALLTOP=%s', - ); - -%c_rehash=( - '^DIR=', 'DIR=%s', - ); - -%mk1mf=( - '^$INSTALLTOP=','$INSTALLTOP="%s";', - ); - -&dofile("crypto/cryptlib.h",$ARGV[0],%cryptlib); -&dofile("Makefile.ssl",$ARGV[0],%Makefile_ssl); -&dofile("tools/c_rehash",$ARGV[0],%c_rehash); -&dofile("util/mk1mf.pl",$ARGV[0],%mk1mf); - -sub dofile - { - ($f,$p,%m)=@_; - - open(IN,"<$f") || die "unable to open $f:$!\n"; - @a=; - close(IN); - foreach $k (keys %m) - { - grep(/$k/ && ($_=sprintf($m{$k}."\n",$p)),@a); - } - ($ff=$f) =~ s/\..*$//; - open(OUT,">$ff.new") || die "unable to open $f:$!\n"; - print OUT @a; - close(OUT); - rename($f,"$ff.old") || die "unable to rename $f\n"; - rename("$ff.new",$f) || die "unable to rename $ff.new\n"; - } - diff --git a/src/lib/libcrypto/util/ssleay.num b/src/lib/libcrypto/util/ssleay.num index 359fa15df1..8121738bd6 100644 --- a/src/lib/libcrypto/util/ssleay.num +++ b/src/lib/libcrypto/util/ssleay.num @@ -154,3 +154,64 @@ TLSv1_server_method 171 TLSv1_client_method 172 BIO_new_buffer_ssl_connect 173 BIO_new_ssl_connect 174 +SSL_get_ex_data_X509_STORE_CTX_idx 175 +SSL_CTX_set_tmp_dh_callback 176 +SSL_CTX_set_tmp_rsa_callback 177 +SSL_CTX_set_timeout 178 +SSL_CTX_get_timeout 179 +SSL_CTX_get_cert_store 180 +SSL_CTX_set_cert_store 181 +SSL_want 182 +SSL_library_init 183 +SSL_COMP_add_compression_method 184 +SSL_add_file_cert_subjects_to_stack 185 +SSL_set_tmp_rsa_callback 186 +SSL_set_tmp_dh_callback 187 +SSL_add_dir_cert_subjects_to_stack 188 +SSL_set_session_id_context 189 +sk_SSL_CIPHER_new 190 +sk_SSL_CIPHER_new_null 191 +sk_SSL_CIPHER_free 192 +sk_SSL_CIPHER_num 193 +sk_SSL_CIPHER_value 194 +sk_SSL_CIPHER_set 195 +sk_SSL_CIPHER_zero 196 +sk_SSL_CIPHER_push 197 +sk_SSL_CIPHER_pop 198 +sk_SSL_CIPHER_find 199 +sk_SSL_CIPHER_delete 200 +sk_SSL_CIPHER_delete_ptr 201 +sk_SSL_CIPHER_set_cmp_func 202 +sk_SSL_CIPHER_dup 203 +sk_SSL_CIPHER_pop_free 204 +sk_SSL_CIPHER_shift 205 +sk_SSL_COMP_new 206 +sk_SSL_COMP_new_null 207 +sk_SSL_COMP_free 208 +sk_SSL_COMP_num 209 +sk_SSL_COMP_value 210 +sk_SSL_COMP_set 211 +sk_SSL_COMP_zero 212 +sk_SSL_COMP_push 213 +sk_SSL_COMP_pop 214 +sk_SSL_COMP_find 215 +sk_SSL_COMP_delete 216 +sk_SSL_COMP_delete_ptr 217 +sk_SSL_COMP_set_cmp_func 218 +sk_SSL_COMP_dup 219 +sk_SSL_COMP_pop_free 220 +sk_SSL_COMP_shift 221 +SSL_CTX_use_certificate_chain_file 222 +sk_SSL_COMP_insert 223 +sk_SSL_CIPHER_insert 224 +SSL_CTX_set_verify_depth 225 +SSL_set_verify_depth 226 +sk_SSL_CIPHER_unshift 227 +SSL_CTX_get_verify_depth 228 +SSL_get_verify_depth 229 +sk_SSL_COMP_unshift 230 +SSL_CTX_set_session_id_context 231 +SSL_CTX_set_cert_verify_callback 232 +sk_SSL_COMP_sort 233 +sk_SSL_CIPHER_sort 234 +SSL_CTX_set_default_passwd_cb_userdata 235 diff --git a/src/lib/libcrypto/util/tab_num.pl b/src/lib/libcrypto/util/tab_num.pl index 77b591d92f..a81ed0edc2 100644 --- a/src/lib/libcrypto/util/tab_num.pl +++ b/src/lib/libcrypto/util/tab_num.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/local/bin/perl $num=1; $width=40; diff --git a/src/lib/libcrypto/util/up_ver.pl b/src/lib/libcrypto/util/up_ver.pl deleted file mode 100644 index 32c086b2aa..0000000000 --- a/src/lib/libcrypto/util/up_ver.pl +++ /dev/null @@ -1,79 +0,0 @@ -#!/usr/bin/perl -# -# Up the version numbers in the files. -# - -@files=( - "crypto/crypto.h", - "crypto/des/ecb_enc.c", - "crypto/idea/i_ecb.c", - "crypto/lhash/lhash.c", - "crypto/conf/conf.c", - "crypto/md2/md2_dgst.c", - "crypto/md5/md5_dgst.c", - "crypto/ripemd/rmd_dgst.c", - "crypto/pem/pem_lib.c", - "crypto/bn/bn_lib.c", - "crypto/dh/dh_lib.c", - "crypto/rc2/rc2_ecb.c", - "crypto/rc4/rc4_skey.c", - "crypto/rc5/rc5_ecb.c", - "crypto/bf/bf_ecb.c", - "crypto/cast/c_ecb.c", - "crypto/rsa/rsa_lib.c", - "crypto/dsa/dsa_lib.c", - "crypto/sha/sha1dgst.c", - "crypto/sha/sha_dgst.c", - "crypto/asn1/asn1_lib.c", - "crypto/x509/x509_vfy.c", - "crypto/evp/evp_enc.c", - "crypto/rand/md_rand.c", - "crypto/stack/stack.c", - "crypto/txt_db/txt_db.c", - "crypto/cversion.c", - "ssl/ssl_lib.c", - "ssl/s2_lib.c", - "ssl/s3_lib.c", - "ssl/t1_lib.c", - "README", - ); - -@month=('Jan','Feb','Mar','Apr','May','Jun', - 'Jul','Aug','Sep','Oct','Nov','Dec'); -@a=localtime(time()); -$time=sprintf("%02d-%s-%04d",$a[3],$month[$a[4]],$a[5]+1900); - -$ver=$ARGV[0]; -($ver ne "") || die "no version number specified\n"; -($a,$b,$c,$d)=unpack('axaxac',$ver); -$d=defined($d)?$d-96:0; -$xver=sprintf("%x%x%x%x",$a,$b,$c,$d); - -foreach $file (@files) - { - open(IN,"<$file") || die "unable to open $file:$!\n"; - open(OUT,">$file.new") || die "unable to open $file.new:$!\n"; - $found=0; - - print STDERR "$file:"; - - while () - { - if ((s/SSLeay \d\.\d.\d[^"]*(\"|\s)/SSLeay $ver $time\1/) || - s/^(\#define\s+SSLEAY_VERSION_NUMBER\s+0x)[0-9a-zA-Z]+(.*)$/$1$xver$2/) - { - print STDERR " Done"; - $found++; - print OUT; - while () { print OUT; } - last; - } - print OUT; - } - print STDERR "\n"; - close(IN); - close(OUT); - (!$found) && die "unable to update the version number in $file\n"; - rename($file,"$file.old") || die "unable to rename $file:$!\n"; - rename("$file.new",$file) || die "unable to rename $file.new:$!\n"; - } diff --git a/src/lib/libcrypto/util/x86asm.sh b/src/lib/libcrypto/util/x86asm.sh index 81d3289860..d2090a9849 100644 --- a/src/lib/libcrypto/util/x86asm.sh +++ b/src/lib/libcrypto/util/x86asm.sh @@ -2,8 +2,8 @@ echo Generating x86 assember echo Bignum -(cd crypto/bn/asm; perl bn-586.pl cpp > bn86unix.cpp) -(cd crypto/bn/asm; perl bn-586.pl win32 > bn-win32.asm) +(cd crypto/bn/asm; perl x86.pl cpp > bn86unix.cpp) +(cd crypto/bn/asm; perl x86.pl win32 > bn-win32.asm) echo DES (cd crypto/des/asm; perl des-586.pl cpp > dx86unix.cpp) -- cgit v1.2.3-55-g6feb