The unified diff between revisions [8ada27de..] and [3bc1edb6..] is displayed below. It can also be downloaded as a raw diff.
#
#
# delete "Attic/doc/porting.txt"
#
# delete "Attic/misc/botan.rc"
#
# delete "es_file.cpp"
#
# delete "es_file.h"
#
# delete "inifile.cpp"
#
# add_dir "Attic/modules/es_dev"
#
# add_file "Attic/modules/es_dev/es_dev.cpp"
# content [903d37082b372d65135f66cb43f5cfe84f5a930f]
#
# add_file "Attic/modules/es_dev/es_dev.h"
# content [a733463b4efc81e44fa058cc9f496ae6235e0ad2]
#
# add_file "Attic/modules/es_dev/modinfo.txt"
# content [b25166d29b5afeb56586f6ae759ed944f6874256]
#
# patch "Attic/.mtn-ignore"
# from [e7f8cbb7659be886a26ef6621a3605f815ce1606]
# to [b2ab2a341f6e74b13af6591ca9c419592e3c1fe9]
#
# patch "Attic/checks/algos.cpp"
# from [99cdd8b6e21dbd9160fe5235e95c5a65e2c69b6b]
# to [e7835fc1b1698ad0663717e6558acfc43e0619d2]
#
# patch "Attic/checks/bench.cpp"
# from [380f38c3230ff1cc3599246b0c9152d77994f7a6]
# to [c6edf6ea5b86de31a9297b8c4a38e20b00b17569]
#
# patch "Attic/checks/check.cpp"
# from [77665d2d9e2a8b662ea028908d8f1b9a577609ff]
# to [8bfeb47c287bea56e3b4543a034b486664a0d60d]
#
# patch "Attic/checks/dolook2.cpp"
# from [37bf56072f24c843ac66295bd79544e283de9737]
# to [85311129695d27a3c04ac8d6c56ac0ed7a640d61]
#
# patch "Attic/checks/pk.cpp"
# from [c541d866ce78834d3ac98bc6993dd79622288efe]
# to [40b95d943dfcfd43d2cc5e0f7fce617f35316c4d]
#
# patch "Attic/checks/pk_bench.cpp"
# from [ef6c4d7fb50c3e1f9e48fde2d793b0aff37eb76e]
# to [7397a3fd478a3c1d33965d946c497172b4eb1940]
#
# patch "Attic/checks/validate.cpp"
# from [c8f8cd4ed6867ae6fd8bbe7c8af0f5c04f847664]
# to [f82aaa5253a65fe9f48a69617bdcc9f92587a22f]
#
# patch "Attic/configure.pl"
# from [d8e1ab45a849855ad6dff87d8919c3b8a8b08eaf]
# to [20f79155abfd210ff10126b977ff2652a412ae77]
#
# patch "Attic/doc/api.tex"
# from [cb1e40121b562d97258d9aba065c5cb5f58bfb3c]
# to [2ff20035b5a43d5549e664daf89a4ad837ebef2a]
#
# patch "Attic/doc/building.tex"
# from [5ffcd552ad48605b03a6dbe526ac39d85451c6e4]
# to [93619b803ba091c08e1638e59a70bee267ecfde7]
#
# patch "Attic/doc/examples/ca.cpp"
# from [e495b2b0e52d4c389b828f82bebbe760e57a34a7]
# to [6cc72054e73db7edf59cc9410bbb5efa561d7100]
#
# patch "Attic/doc/examples/passhash.cpp"
# from [8cc8559beed77954bf20883ca8958b45655d8460]
# to [dd7df26838e4daf231280f5fa82a2c1cda66a353]
#
# patch "Attic/doc/examples/x509info.cpp"
# from [5f95ed368ba2d9ca8b50c8f90f1531e1f39a3884]
# to [df788151a6e458f630dee2691b9d4c0aa42b94e2]
#
# patch "Attic/doc/logs/log-17.txt"
# from [84160a4ac4d5f5263cb455fde8e8c8d562008aab]
# to [10451beb53e5ecc4ce9878b017750fe7bb0a2857]
#
# patch "Attic/include/idea.h"
# from [d7276b98289143c01e8cee8c693ba8f7b441f44c]
# to [6628f852d9edb773c8e06a3322a35923b09b70f4]
#
# patch "Attic/misc/config/arch/alpha"
# from [eb4385b12908208ea2f42b048c8401e5a029e734]
# to [3ddceecf33d3c312c6e88ff806473f0a3312d8af]
#
# patch "Attic/misc/config/arch/amd64"
# from [0bf63f53099d9804fc351f00c0a60c53199c8b28]
# to [ea841b88c03ac99e1d6f4b266e9edd08297c7ef1]
#
# patch "Attic/misc/config/arch/ia32"
# from [2cea203db7576d32a3134dc45035afde3a9a800b]
# to [37777964e179c7f27e0ce9f2d58284dabe5cfadf]
#
# patch "Attic/misc/config/arch/ppc"
# from [6f25b71193852853d831ad6ac090c901ab49fc85]
# to [54a4538daebdb62bbf94ebc68739e2340053546a]
#
# patch "Attic/misc/config/arch/ppc64"
# from [010e54c3e6478fe6dc4b1d2962ebd41256ef260d]
# to [126d245d29863c6f1683232536070357b55a3261]
#
# patch "Attic/misc/config/cc/bcc"
# from [ee7774c89526db32c71edec4b46e39c618b9e636]
# to [561513b32f972726cc0e9a83213e33debef2f95f]
#
# patch "Attic/misc/config/cc/compaq"
# from [0d19d1445db032754b13b5a92aaf79f161168ed7]
# to [5b855b2566a3778a208de0f3950299bf71c60b08]
#
# patch "Attic/misc/config/cc/ekopath"
# from [54df4f6c355b56ff537db7e429024428da3a6300]
# to [5e065967f6749183e09a69826d804c12c67ce362]
#
# patch "Attic/misc/config/cc/gcc"
# from [8f5871a7933c06c3db66c6ae748acedc28de85a9]
# to [f57864620e4b61197536ad20ab5f07f44811245a]
#
# patch "Attic/misc/config/cc/hpcc"
# from [0f6eb059dec345100593082d9fb744ae42f0e9dd]
# to [fe395425b4097070162a67b827d43ecfb392287e]
#
# patch "Attic/misc/config/cc/icc"
# from [df7c425f180f6d8f159eccd5b5cda87ae79b20f4]
# to [7f8af2a729b9a249412a5f392b68708d760e15cf]
#
# patch "Attic/misc/config/cc/kai"
# from [9436c4c4dd6486c6982dd86e091830900ace9d56]
# to [61a0afad96346a53d75843a0e3c775e263365885]
#
# patch "Attic/misc/config/cc/mipspro"
# from [c568b9c5fa321db7de3045e21c86bdaaad913c8c]
# to [83a382a4c5c89c79124aaa5fea9543b9934a61e9]
#
# patch "Attic/misc/config/cc/msvc"
# from [a518e200b92423fc58f0c78eafea50e4395799e2]
# to [f0fcdde68fcd833622fcb77df697118fd84bf3ff]
#
# patch "Attic/misc/config/cc/pgi"
# from [55504c4febd8030685b52c149e4ca76cea0bb29d]
# to [35dc70b946b7aa83deb8bf26560fa8ca40680c6e]
#
# patch "Attic/misc/config/cc/sgipro64"
# from [66a21eb000bff03771e5e0b1bbf0fdc910e5b195]
# to [564ca86eb93141bee356b540e38aff20570ee977]
#
# patch "Attic/misc/config/cc/sunwspro"
# from [9720af2d645f294070c78d697d6d872135ebc71c]
# to [bdb44bb25abc0086d1c78c0b2efed958e614f8b6]
#
# patch "Attic/misc/config/os/aix"
# from [564e370d3fca850949786c8b3cd8a359c3db54cc]
# to [1ae489a4423d56d58cdfa6a2c3ec5c52a8e044f4]
#
# patch "Attic/misc/config/os/beos"
# from [a0090a5297ed96bdd71318721022e3dc9f454c6e]
# to [1bb820a522401f7aaa56bead761b6e6c29fa9626]
#
# patch "Attic/misc/config/os/cygwin"
# from [b98e7c0405f1497345e71ba2fe37dc1c596dcda6]
# to [da74ebac5f9ddd009c73255200998cb25295e830]
#
# patch "Attic/misc/config/os/freebsd"
# from [006ab197d32eea63361257fe1d9dcc639fd44313]
# to [d7d4d7710c19332222b65f041853c5fb10617259]
#
# patch "Attic/misc/config/os/hpux"
# from [49b209ede76c5c055c200c68b27ac3facd3eff31]
# to [3259c76e44c088eb2c46c104e4628fde63841e8f]
#
# patch "Attic/misc/config/os/irix"
# from [a62b658f50c62adf9830785f5443137430a4b66c]
# to [cc8d00e11363d56828dd5b1084ff3af9e9bb76fd]
#
# patch "Attic/misc/config/os/linux"
# from [ac26a526ad7af05b54d08a5383b3219e4e7d8629]
# to [566c9d6827c1ea19baabb82d547a6231d18fca45]
#
# patch "Attic/misc/config/os/netbsd"
# from [ac1a9307aec68c1ac997893105649bd7fc687eb1]
# to [c09645e6aab081667e61307d0536b0adc15186b9]
#
# patch "Attic/misc/config/os/openbsd"
# from [0d2465d745a65c18bc10321b0d74d3f3c19f2411]
# to [d1cf34508f82296b77ac1c05a2b8e4ec0e9ef8f7]
#
# patch "Attic/misc/config/os/qnx"
# from [e3aacf5eb51a9636a43d5da7e430ae88ae736fba]
# to [7a8fa58bccdf45e7aacadf9c48ba2c21c75af46e]
#
# patch "Attic/misc/config/os/solaris"
# from [25977d770ed58bd5d262aae613cca6f0aadeb419]
# to [42ccff72aea7d428a33b639eda96e613cc4c33ea]
#
# patch "Attic/misc/config/os/tru64"
# from [614b02f2934db3f90258879dcc57514f151a0e7b]
# to [c9f88ca6171640c19f649b8ce5f0b5a44c6f2a02]
#
# patch "Attic/misc/config/os/windows"
# from [de615c9122334f20e2671a5994988e33a3391d1f]
# to [e36531bad64840b7551ca36b03f8063fa24155ff]
#
# patch "Attic/modules/alg_amd64/modinfo.txt"
# from [0a765bd257f37a2959ec10d20a9299beffb737ae]
# to [52b990d379b77248d5ea65ed9b09df88ead61c54]
#
# patch "Attic/modules/alg_amd64/sha160.cpp"
# from [929af7129275293ff09089a5c13ecfa8927eec0e]
# to [7790c310c1e94695697b419c01ca377d28e349ce]
#
# patch "Attic/modules/alg_ia32/md4.cpp"
# from [a3200965bd266d764dbb756f3b04d6ab0f7eaa26]
# to [95cdb5536b45f2095b354eaadcc271d82516e593]
#
# patch "Attic/modules/alg_ia32/md5.cpp"
# from [4bc9628347a05ba9c49bf4551f808c898708490a]
# to [cfbeef8d027c44e1e760cb13df19da659557b28f]
#
# patch "Attic/modules/alg_ia32/modinfo.txt"
# from [99d0df3d5eb6c0b2cfbc26f79da54a6c6f0ca9ab]
# to [a30d4e1a048c23d047d2d3ef64f5943d44e98c36]
#
# patch "Attic/modules/alg_ia32/serpent.cpp"
# from [ec9b23077080da7c8d62a6cf3271cb9df18e5dc4]
# to [688eb00d15b7833f8972653d056be1e235496189]
#
# patch "Attic/modules/alg_ia32/sha160.cpp"
# from [9b4ec6eca3c9909f97700f85d9d66b39d66d3373]
# to [239c517b749e4a5c7b8694214c187a9730e85e6a]
#
# patch "Attic/modules/alloc_mmap/mmap_mem.cpp"
# from [19ff049ea80042cf62e1f02ede47004f3acf048a]
# to [90dffa50c3f59b20772e0379feb38610a4bd0441]
#
# patch "Attic/modules/alloc_mmap/modinfo.txt"
# from [d36d112666314144a5aa817fc24738e9aea91a8a]
# to [13c7ed238e98cfb2cee3234a0ccb669b882f998f]
#
# patch "Attic/modules/comp_bzip2/modinfo.txt"
# from [85bf9ca722bf07022effa03bfb357136e4c56cfa]
# to [2b56ddd0377539a229214eafdc69ae60b5dd6b0b]
#
# patch "Attic/modules/comp_zlib/modinfo.txt"
# from [5f5620f37503b158951092000b1b72dc1b3b7d82]
# to [104016f30a3f87aac823196c70ba7ef61b2739ca]
#
# patch "Attic/modules/comp_zlib/zlib.cpp"
# from [9d1bffb2c1a97d0a748728fc71149915b800626d]
# to [97d5fe2639e150906b8ed7beedf13174ea1be78c]
#
# patch "Attic/modules/eng_aep/modinfo.txt"
# from [c6c85c43e35cb4f019eeeeb055ddb5eb9dc83748]
# to [5c9e56bd0a4331c14d9f960fe16c33c6c4f5a141]
#
# patch "Attic/modules/eng_gmp/modinfo.txt"
# from [11311582ba7dfe4746dff64496b75b369eec97bf]
# to [fad564f7f180df6bb1f62e58a6d7d1468e27c7b0]
#
# patch "Attic/modules/eng_ossl/modinfo.txt"
# from [8f79388a72fdf29e9395edcc8e997efda201d79d]
# to [2b5cf08954ca898aab69f10d95b5ec908d3d97e8]
#
# patch "Attic/modules/es_beos/modinfo.txt"
# from [d0a5ef440b6013c1f82e6a39031c78f30e3fadd6]
# to [139290a57dfa41e67206141d01fcc3ddda29b852]
#
# patch "Attic/modules/es_capi/modinfo.txt"
# from [a467873f02e52e8e4ba8a88e67fb2c388fc4bfad]
# to [30e09336bd70f66edfc3953f72f0cae2e2d50991]
#
# patch "Attic/modules/es_egd/modinfo.txt"
# from [849799afc6c979db47632b1e12674feea8433633]
# to [11617d320ffae85830cfc628f3cd34be3a4d7b0a]
#
# patch "Attic/modules/es_ftw/es_ftw.cpp"
# from [6b9dc7cec896eed27ff456d7a2e4df9947eae598]
# to [459d8f0d2ed22f05bf43a2fc5071457e7621448c]
#
# patch "Attic/modules/es_ftw/modinfo.txt"
# from [e768aa15a419357a4b137e2ef3ee65b4b376efdc]
# to [6027bf33c4f6c5bcf85d3e18bb38cd00b70c4a29]
#
# patch "Attic/modules/es_unix/es_unix.cpp"
# from [ad762ad2d503283d87ccf89b8c6d3aebb1885c7d]
# to [c38a7e079734811eb5804cae88ce3551a60f0067]
#
# patch "Attic/modules/es_unix/es_unix.h"
# from [0900062e6f972b8f330586f55368935d2b8ca8cb]
# to [c6f4f65433c9dda0d02f50297bd664ffcf79b907]
#
# patch "Attic/modules/es_unix/modinfo.txt"
# from [fa9c67a4f4768aa0c066a9cab02c01ef02695b66]
# to [699f5e83d950612894d82a31d9440fcfd05ea41d]
#
# patch "Attic/modules/es_unix/unix_cmd.cpp"
# from [e749e0619b750a2faf429dcd44fc030f344fd280]
# to [dfc8ffbdea62adae0385bc25265132e96e865c34]
#
# patch "Attic/modules/es_win32/modinfo.txt"
# from [ab32f74ac8c68e0eba7b05565cf76ccfae391301]
# to [e04adc51c45928e40c22e2a9f696386a22aa0f17]
#
# patch "Attic/modules/fd_unix/modinfo.txt"
# from [cbc5342abbb086f96ee060c793b2aa2c26c8db88]
# to [139ba101ce429c741662e9c43545ee12cde1ec1b]
#
# patch "Attic/modules/ml_unix/modinfo.txt"
# from [bf6269c374008bd70e0e70b38e141d608a7348b1]
# to [97b3645bcf1f98fe2122cfb91357872b14890064]
#
# patch "Attic/modules/ml_win32/modinfo.txt"
# from [a587dfdb9f3e79f0a74b69278520b7c680bacf16]
# to [51cbfd07cbf5885d98ebb7a94e7d8f9f6b59b216]
#
# patch "Attic/modules/mp_amd64/modinfo.txt"
# from [707b42d89ee327711973f147e8583142ff52e873]
# to [87de4b21f1135e6abd902535db56d18747715701]
#
# patch "Attic/modules/mp_asm64/modinfo.txt"
# from [b986042b6363c26bff5f6deafdb72136771c2ad5]
# to [1388f106d1f50c1cffa8696dd0f6a70df1c10a26]
#
# patch "Attic/modules/mp_asm64/mp_asm.h"
# from [4a273756476f9e614222f5dc4c1861945fa93901]
# to [07cf111ba199cc23b30c65dd3501a7057bb74656]
#
# patch "Attic/modules/mp_ia32/modinfo.txt"
# from [d40d210e8f58f97f7f5ededc3ec2d2087d2a326a]
# to [c32d998bb81224cc6f23fbd747abc427b6f67116]
#
# patch "Attic/modules/mux_pthr/modinfo.txt"
# from [0306778b14500cd26b308c4ece786d4c090046f1]
# to [fc682dca25479dbea473bfe1c767bbd962711f68]
#
# patch "Attic/modules/mux_qt/modinfo.txt"
# from [7a2d33867e046517ab5abbac000f20112a8b9079]
# to [1ce02e3c791aac207a7c9d85c518608141e6ea04]
#
# patch "Attic/modules/mux_win32/modinfo.txt"
# from [0f8259741903003ddee76b57fa3eb910ad7cd337]
# to [02e107ddb2b2200962178661759102e32ced9e69]
#
# patch "Attic/modules/tm_hard/modinfo.txt"
# from [34ed0938a058deec122cda1dcb6011362b896f89]
# to [6fb2b3c80e52cbd5158ad153a8ba1d41137ed936]
#
# patch "Attic/modules/tm_hard/tm_hard.cpp"
# from [bbb7579021cb5bbe97a07b837a60d2a389c7c00c]
# to [da68b23d5de67a487cda44e90b03edf34297730c]
#
# patch "Attic/modules/tm_posix/modinfo.txt"
# from [31f8fdc8ad4d300118857e941ba9e10a54847456]
# to [ed4eddd6b042f1d473fe5896e36ca6619ca46334]
#
# patch "Attic/modules/tm_posix/tm_posix.cpp"
# from [18d0dc1baba7dc1fbbbf5686a651aa123d1c8c14]
# to [c42545cf0bf6ff897e22295ea485c33e8634d075]
#
# patch "Attic/modules/tm_unix/modinfo.txt"
# from [b5b5e69895fd4a5f9f7a7ccdc1b8dc12e93c2e49]
# to [1a4d1b4ea18d427b03ea220b333aa4af33a656c1]
#
# patch "Attic/modules/tm_unix/tm_unix.cpp"
# from [005a4faecc3b417e3b79afe00b62256bc9492cf0]
# to [1d0040253a1a3ce883428ae5b7c7f474704f6e8a]
#
# patch "Attic/modules/tm_win32/modinfo.txt"
# from [1767c2035911b3d660e62b9d5d46f6a6021f7582]
# to [39ec6dc93fc111aa33b9005f3f4bd770f5811887]
#
# patch "Attic/readme.txt"
# from [3e7dc82c42649ddd1304614574f8db74df4993b4]
# to [d315e32e48cd2751ef8429a40f9bc7f779557892]
#
# patch "Attic/src/adler32.cpp"
# from [a24f1326ce7dfeebea829176108aef995a2e1785]
# to [5232276ee81a2ecc6630dce8c1dbdc87bc887679]
#
# patch "Attic/src/blowfish.cpp"
# from [451bc573de7db1dcff7df2fbebf0cc170f1cb110]
# to [3506a0d5752f4f5ca8feca853b652dae0416d3a7]
#
# patch "Attic/src/cast128.cpp"
# from [ec5552b43a28c952f1510c5f6f8995363f2ef6a6]
# to [8767f6c1133f75e9ed9eed7703a0e3339095e664]
#
# patch "Attic/src/cast256.cpp"
# from [44670c98f46420089cd454433c31274d8d818892]
# to [7543bed89da662a90249546c77198dcb1d71d4d7]
#
# patch "Attic/src/crc24.cpp"
# from [b94b5e2c89406837ffb48346b668de4af103d97b]
# to [c3f2e8094b2f77cad379608f63d460e4549995d1]
#
# patch "Attic/src/fork256.cpp"
# from [6b80eec590efad26406f56f0e9703c366421267b]
# to [b729af81104d3170f803e95305663fdf27901a96]
#
# patch "Attic/src/gost.cpp"
# from [7cd0acc2a75a0560db41548a38e76f85a717d303]
# to [de7d8b6a6bf29127d30c20e1002db15da400b6a0]
#
# patch "Attic/src/has160.cpp"
# from [22a7db6fbe9e90cdc5168213cdbce43fd197d90f]
# to [6f710fd174404b59efbbbc00052cf04e347f6a8f]
#
# patch "Attic/src/idea.cpp"
# from [346e484e6e8392302c0716733aa996cc7cacf82c]
# to [fc756e94b7f74c3f6acf7f776a8d3e6a0ca60637]
#
# patch "Attic/src/kasumi.cpp"
# from [02b279e61df9ed1cee1e7140c553cd9ae469de5a]
# to [ddbc2e6804a7ab5b036f114066666b352a11225d]
#
# patch "Attic/src/mars.cpp"
# from [ccb449c10b25ccb13af2f6cb201eee5aac9962d2]
# to [def6233f6fedad32d9a88607bf26f0ae7f1756f4]
#
# patch "Attic/src/md4.cpp"
# from [928d5cd4717715737895ea724ede8f01759697e7]
# to [7bb97a4934e5c3ceef70a37f610d6195503b67b4]
#
# patch "Attic/src/md5.cpp"
# from [21df0d9074f3b8bf66ef93ff3e71e109f6c2cf85]
# to [019efeb7b2df189c4d01a61beb726e1efffe6af7]
#
# patch "Attic/src/misty1.cpp"
# from [59293b7ced418007b34a462e5d8039c3474783a4]
# to [eade3b780e845e2c970e90d0b84da27f685aefa5]
#
# patch "Attic/src/rc2.cpp"
# from [b2326b147df254172b49f28770a7a7a35734ea95]
# to [419a109293de2371f7416c99e70ed4994b32bfc0]
#
# patch "Attic/src/rc5.cpp"
# from [b7d287e1b7c378b4d810cb22c7186228d01a3626]
# to [e5bff46540752b708f2567fc033831635095445d]
#
# patch "Attic/src/rc6.cpp"
# from [d84c45da325ae1dc098699d57d92794b6c7c90f8]
# to [7bf767a87ac39abf99faf2573968e6c668c42914]
#
# patch "Attic/src/rmd128.cpp"
# from [255d14e11a595f2d7d3139512965f05016e05e7e]
# to [c46423e484d9945d4bbb16ddb3795397a72709e8]
#
# patch "Attic/src/rmd160.cpp"
# from [0cb48c93b63cf3ed0d359101f457b8a07b8726be]
# to [b9cd593d5143b9fee3cfecdb94798dcdf40c7ab4]
#
# patch "Attic/src/seed.cpp"
# from [0fdf26c65e798b580a739d0e862b6e0cfc1abbd4]
# to [26e36402ace4f951aed8b27812363a4c8222366a]
#
# patch "Attic/src/serpent.cpp"
# from [89d2e55113edf36724de212fc1d76f4629f0a650]
# to [4e1e68d17eae627328b0a63f6978444b7ea32fbe]
#
# patch "Attic/src/sha_64.cpp"
# from [d8bcc62e9199aa8ff55f012ed4106a40b1fd2724]
# to [96193171f599b8fa25e8ef94a951ef9768f3f688]
#
# patch "Attic/src/skipjack.cpp"
# from [6ebdb7aa8aeed9f7fdd81bee53a96fec1f3f5350]
# to [1e5c6968deca4a0a187ee8b974b29e3eb1602614]
#
# patch "Attic/src/square.cpp"
# from [2dee9943162dc91da9e5d3d25154f663fd32cbf7]
# to [9071c1e3a16ecca3b91f6fa2364b0a6a54115f26]
#
# patch "Attic/src/tea.cpp"
# from [c7b587aeee5991921574d81a02b319958a2e3f4f]
# to [a1c6909be1811d3e912aa8a1199c8ff6a5fd00e0]
#
# patch "Attic/src/tiger.cpp"
# from [13a022c8b1ae57eff82f8e1f13d684d17d334e31]
# to [2a79e7fe701b33a9a3d8abb8b7bb028b6618155b]
#
# patch "Attic/src/turing.cpp"
# from [2384c861feb6423bed7696729418c856ee8bd99d]
# to [5155dad33304df10b9b61e7103c611eba62a4c0d]
#
# patch "Attic/src/twofish.cpp"
# from [4a94dcb5fcf19416e3f9cab663dd4604d8fbbb5e]
# to [4822f8b8e445a87131d78834f7e5e5594d471905]
#
# patch "Attic/src/whrlpool.cpp"
# from [a16be06301dd1c792913e0303ac5604d67424060]
# to [9eb6bc50720405688ce451148d0fad95d3ca3c97]
#
# patch "Attic/src/wid_wake.cpp"
# from [89be242c851e4f408f0ccdc8da4e2d5265ea967a]
# to [3cef73b3fd87e23405908a21cc66180d7cdf5f53]
#
# patch "Attic/src/xtea.cpp"
# from [f1b3a3d556acd9faeaa80c4ca80f95a5cfa27d27]
# to [e9da58a23d7c7bd6b55975d3395d777a07f3c29c]
#
# patch "aes.cpp"
# from [90c19327b41ac342532515f8949205302ad89114]
# to [64cbb7d0ea9ab07ed15096a583ad4338617dbd59]
#
# patch "allocate.h"
# from [532035d3cdec5a2c8fd3250f87a78fa7f3d77eb4]
# to [acaf4aa6a1213de0c71b128d79d4760cdb3159b3]
#
# patch "asn1_alt.cpp"
# from [ac84eab7afc78b1de20140301ee3ba62b976acca]
# to [7e8452edabab705665021ecd21f3356fa07d4e3e]
#
# patch "asn1_ku.cpp"
# from [7d55d34b2291f34d75c1f14bbbfecae262e30a65]
# to [442eee1c50bbbd7afb22bf2b2e23dd2db39ca218]
#
# patch "asn1_obj.h"
# from [dfbdbae68301d279de67562d713133df1258084c]
# to [da21ba3ef127a710bbcf34fe370d4943a49f19cb]
#
# patch "ber_dec.cpp"
# from [d22b06ac717befb508e9dbe7d34bcf5681280287]
# to [a7851af3cb4bf32890ffe35296b86c6918864cd8]
#
# patch "big_base.cpp"
# from [e0ee9ef996a0754bd45af121f5199bffff45aed4]
# to [dd3002c65862ad61fac7ebd55f5f4835443b2622]
#
# patch "big_ops2.cpp"
# from [48afc3ad1501db0257ff9f9b24ab0ef1cb986165]
# to [78437d7c067268e4505881c5ba72b3120de6ebe6]
#
# patch "bit_ops.cpp"
# from [d42b4bc18f574f8b848335613aa7b102868dcc59]
# to [ebab53284a6ab9a749188fcbe417c8dcc73ac052]
#
# patch "bit_ops.h"
# from [77538dc92d95bf5bdca68230ea5626bf117c7994]
# to [ace888ad7c2755ca077461722e24cb1a422a2ed5]
#
# patch "buf_es.cpp"
# from [0662ad86a41b68df7d8ca64b4f8fd944c558fa8f]
# to [cd4e86efa29384aae6f685444297076319ba3490]
#
# patch "crc32.cpp"
# from [2ee196e8c63de2044782412cb88b5961603a4eea]
# to [31b788eb10e2fcd3ac69880f24f9c02a72a85fa5]
#
# patch "credits.txt"
# from [9d06d23a922b731a18611d1935f3d5379d267346]
# to [562b9695183b67e72232e6068b66c2d5a14c12bb]
#
# patch "defalloc.cpp"
# from [940db8ef03ae170341d257f9f7e4320ee3938935]
# to [e51a9fe4f6a6e191818c3e968213cc58e98cc6c2]
#
# patch "defalloc.h"
# from [ef3958943a473c5a5068dbf77eae02e7cafa55fa]
# to [e7507091a397628e401de0bd41be48bbbf929ff9]
#
# patch "der_enc.cpp"
# from [431f71f58e378c7de52d0f540e5271fe705f5e65]
# to [44385fc6ff987d9e3025d291cff3fa18faf7de2d]
#
# patch "des.cpp"
# from [b4b952183124098874fc21851366dfec58fdd8de]
# to [5f7b629ff5ba2cf0374defe0ec88e7ef16761422]
#
# patch "dsa_gen.cpp"
# from [71213b478a52c337f6aad69d3942bdcb51193e3e]
# to [c1a6e61bf86dc05674879f70d6b34f55338ba2b4]
#
# patch "es_egd.cpp"
# from [39d2684aac4c7a382253daf8e50b1c00d797d437]
# to [e68c9f084c8c7b175f347363a848824f718fd19e]
#
# patch "hex.cpp"
# from [e49d63031296f49e80205e2e18bf56cc9097ac41]
# to [82a0b2616131326ade86372d7a688fc5089e8466]
#
# patch "init.h"
# from [4e6621c7bdf9dd3e309d28456d06cafaebf16029]
# to [1844022acd8847f03728c907a4d390b7114af216]
#
# patch "init_def.cpp"
# from [032c0a1f7bd132c86506da3f4756a1f39a49e6aa]
# to [4bd85664ecd76d33293aed8ba67da930cc08121a]
#
# patch "init_opt.cpp"
# from [b66c0ecf18aa8f66a11ffbef319395e5323c69ea]
# to [9a0e31808f088cb63f2ec8563d937a69421f795f]
#
# patch "kdf.cpp"
# from [5a8a42038d9d402727e6ca1b11d0244954137a32]
# to [51328f78da34fe2b8884e085cca87e3c1c4e7a5b]
#
# patch "libstate.cpp"
# from [233c9231a05eae79ae231f8136850b43c34914d3]
# to [4cc7325e854efc2351e4f1e0726092e5d8fb760f]
#
# patch "mdx_hash.cpp"
# from [7e90baec5a8465c7405841bc2d1075fde1165797]
# to [dfd1108e0b1c47cfea3d7c455483039fee5423b8]
#
# patch "mem_pool.cpp"
# from [399aa8cd9dac6bce28a803b11a262d5e6d1b3fcb]
# to [6d123c425e59539c197b86596c4a2c01c1ba6757]
#
# patch "mgf1.cpp"
# from [833bdd2150cc0db702b39bc4d799426504dda7d5]
# to [9a3f3843edef84efab329e1ab7b52a244ee4feca]
#
# patch "modules.cpp"
# from [310f410a77f14f2b559a24a0a00821880205b6c8]
# to [d5fbabe263e5a39b8a85adf8a5084ec28405ee64]
#
# patch "mp_mul.cpp"
# from [dafb1262e69f06c17fe781aea9c7ed04ef789829]
# to [4801f41f564dbaf9a3a0bacb03ad795f94c4a27b]
#
# patch "parsing.cpp"
# from [4c423baf1e0e9ba8d65a5feda7eb79e6be6fe445]
# to [87ed49975088808462d85302cefc5b363fcc5754]
#
# patch "parsing.h"
# from [d706a1c3fe72a2466149994e8e3a256b243514f5]
# to [461ef25f0cb18bb10c980d97d9fb0351081b2310]
#
# patch "pkcs5.cpp"
# from [74572fee997b93c59ca6e747e0d7f14b1ca47a46]
# to [613526700b03c08fed46fbb63192a7cf213c2bb2]
#
# patch "policy.cpp"
# from [979a989d26dd9cbc7a01e489136831c7c8ea5bc2]
# to [1cbaa37581f2e3a3cc3388766eb0f57f92c16a92]
#
# patch "prf_x942.cpp"
# from [94d6c065c580325db247150d2bce204a1b3e51ee]
# to [e1877085d765ac659d96c0a7b20cca43de558022]
#
# patch "pubkey.cpp"
# from [413323d6652270bf268b614a10443c86987fddb9]
# to [01bb597aad00093d35f276672867b87cc30bb6b4]
#
# patch "randpool.cpp"
# from [dcfe978754894d39838888a39221519c5ca9b260]
# to [cf40501448e5f6f3bcaa3d00b43dd3cc33c39170]
#
# patch "reducer.cpp"
# from [cbb17f184cc998fba5ca47c08ae25423826c7bf3]
# to [74e281342c802809f6fd56caaa75a3be2b06b3e2]
#
# patch "sha160.cpp"
# from [7f151f0f0f0f3c5358f422625c85d9fbfbc2520f]
# to [1e4669389c7963842f6a1da3e247f9b4ff0924d8]
#
# patch "sha256.cpp"
# from [c301182d8aaf2804b5c52543987d0bd713acd7e2]
# to [dd26a6d28f8a614772afa56b98b9807e00f41df4]
#
# patch "x509cert.cpp"
# from [d5de5f096e8a47ab498b0b0d90042775c3a1c0fa]
# to [f0061d4c02f30534521000d90299395feff1172f]
#
# patch "x509self.cpp"
# from [5f92488b35e43625413b0215aac9d1f46a1d7a99]
# to [91acdb2db0e5bc5b678bf758ca05bfc385604b9a]
#
# patch "x509self.h"
# from [9aac88cb666ace50f762e4371408402e4618b33f]
# to [08a310e8d92f3897b2b1e62f4177b44cd615c195]
#
============================================================
--- Attic/modules/es_dev/es_dev.cpp 903d37082b372d65135f66cb43f5cfe84f5a930f
+++ Attic/modules/es_dev/es_dev.cpp 903d37082b372d65135f66cb43f5cfe84f5a930f
@@ -0,0 +1,118 @@
+/*************************************************
+* Device EntropySource Source File *
+* (C) 1999-2007 The Botan Project *
+*************************************************/
+
+#include <botan/es_dev.h>
+#include <botan/config.h>
+#include <sys/select.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <sys/fcntl.h>
+#include <unistd.h>
+
+namespace Botan {
+
+namespace {
+
+/*************************************************
+* A class handling reading from a device *
+*************************************************/
+class Device_Reader
+ {
+ public:
+ typedef int fd_type;
+
+ Device_Reader(fd_type device_fd) : fd(device_fd) {}
+ ~Device_Reader() { ::close(fd); }
+ u32bit get(byte out[], u32bit length);
+
+ static fd_type open(const std::string& pathname);
+ private:
+ fd_type fd;
+ };
+
+/*************************************************
+* Read from a device file *
+*************************************************/
+u32bit Device_Reader::get(byte out[], u32bit length)
+ {
+ if(fd < 0)
+ return 0;
+
+ if(fd >= FD_SETSIZE)
+ return 0;
+
+ const u32bit READ_WAIT_MS = 10;
+
+ fd_set read_set;
+ FD_ZERO(&read_set);
+ FD_SET(fd, &read_set);
+
+ struct ::timeval timeout;
+ timeout.tv_sec = 0;
+ timeout.tv_usec = READ_WAIT_MS * 1000;
+
+ if(::select(fd + 1, &read_set, 0, 0, &timeout) < 0)
+ return 0;
+
+ if(!(FD_ISSET(fd, &read_set)))
+ return 0;
+
+ const ssize_t got = ::read(fd, out, length);
+ if(got <= 0)
+ return 0;
+
+ const u32bit ret = static_cast<u32bit>(got);
+
+ if(ret > length)
+ return 0;
+
+ return ret;
+ }
+
+/*************************************************
+* Attempt to open a device *
+*************************************************/
+int Device_Reader::open(const std::string& pathname)
+ {
+#ifndef O_NONBLOCK
+ #define O_NONBLOCK 0
+#endif
+
+#ifndef O_NOCTTY
+ #define O_NOCTTY 0
+#endif
+
+ const int flags = O_RDONLY | O_NONBLOCK | O_NOCTTY;
+ return ::open(pathname.c_str(), flags);
+ }
+
+}
+
+/*************************************************
+* Gather entropy from a RNG device *
+*************************************************/
+u32bit Device_EntropySource::slow_poll(byte output[], u32bit length)
+ {
+ std::vector<std::string> sources =
+ global_config().option_as_list("rng/es_files");
+
+ u32bit read = 0;
+
+ for(size_t j = 0; j != sources.size(); ++j)
+ {
+ const std::string source = sources[j];
+
+ Device_Reader reader(Device_Reader::open(source));
+
+ read += reader.get(output + read, length - read);
+
+ if(read == length)
+ break;
+ }
+
+ return read;
+ }
+
+}
============================================================
--- Attic/modules/es_dev/es_dev.h a733463b4efc81e44fa058cc9f496ae6235e0ad2
+++ Attic/modules/es_dev/es_dev.h a733463b4efc81e44fa058cc9f496ae6235e0ad2
@@ -0,0 +1,24 @@
+/*************************************************
+* Device EntropySource Header File *
+* (C) 1999-2007 The Botan Project *
+*************************************************/
+
+#ifndef BOTAN_ENTROPY_SRC_DEVICE_H__
+#define BOTAN_ENTROPY_SRC_DEVICE_H__
+
+#include <botan/base.h>
+
+namespace Botan {
+
+/*************************************************
+* Device Based Entropy Source *
+*************************************************/
+class Device_EntropySource : public EntropySource
+ {
+ public:
+ u32bit slow_poll(byte[], u32bit);
+ };
+
+}
+
+#endif
============================================================
--- Attic/modules/es_dev/modinfo.txt b25166d29b5afeb56586f6ae759ed944f6874256
+++ Attic/modules/es_dev/modinfo.txt b25166d29b5afeb56586f6ae759ed944f6874256
@@ -0,0 +1,11 @@
+realname "RNG Device Reader"
+
+define ENTROPY_SRC_DEVICE
+
+load_on auto
+modset unix
+
+<add>
+es_dev.h
+es_dev.cpp
+</add>
============================================================
--- Attic/.mtn-ignore e7f8cbb7659be886a26ef6621a3605f815ce1606
+++ Attic/.mtn-ignore b2ab2a341f6e74b13af6591ca9c419592e3c1fe9
@@ -1,13 +1,14 @@
-^check$
^Makefile$
^botan-config$
^build$
+^build/build\.h$
^build/checks$
+^build/checks/.*\.o$
^build/include$
^build/include/botan$
+^build/include/botan/.*\.h$
^build/lib$
^build/lib/.*\.o$
-^build/checks/.*\.o$
-^build/include/botan/.*\.h$
-^build/build\.h$
+^check$
+^doc/examples/.*\.pem$
^misc/nist_tests/x509test$
============================================================
--- Attic/checks/algos.cpp 99cdd8b6e21dbd9160fe5235e95c5a65e2c69b6b
+++ Attic/checks/algos.cpp e7835fc1b1698ad0663717e6558acfc43e0619d2
@@ -84,5 +84,8 @@ std::vector<algorithm> get_algos()
algos.push_back(algorithm("RNG", "Randpool"));
algos.push_back(algorithm("RNG", "X9.31-RNG"));
+ algos.push_back(algorithm("Codec", "Base64_Encode"));
+ algos.push_back(algorithm("Codec", "Base64_Decode"));
+
return algos;
}
============================================================
--- Attic/checks/bench.cpp 380f38c3230ff1cc3599246b0c9152d77994f7a6
+++ Attic/checks/bench.cpp c6edf6ea5b86de31a9297b8c4a38e20b00b17569
@@ -35,7 +35,7 @@ double bench_filter(std::string name, Bo
u32bit iterations = 0;
u64bit start = get_clock(), clocks_used = 0;
- u64bit go_up_to = (u64bit)(seconds * get_ticks());
+ u64bit go_up_to = static_cast<u64bit>(seconds * get_ticks());
while(clocks_used < go_up_to)
{
@@ -44,8 +44,8 @@ double bench_filter(std::string name, Bo
clocks_used = get_clock() - start;
}
- double bytes_per_sec = ((double)iterations * BUFFERSIZE) /
- ((double)clocks_used / get_ticks());
+ double bytes_per_sec = (static_cast<double>(iterations) * BUFFERSIZE) /
+ (static_cast<double>(clocks_used) / get_ticks());
double mbytes_per_sec = bytes_per_sec / (1024.0 * 1024.0);
std::cout.setf(std::ios::fixed, std::ios::floatfield);
@@ -121,7 +121,7 @@ void benchmark(const std::string& what,
if(html)
std::cout << "</TABLE>\n\n";
- double average = std::exp(sum / (double)how_many);
+ double average = std::exp(sum / static_cast<double>(how_many));
if(what == "All" && html)
std::cout << "\n<P>Overall speed average: " << average
============================================================
--- Attic/checks/check.cpp 77665d2d9e2a8b662ea028908d8f1b9a577609ff
+++ Attic/checks/check.cpp 8bfeb47c287bea56e3b4543a034b486664a0d60d
@@ -47,7 +47,7 @@ int main(int argc, char* argv[])
<< " --validate: Check test vectors\n"
<< " --benchmark: Benchmark everything\n"
<< " --bench-type={block,mode,stream,hash,mac,rng,pk}:\n"
- << " Benchmark only algorithms of a particular type\n"
+ << " Benchmark only algorithms of a particular type\n"
<< " --html: Produce HTML output for benchmarks\n"
<< " --seconds=n: Benchmark for n seconds\n"
<< " --init=<str>: Pass <str> to the library\n"
============================================================
--- Attic/checks/dolook2.cpp 37bf56072f24c843ac66295bd79544e283de9737
+++ Attic/checks/dolook2.cpp 85311129695d27a3c04ac8d6c56ac0ed7a640d61
@@ -19,7 +19,7 @@ class S2K_Filter : public Filter
{
public:
void write(const byte in[], u32bit len)
- { passphrase += std::string((const char*)in, len); }
+ { passphrase += std::string(reinterpret_cast<const char*>(in), len); }
void end_msg()
{
s2k->change_salt(salt, salt.size());
============================================================
--- Attic/checks/pk.cpp c541d866ce78834d3ac98bc6993dd79622288efe
+++ Attic/checks/pk.cpp 40b95d943dfcfd43d2cc5e0f7fce617f35316c4d
@@ -28,7 +28,7 @@ static BigInt to_bigint(const std::strin
static BigInt to_bigint(const std::string& h)
{
- return BigInt::decode((const byte*)h.data(),
+ return BigInt::decode(reinterpret_cast<const byte*>(h.data()),
h.length(), BigInt::Hexadecimal);
}
@@ -326,7 +326,9 @@ u32bit validate_rsa_enc_pkcs8(const std:
strip_newlines(pass); /* it will have a newline thanks to the messy
decoding method we use */
- DataSource_Memory keysource((const byte*)str[0].c_str(), str[0].length());
+ DataSource_Memory keysource(reinterpret_cast<const byte*>(str[0].c_str()),
+ str[0].length());
+
Private_Key* privkey = PKCS8::load_key(keysource, pass);
RSA_PrivateKey* rsapriv = dynamic_cast<RSA_PrivateKey*>(privkey);
@@ -441,7 +443,8 @@ u32bit validate_rsa_ver_x509(const std::
if(str.size() != 5) /* is actually 3, parse() adds extra empty ones */
throw Exception("Invalid input from pk_valid.dat");
- DataSource_Memory keysource((const byte*)str[0].c_str(), str[0].length());
+ DataSource_Memory keysource(reinterpret_cast<const byte*>(str[0].c_str()),
+ str[0].length());
Public_Key* key = X509::load_key(keysource);
@@ -518,7 +521,9 @@ u32bit validate_dsa_sig(const std::strin
strip_newlines(pass); /* it will have a newline thanks to the messy
decoding method we use */
- DataSource_Memory keysource((const byte*)str[0].c_str(), str[0].length());
+ DataSource_Memory keysource(reinterpret_cast<const byte*>(str[0].c_str()),
+ str[0].length());
+
Private_Key* privkey = PKCS8::load_key(keysource, pass);
DSA_PrivateKey* dsapriv = dynamic_cast<DSA_PrivateKey*>(privkey);
@@ -545,7 +550,9 @@ u32bit validate_dsa_ver(const std::strin
if(str.size() != 5) /* is actually 3, parse() adds extra empty ones */
throw Exception("Invalid input from pk_valid.dat");
- DataSource_Memory keysource((const byte*)str[0].c_str(), str[0].length());
+ DataSource_Memory keysource(reinterpret_cast<const byte*>(str[0].c_str()),
+ str[0].length());
+
Public_Key* key = X509::load_key(keysource);
DSA_PublicKey* dsakey = dynamic_cast<DSA_PublicKey*>(key);
============================================================
--- Attic/checks/pk_bench.cpp ef6c4d7fb50c3e1f9e48fde2d793b0aff37eb76e
+++ Attic/checks/pk_bench.cpp 7397a3fd478a3c1d33965d946c497172b4eb1940
@@ -4,13 +4,12 @@
#include <botan/nr.h>
#include <botan/rw.h>
#include <botan/elgamal.h>
+#include <botan/parsing.h>
#include <botan/pkcs8.h>
#include <botan/look_pk.h>
#include <botan/rng.h>
-#include <botan/parsing.h>
-
using namespace Botan;
#include "common.h"
@@ -55,7 +54,6 @@ void bench_pk(const std::string& algo, b
ad-hoc format (the RW algorithm has no assigned OID that I know of, so
there is no way to encode a RW key into a PKCS #8 structure).
*/
-
if(algo == "All" || algo == "RSA")
{
const u32bit keylen[] = { 512, 1024, 1536, 2048, 3072, 4096, 0 };
@@ -70,7 +68,7 @@ void bench_pk(const std::string& algo, b
);
if(key.get() == 0)
- throw Invalid_Argument(file + " doesn't have an RSA key in it!");
+ throw Invalid_Argument("Failure reading RSA key from " + file);
bench_enc(get_pk_encryptor(*key, "Raw"),
"RSA-" + len_str, seconds, html);
@@ -161,7 +159,8 @@ void bench_pk(const std::string& algo, b
const std::string len_str = to_string(keylen[j]);
const std::string file = "checks/keys/rw" + len_str + ".pem";
- RW_PrivateKey* key = dynamic_cast<RW_PrivateKey*>(PKCS8::load_key(file));
+ RW_PrivateKey* key =
+ dynamic_cast<RW_PrivateKey*>(PKCS8::load_key(file));
bench_ver(get_pk_signer(*key, "EMSA2(SHA-1)"),
get_pk_verifier(*key, "EMSA2(SHA-1)"),
@@ -177,11 +176,10 @@ void print_result(bool html, u32bit runs
void print_result(bool html, u32bit runs, u64bit clocks_used,
const std::string& algo_name, const std::string& op)
{
- double seconds = (double)clocks_used / get_ticks();
+ double seconds = static_cast<double>(clocks_used) / get_ticks();
double mseconds_per_run = 1000 * (seconds / runs);
double runs_per_sec = runs / seconds;
-
if(html)
{
std::cout << " <TR><TH>" << algo_name << " (" << op << ") <TH>";
@@ -201,9 +199,9 @@ void print_result(bool html, u32bit runs
std::cout.precision(2);
if(PRINT_MS_PER_OP)
- std::cout << mseconds_per_run << " ms / " << op << std::endl;
+ std::cout << mseconds_per_run << " ms / " << op << "\n";
else
- std::cout << runs_per_sec << " ops / second (" << op << ")" << std::endl;
+ std::cout << runs_per_sec << " ops / second (" << op << ")\n";
}
}
============================================================
--- Attic/checks/validate.cpp c8f8cd4ed6867ae6fd8bbe7c8af0f5c04f847664
+++ Attic/checks/validate.cpp f82aaa5253a65fe9f48a69617bdcc9f92587a22f
@@ -263,7 +263,7 @@ bool failed_test(const std::string& algo
bool OK = true;
for(u32bit j = offset; j != offset+length; j++)
- if((byte)output[j] != peekbuf[j-offset])
+ if(static_cast<byte>(output[j]) != peekbuf[j-offset])
OK = false;
if(!OK)
============================================================
--- Attic/configure.pl d8e1ab45a849855ad6dff87d8919c3b8a8b08eaf
+++ Attic/configure.pl 20f79155abfd210ff10126b977ff2652a412ae77
@@ -9,7 +9,7 @@ my $MINOR_VERSION = 7;
my $MAJOR_VERSION = 1;
my $MINOR_VERSION = 7;
-my $PATCH_VERSION = 2;
+my $PATCH_VERSION = 3;
my $VERSION_STRING = "$MAJOR_VERSION.$MINOR_VERSION.$PATCH_VERSION";
@@ -24,19 +24,13 @@ my @DOCS = (
'credits.txt', 'info.txt', 'license.txt', 'log.txt',
'thanks.txt', 'todo.txt', 'pgpkeys.asc');
-my %MODULE_SETS =
- (
- 'unix' => [ 'alloc_mmap', 'es_egd', 'es_ftw', 'es_unix', 'fd_unix',
- 'tm_unix' ],
- 'beos' => [ 'es_beos', 'es_unix', 'fd_unix', 'tm_unix' ],
- 'win32' => ['es_capi', 'es_win32', 'mux_win32', 'tm_win32' ],
- );
-
my $TRACING = 0;
##################################################
# Run main() and Quit #
##################################################
+my $config = {};
+
main();
exit;
@@ -44,8 +38,6 @@ sub main {
# Main Driver #
##################################################
sub main {
- my $config = {};
-
my $base_dir = where_am_i();
$$config{'base-dir'} = $base_dir;
@@ -68,7 +60,7 @@ sub main {
'version' => $VERSION_STRING,
});
- my ($target, $module_list) = get_options($config);
+ get_options($config);
my $default_value_is = sub {
my ($var, $val) = @_;
@@ -82,8 +74,10 @@ sub main {
&$default_value_is('local_config', '');
if(defined($$config{'build-dir'})) {
- $$config{'botan-config'} = File::Spec->catfile($$config{'build-dir'}, 'botan-config');
- $$config{'makefile'} = File::Spec->catfile($$config{'build-dir'}, 'Makefile');
+ $$config{'botan-config'} =
+ File::Spec->catfile($$config{'build-dir'}, 'botan-config');
+ $$config{'makefile'} =
+ File::Spec->catfile($$config{'build-dir'}, 'Makefile');
$$config{'check_prefix'} = $$config{'build-dir'};
$$config{'lib_prefix'} = $$config{'build-dir'};
}
@@ -95,7 +89,7 @@ sub main {
$$config{'lib_prefix'} = '';
}
- choose_target($config, $target);
+ choose_target($config);
my $os = $$config{'os'};
my $cc = $$config{'compiler'};
@@ -105,7 +99,7 @@ sub main {
&$default_value_is('docdir', os_info_for($os, 'doc_dir'));
&$default_value_is('make_style', $COMPILER{$cc}{'makefile_style'});
- my @modules = choose_modules($config, $module_list);
+ autoload_modules($config) if($$config{'autoconfig'});
add_to($config, {
'includedir' => os_info_for($os, 'header_dir'),
@@ -117,9 +111,8 @@ sub main {
'build_include_botan' =>
File::Spec->catdir($$config{'build-dir'}, 'include', 'botan'),
- 'modules' => [ @modules ],
- 'mp_bits' => find_mp_bits(@modules),
- 'mod_libs' => [ using_libs($os, @modules) ],
+ 'mp_bits' => find_mp_bits(sort keys %{$$config{'modules'}}),
+ 'mod_libs' => [ using_libs($os, sort keys %{$$config{'modules'}}) ],
'sources' => {
map_to($$config{'src-dir'}, dir_list($$config{'src-dir'}))
@@ -138,10 +131,12 @@ sub main {
load_modules($config);
- mkdirs($$config{'build-dir'},
- $$config{'build_include'}, $$config{'build_include_botan'},
- $$config{'build_lib'}, $$config{'build_check'});
+ my @dirs = mkdirs($$config{'build-dir'},
+ $$config{'build_include'}, $$config{'build_include_botan'},
+ $$config{'build_lib'}, $$config{'build_check'});
+ #autoconfig('Created ' . join(' ', @dirs)) if @dirs;
+
write_pkg_config($config);
process_template(File::Spec->catfile($$config{'config-dir'}, 'buildh.in'),
@@ -180,11 +175,12 @@ sub warning {
}
sub warning {
- warn with_diagnostic('note', @_);
+ warn with_diagnostic('warning', @_);
}
sub autoconfig {
- print with_diagnostic('autoconfig', @_);
+ print with_diagnostic('autoconfig', @_)
+ if($$config{'verbose'});
}
sub emit_help {
@@ -207,74 +203,114 @@ sub display_help {
# Display Help and Quit #
##################################################
sub display_help {
- my $sets = join('|', sort keys %MODULE_SETS);
+ sub module_sets {
+ my %modsets;
+ for my $name (sort keys %MODULES) {
+ my %info = %{$MODULES{$name}};
+ next unless (defined($info{'modset'}));
- my $helptxt = <<ENDOFHELP;
-Usage: $0 [options] CC-OS-CPU
+ for my $s (split(/,/, $info{'modset'})) {
+ $modsets{$s} = undef;
+ }
+ }
-See doc/building.pdf for more information about this program.
+ return sort keys %modsets;
+ }
-Options:
+ my $sets = join(' ', module_sets());
+
+ my $listing = sub {
+ my (@list) = @_;
+
+ return '' if (@list == 0);
+
+ my ($output, $len) = ('', 0);
+
+ my $append = sub {
+ my ($to_append) = @_;
+ $output .= $to_append;
+ $len += length $to_append;
+ };
+
+ foreach my $name (sort @list) {
+ next if $name eq 'defaults';
+ if($len > 65) {
+ $output .= "\n ";
+ $len = 8;
+ }
+ &$append($name . ' ');
+ }
+ chop $output;
+ return $output;
+ };
+
+ my $modules = &$listing(keys %MODULES);
+ my $compilers = &$listing(keys %COMPILER);
+ my $oses = &$listing(keys %OPERATING_SYSTEM);
+ my $cpus = &$listing(keys %CPU);
+
+ my $helptxt = <<ENDOFHELP;
+
+Usage for $0 (Botan $VERSION_STRING):
+
+To set the compiler to use, or which OS or CPU to target, use:
+
+ --cc=[$compilers]
+ --os=[$oses generic]
+ --cpu=[$cpus generic]
+
+ --endian=[little big none]
+ --unaligned-mem=[yes no]
+
+To change what modules to use:
+
+ --modules=
+ [$modules]
+
+To add a set of modules:
+ --module-set=[$sets]
+
+ --module-info: display more information about modules
+ --noauto: don't enable any modules unless specifically named
+
+To change where the library is installed:
+
--prefix=PATH: set the base installation directory
--libdir=PATH: install library files in \${prefix}/\${libdir}
--docdir=PATH: install documentation in \${prefix}/\${docdir}
+
+To change build options:
+
--build-dir=DIR: setup the build in DIR
--local-config=FILE: include the contents of FILE into build.h
- --modules=MODS: add module(s) MODS to the library.
- --module-set=SET: add a pre-specified set of modules ($sets)
- --module-info: display some information about known modules
-
--debug: set compiler flags for debugging
- --disable-shared: disable building shared libararies
- --noauto: disable autoconfiguration
+ --no-asm: disable all modules that contain assembly code
+ --no-shared: don't build shared libararies
--make-style=STYLE: override the guess as to what type of makefile to use
-You may use 'generic' for OS or CPU (useful if your OS or CPU isn't listed).
+For more information about supported CPUs, use --arch-info:
-CPU can be a generic family name or a specific model name. Common aliases are
-supported but not listed. Choosing a specific submodel will usually result in
-code that will not run on earlier versions of that architecture.
+ --arch-info=[$cpus]
-ENDOFHELP
+For diagnostic output:
- my $listing = sub {
- my ($header, @list) = @_;
+ --help display this help
+ --version display the version of Botan
+ --quiet display only warnings and errors
+ --trace enable tracing
- return '' if (@list == 0);
+See doc/building.pdf for more information about this program.
- my ($output, $len) = ('', 0);
+ENDOFHELP
- my $append = sub {
- my ($to_append) = @_;
- $output .= $to_append;
- $len += length $to_append;
- };
-
- &$append($header . ': ');
-
- foreach my $name (sort @list) {
- next if $name eq 'defaults';
- if($len > 71) {
- $output .= "\n ";
- $len = 3;
- }
- &$append($name . ' ');
- }
- return $output . "\n";
- };
-
- emit_help($helptxt,
- &$listing('CC', keys %COMPILER),
- &$listing('OS', keys %OPERATING_SYSTEM),
- &$listing('CPU', keys %CPU),
- &$listing('Modules', keys %MODULES));
+ emit_help($helptxt);
}
##################################################
# Display Further Information about Modules #
##################################################
-sub display_module_info {
+sub module_info {
my $info = '';
foreach my $mod (sort keys %MODULES) {
@@ -284,24 +320,26 @@ sub display_module_info {
while(length($mod) < 10) { $mod .= ' '; }
$info .= "$mod - $fullname\n";
}
- emit_help($info);
+
+ return $info;
}
##################################################
#
##################################################
sub choose_target {
- my ($config, $target) = @_;
+ my ($config) = @_;
- if($target eq '' and $$config{'autoconfig'}) {
- $target = guess_triple();
- autoconfig("Guessing your system config is $target");
- }
+ my $cc = $$config{'compiler'};
+ my $os = $$config{'os'};
+ my $cpu = $$config{'cpu'};
- my ($cc,$os,$submodel) = split(/-/,$target,3);
+ $cpu = guess_cpu() if not defined($cpu);
+ $cc = guess_compiler() if not defined($cc);
+ $os = guess_os() if not defined($os);
display_help()
- unless(defined($cc) and defined($os) and defined($submodel));
+ unless(defined($cc) and defined($os) and defined($cpu));
croak("Compiler $cc isn't known (try --help)")
unless defined($COMPILER{$cc});
@@ -312,20 +350,8 @@ sub choose_target {
croak("OS $os isn't known (try --help)") unless
($os eq 'generic' or defined($OPERATING_SYSTEM{$os}));
- my $arch = undef;
- ($arch, $submodel) = figure_out_arch($submodel);
+ my ($arch, $submodel) = figure_out_arch($cpu);
- croak(realname($os), " doesn't run on $arch ($submodel)")
- unless($arch eq 'generic' or $os eq 'generic' or
- in_array($arch, $OPERATING_SYSTEM{$os}{'arch'}));
-
- croak(realname($cc), " doesn't run on $arch ($submodel)")
- unless($arch eq 'generic' or
- (in_array($arch, $ccinfo{'arch'})));
-
- croak(realname($cc), " doesn't run on ", realname($os))
- unless($os eq 'generic' or (in_array($os, $ccinfo{'os'})));
-
# hacks
if($cc eq 'gcc') {
$ccinfo{'binary_name'} = 'c++' if($os eq 'darwin');
@@ -337,30 +363,29 @@ sub choose_target {
$gcc_version = '' if not defined $gcc_version;
- # Some versions of GCC are a little buggy dealing with
- # long long in C++. The last check is because on Cygwin
- # (at least for me) gcc_version doesn't get the output,
- # maybe something to do with the stderr redirection? If
- # it's Cygwin and we didn't get output, assume it's a
- # buggy GCC. There is no reduction in code quality so even
- # if we're wrong it's OK.
+ my $has_ll_bug = 0;
+ $has_ll_bug = 1 if($gcc_version =~ /4\.[0123]/);
+ $has_ll_bug = 1 if($gcc_version =~ /3\.[34]/);
+ $has_ll_bug = 1 if($gcc_version =~ /2\.25\.[0-4]/);
+ $has_ll_bug = 1 if($gcc_version eq '');
- if(($gcc_version =~ /4\.[01]/) || ($gcc_version =~ /3\.[34]/) ||
- ($gcc_version =~ /2\.95\.[0-4]/) ||
- ($gcc_version eq '' && $^O eq 'cygwin'))
+ $has_ll_bug = 0 if($arch eq 'alpha' or $arch =~ /.*64$/);
+
+ if($has_ll_bug)
{
warning('Enabling -fpermissive to work around ',
'possible GCC bug');
$$config{'gcc_bug'} = 1;
}
- if($gcc_version =~ /2\.95\.[0-4]/)
- {
- warning('GCC 2.95.x issues many spurious warnings');
- }
+
+ warning('GCC 2.95.x issues many spurious warnings')
+ if($gcc_version =~ /2\.95\.[0-4]/);
}
}
+ trace("using $cc $os $arch $submodel");
+
add_to($config, {
'compiler' => $cc,
'os' => $os,
@@ -369,31 +394,60 @@ sub choose_target {
});
}
-sub choose_modules {
- my ($config, $mod_str) = @_;
+# Add modules that we think would work (unless autoconfig is off)
+# to $$config{'modules'}
+sub autoload_modules {
+ my ($config) = @_;
- my @modules = grep { $_ ne '' } split(/,/, $mod_str);
+ my $cc = $$config{'compiler'};
+ my $os = $$config{'os'};
+ my $arch = $$config{'arch'};
+ my $submodel = $$config{'submodel'};
- if($$config{'autoconfig'})
- {
- foreach my $mod (guess_mods($config)) {
+ my $asm_ok = $$config{'asm_ok'};
- autoconfig("Enabling module $mod")
- unless in_array($mod, \@modules);
+ foreach my $mod (sort keys %MODULES) {
+ my %modinfo = %{ $MODULES{$mod} };
- push @modules, $mod;
+ if(defined($$config{'modules'}{$mod})) {
+ autoconfig("Module $mod - loading by user request");
+ next;
}
- }
- # Uniqify @modules
- my %uniqed_mods = map_to(undef, @modules);
- @modules = sort keys %uniqed_mods;
+ my @arch_list = @{ $modinfo{'arch'} };
+ if(scalar @arch_list > 0 &&
+ !in_array($arch, \@arch_list) &&
+ !in_array($submodel, \@arch_list)) {
+ autoconfig("Module $mod - won't use, " .
+ "doesn't run on CPU $arch/$submodel");
+ next;
+ }
- foreach (@modules) {
- croak("Module '$_' isn't known (try --help)")
- unless defined $MODULES{$_};
+ my @os_list = @{ $modinfo{'os'} };
+ if(scalar @os_list > 0 && !in_array($os, \@os_list)) {
+ autoconfig("Module $mod - won't use, not compatible with OS $os");
+ next;
+ }
+
+ my @cc_list = @{ $modinfo{'cc'} };
+ if(scalar @cc_list > 0 && !in_array($cc, \@cc_list)) {
+ autoconfig("Module $mod - won't use, not compatbile with CC $cc");
+ next;
+ }
+
+ if(!$asm_ok and $modinfo{'load_on'} eq 'asm_ok') {
+ autoconfig("Module $mod - won't use; avoiding due to use of --no-asm");
+ next;
+ }
+
+ if($modinfo{'load_on'} eq 'request') {
+ autoconfig("Module $mod - won't use, loaded by request only");
+ next;
+ }
+
+ autoconfig("Module $mod - autoloading");
+ $$config{'modules'}{$mod} = 1;
}
- return @modules;
}
sub get_options {
@@ -405,13 +459,88 @@ sub get_options {
$$config{$opt} = $val;
};
- my $module_set = '';
- my @modules;
+ $$config{'verbose'} = 1;
+ $$config{'asm_ok'} = 1;
+ $$config{'modules'} = {};
+
+ sub arch_info {
+ my $arg = $_[0];
+
+ my $arch = find_arch($arg);
+
+ unless(defined($arch) and defined($CPU{$arch})) {
+ warning("Unknown arch name '$arg' passed to --arch-info (try --help)");
+ return '';
+ }
+
+ my %info = %{ $CPU{$arch} };
+
+ my $out = "Information for $arg ($arch)\n--------\n";
+
+ if(@{$info{'aliases'}}) {
+ $out .= 'Aliases: ' . join(' ', @{$info{'aliases'}}) . "\n";
+ }
+
+ if(@{$info{'submodels'}}) {
+ $out .= 'Submodels: ' . join(' ', @{$info{'submodels'}}) . "\n";
+ }
+
+ foreach my $k (keys %{$info{'submodel_aliases'}}) {
+ $out .= "Alias '$k' -> '" . $info{'submodel_aliases'}{$k} . "'\n";
+ }
+
+ if(defined($info{'endian'})) {
+ $out .= 'Default endian: ' . $info{'endian'} . "\n";
+ }
+
+ if(defined($info{'unaligned'})) {
+ $out .= 'Unaligned memory access: ' . $info{'unaligned'} . "\n";
+ }
+
+ return $out;
+ }
+
+ sub add_modules {
+ my ($config,$mods) = @_;
+
+ foreach my $mod (split(/,/, $mods)) {
+ $$config{'modules'}{$mod} = 1;
+ }
+ }
+
+ sub add_module_sets {
+ my ($config,$sets) = @_;
+
+ foreach my $set (split(/,/, $sets)) {
+ for my $name (sort keys %MODULES) {
+ my %info = %{$MODULES{$name}};
+
+ next unless (defined($info{'modset'}));
+
+ for my $s (split(/,/, $info{'modset'})) {
+ if($s eq $set) {
+ $$config{'modules'}{$name} = 1;
+ }
+ }
+ }
+ }
+ }
+
exit 1 unless GetOptions(
'help' => sub { display_help(); },
- 'module-info' => sub { display_module_info(); },
+ 'module-info' => sub { emit_help(module_info()); },
'version' => sub { emit_help("Botan $VERSION_STRING\n") },
+ 'quiet' => sub { $$config{'verbose'} = 0; },
+
+ 'cc=s' => sub { &$save_option('compiler', $_[1]) },
+ 'os=s' => sub { &$save_option(@_) },
+ 'cpu=s' => sub { &$save_option(@_) },
+ 'endian=s' => sub { &$save_option(@_); },
+ 'unaligned-mem=s' => sub { &$save_option(@_); },
+
+ 'arch-info=s' => sub { emit_help(arch_info($_[1])); },
+
'prefix=s' => sub { &$save_option(@_); },
'docdir=s' => sub { &$save_option(@_); },
'libdir=s' => sub { &$save_option(@_); },
@@ -421,34 +550,50 @@ sub get_options {
'make-style=s' => sub { &$save_option(@_); },
- 'modules=s' => \@modules,
- 'module-set=s' => \$module_set,
+ 'module=s' => sub { add_modules($config, $_[1]); },
+ 'modules=s' => sub { add_modules($config, $_[1]); },
+ 'module-set=s' => sub { add_module_sets($config, $_[1]); },
+ 'module-sets=s' => sub { add_module_sets($config, $_[1]); },
'trace' => sub { $TRACING = 1; },
'debug' => sub { &$save_option($_[0], 1); },
- 'disable-shared' => sub { $$config{'shared'} = 'no'; },
+ 'no-shared' => sub { $$config{'shared'} = 'no'; },
+ 'no-asm' => sub { $$config{'asm_ok'} = 0; },
'noauto' => sub { $$config{'autoconfig'} = 0; },
'dumb-gcc|gcc295x' => sub { $$config{'gcc_bug'} = 1; }
);
- croak("Module set $module_set isn't known (try --help)")
- if($module_set && !defined($MODULE_SETS{$module_set}));
-
- if($module_set) {
- foreach (@{ $MODULE_SETS{$module_set} }) { push @modules,$_; }
- }
-
- my $mod_str = join(',', @modules);
-
- return ('', $mod_str) if($#ARGV == -1);
- return ($ARGV[0], $mod_str) if($#ARGV == 0);
- display_help();
+ # All arguments should now be consumed
+ croak("Unknown option $ARGV[0] (try --help)") unless($#ARGV == -1);
}
##################################################
# Functions to search the info tables #
##################################################
+sub find_arch {
+ my $name = $_[0];
+
+ foreach my $arch (keys %CPU) {
+ my %info = %{$CPU{$arch}};
+
+ return $arch if($name eq $arch);
+
+ foreach my $alias (@{$info{'aliases'}}) {
+ return $arch if($name eq $alias);
+ }
+
+ foreach my $submodel (@{$info{'submodels'}}) {
+ return $arch if($name eq $submodel);
+ }
+
+ foreach my $submodel (keys %{$info{'submodel_aliases'}}) {
+ return $arch if($name eq $submodel);
+ }
+ }
+ return undef;
+};
+
sub figure_out_arch {
my ($name) = @_;
@@ -473,30 +618,7 @@ sub figure_out_arch {
return '';
};
- my $find_arch = sub {
- my $name = $_[0];
-
- foreach my $arch (keys %CPU) {
- my %info = %{$CPU{$arch}};
-
- return $arch if($name eq $arch);
-
- foreach my $alias (@{$info{'aliases'}}) {
- return $arch if($name eq $alias);
- }
-
- foreach my $submodel (@{$info{'submodels'}}) {
- return $arch if($name eq $submodel);
- }
-
- foreach my $submodel (keys %{$info{'submodel_aliases'}}) {
- return $arch if($name eq $submodel);
- }
- }
- return undef;
- };
-
- my $arch = &$find_arch($name);
+ my $arch = find_arch($name);
croak("Arch type $name isn't known (try --help)") unless defined $arch;
trace("mapped name '$name' to arch '$arch'");
@@ -507,7 +629,7 @@ sub figure_out_arch {
if($submodel eq '') {
$submodel = $archinfo{'default_submodel'};
- warning("Using $submodel as default type for family ", realname($arch))
+ autoconfig("Using $submodel as default type for family ", realname($arch))
if($submodel ne $arch);
}
@@ -537,6 +659,8 @@ sub os_info_for {
sub os_info_for {
my ($os,$what) = @_;
+ die unless defined($os);
+
croak('os_info_for called with an os of defaults (internal problem)')
if($os eq 'defaults');
@@ -708,11 +832,15 @@ sub mkdirs {
sub mkdirs {
my (@dirs) = @_;
+
+ my @created;
foreach my $dir (@dirs) {
next if( -e $dir and -d $dir ); # skip it if it's already there
mkdir($dir, 0777) or
croak("Could not create directory $dir ($!)");
+ push @created, $dir;
}
+ return @created;
}
sub slurp_file {
@@ -813,9 +941,7 @@ sub load_modules {
sub load_modules {
my ($config) = @_;
- my @modules = @{$$config{'modules'}};
-
- foreach my $mod (@modules) {
+ foreach my $mod (sort keys %{$$config{'modules'}}) {
load_module($config, $mod);
}
@@ -828,9 +954,16 @@ sub load_modules {
my %cpu_info = %{$CPU{$arch}};
my $endian = $cpu_info{'endian'};
- $arch = uc $arch;
- $defines .= "#define BOTAN_TARGET_ARCH_IS_$arch\n";
+ if(defined($$config{'endian'})) {
+ $endian = $$config{'endian'};
+ $endian = undef unless($endian eq 'little' || $endian eq 'big');
+ }
+ elsif(defined($endian)) {
+ autoconfig("Since arch is $arch, assuming $endian endian mode");
+ }
+ $defines .= "#define BOTAN_TARGET_ARCH_IS_" . (uc $arch) . "\n";
+
my $submodel = $$config{'submodel'};
if($arch ne $submodel) {
$submodel = uc $submodel;
@@ -838,14 +971,41 @@ sub load_modules {
$defines .= "#define BOTAN_TARGET_CPU_IS_$submodel\n";
}
+ my $unaligned_ok = 0;
+
if(defined($endian)) {
$endian = uc $endian;
$defines .= "#define BOTAN_TARGET_CPU_IS_${endian}_ENDIAN\n";
+
+ if(defined($$config{'unaligned_mem'})) {
+ my $spec = $$config{'unaligned_mem'};
+
+ if($spec eq 'yes') {
+ $unaligned_ok = 1;
+ }
+ elsif($spec eq 'no') {
+ $unaligned_ok = 0;
+ }
+ else {
+ warning("Unknown arg to --unaligned-mem '$spec', will ignore");
+ $unaligned_ok = 0;
+ }
+ }
+ elsif(defined($cpu_info{'unaligned'}) and
+ $cpu_info{'unaligned'} eq 'ok')
+ {
+ autoconfig("Since arch is $arch, " .
+ "assuming unaligned memory access is OK");
+ $unaligned_ok = 1;
+ }
}
+
+ $defines .=
+ "#define BOTAN_TARGET_UNALIGNED_LOADSTOR_OK $unaligned_ok\n";
}
my @defarray;
- foreach my $mod (@modules) {
+ foreach my $mod (sort keys %{$$config{'modules'}}) {
my $defs = $MODULES{$mod}{'define'};
next unless $defs;
@@ -1123,21 +1283,20 @@ sub read_module_files {
##################################################
# #
##################################################
+
sub get_module_info {
my ($name, $file) = @_;
my $reader = make_reader($file);
my %info;
$info{'name'} = $name;
- $info{'load_on'} = 'requeste'; # default unless specified
+ $info{'load_on'} = 'request'; # default unless specified
$info{'libs'} = {};
while($_ = &$reader()) {
match_any_of($_, \%info, 'quoted', 'realname:note');
- match_any_of($_, \%info, 'unquoted', 'define:mp_bits');
+ match_any_of($_, \%info, 'unquoted', 'define:mp_bits:modset:load_on');
- $info{'load_on'} = $1 if(/^load_on: (.*)$/);
-
read_list($_, $reader, 'arch', list_push(\@{$info{'arch'}}));
read_list($_, $reader, 'cc', list_push(\@{$info{'cc'}}));
read_list($_, $reader, 'os', list_push(\@{$info{'os'}}));
@@ -1186,8 +1345,8 @@ sub get_arch_info {
while($_ = &$reader()) {
match_any_of($_, \%info, 'quoted', 'realname');
- match_any_of($_, \%info, 'unquoted', 'default_submodel');
- match_any_of($_, \%info, 'unquoted', 'endian');
+ match_any_of($_, \%info, 'unquoted',
+ 'default_submodel:endian:unaligned');
read_list($_, $reader, 'aliases', list_push(\@{$info{'aliases'}}));
read_list($_, $reader, 'submodels', list_push(\@{$info{'submodels'}}));
@@ -1222,7 +1381,6 @@ sub get_os_info {
'install_cmd_data:install_cmd_exec');
read_list($_, $reader, 'aliases', list_push(\@{$info{'aliases'}}));
- read_list($_, $reader, 'arch', list_push(\@{$info{'arch'}}));
read_list($_, $reader, 'supports_shared',
list_push(\@{$info{'supports_shared'}}));
@@ -1251,9 +1409,6 @@ sub get_cc_info {
match_any_of($_, \%info, 'unquoted', 'makefile_style');
- read_list($_, $reader, 'os', list_push(\@{$info{'os'}}));
- read_list($_, $reader, 'arch', list_push(\@{$info{'arch'}}));
-
sub quoted_mapping {
my $hashref = $_[0];
return sub {
@@ -1280,40 +1435,6 @@ sub get_cc_info {
return %info;
}
-sub guess_mods {
- my ($config) = @_;
-
- my $cc = $$config{'compiler'};
- my $os = $$config{'os'};
- my $arch = $$config{'arch'};
- my $submodel = $$config{'submodel'};
-
- my $asm_ok = ($$config{'debug'} == 0);
-
- my @usable_modules;
-
- foreach my $mod (sort keys %MODULES) {
- my %modinfo = %{ $MODULES{$mod} };
-
- next if($modinfo{'load_on'} eq 'request');
- next if(!$asm_ok and $modinfo{'load_on'} eq 'asm_ok');
-
- my @cc_list = @{ $modinfo{'cc'} };
- next if(scalar @cc_list > 0 && !in_array($cc, \@cc_list));
-
- my @os_list = @{ $modinfo{'os'} };
- next if(scalar @os_list > 0 && !in_array($os, \@os_list));
-
- my @arch_list = @{ $modinfo{'arch'} };
- next if(scalar @arch_list > 0 &&
- !in_array($arch, \@arch_list) &&
- !in_array($submodel, \@arch_list));
-
- push @usable_modules, $mod;
- }
- return @usable_modules;
-}
-
##################################################
# #
##################################################
@@ -1594,6 +1715,8 @@ sub generate_makefile {
trace("'$make_style' -> '$template'");
process_template($template, $$config{'makefile'}, $config);
+
+ #autoconfig('Created ' . $$config{'makefile'});
}
##################################################
@@ -1650,131 +1773,122 @@ sub guess_cpu_from_this
# Do some WAGing and see if we can figure out what system we are. Think about
# this as a really moronic config.guess
-sub guess_triple
+sub guess_compiler
{
- # /bin/sh, good bet we're on something Unix-y (at least it'll have uname)
- if(-f '/bin/sh')
+ my @CCS = ('gcc', 'msvc', 'icc', 'compaq', 'kai');
+
+ # First try the CC enviornmental variable, if it's set
+ if(defined($ENV{CC}))
{
- my $os = lc `uname -s 2>/dev/null`; chomp $os;
+ my @new_CCS = ($ENV{CC});
+ foreach my $cc (@CCS) { push @new_CCS, $cc; }
+ @CCS = @new_CCS;
+ }
- # Let the crappy hacks commence!
+ foreach (@CCS)
+ {
+ my $bin_name = $COMPILER{$_}{'binary_name'};
+ autoconfig("Guessing you want to use $_ as the compiler");
+ return $_ if(which($bin_name) ne '');
+ }
- # Cygwin's uname -s is cygwin_<windows version>
- $os = 'cygwin' if($os =~ /^cygwin/);
- $os = os_alias($os);
+ croak(
+ "Can't find a usable C++ compiler, is your PATH right?\n" .
+ "You might need to run with explicit compiler/system flags;\n" .
+ " run '$0 --help' for more information\n");
+}
- if(!defined $OPERATING_SYSTEM{$os})
- {
- warning("Unknown uname -s output: $os, falling back to 'generic'");
- $os = 'generic';
- }
+sub guess_os
+{
+ sub recognize_os
+ {
+ my $os = os_alias($_[0]);
+ if(defined($OPERATING_SYSTEM{$os})) {
+ autoconfig("Guessing your operating system is $os");
+ return $os;
+ }
+ return undef;
+ }
- my $cpu = '';
+ my $guess = recognize_os($^O);
+ return $guess if $guess;
- # If we have /proc/cpuinfo, try to get nice specific information about
- # what kind of CPU we're running on.
- my $cpuinfo = '/proc/cpuinfo';
+ trace("Can't guess os from $^O");
- if(-e $cpuinfo and -r $cpuinfo)
- {
- $cpu = guess_cpu_from_this(slurp_file($cpuinfo));
- }
+ my $uname = `uname -s 2>/dev/null`;
+ chomp $uname;
+ $uname = lc $uname;
- # `umame -p` is sometimes something stupid like unknown, but in some
- # cases it can be more specific (useful) than `uname -m`
- if($cpu eq '') # no guess so far
- {
- my $uname_p = `uname -p 2>/dev/null`;
- chomp $uname_p;
- $cpu = guess_cpu_from_this($uname_p);
+ $guess = recognize_os($uname);
+ return $guess if $guess;
- # If guess_cpu_from_this didn't figure it out, try it plain
- if($cpu eq '') { $cpu = lc $uname_p; }
+ trace("Can't guess os from $uname");
- sub known_arch {
- my ($name) = @_;
+ warning("Unknown OS ('$^O', '$uname'), falling back to generic code");
+ return 'generic';
+}
- foreach my $arch (keys %CPU) {
- my %info = %{$CPU{$arch}};
+sub guess_cpu
+{
+ # If we have /proc/cpuinfo, try to get nice specific information about
+ # what kind of CPU we're running on.
+ my $cpuinfo = '/proc/cpuinfo';
- return 1 if $name eq $info{'name'};
- foreach my $submodel (@{$info{'submodels'}}) {
- return 1 if $name eq $submodel;
- }
+ if(-e $cpuinfo and -r $cpuinfo)
+ {
+ my $cpu = guess_cpu_from_this(slurp_file($cpuinfo));
+ if($cpu) {
+ autoconfig("Guessing (based on $cpuinfo) that your CPU is a $cpu");
+ return $cpu;
+ }
+ }
- foreach my $alias (@{$info{'aliases'}}) {
- return 1 if $name eq $alias;
- }
+ # `umame -p` is sometimes something stupid like unknown, but in some
+ # cases it can be more specific (useful) than `uname -m`
+ my $uname_p = `uname -p 2>/dev/null`;
+ chomp $uname_p;
+ my $cpu = guess_cpu_from_this($uname_p);
- if(defined($info{'submodel_aliases'})) {
- my %submodel_aliases = %{$info{'submodel_aliases'}};
- foreach my $sm_alias (keys %submodel_aliases) {
- return 1 if $name eq $sm_alias;
- }
- }
- }
- return 0;
+ # If guess_cpu_from_this didn't figure it out, try it as is
+ if($cpu eq '') { $cpu = lc $uname_p; }
+
+ sub known_arch {
+ my ($name) = @_;
+
+ foreach my $arch (keys %CPU) {
+ my %info = %{$CPU{$arch}};
+
+ return 1 if $name eq $info{'name'};
+ foreach my $submodel (@{$info{'submodels'}}) {
+ return 1 if $name eq $submodel;
}
- if(!known_arch($cpu))
- {
- # Nope, couldn't figure out uname -p
- $cpu = lc `uname -m 2>/dev/null`;
- chomp $cpu;
+ foreach my $alias (@{$info{'aliases'}}) {
+ return 1 if $name eq $alias;
+ }
- if(!known_arch($cpu))
- {
- $cpu = 'generic';
+ if(defined($info{'submodel_aliases'})) {
+ my %submodel_aliases = %{$info{'submodel_aliases'}};
+ foreach my $sm_alias (keys %submodel_aliases) {
+ return 1 if $name eq $sm_alias;
}
}
}
+ return 0;
+ }
- my @CCS = ('gcc', 'icc', 'compaq', 'kai'); # Skips several, oh well...
+ if(!known_arch($cpu))
+ {
+ # Nope, couldn't figure out uname -p
+ $cpu = lc `uname -m 2>/dev/null`;
+ chomp $cpu;
- # First try the CC enviornmental variable, if it's set
- if(defined($ENV{CC}))
+ if(!known_arch($cpu))
{
- my @new_CCS = ($ENV{CC});
- foreach my $cc (@CCS) { push @new_CCS, $cc; }
- @CCS = @new_CCS;
+ $cpu = 'generic';
}
-
- my $cc = '';
- foreach (@CCS)
- {
- my $bin_name = $COMPILER{$_}{'binary_name'};
- $cc = $_ if(which($bin_name) ne '');
- last if($cc ne '');
- }
-
- if($cc eq '') {
- my $msg =
- "Can't find a usable C++ compiler, is your PATH right?\n" .
- "You might need to run with explicit compiler/system flags;\n" .
- " run '$0 --help' for more information\n";
- croak($msg);
- }
-
- return "$cc-$os-$cpu";
}
- elsif($^O eq 'MSWin32' or $^O eq 'dos')
- {
- my $os = 'windows'; # obviously
- # Suggestions on this? The Win32 'shell' env is not so hot. We could
- # try using cpuinfo, except that will crash hard on NT/Alpha (like what
- # we're doing now won't!). In my defense of choosing i686:
- # a) There are maybe a few hundred Alpha/MIPS boxes running NT4 today
- # b) Anyone running Windows on < Pentium Pro deserves to lose.
- my $cpu = 'i686';
-
- # No /bin/sh, so not cygwin. Assume VC++; again, this could be much
- # smarter
- my $cc = 'msvc';
- return "$cc-$os-$cpu";
- }
- else
- {
- croak('Autoconfiguration failed (try --help)');
- }
+ autoconfig("Guessing (based on uname -p) your CPU is a $cpu");
+ return $cpu;
}
============================================================
--- Attic/doc/api.tex cb1e40121b562d97258d9aba065c5cb5f58bfb3c
+++ Attic/doc/api.tex 2ff20035b5a43d5549e664daf89a4ad837ebef2a
@@ -212,12 +212,6 @@ \subsection{Initializing the Library}
On systems that don't (currently) have any specialized allocators, like
MS Windows, this option is ignored.
-\option{config=/path/to/configfile}: Process the specified
-configuration file. Configuration files can specify things like the
-various options, new aliases, and new OIDs for algorithms. An example
-can be found in \filename{doc/botan.rc}. Currently only one config=
-argument will be processed, the rest will be ignored.
-
\option{use\_engines}: Use any available ``engine'' modules to speed
up processing. Currently Botan has support for engines based on the
AEP1000/AEP2000 crypto hardware cards, GNU MP, and OpenSSL's BN
@@ -2762,105 +2756,6 @@ \subsection{Available Options}
and much less commonly used.
\end{list}
-\subsection{Configuration Files}
-
-Botan has a number of options, which can be configured by calling the
-appropriate functions, documented earlier in this section. But this is somewhat
-inconvenient for the users of applications which use Botan. So Botan also
-supports reading options from a file which looks rather like Windows .INI files
-or OpenSSL configurations. You can find an example config (which simply matches
-the compiled-in defaults) in \filename{doc/botan.rc}
-
-Each set of options is part of a 'section', for example, ``base'', ``rng'', or
-``x509''. These names are essentially arbitrary, and are (in theory) chosen on
-the basis of what the options pertain to. To set the option
-``x509/ca/default\_expire'' (which tells \type{X509\_CA} how long newly minted
-X.509 certificates should be valid for), you could use either of the following
-methods:
-
-\begin{verbatim}
-[x509/ca] # section is x509/ca
-default_expire = 1y # x509/ca + default_expire -> x509/ca/default_expire
-
-# same as above
-[x509] # section is x509
-# other x509/ options in here...
-ca/default_expire = 1y # x509 + ca/default_expire -> x509/ca/default_expire
-\end{verbatim}
-
-There are also two special sections, ``oids'' and ``aliases''. The aliases
-section is easier to understand, and probably more useful for the average user.
-By adding a new line in an alias section, \verb|alias = officialname|, you can
-create a new way to reference a particular algorithm (in those cases when you
-ask for an algorithm object with a string specifying its type). For example, if
-the line \verb|MyAlgo = Blowfish| was included in an aliases section, then one
-could do this:
-
-\begin{verbatim}
-Pipe pipe(get_cipher(``MyAlgo/CBC/PKCS7'', key, iv, ENCRYPTION));
-\end{verbatim}
-
-and get a Blowfish CBC encryptor. Initially this was implemented due to the
-number of algorithms with multiple names (such as ``SHA1'', ``SHA-1'', and
-``SHA-160''), but might also be useful in other, more interesting, contexts.
-
-The OIDs section gives a mapping between ASN.1 OIDs and the algorithm or object
-it represents, in the form \verb|name = oid|, where oid is the usual
-decimal-dotted representation. For readability and easy of extension in
-configuration files, a simple variable interpolation scheme is also
-available. Consider the following:
-
-\begin{verbatim}
-[oids]
-ISO_MEMBER = 1.2
-US_BODY = ISO_MEMBER.840 # US_BODY = 1.2.840
-RSA_DSI = US_BODY.113549 # RSA_DSI = 1.2.840.113549
-\end{verbatim}
-
-This only works when the variable name is at the start of the string; since the
-primary reason for its inclusion is for with OIDs, this is acceptable. In some
-cases, adding a new OID in is sufficient for code to work with new algorithms
-(though not always). For example, by setting the proper OIDs, you can make it
-possible to import, export, create, and process X.509 certificates that use
-Rabin-Williams.
-
-\subsubsection{Syntax}
-
-Each line is either a comment, blank, a section name, or a name/value pair
-separated by a '='. Comments start with the '\#' character and continue to the
-end of line. The reader allows escaping, so if you wanted to include an actual
-\# sign you could use \verb|\#|, or include it in a string ('\#' or ``\#''). A
-section name is specified by \verb|[somename]|; a section name must have at
-least one character, and a section must appear before any name/value pairs. A
-name must be alphanumeric, but a value can contain spaces or other strange
-things (you must either enclose the argument in quotes or escape each space
-with a backslash). An example showing some of the trickier parts of how input
-is interpreted follows (but the reader is cautioned that relying on this
-behavior is not a good idea):
-
-\begin{verbatim}
-[examples]
-foo1 = a b c # stored as abc (not quoted, ws removed)
-foo2 = 'a b c' # stored as a b c (quoted, keep ws)
-foo3 = "a b c" # stored as a b c (quoted, keep ws)
-tricky = "Jack \"I like pie\" Lloyd" # stored as Jack "I like pie" Lloyd
-simpler = "Jack 'I like pie' Lloyd" # no escapes needed
-
-hashmark = "#" # set to a hash
-hashmark2 = \# # also set to a hash
-
-[oids]
-RW = 1.2.3.4.5.6 # Now RW keys can be imported/exported!
-NR = 1.2.3.4.5.7 # Now NR can be imported/exported too.
- # Note these OIDs are *not* allocated for RW/NR, in fact I have no idea who
- # owns that section of the OID space, but it's certainly not me. Someone will
- # have to allocate OIDs for RW/NR before this is 'legal'
-
-some_thing = 1.2.3 # some OID
-another_thing = some_thing.4.5 # another_thing = 1.2.3.4.5
-\end{verbatim}
-
-
\pagebreak
\section{Botan's Modules}
============================================================
--- Attic/doc/building.tex 5ffcd552ad48605b03a6dbe526ac39d85451c6e4
+++ Attic/doc/building.tex 93619b803ba091c08e1638e59a70bee267ecfde7
@@ -55,41 +55,27 @@ \section{For the Impatient}
spot, you might need to prefix the \texttt{configure.pl} command with
\texttt{perl} or \texttt{/path/to/perl}.
-The autoconfiguaration abilities of \filename{configure.pl} were only recently
-added, so they may break if you run it on something unusual. In addition, you
-are certain to get more features, and possibly better optimization, by
-explicitly specifying how you want to library configured. How to do this is
-detailed below. Also, if you don't want to use the default compiler (typically
-either GNU C++ or Visual C++, depending on the platform), you will need to
-specify one.
-
\section{Building the Library}
-The first step is to run \filename{configure.pl}, which is a Perl script that
-creates various directories, config files, and a Makefile for building
-everything. It is run as \verb|./configure.pl CC-OS-CPU <extra args>|. The
-script requires at least Perl 5.6; any later version should also work.
+The first step is to run \filename{configure.pl}, which is a Perl
+script that creates various directories, config files, and a Makefile
+for building everything. The script requires at least Perl 5.6; any
+later version should also work.
-The tuple CC-OS-CPU specifies what system Botan is being built for, in terms of
-the C++ compiler, the operating system, and the CPU model. For example, to use
-GNU C++ on a FreeBSD box that has an Alpha EV6 CPU, one would use
-``gcc-freebsd-alphaev6'', and for Visual C++ on Windows with a Pentium II,
-``msvc-windows-pentium2''. To get the list of values for \verb|CC|, \verb|OS|,
-and \verb|CPU| that \filename{configure.pl} supports, run it with the
-``\verb|--help|'' option.
+The script will attempt to guess what kind of system you are trying
+to compile for (and will print messages telling you what it guessed).
+You can override this process by passing the options \verb|--cc|,
+\verb|--os|, and \verb|--arch| -- acceptable values are printed if
+you run \verb|configure.pl| with \verb|--help|.
-You can put basically anything reasonable for CPU: the script knows
-about a large number of different architectures, their sub-models, and
-common aliases for them. The script does not display all the
-possibilities in its help message because there are simply too many
-entries. You should only select the 64-bit version of a CPU (such as
-``sparc64'' or ``mips64'') if your operating system knows how to
+You can pass basically anything reasonable with \verb|--cpu|: the
+script knows about a large number of different architectures, their
+sub-models, and common aliases for them. The script does not display
+all the possibilities in its help message because there are simply too
+many entries. You should only select the 64-bit version of a CPU (such
+as ``sparc64'' or ``mips64'') if your operating system knows how to
handle 64-bit object code -- a 32-bit kernel on a 64-bit CPU will
-generally not like 64-bit code. For example, gcc-solaris-sparc64 will
-not work unless you're running a 64-bit Solaris kernel (for 32-bit
-Solaris running on an UltraSPARC system, you want
-gcc-solaris-sparc32-v9). You may or may not have to install 64-bit
-versions of libc and related system libraries as well.
+generally not like 64-bit code.
The script also knows about the various extension modules
available. You can enable one or more with the option
@@ -128,13 +114,16 @@ \subsection{POSIX / Unix}
The basic build procedure on Unix and Unix-like systems is:
\begin{verbatim}
- $ ./configure.pl CC-OS-CPU --module-set=[unix|beos] --modules=<other mods>
+ $ ./configure.pl --module-set=[unix|beos] --modules=<other mods>
$ make
# You may need to set your LD_LIBRARY_PATH or equivalent for ./check to run
$ make check # optional, but a good idea
$ make install
\end{verbatim}
+This will probably default to using GCC, depending on what can be
+found within your PATH.
+
The 'unix' module set should work on most POSIX/Unix systems out there
(including MacOS X), while the 'beos' module is specific to BeOS. While the two
sets share a number of modules, some normal Unix ones don't work on BeOS (in
@@ -142,9 +131,9 @@ \subsection{POSIX / Unix}
a few extras just for it. The library will pick a default module set for you
based on the value of OS, so there is rarely a reason to specify that.
-The \verb|make install| target has a default directory in which it will install
-Botan (on everything that's a real Unix, it's \verb|/usr/local|). You can
-override this by using the \texttt{--prefix} argument to
+The \verb|make install| target has a default directory in which it
+will install Botan (typically \verb|/usr/local|). You can override
+this by using the \texttt{--prefix} argument to
\filename{configure.pl}, like so:
\verb|./configure.pl --prefix=/opt <other arguments>|
@@ -173,15 +162,16 @@ \subsection{MS Windows}
have a copy of Perl installed, and have both Perl and Visual C++ in your path.
\begin{verbatim}
- > perl configure.pl msvc-windows-<CPU> --module-set=win32
+ > perl configure.pl --cc=msvc --os=windows [--cpu=CPU] --module-set=win32
> nmake
> nmake check # optional, but recommended
\end{verbatim}
-By default, the configure script will include the 'win32' module set for you.
-This includes a pair of entropy sources for use on Windows; at some point in
-the future it will also add support for high-resolution timers, mutexes for
-thread safety, and other useful things.
+The configure script will include the 'win32' module set by default if
+you pass \verb|--os=windows|. This module set includes a pair of
+entropy sources for use on Windows; at some point in the future it
+will also add support for high-resolution timers, mutexes for thread
+safety, and other useful things.
For Win95 pre OSR2, the \verb|es_capi| module will not work, because
CryptoAPI didn't exist. All versions of NT4 lack the ToolHelp32
============================================================
--- Attic/doc/examples/ca.cpp e495b2b0e52d4c389b828f82bebbe760e57a34a7
+++ Attic/doc/examples/ca.cpp 6cc72054e73db7edf59cc9410bbb5efa561d7100
@@ -21,27 +21,35 @@ int main(int argc, char* argv[])
int main(int argc, char* argv[])
{
- if(argc != 2)
+ if(argc != 5)
{
- std::cout << "Usage: " << argv[0] << " passphrase" << std::endl;
+ std::cout << "Usage: " << argv[0] << " <passphrase> "
+ << "<ca cert> <ca key> <pkcs10>" << std::endl;
return 1;
}
- try {
- // set up our CA
- X509_Certificate ca_cert("cacert.pem");
+ try
+ {
+ const std::string arg_passphrase = argv[1];
+ const std::string arg_ca_cert = argv[2];
+ const std::string arg_ca_key = argv[3];
+ const std::string arg_req_file = argv[4];
+
+ X509_Certificate ca_cert(arg_ca_cert);
+
std::auto_ptr<PKCS8_PrivateKey> privkey(
- PKCS8::load_key("caprivate.pem", argv[1])
+ PKCS8::load_key(arg_ca_key, arg_passphrase)
);
+
X509_CA ca(ca_cert, *privkey);
// got a request
- PKCS10_Request req("req.pem");
+ PKCS10_Request req(arg_req_file);
- // presumably attempt to verify the req for sanity/accuracy here, but
- // as Verisign, etc have shown, that's not a must. :)
+ // you would insert checks here, and perhaps modify the request
+ // (this example should be extended to show how)
- // now sign it
+ // now sign the request
X509_Certificate new_cert = ca.sign_request(req);
// send the new cert back to the requestor
============================================================
--- Attic/doc/examples/passhash.cpp 8cc8559beed77954bf20883ca8958b45655d8460
+++ Attic/doc/examples/passhash.cpp dd7df26838e4daf231280f5fa82a2c1cda66a353
@@ -19,7 +19,8 @@ int main(int argc, char* argv[])
try
{
if(argc == 2)
- std::cout << "H('" << argv[1] << "') = " << password_hash(argv[1]) << '\n';
+ std::cout << "H('" << argv[1] << "') = "
+ << password_hash(argv[1]) << '\n';
else
{
bool ok = password_hash_ok(argv[1], argv[2]);
@@ -71,4 +72,3 @@ bool password_hash_ok(const std::string&
return same_mem(cmp.begin(), hash_bin.begin() + 6, 12);
}
-
============================================================
--- Attic/doc/examples/x509info.cpp 5f95ed368ba2d9ca8b50c8f90f1531e1f39a3884
+++ Attic/doc/examples/x509info.cpp df788151a6e458f630dee2691b9d4c0aa42b94e2
@@ -69,6 +69,9 @@ int main(int argc, char* argv[])
do_subject(cert, "Locality");
do_subject(cert, "State");
do_subject(cert, "Country");
+ do_subject(cert, "IP");
+ do_subject(cert, "DNS");
+ do_subject(cert, "URI");
do_subject(cert, "PKIX.XMPPAddr");
std::cout << "Issuer" << std::endl;
@@ -79,6 +82,9 @@ int main(int argc, char* argv[])
do_issuer(cert, "Locality");
do_issuer(cert, "State");
do_issuer(cert, "Country");
+ do_issuer(cert, "IP");
+ do_issuer(cert, "DNS");
+ do_issuer(cert, "URI");
std::cout << "Validity" << std::endl;
============================================================
--- Attic/doc/logs/log-17.txt 84160a4ac4d5f5263cb455fde8e8c8d562008aab
+++ Attic/doc/logs/log-17.txt 10451beb53e5ecc4ce9878b017750fe7bb0a2857
@@ -1,5 +1,15 @@
-* 1.7.2, Oct 13, 2007
+* 1.7.3, January 23, 2008
+ - New invocation syntax for configure.pl with several new options
+ - Support for IPv4 addresses in a subject alternative name
+ - New fast poll for the generic Unix entropy source (es_unix)
+ - The es_file entropy source has been replaced by the es_dev module
+ - The malloc allocator does not inherit from Pooling_Allocator anymore
+ - The path that es_unix will search in are now fully user-configurable
+ - Truncate X9.42 PRF output rather than allow counter overflow
+ - PowerPC is now assumed to be big-endian
+
+* 1.7.2, October 13, 2007
- Initialize the global library state lazily
- Add plain CBC-MAC for backwards compatability with old systems
- Clean up some of the self test code
============================================================
--- Attic/include/idea.h d7276b98289143c01e8cee8c693ba8f7b441f44c
+++ Attic/include/idea.h 6628f852d9edb773c8e06a3322a35923b09b70f4
@@ -24,7 +24,6 @@ class IDEA : public BlockCipher
void enc(const byte[], byte[]) const;
void dec(const byte[], byte[]) const;
void key(const byte[], u32bit);
- static u16bit mul_inv(u16bit);
SecureBuffer<u16bit, 52> EK, DK;
};
============================================================
--- Attic/misc/config/arch/alpha eb4385b12908208ea2f42b048c8401e5a029e734
+++ Attic/misc/config/arch/alpha 3ddceecf33d3c312c6e88ff806473f0a3312d8af
@@ -1,6 +1,7 @@ default_submodel alpha-ev5
realname "DEC Alpha"
default_submodel alpha-ev5
+endian little
<aliases>
axp
============================================================
--- Attic/misc/config/arch/amd64 0bf63f53099d9804fc351f00c0a60c53199c8b28
+++ Attic/misc/config/arch/amd64 ea841b88c03ac99e1d6f4b266e9edd08297c7ef1
@@ -3,6 +3,7 @@ endian little
default_submodel amd64
endian little
+unaligned ok
<aliases>
x86-64
============================================================
--- Attic/misc/config/arch/ia32 2cea203db7576d32a3134dc45035afde3a9a800b
+++ Attic/misc/config/arch/ia32 37777964e179c7f27e0ce9f2d58284dabe5cfadf
@@ -1,8 +1,9 @@ realname "IA-32"
realname "IA-32"
-default_submodel i586
+default_submodel i686
endian little
+unaligned ok
<aliases>
x86
============================================================
--- Attic/misc/config/arch/ppc 6f25b71193852853d831ad6ac090c901ab49fc85
+++ Attic/misc/config/arch/ppc 54a4538daebdb62bbf94ebc68739e2340053546a
@@ -1,5 +1,7 @@ realname "PowerPC"
realname "PowerPC"
+endian big
+
# G3; probably a reasonable assumption these days
default_submodel ppc740
============================================================
--- Attic/misc/config/arch/ppc64 010e54c3e6478fe6dc4b1d2962ebd41256ef260d
+++ Attic/misc/config/arch/ppc64 126d245d29863c6f1683232536070357b55a3261
@@ -1,5 +1,7 @@ realname "PowerPC 64"
realname "PowerPC 64"
+endian big
+
default_submodel power4
<submodel_aliases>
============================================================
--- Attic/misc/config/cc/bcc ee7774c89526db32c71edec4b46e39c618b9e636
+++ Attic/misc/config/cc/bcc 561513b32f972726cc0e9a83213e33debef2f95f
@@ -26,11 +26,3 @@ pentium4 -> "/G6"
athlon -> "/G6"
pentium4 -> "/G6"
</mach_opt>
-
-<arch>
-ia32
-</arch>
-
-<os>
-windows
-</os>
============================================================
--- Attic/misc/config/cc/compaq 0d19d1445db032754b13b5a92aaf79f161168ed7
+++ Attic/misc/config/cc/compaq 5b855b2566a3778a208de0f3950299bf71c60b08
@@ -24,12 +24,3 @@ alpha -> "-arch=SUBMODEL" alpha-
<mach_opt>
alpha -> "-arch=SUBMODEL" alpha-
</mach_opt>
-
-<arch>
-alpha
-</arch>
-
-<os>
-tru64
-linux
-</os>
============================================================
--- Attic/misc/config/cc/ekopath 54df4f6c355b56ff537db7e429024428da3a6300
+++ Attic/misc/config/cc/ekopath 5e065967f6749183e09a69826d804c12c67ce362
@@ -35,12 +35,3 @@ amd64 -> "-mcpu=athlon64"
ia32 -> "-mcpu=anyx86"
amd64 -> "-mcpu=athlon64"
</mach_opt>
-
-<os>
-linux
-</os>
-
-<arch>
-ia32
-amd64
-</arch>
============================================================
--- Attic/misc/config/cc/gcc 8f5871a7933c06c3db66c6ae748acedc28de85a9
+++ Attic/misc/config/cc/gcc f57864620e4b61197536ad20ab5f07f44811245a
@@ -81,39 +81,3 @@ qnx -> "-fexceptions -D_QNX_SOURCE"
netbsd -> "-pthread"
qnx -> "-fexceptions -D_QNX_SOURCE"
</mach_abi_linking>
-
-<os>
-aix
-beos
-cygwin
-darwin
-freebsd
-hpux
-irix
-linux
-netbsd
-openbsd
-qnx
-solaris
-tru64
-windows
-</os>
-
-<arch>
-alpha
-amd64
-arm
-hppa
-ia32
-ia64
-m68k
-mips32
-mips64
-ppc
-ppc64
-s390
-s390x
-sh
-sparc32
-sparc64
-</arch>
============================================================
--- Attic/misc/config/cc/hpcc 0f6eb059dec345100593082d9fb744ae42f0e9dd
+++ Attic/misc/config/cc/hpcc fe395425b4097070162a67b827d43ecfb392287e
@@ -27,11 +27,3 @@ default -> "$(CXX) +Z -b -Wl,+h,$(SONAME
<so_link_flags>
default -> "$(CXX) +Z -b -Wl,+h,$(SONAME)" # Documented in cc(1), but not CC(1) (?)
</so_link_flags>
-
-<arch>
-hppa
-</arch>
-
-<os>
-hpux
-</os>
============================================================
--- Attic/misc/config/cc/icc df7c425f180f6d8f159eccd5b5cda87ae79b20f4
+++ Attic/misc/config/cc/icc 7f8af2a729b9a249412a5f392b68708d760e15cf
@@ -1,6 +1,6 @@ realname "Intel C++"
realname "Intel C++"
-binary_name "icc"
+binary_name "icpc"
compile_option "-c "
output_to_option "-o "
@@ -11,30 +11,20 @@ debug_flags "-g"
lib_opt_flags "-O3 -ip -unroll"
check_opt_flags "-O2"
debug_flags "-g"
-no_debug_flags ""
+no_debug_flags "-fomit-frame-pointer"
lang_flags ""
warning_flags "-w1"
-so_obj_flags "-KPIC"
+so_obj_flags "-fPIC"
makefile_style unix
<mach_opt>
-i586 -> "-tpp5"
-i686 -> "-tpp6 -xiM"
-athlon -> "-tpp6 -xiM"
-pentium4 -> "-tpp7 -xiMW"
+i686 -> "-march=pentium3"
+athlon -> "-march=pentium3"
+pentium4 -> "-march=pentium4"
+core2duo -> "-msse3"
</mach_opt>
<so_link_flags>
-default -> "$(CXX) -KPIC -shared"
+default -> "$(CXX) -fPIC -shared"
</so_link_flags>
-
-<arch>
-amd64
-ia32
-ia64
-</arch>
-
-<os>
-linux
-</os>
============================================================
--- Attic/misc/config/cc/kai 9436c4c4dd6486c6982dd86e091830900ace9d56
+++ Attic/misc/config/cc/kai 61a0afad96346a53d75843a0e3c775e263365885
@@ -25,22 +25,3 @@ all -> "--one_per"
<mach_abi_linking>
all -> "--one_per"
</mach_abi_linking>
-
-<arch>
-alpha
-hppa
-ia32
-mips32
-mips64
-sparc32
-sparc64
-</arch>
-
-<os>
-hpux
-irix
-linux
-solaris
-tru64
-</os>
-
============================================================
--- Attic/misc/config/cc/mipspro c568b9c5fa321db7de3045e21c86bdaaad913c8c
+++ Attic/misc/config/cc/mipspro 83a382a4c5c89c79124aaa5fea9543b9934a61e9
@@ -37,12 +37,3 @@ mips64 -> "-64"
mips32 -> "-n32"
mips64 -> "-64"
</mach_abi_linking>
-
-<arch>
-mips32
-mips64
-</arch>
-
-<os>
-irix
-</os>
============================================================
--- Attic/misc/config/cc/msvc a518e200b92423fc58f0c78eafea50e4395799e2
+++ Attic/misc/config/cc/msvc f0fcdde68fcd833622fcb77df697118fd84bf3ff
@@ -10,7 +10,7 @@ check_opt_flags "/O2"
lib_opt_flags "/O2 /Ob2"
check_opt_flags "/O2"
-debug_flags ""
+debug_flags "/Zi"
no_debug_flags ""
lang_flags "/EHsc /GR /D_CONSOLE"
warning_flags ""
@@ -18,11 +18,3 @@ makefile_style nmake
ar_command "link /lib"
makefile_style nmake
-
-<arch>
-ia32
-</arch>
-
-<os>
-windows
-</os>
============================================================
--- Attic/misc/config/cc/pgi 55504c4febd8030685b52c149e4ca76cea0bb29d
+++ Attic/misc/config/cc/pgi 35dc70b946b7aa83deb8bf26560fa8ca40680c6e
@@ -26,12 +26,3 @@ ia32 -> "-tp px"
pentium4 -> "-tp p6"
ia32 -> "-tp px"
</mach_opt>
-
-<arch>
-ia32
-</arch>
-
-<os>
-linux
-solaris
-</os>
============================================================
--- Attic/misc/config/cc/sgipro64 66a21eb000bff03771e5e0b1bbf0fdc910e5b195
+++ Attic/misc/config/cc/sgipro64 564ca86eb93141bee356b540e38aff20570ee977
@@ -25,11 +25,3 @@ default -> "$(CXX) -shared -Wl,-soname,$
<mach_opt>
</mach_opt>
-
-<arch>
-ia64
-</arch>
-
-<os>
-linux
-</os>
============================================================
--- Attic/misc/config/cc/sunwspro 9720af2d645f294070c78d697d6d872135ebc71c
+++ Attic/misc/config/cc/sunwspro bdb44bb25abc0086d1c78c0b2efed958e614f8b6
@@ -41,13 +41,3 @@ sparc64 -> "-xarch=v9"
<mach_abi_linking>
sparc64 -> "-xarch=v9"
</mach_abi_linking>
-
-<arch>
-ia32
-sparc32
-sparc64
-</arch>
-
-<os>
-solaris
-</os>
============================================================
--- Attic/misc/config/os/aix 564e370d3fca850949786c8b3cd8a359c3db54cc
+++ Attic/misc/config/os/aix 1ae489a4423d56d58cdfa6a2c3ec5c52a8e044f4
@@ -5,9 +5,3 @@ all
<supports_shared>
all
</supports_shared>
-
-<arch>
-ia64
-ppc
-ppc64
-</arch>
============================================================
--- Attic/misc/config/os/beos a0090a5297ed96bdd71318721022e3dc9f454c6e
+++ Attic/misc/config/os/beos 1bb820a522401f7aaa56bead761b6e6c29fa9626
@@ -11,11 +11,6 @@ all
all
</supports_shared>
-<arch>
-ia32
-ppc
-</arch>
-
<aliases>
haiku
</aliases>
============================================================
--- Attic/misc/config/os/cygwin b98e7c0405f1497345e71ba2fe37dc1c596dcda6
+++ Attic/misc/config/os/cygwin da74ebac5f9ddd009c73255200998cb25295e830
@@ -11,9 +11,3 @@ doc_dir docs
<supports_shared>
#all
</supports_shared>
-
-<arch>
-ia32
-amd64 # in theory
-ia64 # in theory
-</arch>
============================================================
--- Attic/misc/config/os/freebsd 006ab197d32eea63361257fe1d9dcc639fd44313
+++ Attic/misc/config/os/freebsd d7d4d7710c19332222b65f041853c5fb10617259
@@ -7,12 +7,3 @@ all
<supports_shared>
all
</supports_shared>
-
-<arch>
-alpha
-amd64
-ia32
-ia64
-powerpc
-sparc64
-</arch>
============================================================
--- Attic/misc/config/os/hpux 49b209ede76c5c055c200c68b27ac3facd3eff31
+++ Attic/misc/config/os/hpux 3259c76e44c088eb2c46c104e4628fde63841e8f
@@ -8,11 +8,6 @@ all
all
</supports_shared>
-<arch>
-hppa
-ia64
-</arch>
-
<aliases>
hp-ux
</aliases>
============================================================
--- Attic/misc/config/os/irix a62b658f50c62adf9830785f5443137430a4b66c
+++ Attic/misc/config/os/irix cc8d00e11363d56828dd5b1084ff3af9e9bb76fd
@@ -5,9 +5,3 @@ all
<supports_shared>
all
</supports_shared>
-
-<arch>
-mips32
-mips64
-</arch>
-
============================================================
--- Attic/misc/config/os/linux ac26a526ad7af05b54d08a5383b3219e4e7d8629
+++ Attic/misc/config/os/linux 566c9d6827c1ea19baabb82d547a6231d18fca45
@@ -6,22 +6,3 @@ all
<supports_shared>
all
</supports_shared>
-
-<arch>
-alpha
-amd64
-arm
-hppa
-ia32
-ia64
-m68k
-mips32
-mips64
-ppc
-ppc64
-sh
-sparc32
-sparc64
-s390
-s390x
-</arch>
============================================================
--- Attic/misc/config/os/netbsd ac1a9307aec68c1ac997893105649bd7fc687eb1
+++ Attic/misc/config/os/netbsd c09645e6aab081667e61307d0536b0adc15186b9
@@ -7,17 +7,3 @@ all
<supports_shared>
all
</supports_shared>
-
-<arch>
-alpha
-amd64
-arm
-hppa
-ia32
-ia64
-m68k
-mips32
-mips64
-ppc
-sparc32
-</arch>
============================================================
--- Attic/misc/config/os/openbsd 0d2465d745a65c18bc10321b0d74d3f3c19f2411
+++ Attic/misc/config/os/openbsd d1cf34508f82296b77ac1c05a2b8e4ec0e9ef8f7
@@ -7,13 +7,3 @@ all
<supports_shared>
all
</supports_shared>
-
-<arch>
-alpha
-ia32
-m68k
-mips32
-ppc
-sparc32
-sparc64
-</arch>
============================================================
--- Attic/misc/config/os/qnx e3aacf5eb51a9636a43d5da7e430ae88ae736fba
+++ Attic/misc/config/os/qnx 7a8fa58bccdf45e7aacadf9c48ba2c21c75af46e
@@ -5,11 +5,3 @@ all
<supports_shared>
all
</supports_shared>
-
-<arch>
-arm
-ia32
-mips32
-ppc
-sh
-</arch>
============================================================
--- Attic/misc/config/os/solaris 25977d770ed58bd5d262aae613cca6f0aadeb419
+++ Attic/misc/config/os/solaris 42ccff72aea7d428a33b639eda96e613cc4c33ea
@@ -9,12 +9,6 @@ all
all
</supports_shared>
-<arch>
-ia32
-sparc32
-sparc64
-</arch>
-
<aliases>
sunos
</aliases>
============================================================
--- Attic/misc/config/os/tru64 614b02f2934db3f90258879dcc57514f151a0e7b
+++ Attic/misc/config/os/tru64 c9f88ca6171640c19f649b8ce5f0b5a44c6f2a02
@@ -6,10 +6,6 @@ all
all
</supports_shared>
-<arch>
-alpha
-</arch>
-
<aliases>
osf1
</aliases>
============================================================
--- Attic/misc/config/os/windows de615c9122334f20e2671a5994988e33a3391d1f
+++ Attic/misc/config/os/windows e36531bad64840b7551ca36b03f8063fa24155ff
@@ -19,12 +19,7 @@ install_group <nil>
#all
</supports_shared>
-<arch>
-ia32
-amd64 # in theory
-ia64 # in theory
-</arch>
-
<aliases>
win32
+mswin32
</aliases>
============================================================
--- Attic/modules/alg_amd64/modinfo.txt 0a765bd257f37a2959ec10d20a9299beffb737ae
+++ Attic/modules/alg_amd64/modinfo.txt 52b990d379b77248d5ea65ed9b09df88ead61c54
@@ -2,7 +2,7 @@
mp_bits 64
-load_on: asm_ok
+load_on asm_ok
<replace>
sha160.cpp
============================================================
--- Attic/modules/alg_amd64/sha160.cpp 929af7129275293ff09089a5c13ecfa8927eec0e
+++ Attic/modules/alg_amd64/sha160.cpp 7790c310c1e94695697b419c01ca377d28e349ce
@@ -4,7 +4,7 @@
*************************************************/
#include <botan/sha160.h>
-#include <botan/bit_ops.h>
+#include <botan/loadstor.h>
namespace Botan {
============================================================
--- Attic/modules/alg_ia32/md4.cpp a3200965bd266d764dbb756f3b04d6ab0f7eaa26
+++ Attic/modules/alg_ia32/md4.cpp 95cdb5536b45f2095b354eaadcc271d82516e593
@@ -4,7 +4,7 @@
*************************************************/
#include <botan/md4.h>
-#include <botan/bit_ops.h>
+#include <botan/loadstor.h>
namespace Botan {
============================================================
--- Attic/modules/alg_ia32/md5.cpp 4bc9628347a05ba9c49bf4551f808c898708490a
+++ Attic/modules/alg_ia32/md5.cpp cfbeef8d027c44e1e760cb13df19da659557b28f
@@ -4,7 +4,7 @@
*************************************************/
#include <botan/md5.h>
-#include <botan/bit_ops.h>
+#include <botan/loadstor.h>
namespace Botan {
============================================================
--- Attic/modules/alg_ia32/modinfo.txt 99d0df3d5eb6c0b2cfbc26f79da54a6c6f0ca9ab
+++ Attic/modules/alg_ia32/modinfo.txt a30d4e1a048c23d047d2d3ef64f5943d44e98c36
@@ -2,7 +2,7 @@
mp_bits 32
-load_on: asm_ok
+load_on asm_ok
<replace>
md4.cpp
============================================================
--- Attic/modules/alg_ia32/serpent.cpp ec9b23077080da7c8d62a6cf3271cb9df18e5dc4
+++ Attic/modules/alg_ia32/serpent.cpp 688eb00d15b7833f8972653d056be1e235496189
@@ -4,7 +4,7 @@
*************************************************/
#include <botan/serpent.h>
-#include <botan/bit_ops.h>
+#include <botan/loadstor.h>
namespace Botan {
============================================================
--- Attic/modules/alg_ia32/sha160.cpp 9b4ec6eca3c9909f97700f85d9d66b39d66d3373
+++ Attic/modules/alg_ia32/sha160.cpp 239c517b749e4a5c7b8694214c187a9730e85e6a
@@ -4,7 +4,7 @@
*************************************************/
#include <botan/sha160.h>
-#include <botan/bit_ops.h>
+#include <botan/loadstor.h>
namespace Botan {
============================================================
--- Attic/modules/alloc_mmap/mmap_mem.cpp 19ff049ea80042cf62e1f02ede47004f3acf048a
+++ Attic/modules/alloc_mmap/mmap_mem.cpp 90dffa50c3f59b20772e0379feb38610a4bd0441
@@ -59,15 +59,15 @@ void* MemoryMapping_Allocator::alloc_blo
filepath = new char[path.length() + 1];
std::strcpy(filepath, path.c_str());
- mode_t old_umask = umask(077);
- fd = mkstemp(filepath);
- umask(old_umask);
+ mode_t old_umask = ::umask(077);
+ fd = ::mkstemp(filepath);
+ ::umask(old_umask);
}
~TemporaryFile()
{
delete[] filepath;
- if(fd != -1 && close(fd) == -1)
+ if(fd != -1 && ::close(fd) == -1)
throw MemoryMapping_Failed("Could not close file");
}
private:
@@ -80,15 +80,15 @@ void* MemoryMapping_Allocator::alloc_blo
if(file.get_fd() == -1)
throw MemoryMapping_Failed("Could not create file");
- if(unlink(file.path().c_str()))
- throw MemoryMapping_Failed("Could not unlink file " + file.path());
+ if(::unlink(file.path().c_str()))
+ throw MemoryMapping_Failed("Could not unlink file '" + file.path() + "'");
- lseek(file.get_fd(), n-1, SEEK_SET);
- if(write(file.get_fd(), "\0", 1) != 1)
+ ::lseek(file.get_fd(), n-1, SEEK_SET);
+ if(::write(file.get_fd(), "\0", 1) != 1)
throw MemoryMapping_Failed("Could not write to file");
- void* ptr = mmap(0, n, PROT_READ | PROT_WRITE, MAP_SHARED,
- file.get_fd(), 0);
+ void* ptr = ::mmap(0, n, PROT_READ | PROT_WRITE, MAP_SHARED,
+ file.get_fd(), 0);
if(ptr == static_cast<void*>(MAP_FAILED))
throw MemoryMapping_Failed("Could not map file");
@@ -101,23 +101,21 @@ void MemoryMapping_Allocator::dealloc_bl
*************************************************/
void MemoryMapping_Allocator::dealloc_block(void* ptr, u32bit n)
{
- if(ptr == 0) return;
+ if(ptr == 0)
+ return;
- const u32bit OVERWRITE_PASSES = 12;
const byte PATTERNS[] = { 0x00, 0xFF, 0xAA, 0x55, 0x73, 0x8C, 0x5F, 0xA0,
- 0x6E, 0x91, 0x30, 0xCF, 0xD3, 0x2C, 0xAC, 0x53 };
+ 0x6E, 0x91, 0x30, 0xCF, 0xD3, 0x2C, 0xAC, 0x00 };
- for(u32bit j = 0; j != OVERWRITE_PASSES; j++)
+ for(u32bit j = 0; j != sizeof(PATTERNS); j++)
{
- std::memset(ptr, PATTERNS[j % sizeof(PATTERNS)], n);
- if(msync(ptr, n, MS_SYNC))
+ std::memset(ptr, PATTERNS[j], n);
+
+ if(::msync(ptr, n, MS_SYNC))
throw MemoryMapping_Failed("Sync operation failed");
}
- std::memset(ptr, 0, n);
- if(msync(ptr, n, MS_SYNC))
- throw MemoryMapping_Failed("Sync operation failed");
- if(munmap(ptr, n))
+ if(::munmap(ptr, n))
throw MemoryMapping_Failed("Could not unmap file");
}
============================================================
--- Attic/modules/alloc_mmap/modinfo.txt d36d112666314144a5aa817fc24738e9aea91a8a
+++ Attic/modules/alloc_mmap/modinfo.txt 13c7ed238e98cfb2cee3234a0ccb669b882f998f
@@ -1,8 +1,9 @@
realname "Disk Based Allocation System"
define ALLOC_MMAP
+modset unix
-load_on: auto
+load_on auto
<add>
mmap_mem.cpp
============================================================
--- Attic/modules/comp_bzip2/modinfo.txt 85bf9ca722bf07022effa03bfb357136e4c56cfa
+++ Attic/modules/comp_bzip2/modinfo.txt 2b56ddd0377539a229214eafdc69ae60b5dd6b0b
@@ -3,8 +3,9 @@
realname "Bzip2 Compressor"
define COMPRESSOR_BZIP2
+modset compression
-load_on: request
+load_on request
<add>
bzip2.h
============================================================
--- Attic/modules/comp_zlib/modinfo.txt 5f5620f37503b158951092000b1b72dc1b3b7d82
+++ Attic/modules/comp_zlib/modinfo.txt 104016f30a3f87aac823196c70ba7ef61b2739ca
@@ -4,7 +4,8 @@
define COMPRESSOR_ZLIB
#define COMPRESSOR_ZLIB,COMPRESSOR_GZIP
-load_on: request
+load_on request
+modset compression
<add>
zlib.h
============================================================
--- Attic/modules/comp_zlib/zlib.cpp 9d1bffb2c1a97d0a748728fc71149915b800626d
+++ Attic/modules/comp_zlib/zlib.cpp 97d5fe2639e150906b8ed7beedf13174ea1be78c
@@ -97,12 +97,12 @@ void Zlib_Compression::write(const byte
*************************************************/
void Zlib_Compression::write(const byte input[], u32bit length)
{
- zlib->stream.next_in = (Bytef*)input;
+ zlib->stream.next_in = static_cast<Bytef*>(input);
zlib->stream.avail_in = length;
while(zlib->stream.avail_in != 0)
{
- zlib->stream.next_out = (Bytef*)buffer.begin();
+ zlib->stream.next_out = static_cast<Bytef*>(buffer.begin());
zlib->stream.avail_out = buffer.size();
deflate(&(zlib->stream), Z_NO_FLUSH);
send(buffer.begin(), buffer.size() - zlib->stream.avail_out);
@@ -120,7 +120,7 @@ void Zlib_Compression::end_msg()
int rc = Z_OK;
while(rc != Z_STREAM_END)
{
- zlib->stream.next_out = (Bytef*)buffer.begin();
+ zlib->stream.next_out = static_cast<Bytef*>(buffer.begin());
zlib->stream.avail_out = buffer.size();
rc = deflate(&(zlib->stream), Z_FINISH);
send(buffer.begin(), buffer.size() - zlib->stream.avail_out);
@@ -138,7 +138,7 @@ void Zlib_Compression::flush()
while(true)
{
- zlib->stream.next_out = (Bytef*)buffer.begin();
+ zlib->stream.next_out = static_cast<Bytef*>(buffer.begin());
zlib->stream.avail_out = buffer.size();
deflate(&(zlib->stream), Z_FULL_FLUSH);
send(buffer.begin(), buffer.size() - zlib->stream.avail_out);
@@ -188,12 +188,12 @@ void Zlib_Decompression::write(const byt
{
if(length) no_writes = false;
- zlib->stream.next_in = (Bytef*)input;
+ zlib->stream.next_in = static_cast<Bytef*>(input;
zlib->stream.avail_in = length;
while(zlib->stream.avail_in != 0)
{
- zlib->stream.next_out = (Bytef*)buffer.begin();
+ zlib->stream.next_out = static_cast<Bytef*>(buffer.begin();
zlib->stream.avail_out = buffer.size();
int rc = inflate(&(zlib->stream), Z_SYNC_FLUSH);
@@ -213,7 +213,7 @@ void Zlib_Decompression::write(const byt
{
u32bit read_from_block = length - zlib->stream.avail_in;
start_msg();
- zlib->stream.next_in = (Bytef*)input + read_from_block;
+ zlib->stream.next_in = static_cast<Bytef*>(input + read_from_block;
zlib->stream.avail_in = length - read_from_block;
input += read_from_block;
length -= read_from_block;
@@ -233,7 +233,7 @@ void Zlib_Decompression::end_msg()
int rc = Z_OK;
while(rc != Z_STREAM_END)
{
- zlib->stream.next_out = (Bytef*)buffer.begin();
+ zlib->stream.next_out = static_cast<Bytef*>(buffer.begin();
zlib->stream.avail_out = buffer.size();
rc = inflate(&(zlib->stream), Z_SYNC_FLUSH);
if(rc != Z_OK && rc != Z_STREAM_END)
============================================================
--- Attic/modules/eng_aep/modinfo.txt c6c85c43e35cb4f019eeeeb055ddb5eb9dc83748
+++ Attic/modules/eng_aep/modinfo.txt 5c9e56bd0a4331c14d9f960fe16c33c6c4f5a141
@@ -2,7 +2,7 @@
define ENGINE_AEP,ENTROPY_SRC_AEP
-load_on: request
+load_on request
<add>
eng_aep.cpp
============================================================
--- Attic/modules/eng_gmp/modinfo.txt 11311582ba7dfe4746dff64496b75b369eec97bf
+++ Attic/modules/eng_gmp/modinfo.txt fad564f7f180df6bb1f62e58a6d7d1468e27c7b0
@@ -2,7 +2,7 @@
define ENGINE_GNU_MP
-load_on: request
+load_on request
<add>
eng_gmp.cpp
============================================================
--- Attic/modules/eng_ossl/modinfo.txt 8f79388a72fdf29e9395edcc8e997efda201d79d
+++ Attic/modules/eng_ossl/modinfo.txt 2b5cf08954ca898aab69f10d95b5ec908d3d97e8
@@ -2,7 +2,7 @@
define ENGINE_OPENSSL
-load_on: request
+load_on request
<add>
eng_ossl.cpp
============================================================
--- Attic/modules/es_beos/modinfo.txt d0a5ef440b6013c1f82e6a39031c78f30e3fadd6
+++ Attic/modules/es_beos/modinfo.txt 139290a57dfa41e67206141d01fcc3ddda29b852
@@ -1,8 +1,9 @@
realname "BeOS Entropy Source"
define ENTROPY_SRC_BEOS
+modset beos
-load_on: auto
+load_on auto
<add>
es_beos.h
============================================================
--- Attic/modules/es_capi/modinfo.txt a467873f02e52e8e4ba8a88e67fb2c388fc4bfad
+++ Attic/modules/es_capi/modinfo.txt 30e09336bd70f66edfc3953f72f0cae2e2d50991
@@ -1,9 +1,9 @@
realname "Win32 CryptoAPI Entropy Source"
define ENTROPY_SRC_CAPI
+load_on auto
+modset win32
-load_on: auto
-
<add>
es_capi.h
es_capi.cpp
============================================================
--- Attic/modules/es_egd/modinfo.txt 849799afc6c979db47632b1e12674feea8433633
+++ Attic/modules/es_egd/modinfo.txt 11617d320ffae85830cfc628f3cd34be3a4d7b0a
@@ -2,7 +2,8 @@
define ENTROPY_SRC_EGD
-load_on: auto
+load_on auto
+modset unix
<add>
es_egd.h
============================================================
--- Attic/modules/es_ftw/es_ftw.cpp 6b9dc7cec896eed27ff456d7a2e4df9947eae598
+++ Attic/modules/es_ftw/es_ftw.cpp 459d8f0d2ed22f05bf43a2fc5071457e7621448c
@@ -56,32 +56,32 @@ void FTW_EntropySource::gather_from_dir(
if(dirname == "" || files_read >= max_read)
return;
- DIR* dir = opendir(dirname.c_str());
+ DIR* dir = ::opendir(dirname.c_str());
if(dir == 0)
return;
std::vector<std::string> subdirs;
- dirent* entry = readdir(dir);
+ dirent* entry = ::readdir(dir);
while(entry && (files_read < max_read))
{
if((std::strcmp(entry->d_name, ".") == 0) ||
(std::strcmp(entry->d_name, "..") == 0))
- { entry = readdir(dir); continue; }
+ { entry = ::readdir(dir); continue; }
const std::string filename = dirname + '/' + entry->d_name;
- struct stat stat_buf;
- if(lstat(filename.c_str(), &stat_buf) == -1)
- { entry = readdir(dir); continue; }
+ struct ::stat stat_buf;
+ if(::lstat(filename.c_str(), &stat_buf) == -1)
+ { entry = ::readdir(dir); continue; }
if(S_ISREG(stat_buf.st_mode))
gather_from_file(filename);
else if(S_ISDIR(stat_buf.st_mode))
subdirs.push_back(filename);
- entry = readdir(dir);
+ entry = ::readdir(dir);
}
- closedir(dir);
+ ::closedir(dir);
for(u32bit j = 0; j != subdirs.size(); j++)
gather_from_dir(subdirs[j]);
@@ -98,7 +98,7 @@ void FTW_EntropySource::gather_from_file
SecureVector<byte> read_buf(1024);
ssize_t got = ::read(fd, read_buf.begin(), read_buf.size());
- close(fd);
+ ::close(fd);
if(got > 0)
{
============================================================
--- Attic/modules/es_ftw/modinfo.txt e768aa15a419357a4b137e2ef3ee65b4b376efdc
+++ Attic/modules/es_ftw/modinfo.txt 6027bf33c4f6c5bcf85d3e18bb38cd00b70c4a29
@@ -2,7 +2,8 @@
define ENTROPY_SRC_FTW
-load_on: auto
+load_on auto
+modset unix
<add>
es_ftw.h
============================================================
--- Attic/modules/es_unix/es_unix.cpp ad762ad2d503283d87ccf89b8c6d3aebb1885c7d
+++ Attic/modules/es_unix/es_unix.cpp c38a7e079734811eb5804cae88ce3551a60f0067
@@ -8,6 +8,10 @@
#include <botan/parsing.h>
#include <botan/config.h>
#include <algorithm>
+#include <sys/time.h>
+#include <sys/stat.h>
+#include <sys/resource.h>
+#include <unistd.h>
namespace Botan {
@@ -43,7 +47,35 @@ void Unix_EntropySource::do_fast_poll()
*************************************************/
void Unix_EntropySource::do_fast_poll()
{
- gather(2*1024);
+ const char* STAT_TARGETS[] = { "/", "/tmp", ".", "..", 0 };
+
+ for(u32bit j = 0; STAT_TARGETS[j]; j++)
+ {
+ struct ::stat statbuf;
+ clear_mem(&statbuf, 1);
+ ::stat(STAT_TARGETS[j], &statbuf);
+ add_bytes(&statbuf, sizeof(statbuf));
+ }
+
+ add_bytes(::getpid());
+ add_bytes(::getppid());
+
+ add_bytes(::getuid());
+ add_bytes(::getgid());
+ add_bytes(::geteuid());
+ add_bytes(::getegid());
+
+ add_bytes(::getpgrp());
+ add_bytes(::getsid(0));
+
+ struct ::rusage usage;
+
+ clear_mem(&usage, 1);
+ ::getrusage(RUSAGE_SELF, &usage);
+ add_bytes(&usage, sizeof(usage));
+
+ ::getrusage(RUSAGE_CHILDREN, &usage);
+ add_bytes(&usage, sizeof(usage));
}
/*************************************************
@@ -51,56 +83,34 @@ void Unix_EntropySource::do_slow_poll()
*************************************************/
void Unix_EntropySource::do_slow_poll()
{
- gather(16*1024);
- }
-
-/*************************************************
-* Gather Entropy From Several Unix_Programs *
-*************************************************/
-void Unix_EntropySource::gather(u32bit target_amount)
- {
+ const u32bit TRY_TO_GET = 16 * 1024;
const u32bit MINIMAL_WORKING = 32;
+ const std::string PATH = global_config().option("rng/unix_path");
+
u32bit got = 0;
for(u32bit j = 0; j != sources.size(); j++)
{
add_timestamp();
- got += gather_from(sources[j]);
- sources[j].working = (got >= MINIMAL_WORKING) ? true : false;
+ DataSource_Command pipe(sources[j].name_and_args, PATH);
+ SecureVector<byte> buffer(DEFAULT_BUFFERSIZE);
- if(got >= target_amount)
- break;
- }
- }
+ u32bit got_from_src = 0;
-/*************************************************
-* Gather entropy from a Unix program *
-*************************************************/
-u32bit Unix_EntropySource::gather_from(const Unix_Program& prog)
- {
- const std::string BASE_PATH = "/bin:/sbin:/usr/bin:/usr/sbin";
- const std::string EXTRA_PATH = global_config().option("rng/unix_path");
+ while(!pipe.end_of_data())
+ {
+ u32bit this_loop = pipe.read(buffer, buffer.size());
+ add_bytes(buffer, this_loop);
+ got_from_src += this_loop;
+ }
- std::string PATH = BASE_PATH;
- if(EXTRA_PATH != "")
- PATH += ':' + EXTRA_PATH;
+ sources[j].working = (got_from_src >= MINIMAL_WORKING) ? true : false;
+ got += got_from_src;
- DataSource_Command pipe(prog.name_and_args, PATH);
- if(pipe.end_of_data())
- return 0;
-
- u32bit got = 0;
- SecureVector<byte> buffer(DEFAULT_BUFFERSIZE);
-
- while(!pipe.end_of_data())
- {
- u32bit this_loop = pipe.read(buffer, buffer.size());
- add_bytes(buffer, this_loop);
- got += this_loop;
+ if(got >= TRY_TO_GET)
+ break;
}
-
- return got;
}
}
============================================================
--- Attic/modules/es_unix/es_unix.h 0900062e6f972b8f330586f55368935d2b8ca8cb
+++ Attic/modules/es_unix/es_unix.h c6f4f65433c9dda0d02f50297bd664ffcf79b907
@@ -21,11 +21,10 @@ class Unix_EntropySource : public Buffer
void add_sources(const Unix_Program[], u32bit);
Unix_EntropySource();
private:
+ static void add_default_sources(std::vector<Unix_Program>&);
+
void do_fast_poll();
void do_slow_poll();
- void gather(u32bit);
- u32bit gather_from(const Unix_Program&);
- static void add_default_sources(std::vector<Unix_Program>&);
std::vector<Unix_Program> sources;
};
============================================================
--- Attic/modules/es_unix/modinfo.txt fa9c67a4f4768aa0c066a9cab02c01ef02695b66
+++ Attic/modules/es_unix/modinfo.txt 699f5e83d950612894d82a31d9440fcfd05ea41d
@@ -1,8 +1,9 @@
realname "Generic Unix Entropy Source"
define ENTROPY_SRC_UNIX
+modset unix,beos
-load_on: auto
+load_on auto
<add>
es_unix.cpp
============================================================
--- Attic/modules/es_unix/unix_cmd.cpp e749e0619b750a2faf429dcd44fc030f344fd280
+++ Attic/modules/es_unix/unix_cmd.cpp dfc8ffbdea62adae0385bc25265132e96e865c34
@@ -41,7 +41,7 @@ void do_exec(const std::vector<std::stri
{
const std::string full_path = paths[j] + "/" + arg_list[0];
const char* fsname = full_path.c_str();
- execl(fsname, fsname, arg1, arg2, arg3, arg4, 0);
+ ::execl(fsname, fsname, arg1, arg2, arg3, arg4, 0);
}
}
@@ -69,12 +69,12 @@ u32bit DataSource_Command::read(byte buf
FD_ZERO(&set);
FD_SET(pipe->fd, &set);
- struct timeval tv;
+ struct ::timeval tv;
tv.tv_sec = 0;
tv.tv_usec = MAX_BLOCK_USECS;
ssize_t got = 0;
- if(select(pipe->fd + 1, &set, 0, 0, &tv) == 1)
+ if(::select(pipe->fd + 1, &set, 0, 0, &tv) == 1)
{
if(FD_I