# # # delete_file "botan/socket.h" # # rename_file "botan/parse.cpp" # to "botan/parsing.cpp" # # add_file "botan/bit_ops.cpp" # # add_file "botan/bit_ops.h" # # add_file "botan/out_buf.cpp" # # add_file "botan/out_buf.h" # # add_file "botan/parsing.h" # # patch "ChangeLog" # from [985414350491d44328657fa434b43a5ec985620a] # to [1723c8f66a6941850af1c35870350c4b0547ba8f] # # patch "Makefile.am" # from [5d0b0887a0e4e41a42e3deb7f013179fcb5c7ad1] # to [283d3d90263c0a3791b0f2f82736301194bc2521] # # patch "botan/aes.cpp" # from [f544aa7fd0dca2a0a282736d62433f046fee78f2] # to [ea31ea6f8b2b7dc8edebeceaf6cd76dcea951c43] # # patch "botan/algolist.cpp" # from [1290df2bfa89a27a8f35e2ba3aa1e71cfe2a5ad4] # to [a64db024caeb5780d6ed92ce24942547b384c96e] # # patch "botan/arc4.cpp" # from [3eedab177bb0c069470419686212a1fd6f1d78ee] # to [7e17884686141d3b361384b0368c41ec4538411e] # # patch "botan/asn1.h" # from [0f625e8cacf2288438d5b9f336a89e88205ac868] # to [a15a8ffd094119897e5490f155ca642d31ef803e] # # patch "botan/asn1_alt.cpp" # from [a96db0b1830a1c2aae7d77a6ac0b5945f4398505] # to [2fc51199398f1163aee5a7b4d67e43824c7d4031] # # patch "botan/asn1_dn.cpp" # from [69534bf7311cb012090e0c9c0f64025dcadfc35c] # to [348a2b7b12c6a85b3cbb9e063781ed2112629072] # # patch "botan/asn1_ku.cpp" # from [43916185735c5d26bdc5fa1772698b8db315838b] # to [e6ef3eb1cd606ca2b6d063ffc7daa8dcb4f74fb6] # # patch "botan/asn1_oid.cpp" # from [bd982245f5f3d15f424be78f3383d77762f848d4] # to [e52090928114f5d6012df44b91b02c0c353cd2a2] # # patch "botan/asn1_str.cpp" # from [75c135f4178b8dfec1363b216049809919eb1435] # to [91c1b106a979607e99985bf4cc0b1378cf0d441a] # # patch "botan/asn1_tm.cpp" # from [69296df4a30b2b4d4213d6a78274f5a0f813e48c] # to [1c88ddb515e255c648e05944abf4eed36d03b518] # # patch "botan/barrett.cpp" # from [ea5008b06d86cd1f84a53bb3babec53e2f5973de] # to [395b61510758371148a68e79abb4806d1f6e2567] # # patch "botan/base.cpp" # from [782844d8ab6ab22b787eadda7392a3e23445662e] # to [6f45870998d3f60d680be03512d0ed1a40345316] # # patch "botan/base.h" # from [de06367b6bc1d60bfe3dbaeee2eb958757dbd0d1] # to [f15a3205c8851a4a7413154b940c1ba0cab9c66d] # # patch "botan/base64.cpp" # from [f8f825aa6ababa4d464f193348d429e8729c6cb8] # to [397126d19a42c0fb831b4201828be936e55fa2a5] # # patch "botan/basefilt.cpp" # from [c62ab8ed09c29b42cab4060b763eaa12f5ae4ed5] # to [18aab554ecbec7a50c1606b283c636e75f9bd1a9] # # patch "botan/basefilt.h" # from [dc993b59b350b86f39fd125e42c925c4067edd64] # to [ba3cd0d8a3f0dc1ddeab8a7641cac1eed8f8b2cd] # # patch "botan/ber_code.cpp" # from [41b67aa4c136a6acfe9757658dd4ccbb5d52c340] # to [5142a48f04a95643b2b6cbb273e3d72b9c66be5e] # # patch "botan/ber_dec.cpp" # from [85736204e607a95c150ee1a5e6b9ac1b82373349] # to [c15980c2152172bdd3f82953e8f631799512ff23] # # patch "botan/big_base.cpp" # from [6b393b5416c22430149721f291e3f6839239d3fb] # to [457e25de9b908c143815af89388f873a9ed57d1c] # # patch "botan/big_code.cpp" # from [9d421e837b118c241771431e97b8269a0049339a] # to [9b6b6e6f233069e72f4b621d7e2a867bbed3d5b1] # # patch "botan/big_ops2.cpp" # from [b951478dcd76378226809a907f402ec29abb43c3] # to [7cb04ca6277c03495e7e1035f4f0c5d3ca652e60] # # patch "botan/big_ops3.cpp" # from [7fcfc51d05c038b3cc268b9993c9140524d91afb] # to [033d775b361c8e20acd3d6b67faff41519e0a4d5] # # patch "botan/bit_ops.cpp" # from [] # to [d07b224e9e1d15bb7ce59d0a374e236cd803e895] # # patch "botan/bit_ops.h" # from [] # to [15f92e1769a8715806856e0d5a64b571779f44bc] # # patch "botan/botan.h" # from [e19178830bd4ceadbc977e8f54ce45f9f18c7ec4] # to [b67160e0ce2e91677445439823e4e020963551d9] # # patch "botan/buf_es.cpp" # from [22b201e4e9b1a2704dd762e5d8670d74790b53c8] # to [9d7a0ba8efe806a4088786015e31a41bcf73a433] # # patch "botan/cbc.cpp" # from [07356236e863c7453b30c33fbdb6a10507a02e24] # to [482ead7cd979dedb9264dee265141f3f62cd8b24] # # patch "botan/cfb.cpp" # from [fe3b9c70b199eb3671f1d1a7e678acf81be143ee] # to [fd5cc8fd41bf529237261b94a0c07749130aa71f] # # patch "botan/conf.cpp" # from [a4d66f1f29a263d401e17af592c184131422f682] # to [5f2a4cb8d45511ae6ee082231974fc5da0150ef4] # # patch "botan/conf.h" # from [71b0151c64d71a4a3450a0fad05fc3c6a227815f] # to [5d5aea8872719a387a22c036edf441fe140d0a60] # # patch "botan/crc32.cpp" # from [6f79aadddee3ca58108dbb79eaf9818c917df452] # to [dcbaf9e6729d96e7218e16761f4fdbd1e86a8348] # # patch "botan/crl_ent.cpp" # from [e066797dbdeb2eb2f8124a791e2739deb847fdc4] # to [4198f9e3689fab5978bded5b64f8f71a8f1a1ea0] # # patch "botan/ctr.cpp" # from [f03e800de4653a9a335c30abde0b6a1fbb8b64df] # to [e76cf9a87a8daa959b65e3ddc66014b6bef46427] # # patch "botan/cts.cpp" # from [2008cc5f4cc4303c9d8179a689513de479d5a08e] # to [76480a05851111771df7fb35dbe1f01a0caa3d3f] # # patch "botan/data_snk.cpp" # from [fa0cc906ebf754c99f054b78f02f2906da140db7] # to [9b5fa3d71ac32b238fcdc22f8ae1af48ebf141e2] # # patch "botan/data_snk.h" # from [9e221cab38c1145c37fc832e802c091cfe7dac75] # to [5ff5db19807ce5b4bec7589a89e670b8801c01a2] # # patch "botan/data_src.cpp" # from [00dc4c8f2680501212b65a712d6eef20ae9a271e] # to [3d9619006e9ea1a111e099ba7d4738887485a36c] # # patch "botan/data_src.h" # from [b386d479f8908dcc942ed10013d6cfb2bbc8f031] # to [e60fe6c6f970926fbac49b25bdad2e1465dd11f9] # # patch "botan/def_alg.cpp" # from [e78c4875e92b27d1e8edf594653d3d7d1bd543d7] # to [6149d258796a049d0bd371a8b537a35fccb4d09d] # # patch "botan/def_mode.cpp" # from [a06fee4078dafe7958ae460df501247ad6788178] # to [70796fa32f99c175755d464b29b9ebed8be84d79] # # patch "botan/der_enc.cpp" # from [2898db4a4312ab8887c241f1758f8871153fe844] # to [f5bb0bb31a85670d626e3c02c35850438a8fee4d] # # patch "botan/des.cpp" # from [4d1e86c4b9c39e8b6bbbe48a76b1ebca9ff6d6b9] # to [93600b024d9dbb9dea04535016120e4ae8f1aa3c] # # patch "botan/dh.cpp" # from [88888aafa2ba75594db9f3fc9884ad2397e76e6d] # to [52df677e2549c49115b537a9bcb7d99073c4e7f1] # # patch "botan/dl_param.cpp" # from [46da7888784c4d2e733f2f014aa93644326251be] # to [cfbeb0ab58d260d4854d782f878c3172495b21e2] # # patch "botan/dlies.cpp" # from [0c9a9eb14c241d9a974d69851be22eff0ad9ff9d] # to [b390b695f810705238efe69a61dd63b6ad945135] # # patch "botan/eax.cpp" # from [bef7d724ecb7f46a5d47292ca28f71badb5d9d06] # to [8dadb5fff8caa3da4342acb2206ba165873564cb] # # patch "botan/emsa4.cpp" # from [0be0a60693c31c83cf2a2df0f03a4479b8444b3d] # to [e34dfab00b372e779b31be6b6d935d88177e144c] # # patch "botan/enums.h" # from [fe74b7deb3e19aa07f2db2351381079fd4f73d80] # to [d11810103ab6a83b78ec6248a12f8e40db56121d] # # patch "botan/es_egd.cpp" # from [2bf6636a8908506776ca3f8cf6f05370d0f2b47f] # to [16c13a4ab4865ebcb771d9ddd251e4a2838fb64c] # # patch "botan/es_file.cpp" # from [6d3c2b5bd05b067cf5df1720a585e7a2fa99a166] # to [0ccbd0d7f16404e39f3a7a3c664a867801cf39ce] # # patch "botan/exceptn.cpp" # from [3cd2986ddf5c3d967a5dd20991068545a456c7c2] # to [f16b034aa7a23055e0b00613752e762e3c5edcb7] # # patch "botan/filter.cpp" # from [23a3c3907950660091292e50544a89e04e641f71] # to [5df2e58f9ed1de853a151ba0ab43fa0faa50a0d1] # # patch "botan/filter.h" # from [18e52ca7710b7762627297db5a27722b5afce3aa] # to [aaa4e5977156b60de4d6cff9aee6d6ff0352d939] # # patch "botan/fips140.cpp" # from [c1d4019e258c3b9b85fdf007083420759505ddef] # to [19b5950901dd4973dc066cab00220fda9bd34d1f] # # patch "botan/get_enc.cpp" # from [fb775372aa0d45261c2890e7ed0069c1d5c8a8a4] # to [3691eb8c87161a3ec8897faaf12e6a081aaca466] # # patch "botan/get_pbe.cpp" # from [7701f52c0f08f0a0ee3f97d770294b1dafca7788] # to [ce4d99a19ec0e893483d458e57c8ff86a32c167d] # # patch "botan/gzip.cpp" # from [2161328a84b2cfa13908e4cfadec19a072bfde89] # to [9b0cdbce3ecfa4142c84d8a261b7f90fb98bd8d3] # # patch "botan/hex.cpp" # from [d90dd533be84454b70bd07f7639c6d2371ee9416] # to [cb1b85c614144b7cd3ab2308a1c5221ca43a98bd] # # patch "botan/hmac.cpp" # from [d7bc77900a2af2ba418deebbd87b30c9f3ea3811] # to [f382822b6dfacb4472e9b4568289023ffab33f89] # # patch "botan/inifile.cpp" # from [28f3c77682edec2d7a2108f7437d75a96cb422a1] # to [98bff4e028a824b8233181bd06a12b5ecb652e7b] # # patch "botan/init.cpp" # from [e654bf9fc3a87be25a40bf183a843d6be139de98] # to [fcd3ebd72fbe0bbd544a43cdabe5dfada6d3905d] # # patch "botan/init.h" # from [cbc00892b37c81723cb8476d33a7f674fb73f79b] # to [78786baa62040f7edeed7524e9529dfdce70401e] # # patch "botan/kdf.cpp" # from [9f9a6e9c4a779b5a8c169512ab55fd8dd5712d19] # to [da6521d210af842b78eaf9a32e6f51a80009b079] # # patch "botan/make_prm.cpp" # from [13d08902b6d25716e14e5cdef8365673f8929d3c] # to [e7b6ad43b9f2620d6993fc1c991918b541b5dc14] # # patch "botan/mdx_hash.cpp" # from [70a6a226456a3eed5dea25e9ec2428984796f7fa] # to [7549dd02bb181e14f09af48923bd39f47ea7d235] # # patch "botan/mem_pool.cpp" # from [54ee4313712d9f47ad38cdfc5ad00d890d607de5] # to [cc2313bdb2ed78668efea720ddd78929c8afb461] # # patch "botan/mgf1.cpp" # from [6f1bd57e1eceacffaa09086d688430f533801e75] # to [495b1312a4936391dc3d0b246f3849e02eb830a2] # # patch "botan/mp_fkmul.cpp" # from [2451d3e11ed8dfa1eaa75ed02337c0f72f1fbd0e] # to [118c72f006555d318b183cd0f5f53636b3cab2f7] # # patch "botan/mp_types.h" # from [0883c2c34245124a245ffeb74802a6d0c866ea93] # to [3d35d7b7414c08f0516573f15d99ef5db3b977d2] # # patch "botan/numthry.cpp" # from [b72c9ca258ad576c7b6a9d2664281b23d223cb05] # to [1a9aad79b7e3041179f8f107778421257d2c7bbf] # # patch "botan/numthry.h" # from [9e48c28c48157564d28d2db1f6637d77dd3fa022] # to [7cd9a6b6f82dfbcb7ae04d7ecbca6a97fba83d67] # # patch "botan/ofb.cpp" # from [d98618ab0fd9a03e671e5f034740f3e2746a9696] # to [c9f5e8a40fda1f792eb91972cb72beccfb14e1d1] # # patch "botan/out_buf.cpp" # from [] # to [0389fab8523d683166eec1bb43707c2c68e89dd1] # # patch "botan/out_buf.h" # from [] # to [1a0f690209f84f17abbee097aabbb8822dbe0f1e] # # patch "botan/parsing.cpp" # from [0e43f72e1606149dbcc4770fa5fe6a4533119761] # to [18bc352e3dcbf702bbd5aa3d4e6958ce9e76ff85] # # patch "botan/parsing.h" # from [] # to [cc614612daa8f7957ead652e9d7b6155d60e06e4] # # patch "botan/pbes1.cpp" # from [6068b4f4789773bc100896d6114db18b434dd140] # to [649e6fcfe4fde90cb7423caaaa7303df9e8b169b] # # patch "botan/pbes2.cpp" # from [3c3e6d6ea030fc44f63b8bcfdaf15ab86c7a624e] # to [402a6ec148314cb96273dd54f43360b47a0b0d45] # # patch "botan/pem.cpp" # from [eb4f3783b73f95b339fb1e3579c98ee8028b084a] # to [fe377ccf9051816213ded97776eab82c4f7ebe15] # # patch "botan/pipe.cpp" # from [8b611a67111f11d7da354d6248412ab1eb8239af] # to [774a4992b6b17495388d6087ada4cae49e2dc9b7] # # patch "botan/pipe.h" # from [c1a3ae0a2ac4d5714f471298a9b978612af93a06] # to [2504d23b4aab823fa55180a13725a6d9f56e893b] # # patch "botan/pipe_rw.cpp" # from [d93a14d30e1feb8c498c90ddf0c4596716994536] # to [b8b1c777dbee7ebf724531dc9195a7636e23b0e0] # # patch "botan/pkcs10.cpp" # from [d46f70b67ddf31df4414c885a62855b56ccbc246] # to [377921951d6c212d506ffd85875229b831ae6769] # # patch "botan/pkcs5.cpp" # from [cdf709aac78dc4cf416125512278e117589bf8e6] # to [cf89d6b74fd2e397176e49e4aa0de7b644ca642b] # # patch "botan/policy.cpp" # from [2969e73e720b3a226776f6f8ede5d24d14bbaaff] # to [f695e97b7eef3d49c960d3044b65b53a049e2364] # # patch "botan/prf_x942.cpp" # from [2e82d09acdab42e88e3dc6cf9fe3b8b545e6d1c2] # to [6510c500215a92d3031d2f143432e45ed95c314c] # # patch "botan/pubkey.cpp" # from [4565d64054eb4cda0b3abbf7022978292124d46a] # to [3fbc4d1720dbaa6d720465ae742d8862e02c1196] # # patch "botan/randpool.cpp" # from [4cd57635f9b7a10426ff4ce53e630dbe86358083] # to [cd54358602f6d3d1be416d1175fbd586cf711be6] # # patch "botan/randpool.h" # from [9e5e53dac9493dd855fa05a563fb80769d5b8988] # to [ac16cee42189e9d81f1be3927e6ecfc76240fee9] # # patch "botan/readme.txt" # from [e6d3de9d3e899187f3701bdc2744619db440b22e] # to [2e95992aa746384a01dd6ce9c683f040a15539ae] # # patch "botan/reducer.cpp" # from [feddcce261ed731795367445fcf5f316ae598f96] # to [af05c42c789bbcfcba6ee93371320052a37f7bd5] # # patch "botan/rng.cpp" # from [6241291f961c12f562c194b7cd2a57a7fa41e3f9] # to [7c1cdf73c8815e9bc2dbe381e910c999dca9154c] # # patch "botan/rsa.cpp" # from [93dedfdfc017f5c2dbb93d548003101f580761d4] # to [fd012f7422edfebb9f6cc0c979d0e03d5ef36c22] # # patch "botan/secmem.h" # from [2aa44f66962bab3f1bba1cc32cc1b4de51e192aa] # to [dd47f6b950495e2337fcf95bc44d4138d1f993f1] # # patch "botan/secqueue.cpp" # from [47286a3fe1c00e49d0320be854bbef8f16e5df15] # to [930ab85903a98bb87794e938282860e57ea06a32] # # patch "botan/secqueue.h" # from [88829bd53deeb58ef405f2a51367f0258723fd28] # to [c5ce3de0ceda46423443b1abf297341eb6a702ea] # # patch "botan/sha160.cpp" # from [283762dff556d9a03a0921634c178e7d5e84bda5] # to [7aa930cdbc87357c36b8df16fb74338df660ce6a] # # patch "botan/sha256.cpp" # from [763f18fe97915f53be1b159f7dd29145384d32ad] # to [6f8f29549c04f271120115f9c14113dd3b47c502] # # patch "botan/symkey.cpp" # from [9a1dbc137d57bd32958639b12e0c151d4b9e6f86] # to [2769475d3a051cfa8cdaec178c3e23517b5e9d73] # # patch "botan/symkey.h" # from [ae5be2affed3758d5383cd96c60d5643235b2be6] # to [4851cea7540a270a7ac4082c3e1a052664453287] # # patch "botan/timers.cpp" # from [988a7b75cf3464c0176894cddc741fb271e48a16] # to [0f75eecff82397be0b76891f68c73817e58a8136] # # patch "botan/types.h" # from [be7494e11341bccc6fa12fe984b2a892f88a8532] # to [6747e38dbc6a39c04386ef1c2b60298a98d6c865] # # patch "botan/util.cpp" # from [2e15565b61e10420fb51c9e841807dea7fdf9f4e] # to [ad16ee05002deb5f13a4b9e5e21d2ffa66ae4308] # # patch "botan/util.h" # from [bc34ee6faa38faa9e3a176cf4b046cec86020ad9] # to [7859becfb3fbbac552c6a78de5b265475fa4a767] # # patch "botan/version.h" # from [e73ea207b4bcd5f6bb75baff61666b274b205cb9] # to [f834edcd6981ebe2560d045a4cf24a4fb3946969] # # patch "botan/x509_ca.cpp" # from [9f52746349237842fd87650177ec418ab196abb3] # to [a6ca91a885bd8be1508fe8348af1282563742659] # # patch "botan/x509_crl.cpp" # from [f6d30db8bc65b12ed646fe5418bf14d058a01257] # to [e3bdb21e5c44ca51be84f8793316df1f66552737] # # patch "botan/x509_key.cpp" # from [7b5056172f3f94a53935a8582b4bc42f69bdc036] # to [17699009477db1124b409f6e5e393a1cd709c2e4] # # patch "botan/x509_obj.cpp" # from [1d6e176d66362ef556dcdca527924776db81c427] # to [78e2d735c2a3cf3bb74b5ef36e4a7c132661c4ab] # # patch "botan/x509cert.cpp" # from [9554fb9bca448dc6ee6236ba3841f67728c857e8] # to [9eea501682d3e1f6cd0c35caf8dcc0c1acc6349d] # # patch "botan/x509find.cpp" # from [4424040676ed96bf27580bff45226299060557e9] # to [3540674cc40657424e46fa805404cb2c782064af] # # patch "botan/x509opt.cpp" # from [8cc80bac5a3867975b45f3e390a09eb9b72adf0d] # to [dd7040911c23c5a13f5682f5fe4e9d475db2b0f8] # # patch "botan/x509stor.cpp" # from [ab702468d4cd4cdfbe36adcaf37b0782ac4f643a] # to [5d4584af2b3b825022727421f15a65ef72a2ce58] # # patch "botan/x931_rng.cpp" # from [ddea0d278bffdcc62a9a0a9cefca860fc4447c44] # to [48f15e5b870a4e1ced8dc06df188e7952feef520] # # patch "transforms.cc" # from [c0734188f05e6d4920dc0509389e77e351d5ff06] # to [f41b6f044da14ded182446f88825ebb71acc0eab] # ============================================================ --- ChangeLog 985414350491d44328657fa434b43a5ec985620a +++ ChangeLog 1723c8f66a6941850af1c35870350c4b0547ba8f @@ -1,3 +1,7 @@ +2005-12-21 Matt Johnston + + * upgrade to Botan 1.4.10 + 2005-12-18 graydon hoare * AUTHORS: Add Roland. ============================================================ --- Makefile.am 5d0b0887a0e4e41a42e3deb7f013179fcb5c7ad1 +++ Makefile.am 283d3d90263c0a3791b0f2f82736301194bc2521 @@ -101,7 +101,7 @@ botan/mp_comba.cpp botan/mp_core.cpp botan/mp_fkmul.cpp \ botan/mp_misc.cpp botan/mp_mul.cpp botan/mp_shift.cpp \ botan/mp_smul.cpp botan/mutex.cpp botan/numthry.cpp \ - botan/ofb.cpp botan/oids.cpp botan/parse.cpp botan/pbes1.cpp \ + botan/ofb.cpp botan/oids.cpp botan/parsing.cpp botan/pbes1.cpp \ botan/pbes2.cpp botan/pem.cpp botan/pipe.cpp botan/pipe_io.cpp \ botan/pipe_rw.cpp botan/pk_algs.cpp botan/pk_core.cpp \ botan/pk_filts.cpp botan/pk_keys.cpp botan/pk_util.cpp \ @@ -117,6 +117,7 @@ botan/des.cpp botan/des_tab.cpp botan/pkcs5.cpp \ botan/x509self.cpp botan/x509stor.cpp \ botan/def_alg.cpp botan/def_mode.cpp botan/sha256.cpp \ + botan/x931_rng.cpp botan/out_buf.cpp botan/bit_ops.cpp \ \ botan/aes.h botan/botan.h botan/def_eng.h botan/es_win32.h \ botan/lookup.h botan/randpool.h botan/version.h \ @@ -138,7 +139,7 @@ botan/x509stor.h botan/base64.h botan/crc32.h botan/eme.h \ botan/hmac.h botan/mp_core.h botan/pkcs10.h botan/sha160.h \ botan/crl_ent.h botan/emsa.h \ - botan/if_algo.h botan/mp_madd.h botan/pkcs8.h botan/socket.h \ + botan/if_algo.h botan/mp_madd.h botan/pkcs8.h \ botan/x919_mac.h botan/basefilt.h botan/ctr.h botan/engine.h \ botan/init.h botan/mp_types.h botan/pk_filts.h botan/symkey.h \ botan/base.h botan/cts.h botan/enums.h botan/kdf.h \ @@ -150,9 +151,11 @@ botan/es_file.h botan/look_pk.h botan/oids.h botan/pubkey.h \ botan/util.h botan/charset.h botan/hash_id.h \ botan/des.h botan/pkcs5.h \ - botan/x931_rng.cpp botan/x931_rng.h botan/sha256.h + botan/x931_rng.h botan/sha256.h \ + botan/parsing.h botan/out_buf.h botan/bit_ops.h + BOOST_SANDBOX_SOURCES = \ boost/circular_buffer_adaptor.hpp \ boost/circular_buffer_base.hpp \ ============================================================ --- botan/aes.cpp f544aa7fd0dca2a0a282736d62433f046fee78f2 +++ botan/aes.cpp ea31ea6f8b2b7dc8edebeceaf6cd76dcea951c43 @@ -1,9 +1,11 @@ /************************************************* * AES Source File * * (C) 1999-2005 The Botan Project * *************************************************/ #include +#include +#include namespace Botan { ============================================================ --- botan/algolist.cpp 1290df2bfa89a27a8f35e2ba3aa1e71cfe2a5ad4 +++ botan/algolist.cpp a64db024caeb5780d6ed92ce24942547b384c96e @@ -1,14 +1,13 @@ /************************************************* * Algorithms List Source File * * (C) 1999-2005 The Botan Project * *************************************************/ #include - +#include #include #include - namespace Botan { namespace Algolist { @@ -26,8 +25,6 @@ const std::string algo_name = deref_alias(name[0]); - // removed in monotone - //if(algo_name == "OpenPGP-S2K") return new OpenPGP_S2K(name[1]); if(algo_name == "PBKDF1") return new PKCS5_PBKDF1(name[1]); if(algo_name == "PBKDF2") return new PKCS5_PBKDF2(name[1]); ============================================================ --- botan/arc4.cpp 3eedab177bb0c069470419686212a1fd6f1d78ee +++ botan/arc4.cpp 7e17884686141d3b361384b0368c41ec4538411e @@ -1,9 +1,11 @@ /************************************************* * ARC4 Source File * * (C) 1999-2005 The Botan Project * *************************************************/ #include +#include +#include namespace Botan { ============================================================ --- botan/asn1.h 0f625e8cacf2288438d5b9f336a89e88205ac868 +++ botan/asn1.h a15a8ffd094119897e5490f155ca642d31ef803e @@ -17,8 +17,7 @@ *************************************************/ struct BER_Decoding_Error : public Decoding_Error { - BER_Decoding_Error(const std::string& str) : - Decoding_Error("BER: " + str) {} + BER_Decoding_Error(const std::string&); }; /************************************************* @@ -26,11 +25,8 @@ *************************************************/ struct BER_Bad_Tag : public BER_Decoding_Error { - BER_Bad_Tag(const std::string& str, ASN1_Tag tag) : - BER_Decoding_Error(str + ": " + to_string(tag)) {} - BER_Bad_Tag(const std::string& str, ASN1_Tag tag1, ASN1_Tag tag2) : - BER_Decoding_Error(str + ": " + to_string(tag1) + "/" + - to_string(tag2)) {} + BER_Bad_Tag(const std::string&, ASN1_Tag); + BER_Bad_Tag(const std::string&, ASN1_Tag, ASN1_Tag); }; } ============================================================ --- botan/asn1_alt.cpp a96db0b1830a1c2aae7d77a6ac0b5945f4398505 +++ botan/asn1_alt.cpp 2fc51199398f1163aee5a7b4d67e43824c7d4031 @@ -1,9 +1,10 @@ /************************************************* * AlternativeName Source File * * (C) 1999-2005 The Botan Project * *************************************************/ #include +#include namespace Botan { ============================================================ --- botan/asn1_dn.cpp 69534bf7311cb012090e0c9c0f64025dcadfc35c +++ botan/asn1_dn.cpp 348a2b7b12c6a85b3cbb9e063781ed2112629072 @@ -1,9 +1,10 @@ /************************************************* * X509_DN Source File * * (C) 1999-2005 The Botan Project * *************************************************/ #include +#include #include namespace Botan { ============================================================ --- botan/asn1_ku.cpp 43916185735c5d26bdc5fa1772698b8db315838b +++ botan/asn1_ku.cpp e6ef3eb1cd606ca2b6d063ffc7daa8dcb4f74fb6 @@ -1,9 +1,10 @@ /************************************************* * KeyUsage Source File * * (C) 1999-2005 The Botan Project * *************************************************/ #include +#include namespace Botan { ============================================================ --- botan/asn1_oid.cpp bd982245f5f3d15f424be78f3383d77762f848d4 +++ botan/asn1_oid.cpp e52090928114f5d6012df44b91b02c0c353cd2a2 @@ -1,10 +1,11 @@ /************************************************* * ASN.1 OID Source File * * (C) 1999-2005 The Botan Project * *************************************************/ #include -#include +#include +#include namespace Botan { ============================================================ --- botan/asn1_str.cpp 75c135f4178b8dfec1363b216049809919eb1435 +++ botan/asn1_str.cpp 91c1b106a979607e99985bf4cc0b1378cf0d441a @@ -1,9 +1,11 @@ /************************************************* * Simple ASN.1 String Types Source File * * (C) 1999-2005 The Botan Project * *************************************************/ #include +#include +#include #include namespace Botan { ============================================================ --- botan/asn1_tm.cpp 69296df4a30b2b4d4213d6a78274f5a0f813e48c +++ botan/asn1_tm.cpp 1c88ddb515e255c648e05944abf4eed36d03b518 @@ -1,9 +1,11 @@ /************************************************* * X.509 Time Types Source File * * (C) 1999-2005 The Botan Project * *************************************************/ #include +#include +#include #include #include ============================================================ --- botan/barrett.cpp ea5008b06d86cd1f84a53bb3babec53e2f5973de +++ botan/barrett.cpp 395b61510758371148a68e79abb4806d1f6e2567 @@ -6,6 +6,7 @@ #include #include #include +#include namespace Botan { ============================================================ --- botan/base.cpp 782844d8ab6ab22b787eadda7392a3e23445662e +++ botan/base.cpp 6f45870998d3f60d680be03512d0ed1a40345316 @@ -5,6 +5,7 @@ #include #include +#include namespace Botan { ============================================================ --- botan/base.h de06367b6bc1d60bfe3dbaeee2eb958757dbd0d1 +++ botan/base.h f15a3205c8851a4a7413154b940c1ba0cab9c66d @@ -6,10 +6,8 @@ #ifndef BOTAN_BASE_H__ #define BOTAN_BASE_H__ -#include #include #include -#include namespace Botan { @@ -36,7 +34,7 @@ /************************************************* * Symmetric Algorithm * *************************************************/ -class SymmetricAlgorithm : public Algorithm +class SymmetricAlgorithm : public virtual Algorithm { public: const u32bit MAXIMUM_KEYLENGTH, MINIMUM_KEYLENGTH, KEYLENGTH_MULTIPLE; @@ -93,7 +91,7 @@ /************************************************* * Buffered Computation * *************************************************/ -class BufferedComputation : public Algorithm +class BufferedComputation : public virtual Algorithm { public: const u32bit OUTPUT_LENGTH; ============================================================ --- botan/base64.cpp f8f825aa6ababa4d464f193348d429e8729c6cb8 +++ botan/base64.cpp 397126d19a42c0fb831b4201828be936e55fa2a5 @@ -1,9 +1,10 @@ /************************************************* * Base64 Encoder/Decoder Source File * * (C) 1999-2005 The Botan Project * *************************************************/ #include +#include namespace Botan { ============================================================ --- botan/basefilt.cpp c62ab8ed09c29b42cab4060b763eaa12f5ae4ed5 +++ botan/basefilt.cpp 18aab554ecbec7a50c1606b283c636e75f9bd1a9 @@ -36,25 +36,16 @@ *************************************************/ Fork::Fork(Filter* f1, Filter* f2, Filter* f3, Filter* f4) { - u32bit used = 0; - if(f1) used = 1; - if(f2) used = 2; - if(f3) used = 3; - if(f4) used = 4; - set_port_count(used); - if(f1) next[0] = f1; - if(f2) next[1] = f2; - if(f3) next[2] = f3; - if(f4) next[3] = f4; + Filter* filters[4] = { f1, f2, f3, f4 }; + set_next(filters, 4); } /************************************************* * Fork Constructor * *************************************************/ -Fork::Fork(Filter* filters[], u32bit count) : Filter(count) +Fork::Fork(Filter* filters[], u32bit count) { - for(u32bit j = 0; j != count; j++) - next[j] = filters[j]; + set_next(filters, count); } /************************************************* ============================================================ --- botan/basefilt.h dc993b59b350b86f39fd125e42c925c4067edd64 +++ botan/basefilt.h ba3cd0d8a3f0dc1ddeab8a7641cac1eed8f8b2cd @@ -13,7 +13,7 @@ /************************************************* * Chain * *************************************************/ -class Chain : public Filter +class Chain : public Fanout_Filter { public: void write(const byte input[], u32bit length) { send(input, length); } @@ -25,11 +25,11 @@ /************************************************* * Fork * *************************************************/ -class Fork : public Filter +class Fork : public Fanout_Filter { public: void write(const byte input[], u32bit length) { send(input, length); } - void set_port(u32bit n) { set_port(n); } + void set_port(u32bit n) { Fanout_Filter::set_port(n); } Fork(Filter*, Filter*, Filter* = 0, Filter* = 0); Fork(Filter*[], u32bit); ============================================================ --- botan/ber_code.cpp 41b67aa4c136a6acfe9757658dd4ccbb5d52c340 +++ botan/ber_code.cpp 5142a48f04a95643b2b6cbb273e3d72b9c66be5e @@ -1,12 +1,26 @@ /************************************************* * BER Decoding Source File * * (C) 1999-2005 The Botan Project * *************************************************/ #include +#include namespace Botan { +/************************************************* +* BER Decoding Exceptions * +*************************************************/ +BER_Decoding_Error::BER_Decoding_Error(const std::string& str) : + Decoding_Error("BER: " + str) {} + +BER_Bad_Tag::BER_Bad_Tag(const std::string& str, ASN1_Tag tag) : + BER_Decoding_Error(str + ": " + to_string(tag)) {} + +BER_Bad_Tag::BER_Bad_Tag(const std::string& str, + ASN1_Tag tag1, ASN1_Tag tag2) : + BER_Decoding_Error(str + ": " + to_string(tag1) + "/" + to_string(tag2)) {} + namespace { /************************************************* ============================================================ --- botan/ber_dec.cpp 85736204e607a95c150ee1a5e6b9ac1b82373349 +++ botan/ber_dec.cpp c15980c2152172bdd3f82953e8f631799512ff23 @@ -1,9 +1,10 @@ /************************************************* * BER Decoder Source File * * (C) 1999-2005 The Botan Project * *************************************************/ #include +#include namespace Botan { ============================================================ --- botan/big_base.cpp 6b393b5416c22430149721f291e3f6839239d3fb +++ botan/big_base.cpp 457e25de9b908c143815af89388f873a9ed57d1c @@ -6,6 +6,8 @@ #include #include #include +#include +#include #include namespace Botan { ============================================================ --- botan/big_code.cpp 9d421e837b118c241771431e97b8269a0049339a +++ botan/big_code.cpp 9b6b6e6f233069e72f4b621d7e2a867bbed3d5b1 @@ -5,6 +5,7 @@ #include #include +#include #include namespace Botan { ============================================================ --- botan/big_ops2.cpp b951478dcd76378226809a907f402ec29abb43c3 +++ botan/big_ops2.cpp 7cb04ca6277c03495e7e1035f4f0c5d3ca652e60 @@ -6,6 +6,7 @@ #include #include #include +#include namespace Botan { ============================================================ --- botan/big_ops3.cpp 7fcfc51d05c038b3cc268b9993c9140524d91afb +++ botan/big_ops3.cpp 033d775b361c8e20acd3d6b67faff41519e0a4d5 @@ -6,6 +6,7 @@ #include #include #include +#include namespace Botan { ============================================================ --- botan/bit_ops.cpp +++ botan/bit_ops.cpp d07b224e9e1d15bb7ce59d0a374e236cd803e895 @@ -0,0 +1,98 @@ +/************************************************* +* Bit/Word Operations Source File * +* (C) 1999-2005 The Botan Project * +*************************************************/ + +#include + +namespace Botan { + +/************************************************* +* XOR arrays together * +*************************************************/ +void xor_buf(byte data[], const byte mask[], u32bit length) + { + while(length >= 8) + { + data[0] ^= mask[0]; data[1] ^= mask[1]; + data[2] ^= mask[2]; data[3] ^= mask[3]; + data[4] ^= mask[4]; data[5] ^= mask[5]; + data[6] ^= mask[6]; data[7] ^= mask[7]; + data += 8; mask += 8; length -= 8; + } + for(u32bit j = 0; j != length; j++) + data[j] ^= mask[j]; + } + +void xor_buf(byte out[], const byte in[], const byte mask[], u32bit length) + { + while(length >= 8) + { + out[0] = in[0] ^ mask[0]; out[1] = in[1] ^ mask[1]; + out[2] = in[2] ^ mask[2]; out[3] = in[3] ^ mask[3]; + out[4] = in[4] ^ mask[4]; out[5] = in[5] ^ mask[5]; + out[6] = in[6] ^ mask[6]; out[7] = in[7] ^ mask[7]; + in += 8; out += 8; mask += 8; length -= 8; + } + for(u32bit j = 0; j != length; j++) + out[j] = in[j] ^ mask[j]; + } + +/************************************************* +* Return true iff arg is 2**n for some n > 0 * +*************************************************/ +bool power_of_2(u64bit arg) + { + if(arg == 0 || arg == 1) + return false; + if((arg & (arg-1)) == 0) + return true; + return false; + } + +/************************************************* +* Return the index of the highest set bit * +*************************************************/ +u32bit high_bit(u64bit n) + { + for(u32bit count = 64; count > 0; count--) + if((n >> (count - 1)) & 0x01) + return count; + return 0; + } + +/************************************************* +* Return the index of the lowest set bit * +*************************************************/ +u32bit low_bit(u64bit n) + { + for(u32bit count = 0; count != 64; count++) + if((n >> count) & 0x01) + return (count + 1); + return 0; + } + +/************************************************* +* Return the number of significant bytes in n * +*************************************************/ +u32bit significant_bytes(u64bit n) + { + for(u32bit j = 0; j != 8; j++) + if(get_byte(j, n)) + return 8-j; + return 0; + } + +/************************************************* +* Return the Hamming weight of n * +*************************************************/ +u32bit hamming_weight(u64bit n) + { + u32bit weight = 0; + for(u32bit j = 0; j != 64; j++) + if((n >> j) & 0x01) + weight++; + return weight; + } + +} ============================================================ --- botan/bit_ops.h +++ botan/bit_ops.h 15f92e1769a8715806856e0d5a64b571779f44bc @@ -0,0 +1,64 @@ +/************************************************* +* Bit/Word Operations Header File * +* (C) 1999-2005 The Botan Project * +*************************************************/ + +#ifndef BOTAN_BIT_OPS_H__ +#define BOTAN_BIT_OPS_H__ + +#include + +namespace Botan { + +/************************************************* +* Rotation Functions * +*************************************************/ +template inline T rotate_left(T input, u32bit rot) + { return (T)((input << rot) | (input >> (8*sizeof(T)-rot))); } + +template inline T rotate_right(T input, u32bit rot) + { return (T)((input >> rot) | (input << (8*sizeof(T)-rot))); } + +/************************************************* +* Byte Extraction Function * +*************************************************/ +template inline byte get_byte(u32bit byte_num, T input) + { return (byte)(input >> ((sizeof(T)-1-(byte_num&(sizeof(T)-1))) << 3)); } + +/************************************************* +* Byte to Word Conversions * +*************************************************/ +inline u16bit make_u16bit(byte input0, byte input1) + { return (u16bit)(((u16bit)input0 << 8) | input1); } + +inline u32bit make_u32bit(byte input0, byte input1, byte input2, byte input3) + { return (u32bit)(((u32bit)input0 << 24) | ((u32bit)input1 << 16) | + ((u32bit)input2 << 8) | input3); } + +inline u64bit make_u64bit(byte input0, byte input1, byte input2, byte input3, + byte input4, byte input5, byte input6, byte input7) + { + return (u64bit)(((u64bit)input0 << 56) | ((u64bit)input1 << 48) | + ((u64bit)input2 << 40) | ((u64bit)input3 << 32) | + ((u64bit)input4 << 24) | ((u64bit)input5 << 16) | + ((u64bit)input6 << 8) | input7); + } + +/************************************************* +* XOR Functions * +*************************************************/ +void xor_buf(byte[], const byte[], u32bit); +void xor_buf(byte[], const byte[], const byte[], u32bit); + +/************************************************* +* Misc Utility Functions * +*************************************************/ +bool power_of_2(u64bit); +u32bit high_bit(u64bit); +u32bit low_bit(u64bit); +u32bit significant_bytes(u64bit); +u32bit hamming_weight(u64bit); + +} + +#endif ============================================================ --- botan/botan.h e19178830bd4ceadbc977e8f54ce45f9f18c7ec4 +++ botan/botan.h b67160e0ce2e91677445439823e4e020963551d9 @@ -1,13 +1,14 @@ /************************************************* -* Basic Interface Header File * +* Botan Core Interface Header File * * (C) 1999-2005 The Botan Project * *************************************************/ #include #include -#include #include #include #include #include +#include +#include ============================================================ --- botan/buf_es.cpp 22b201e4e9b1a2704dd762e5d8670d74790b53c8 +++ botan/buf_es.cpp 9d7a0ba8efe806a4088786015e31a41bcf73a433 @@ -1,9 +1,10 @@ /************************************************* * Buffered EntropySource Source File * * (C) 1999-2005 The Botan Project * *************************************************/ #include +#include #include namespace Botan { ============================================================ --- botan/cbc.cpp 07356236e863c7453b30c33fbdb6a10507a02e24 +++ botan/cbc.cpp 482ead7cd979dedb9264dee265141f3f62cd8b24 @@ -5,6 +5,7 @@ #include #include +#include namespace Botan { ============================================================ --- botan/cfb.cpp fe3b9c70b199eb3671f1d1a7e678acf81be143ee +++ botan/cfb.cpp fd5cc8fd41bf529237261b94a0c07749130aa71f @@ -5,6 +5,8 @@ #include #include +#include +#include namespace Botan { ============================================================ --- botan/conf.cpp a4d66f1f29a263d401e17af592c184131422f682 +++ botan/conf.cpp 5f2a4cb8d45511ae6ee082231974fc5da0150ef4 @@ -6,6 +6,8 @@ #include #include #include +#include +#include #include #include ============================================================ --- botan/conf.h 71b0151c64d71a4a3450a0fad05fc3c6a227815f +++ botan/conf.h 5d5aea8872719a387a22c036edf441fe140d0a60 @@ -6,7 +6,6 @@ #ifndef BOTAN_POLICY_CONF_H__ #define BOTAN_POLICY_CONF_H__ -#include #include #include #include ============================================================ --- botan/crc32.cpp 6f79aadddee3ca58108dbb79eaf9818c917df452 +++ botan/crc32.cpp dcbaf9e6729d96e7218e16761f4fdbd1e86a8348 @@ -1,9 +1,10 @@ /************************************************* * CRC32 Source File * * (C) 1999-2005 The Botan Project * *************************************************/ #include +#include namespace Botan { ============================================================ --- botan/crl_ent.cpp e066797dbdeb2eb2f8124a791e2739deb847fdc4 +++ botan/crl_ent.cpp 4198f9e3689fab5978bded5b64f8f71a8f1a1ea0 @@ -8,6 +8,7 @@ #include #include #include +#include namespace Botan { ============================================================ --- botan/ctr.cpp f03e800de4653a9a335c30abde0b6a1fbb8b64df +++ botan/ctr.cpp e76cf9a87a8daa959b65e3ddc66014b6bef46427 @@ -5,6 +5,7 @@ #include #include +#include namespace Botan { ============================================================ --- botan/cts.cpp 2008cc5f4cc4303c9d8179a689513de479d5a08e +++ botan/cts.cpp 76480a05851111771df7fb35dbe1f01a0caa3d3f @@ -5,6 +5,7 @@ #include #include +#include namespace Botan { ============================================================ --- botan/data_snk.cpp fa0cc906ebf754c99f054b78f02f2906da140db7 +++ botan/data_snk.cpp 9b5fa3d71ac32b238fcdc22f8ae1af48ebf141e2 @@ -30,9 +30,14 @@ /************************************************* * DataSink_Stream Constructor * *************************************************/ -DataSink_Stream::DataSink_Stream(const std::string& file) : fsname(file) +DataSink_Stream::DataSink_Stream(const std::string& file, + bool use_binary) : fsname(file) { - sink = new std::ofstream(fsname.c_str(), std::ios::binary); + if(use_binary) + sink = new std::ofstream(fsname.c_str(), std::ios::binary); + else + sink = new std::ofstream(fsname.c_str()); + if(!sink->good()) throw Stream_IO_Error("DataSink_Stream: Failure opening " + fsname); owns = true; ============================================================ --- botan/data_snk.h 9e221cab38c1145c37fc832e802c091cfe7dac75 +++ botan/data_snk.h 5ff5db19807ce5b4bec7589a89e670b8801c01a2 @@ -33,7 +33,7 @@ public: void write(const byte[], u32bit); DataSink_Stream(std::ostream&); - DataSink_Stream(const std::string&); + DataSink_Stream(const std::string&, bool = false); ~DataSink_Stream(); private: const std::string fsname; ============================================================ --- botan/data_src.cpp 00dc4c8f2680501212b65a712d6eef20ae9a271e +++ botan/data_src.cpp 3d9619006e9ea1a111e099ba7d4738887485a36c @@ -154,9 +154,14 @@ /************************************************* * DataSource_Stream Constructor * *************************************************/ -DataSource_Stream::DataSource_Stream(const std::string& file) : fsname(file) +DataSource_Stream::DataSource_Stream(const std::string& file, + bool use_binary) : fsname(file) { - source = new std::ifstream(fsname.c_str(), std::ios::binary); + if(use_binary) + source = new std::ifstream(fsname.c_str(), std::ios::binary); + else + source = new std::ifstream(fsname.c_str()); + if(!source->good()) throw Stream_IO_Error("DataSource_Stream: Failure opening " + fsname); total_read = 0; ============================================================ --- botan/data_src.h b386d479f8908dcc942ed10013d6cfb2bbc8f031 +++ botan/data_src.h e60fe6c6f970926fbac49b25bdad2e1465dd11f9 @@ -61,7 +61,7 @@ bool end_of_data() const; std::string id() const; - DataSource_Stream(const std::string&); + DataSource_Stream(const std::string&, bool = false); ~DataSource_Stream(); private: const std::string fsname; ============================================================ --- botan/def_alg.cpp e78c4875e92b27d1e8edf594653d3d7d1bd543d7 +++ botan/def_alg.cpp 6149d258796a049d0bd371a8b537a35fccb4d09d @@ -5,6 +5,7 @@ #include #include +#include #include #include @@ -17,8 +18,6 @@ #include -#include - namespace Botan { /************************************************* ============================================================ --- botan/def_mode.cpp a06fee4078dafe7958ae460df501247ad6788178 +++ botan/def_mode.cpp 70796fa32f99c175755d464b29b9ebed8be84d79 @@ -1,11 +1,12 @@ /************************************************* * Default Engine Source File * * (C) 1999-2005 The Botan Project * *************************************************/ #include -#include +#include #include +#include #include #include #include @@ -13,7 +14,6 @@ #include #include #include -#include namespace Botan { ============================================================ --- botan/der_enc.cpp 2898db4a4312ab8887c241f1758f8871153fe844 +++ botan/der_enc.cpp f5bb0bb31a85670d626e3c02c35850438a8fee4d @@ -5,6 +5,8 @@ #include #include +#include +#include namespace Botan { ============================================================ --- botan/des.cpp 4d1e86c4b9c39e8b6bbbe48a76b1ebca9ff6d6b9 +++ botan/des.cpp 93600b024d9dbb9dea04535016120e4ae8f1aa3c @@ -1,9 +1,10 @@ /************************************************* * DES Source File * * (C) 1999-2005 The Botan Project * *************************************************/ #include +#include namespace Botan { ============================================================ --- botan/dh.cpp 88888aafa2ba75594db9f3fc9884ad2397e76e6d +++ botan/dh.cpp 52df677e2549c49115b537a9bcb7d99073c4e7f1 @@ -5,6 +5,7 @@ #include #include +#include namespace Botan { ============================================================ --- botan/dl_param.cpp 46da7888784c4d2e733f2f014aa93644326251be +++ botan/dl_param.cpp cfbeb0ab58d260d4854d782f878c3172495b21e2 @@ -1,12 +1,14 @@ /************************************************* * Discrete Logarithm Parameters Source File * * (C) 1999-2005 The Botan Project * *************************************************/ #include +#include #include #include #include +#include #include namespace Botan { ============================================================ --- botan/dlies.cpp 0c9a9eb14c241d9a974d69851be22eff0ad9ff9d +++ botan/dlies.cpp b390b695f810705238efe69a61dd63b6ad945135 @@ -6,6 +6,7 @@ #include #include #include +#include #include namespace Botan { ============================================================ --- botan/eax.cpp bef7d724ecb7f46a5d47292ca28f71badb5d9d06 +++ botan/eax.cpp 8dadb5fff8caa3da4342acb2206ba165873564cb @@ -5,6 +5,8 @@ #include #include +#include +#include namespace Botan { ============================================================ --- botan/emsa4.cpp 0be0a60693c31c83cf2a2df0f03a4479b8444b3d +++ botan/emsa4.cpp e34dfab00b372e779b31be6b6d935d88177e144c @@ -6,6 +6,7 @@ #include #include #include +#include #include namespace Botan { @@ -37,7 +38,7 @@ if(msg.size() != HASH_SIZE) throw Invalid_Argument("EMSA4::encoding_of: Bad input length"); if(output_bits < 8*HASH_SIZE + 8*SALT_SIZE + 9) - throw Invalid_Argument("EMSA4::pad: Output length is too small"); + throw Invalid_Argument("EMSA4::encoding_of: Output length is too small"); const u32bit output_length = (output_bits + 7) / 8; ============================================================ --- botan/enums.h fe74b7deb3e19aa07f2db2351381079fd4f73d80 +++ botan/enums.h d11810103ab6a83b78ec6248a12f8e40db56121d @@ -6,8 +6,6 @@ #ifndef BOTAN_ENUMS_H__ #define BOTAN_ENUMS_H__ -#include - namespace Botan { /************************************************* ============================================================ --- botan/es_egd.cpp 2bf6636a8908506776ca3f8cf6f05370d0f2b47f +++ botan/es_egd.cpp 16c13a4ab4865ebcb771d9ddd251e4a2838fb64c @@ -5,7 +5,10 @@ #include #include +#include +#include #include + #include #include #include ============================================================ --- botan/es_file.cpp 6d3c2b5bd05b067cf5df1720a585e7a2fa99a166 +++ botan/es_file.cpp 0ccbd0d7f16404e39f3a7a3c664a867801cf39ce @@ -5,6 +5,7 @@ #include #include +#include #include namespace Botan { ============================================================ --- botan/exceptn.cpp 3cd2986ddf5c3d967a5dd20991068545a456c7c2 +++ botan/exceptn.cpp f16b034aa7a23055e0b00613752e762e3c5edcb7 @@ -1,10 +1,10 @@ /************************************************* * Exceptions Source File * * (C) 1999-2005 The Botan Project * *************************************************/ #include -#include +#include namespace Botan { ============================================================ --- botan/filter.cpp 23a3c3907950660091292e50544a89e04e641f71 +++ botan/filter.cpp 5df2e58f9ed1de853a151ba0ab43fa0faa50a0d1 @@ -12,18 +12,9 @@ /************************************************* * Filter Constructor * *************************************************/ -Filter::Filter(u32bit count) +Filter::Filter() { - set_port_count(count); - } - -/************************************************* -* Set/Reset next * -*************************************************/ -void Filter::set_port_count(u32bit n) - { - next.clear(); - next.resize(n); + next.resize(1); port_num = 0; filter_owns = 0; } @@ -107,6 +98,24 @@ } /************************************************* +* Set the next Filters * +*************************************************/ +void Filter::set_next(Filter* filters[], u32bit size) + { + while(size && filters && filters[size-1] == 0) + size--; + + next.clear(); + next.resize(size); + + port_num = 0; + filter_owns = 0; + + for(u32bit j = 0; j != size; j++) + next[j] = filters[j]; + } + +/************************************************* * Return the total number of ports * *************************************************/ u32bit Filter::total_ports() const ============================================================ --- botan/filter.h 18e52ca7710b7762627297db5a27722b5afce3aa +++ botan/filter.h aaa4e5977156b60de4d6cff9aee6d6ff0352d939 @@ -28,26 +28,42 @@ virtual void send(const byte[], u32bit); void send(byte input) { send(&input, 1); } void send(const MemoryRegion& in) { send(in.begin(), in.size()); } + Filter(); + private: + Filter(const Filter&) {} + Filter& operator=(const Filter&) { return (*this); } - void attach(Filter*); + friend class Pipe; + friend class Fanout_Filter; + u32bit total_ports() const; u32bit current_port() const { return port_num; } - void set_port_count(u32bit); void set_port(u32bit); + u32bit owns() const { return filter_owns; } - void incr_owns() { filter_owns++; } - Filter(u32bit = 1); - private: - friend class Pipe; - friend class Fork; - Filter(const Filter&) {} - Filter& operator=(const Filter&) { return (*this); } + + void attach(Filter*); + void set_next(Filter*[], u32bit); Filter* get_next() const; + SecureVector write_queue; std::vector next; u32bit port_num, filter_owns; }; +/************************************************* +* Fanout Filter Base Class * +*************************************************/ +class Fanout_Filter : public Filter + { + protected: + void incr_owns() { filter_owns++; } + + void set_port(u32bit n) { Filter::set_port(n); } + void set_next(Filter* f[], u32bit n) { Filter::set_next(f, n); } + void attach(Filter* f) { Filter::attach(f); } + }; + } #endif ============================================================ --- botan/fips140.cpp c1d4019e258c3b9b85fdf007083420759505ddef +++ botan/fips140.cpp 19b5950901dd4973dc066cab00220fda9bd34d1f @@ -166,7 +166,7 @@ Pipe pipe1(new Hash_Filter("SHA-1")); Pipe pipe2(new Hex_Decoder); - DataSource_Stream in(filename); + DataSource_Stream in(filename, true); pipe1.process_msg(in); pipe2.process_msg(edc); ============================================================ --- botan/get_enc.cpp fb775372aa0d45261c2890e7ed0069c1d5c8a8a4 +++ botan/get_enc.cpp 3691eb8c87161a3ec8897faaf12e6a081aaca466 @@ -1,13 +1,15 @@ /************************************************* * EMSA/EME/KDF/MGF Retrieval Source File * * (C) 1999-2005 The Botan Project * *************************************************/ #include +#include #include #include #include #include +#include namespace Botan { ============================================================ --- botan/get_pbe.cpp 7701f52c0f08f0a0ee3f97d770294b1dafca7788 +++ botan/get_pbe.cpp ce4d99a19ec0e893483d458e57c8ff86a32c167d @@ -6,6 +6,7 @@ #include #include #include +#include namespace Botan { ============================================================ --- botan/gzip.cpp 2161328a84b2cfa13908e4cfadec19a072bfde89 +++ botan/gzip.cpp 9b0cdbce3ecfa4142c84d8a261b7f90fb98bd8d3 @@ -14,6 +14,7 @@ #include #include +#include #include #include #include ============================================================ --- botan/hex.cpp d90dd533be84454b70bd07f7639c6d2371ee9416 +++ botan/hex.cpp cb1b85c614144b7cd3ab2308a1c5221ca43a98bd @@ -1,9 +1,11 @@ /************************************************* * Hex Encoder/Decoder Source File * * (C) 1999-2005 The Botan Project * *************************************************/ #include +#include +#include namespace Botan { ============================================================ --- botan/hmac.cpp d7bc77900a2af2ba418deebbd87b30c9f3ea3811 +++ botan/hmac.cpp f382822b6dfacb4472e9b4568289023ffab33f89 @@ -5,6 +5,7 @@ #include #include +#include namespace Botan { ============================================================ --- botan/inifile.cpp 28f3c77682edec2d7a2108f7437d75a96cb422a1 +++ botan/inifile.cpp 98bff4e028a824b8233181bd06a12b5ecb652e7b @@ -7,6 +7,8 @@ #include #include #include +#include +#include #include #include ============================================================ --- botan/init.cpp e654bf9fc3a87be25a40bf183a843d6be139de98 +++ botan/init.cpp fcd3ebd72fbe0bbd544a43cdabe5dfada6d3905d @@ -6,13 +6,15 @@ #include #include +#include +#include #include #include #include + #include #include #include -#include #include #if defined(BOTAN_EXT_MUTEX_PTHREAD) ============================================================ --- botan/init.h cbc00892b37c81723cb8476d33a7f674fb73f79b +++ botan/init.h 78786baa62040f7edeed7524e9529dfdce70401e @@ -6,7 +6,6 @@ #ifndef BOTAN_INIT_H__ #define BOTAN_INIT_H__ -#include #include #include #include ============================================================ --- botan/kdf.cpp 9f9a6e9c4a779b5a8c169512ab55fd8dd5712d19 +++ botan/kdf.cpp da6521d210af842b78eaf9a32e6f51a80009b079 @@ -5,6 +5,7 @@ #include #include +#include #include namespace Botan { ============================================================ --- botan/make_prm.cpp 13d08902b6d25716e14e5cdef8365673f8929d3c +++ botan/make_prm.cpp e7b6ad43b9f2620d6993fc1c991918b541b5dc14 @@ -5,6 +5,8 @@ #include #include +#include +#include #include #include #include ============================================================ --- botan/mdx_hash.cpp 70a6a226456a3eed5dea25e9ec2428984796f7fa +++ botan/mdx_hash.cpp 7549dd02bb181e14f09af48923bd39f47ea7d235 @@ -1,9 +1,10 @@ /************************************************* * MDx Hash Function Source File * * (C) 1999-2005 The Botan Project * *************************************************/ #include +#include namespace Botan { @@ -77,14 +78,14 @@ /************************************************* * Write the count bits to the buffer * *************************************************/ -void MDx_HashFunction::write_count(byte buffer[]) +void MDx_HashFunction::write_count(byte out[]) { if(COUNT_SIZE < 8) throw Invalid_State("MDx_HashFunction::write_count: COUNT_SIZE < 8"); for(u32bit j = 0; j != 8; j++) { const u32bit choose = (BIG_BYTE_ENDIAN ? (j % 8) : (7 - (j % 8))); - buffer[j+COUNT_SIZE-8] = get_byte(choose, 8 * count); + out[j+COUNT_SIZE-8] = get_byte(choose, 8 * count); } } ============================================================ --- botan/mem_pool.cpp 54ee4313712d9f47ad38cdfc5ad00d890d607de5 +++ botan/mem_pool.cpp cc2313bdb2ed78668efea720ddd78929c8afb461 @@ -6,6 +6,7 @@ #include #include #include +#include namespace Botan { ============================================================ --- botan/mgf1.cpp 6f1bd57e1eceacffaa09086d688430f533801e75 +++ botan/mgf1.cpp 495b1312a4936391dc3d0b246f3849e02eb830a2 @@ -5,6 +5,7 @@ #include #include +#include #include namespace Botan { ============================================================ --- botan/mp_fkmul.cpp 2451d3e11ed8dfa1eaa75ed02337c0f72f1fbd0e +++ botan/mp_fkmul.cpp 118c72f006555d318b183cd0f5f53636b3cab2f7 @@ -1,10 +1,11 @@ /************************************************* * Fixed Karatsuba Multiplication Source File * * (C) 1999-2005 The Botan Project * *************************************************/ #include -#include +#include +#include #include namespace Botan { ============================================================ --- botan/mp_types.h 0883c2c34245124a245ffeb74802a6d0c866ea93 +++ botan/mp_types.h 3d35d7b7414c08f0516573f15d99ef5db3b977d2 @@ -6,7 +6,6 @@ #ifndef BOTAN_MPI_TYPES_H__ #define BOTAN_MPI_TYPES_H__ -#include #include namespace Botan { ============================================================ --- botan/numthry.cpp b72c9ca258ad576c7b6a9d2664281b23d223cb05 +++ botan/numthry.cpp 1a9aad79b7e3041179f8f107778421257d2c7bbf @@ -79,27 +79,6 @@ } /************************************************* -* If this number is of the form 2^n, return n * -*************************************************/ -u32bit power_of_2(const BigInt& n) - { - if(n <= 1 || n % 2 == 1) return 0; - if(n == 2) return 1; - - u32bit bit_set = 0; - - const u32bit n_bits = n.bits(); - for(u32bit j = 1; j != n_bits; j++) - if(n.get_bit(j)) - { - if(bit_set) return 0; - bit_set = j; - } - - return bit_set; - } - -/************************************************* * Calculate the GCD * *************************************************/ BigInt gcd(const BigInt& a, const BigInt& b) ============================================================ --- botan/numthry.h 9e48c28c48157564d28d2db1f6637d77dd3fa022 +++ botan/numthry.h 7cd9a6b6f82dfbcb7ae04d7ecbca6a97fba83d67 @@ -45,7 +45,6 @@ * Utility Functions * *************************************************/ u32bit low_zero_bits(const BigInt&); -u32bit power_of_2(const BigInt&); /************************************************* * Primality Testing * ============================================================ --- botan/ofb.cpp d98618ab0fd9a03e671e5f034740f3e2746a9696 +++ botan/ofb.cpp c9f5e8a40fda1f792eb91972cb72beccfb14e1d1 @@ -5,6 +5,7 @@ #include #include +#include namespace Botan { ============================================================ --- botan/out_buf.cpp +++ botan/out_buf.cpp 0389fab8523d683166eec1bb43707c2c68e89dd1 @@ -0,0 +1,114 @@ +/************************************************* +* Pipe Output Buffer Source file * +* (C) 1999-2005 The Botan Project * +*************************************************/ + +#include +#include + +namespace Botan { + +/************************************************* +* Read data from a message * +*************************************************/ +u32bit Output_Buffers::read(byte output[], u32bit length, u32bit msg) + { + SecureQueue* q = get(msg); + if(q) + return q->read(output, length); + return 0; + } + +/************************************************* +* Peek at data in a message * +*************************************************/ +u32bit Output_Buffers::peek(byte output[], u32bit length, + u32bit stream_offset, u32bit msg) const + { + SecureQueue* q = get(msg); + if(q) + return q->peek(output, length, stream_offset); + return 0; + } + +/************************************************* +* Check available bytes in a message * +*************************************************/ +u32bit Output_Buffers::remaining(u32bit msg) const + { + SecureQueue* q = get(msg); + if(q) + return q->size(); + return 0; + } + +/************************************************* +* Add a new output queue * +*************************************************/ +void Output_Buffers::add(SecureQueue* queue) + { + if(!queue) + throw Internal_Error("Output_Buffers::add: Argument was NULL"); + + if(buffers.size() == buffers.max_size()) + throw Internal_Error("Output_Buffers::add: No more room in container"); + + buffers.push_back(queue); + } + +/************************************************* +* Retire old output queues * +*************************************************/ +void Output_Buffers::retire() + { + while(buffers.size()) + { + if(buffers[0] == 0 || buffers[0]->size() == 0) + { + buffers.pop_front(); + offset++; + } + else + break; + } + } + +/************************************************* +* Get a particular output queue * +*************************************************/ +SecureQueue* Output_Buffers::get(u32bit msg) const + { + if(msg < offset) + return 0; + if(msg > message_count()) + throw Internal_Error("Output_Buffers::get: msg > size"); + + return buffers[msg-offset]; + } + +/************************************************* +* Return the total number of messages * +*************************************************/ +u32bit Output_Buffers::message_count() const + { + return (buffers.size() + offset); + } + +/************************************************* +* Output_Buffers Constructor * +*************************************************/ +Output_Buffers::Output_Buffers() + { + offset = 0; + } + +/************************************************* +* Output_Buffers Destructor * +*************************************************/ +Output_Buffers::~Output_Buffers() + { + for(u32bit j = 0; j != buffers.size(); j++) + delete buffers[j]; + } + +} ============================================================ --- botan/out_buf.h +++ botan/out_buf.h 1a0f690209f84f17abbee097aabbb8822dbe0f1e @@ -0,0 +1,40 @@ +/************************************************* +* Output Buffer Header File * +* (C) 1999-2005 The Botan Project * +*************************************************/ + +#ifndef BOTAN_OUTPUT_BUFFER_H__ +#define BOTAN_OUTPUT_BUFFER_H__ + +#include +#include + +namespace Botan { + +/************************************************* +* Container of output buffers for Pipe * +*************************************************/ +class Output_Buffers + { + public: + u32bit read(byte[], u32bit, u32bit); + u32bit peek(byte[], u32bit, u32bit, u32bit) const; + u32bit remaining(u32bit) const; + + void add(class SecureQueue*); + void retire(); + + u32bit message_count() const; + + Output_Buffers(); + ~Output_Buffers(); + private: + class SecureQueue* get(u32bit) const; + + std::deque buffers; + u32bit offset; + }; + +} + +#endif ============================================================ --- botan/parsing.cpp 0e43f72e1606149dbcc4770fa5fe6a4533119761 +++ botan/parsing.cpp 18bc352e3dcbf702bbd5aa3d4e6958ce9e76ff85 @@ -1,14 +1,60 @@ /************************************************* -* Parsing Functions Source File * +* Parser Functions Source File * * (C) 1999-2005 The Botan Project * *************************************************/ +#include #include -#include +#include namespace Botan { /************************************************* +* Convert a string into an integer * +*************************************************/ +u32bit to_u32bit(const std::string& number) + { + u32bit n = 0; + + for(std::string::const_iterator j = number.begin(); j != number.end(); j++) + { + const u32bit OVERFLOW_MARK = 0xFFFFFFFF / 10; + + byte digit = char2digit(*j); + + if((n > OVERFLOW_MARK) || (n == OVERFLOW_MARK && digit > 5)) + throw Decoding_Error("to_u32bit: Integer overflow"); + n *= 10; + n += digit; + } + return n; + } + + +/************************************************* +* Convert an integer into a string * +*************************************************/ +std::string to_string(u64bit n, u32bit min_len) + { + std::string lenstr; + if(n) + { + while(n > 0) + { + lenstr = digit2char(n % 10) + lenstr; + n /= 10; + } + } + else + lenstr = "0"; + + while(lenstr.size() < min_len) + lenstr = "0" + lenstr; + + return lenstr; + } + +/************************************************* * Parse a SCAN-style algorithm name * *************************************************/ std::vector parse_algorithm_name(const std::string& namex) ============================================================ --- botan/parsing.h +++ botan/parsing.h cc614612daa8f7957ead652e9d7b6155d60e06e4 @@ -0,0 +1,32 @@ +/************************************************* +* Parser Functions Header File * +* (C) 1999-2005 The Botan Project * +*************************************************/ + +#ifndef BOTAN_PARSER_H__ +#define BOTAN_PARSER_H__ + +#include +#include +#include + +namespace Botan { + +/************************************************* +* String Parsing Functions * +*************************************************/ +std::vector parse_algorithm_name(const std::string&); +std::vector split_on(const std::string&, char); +std::vector parse_asn1_oid(const std::string&); +bool x500_name_cmp(const std::string&, const std::string&); +u32bit parse_expr(const std::string&); + +/************************************************* +* String/Integer Conversions * +*************************************************/ +std::string to_string(u64bit, u32bit = 0); +u32bit to_u32bit(const std::string&); + +} + +#endif ============================================================ --- botan/pbes1.cpp 6068b4f4789773bc100896d6114db18b434dd140 +++ botan/pbes1.cpp 649e6fcfe4fde90cb7423caaaa7303df9e8b169b @@ -1,9 +1,10 @@ /************************************************* * PKCS #5 PBES1 Source File * * (C) 1999-2005 The Botan Project * *************************************************/ #include +#include #include #include #include ============================================================ --- botan/pbes2.cpp 3c3e6d6ea030fc44f63b8bcfdaf15ab86c7a624e +++ botan/pbes2.cpp 402a6ec148314cb96273dd54f43360b47a0b0d45 @@ -1,9 +1,10 @@ /************************************************* * PKCS #5 PBES2 Source File * * (C) 1999-2005 The Botan Project * *************************************************/ #include +#include #include #include #include @@ -173,11 +174,11 @@ /************************************************* * Check if this is a known PBES2 cipher * *************************************************/ -bool PBE_PKCS5v20::known_cipher(const std::string& cipher) const +bool PBE_PKCS5v20::known_cipher(const std::string& algo) const { - if(cipher == "AES-128" || cipher == "AES-192" || cipher == "AES-256") + if(algo == "AES-128" || algo == "AES-192" || algo == "AES-256") return true; - if(cipher == "DES" || cipher == "TripleDES") + if(algo == "DES" || algo == "TripleDES") return true; return false; } ============================================================ --- botan/pem.cpp eb4f3783b73f95b339fb1e3579c98ee8028b084a +++ botan/pem.cpp fe377ccf9051816213ded97776eab82c4f7ebe15 @@ -6,6 +6,7 @@ #include #include #include +#include namespace Botan { ============================================================ --- botan/pipe.cpp 8b611a67111f11d7da354d6248412ab1eb8239af +++ botan/pipe.cpp 774a4992b6b17495388d6087ada4cae49e2dc9b7 @@ -1,9 +1,10 @@ /************************************************* * Pipe Source File * * (C) 1999-2005 The Botan Project * *************************************************/ #include +#include #include namespace Botan { @@ -50,8 +51,7 @@ Pipe::~Pipe() { destruct(pipe); - for(u32bit j = 0; j != messages.size(); j++) - delete messages[j]; + delete outputs; } /************************************************* @@ -59,9 +59,10 @@ *************************************************/ void Pipe::init() { + outputs = new Output_Buffers; pipe = 0; default_read = 0; - locked = false; + inside_msg = false; } /************************************************* @@ -69,11 +70,11 @@ *************************************************/ void Pipe::reset() { - if(locked) - throw Invalid_State("Pipe cannot be reset while it is locked"); + if(inside_msg) + throw Invalid_State("Pipe cannot be reset while it is processing"); destruct(pipe); pipe = 0; - locked = false; + inside_msg = false; } /************************************************* @@ -101,7 +102,7 @@ *************************************************/ void Pipe::set_default_msg(u32bit msg) { - if(msg >= messages.size()) + if(msg >= message_count()) throw Invalid_Argument("Pipe::set_default_msg: msg number is too high"); default_read = msg; } @@ -147,13 +148,13 @@ *************************************************/ void Pipe::start_msg() { - if(locked) + if(inside_msg) throw Invalid_State("Pipe::start_msg: Message was already started"); if(pipe == 0) pipe = new Null_Filter; find_endpoints(pipe); pipe->new_msg(); - locked = true; + inside_msg = true; } /************************************************* @@ -161,7 +162,7 @@ *************************************************/ void Pipe::end_msg() { - if(!locked) + if(!inside_msg) throw Invalid_State("Pipe::end_msg: Message was already ended"); pipe->finish_msg(); clear_endpoints(pipe); @@ -170,7 +171,9 @@ delete pipe; pipe = 0; } - locked = false; + inside_msg = false; + + outputs->retire(); } /************************************************* @@ -185,7 +188,7 @@ { SecureQueue* q = new SecureQueue; f->next[j] = q; - messages.push_back(q); + outputs->add(q); } } @@ -199,8 +202,7 @@ { if(f->next[j] && dynamic_cast(f->next[j])) f->next[j] = 0; - if(f->next[j]) - clear_endpoints(f->next[j]); + clear_endpoints(f->next[j]); } } @@ -209,8 +211,8 @@ *************************************************/ void Pipe::append(Filter* filter) { - if(locked) - throw Invalid_State("Cannot append to a Pipe while it is locked"); + if(inside_msg) + throw Invalid_State("Cannot append to a Pipe while it is processing"); if(!filter) return; if(dynamic_cast(filter)) @@ -225,8 +227,8 @@ *************************************************/ void Pipe::prepend(Filter* filter) { - if(locked) - throw Invalid_State("Cannot prepend to a Pipe while it is locked"); + if(inside_msg) + throw Invalid_State("Cannot prepend to a Pipe while it is processing"); if(!filter) return; if(dynamic_cast(filter)) @@ -241,11 +243,15 @@ *************************************************/ void Pipe::pop() { - if(locked) - throw Invalid_State("Cannot pop off a Pipe while it is locked"); - if(!pipe) return; + if(inside_msg) + throw Invalid_State("Cannot pop off a Pipe while it is processing"); + + if(!pipe) + return; + if(pipe->total_ports() > 1) throw Invalid_State("Cannot pop off a Filter with multiple ports"); + Filter* f = pipe; u32bit owns = f->owns(); pipe = pipe->next[0]; @@ -264,7 +270,7 @@ *************************************************/ u32bit Pipe::message_count() const { - return messages.size(); + return outputs->message_count(); } } ============================================================ --- botan/pipe.h c1a3ae0a2ac4d5714f471298a9b978612af93a06 +++ botan/pipe.h 2504d23b4aab823fa55180a13725a6d9f56e893b @@ -18,7 +18,6 @@ class Pipe : public DataSource { public: - static const u32bit MAX_MESSAGES = 0xFFFFFFF0; static const u32bit LAST_MESSAGE = 0xFFFFFFFE; static const u32bit DEFAULT_MESSAGE = 0xFFFFFFFF; @@ -69,11 +68,13 @@ void destruct(Filter*); void find_endpoints(Filter*); void clear_endpoints(Filter*); - class SecureQueue* get_message(const std::string&, u32bit) const; - std::vector messages; + + u32bit get_message_no(const std::string&, u32bit) const; + Filter* pipe; - bool locked; + class Output_Buffers* outputs; u32bit default_read; + bool inside_msg; }; /************************************************* ============================================================ --- botan/pipe_rw.cpp d93a14d30e1feb8c498c90ddf0c4596716994536 +++ botan/pipe_rw.cpp b8b1c777dbee7ebf724531dc9195a7636e23b0e0 @@ -1,31 +1,28 @@ /************************************************* * Pipe Reading/Writing Source File * * (C) 1999-2005 The Botan Project * *************************************************/ #include +#include #include namespace Botan { /************************************************* -* Write into a Pipe * +* Look up the canonical ID for a queue * *************************************************/ -SecureQueue* Pipe::get_message(const std::string& func_name, u32bit msg) const +u32bit Pipe::get_message_no(const std::string& func_name, u32bit msg) const { - if(msg == MAX_MESSAGES) - throw Invalid_State("Pipe::get_message: overflow of message counter"); + if(msg == DEFAULT_MESSAGE) + msg = default_msg(); + else if(msg == LAST_MESSAGE) + msg = message_count() - 1; - if(msg == DEFAULT_MESSAGE) msg = default_msg(); - else if(msg == LAST_MESSAGE) msg = message_count() - 1; - - if(msg >= messages.size()) + if(msg >= message_count()) throw Invalid_Message_Number(func_name, msg); - if(messages[msg]) - return messages[msg]; - else - throw Internal_Error("Pipe:get_message: got NULL for message #" + - to_string(msg)); + + return msg; } /************************************************* @@ -33,8 +30,8 @@ *************************************************/ void Pipe::write(const byte input[], u32bit length) { - if(!locked) - throw Exception("Cannot write to a Pipe while it is unlocked"); + if(!inside_msg) + throw Exception("Cannot write to a Pipe while it is not processing"); pipe->write(input, length); } @@ -80,11 +77,7 @@ *************************************************/ u32bit Pipe::read(byte output[], u32bit length, u32bit msg) { - SecureQueue* msg_queue = get_message("read", msg); - if(msg_queue) - return msg_queue->read(output, length); - else - return 0; + return outputs->read(output, length, get_message_no("read", msg)); } /************************************************* @@ -140,11 +133,7 @@ *************************************************/ u32bit Pipe::remaining(u32bit msg) const { - SecureQueue* msg_queue = get_message("remaining", msg); - if(msg_queue) - return msg_queue->size(); - else - return 0; + return outputs->remaining(get_message_no("remaining", msg)); } /************************************************* @@ -153,11 +142,7 @@ u32bit Pipe::peek(byte output[], u32bit length, u32bit offset, u32bit msg) const { - SecureQueue* msg_queue = get_message("peek", msg); - if(msg_queue) - return msg_queue->peek(output, length, offset); - else - return 0; + return outputs->peek(output, length, offset, get_message_no("peek", msg)); } /************************************************* ============================================================ --- botan/pkcs10.cpp d46f70b67ddf31df4414c885a62855b56ccbc246 +++ botan/pkcs10.cpp 377921951d6c212d506ffd85875229b831ae6769 @@ -1,9 +1,10 @@ /************************************************* * PKCS #10 Source File * * (C) 1999-2005 The Botan Project * *************************************************/ #include +#include #include #include ============================================================ --- botan/pkcs5.cpp cdf709aac78dc4cf416125512278e117589bf8e6 +++ botan/pkcs5.cpp cf89d6b74fd2e397176e49e4aa0de7b644ca642b @@ -5,6 +5,7 @@ #include #include +#include #include #include ============================================================ --- botan/policy.cpp 2969e73e720b3a226776f6f8ede5d24d14bbaaff +++ botan/policy.cpp f695e97b7eef3d49c960d3044b65b53a049e2364 @@ -43,6 +43,7 @@ add_oid("1.2.840.113549.2.5", "MD5"); add_oid("1.3.14.3.2.26", "SHA-160"); + add_oid("1.3.6.1.4.1.11591.12.2", "Tiger(24,3)"); add_oid("1.2.840.113549.1.9.16.3.6", "KeyWrap.TripleDES"); add_oid("1.2.840.113549.1.9.16.3.7", "KeyWrap.RC2"); ============================================================ --- botan/prf_x942.cpp 2e82d09acdab42e88e3dc6cf9fe3b8b545e6d1c2 +++ botan/prf_x942.cpp 6510c500215a92d3031d2f143432e45ed95c314c @@ -7,6 +7,7 @@ #include #include #include +#include #include namespace Botan { ============================================================ --- botan/pubkey.cpp 4565d64054eb4cda0b3abbf7022978292124d46a +++ botan/pubkey.cpp 3fbc4d1720dbaa6d720465ae742d8862e02c1196 @@ -1,11 +1,12 @@ /************************************************* * Public Key Base Source File * * (C) 1999-2005 The Botan Project * *************************************************/ #include +#include +#include #include -#include #include #include ============================================================ --- botan/randpool.cpp 4cd57635f9b7a10426ff4ce53e630dbe86358083 +++ botan/randpool.cpp cd54358602f6d3d1be416d1175fbd586cf711be6 @@ -5,6 +5,8 @@ #include #include +#include +#include namespace Botan { @@ -36,15 +38,14 @@ counter++; for(u32bit j = 0; j != 4; j++) - hash->update(get_byte(j, counter)); + mac->update(get_byte(j, counter)); for(u32bit j = 0; j != 8; j++) - hash->update(get_byte(j, timestamp)); - hash->update(poolhash); + mac->update(get_byte(j, timestamp)); - SecureVector outerhash = hash->final(); + SecureVector mac_val = mac->final(); - for(u32bit j = 0; j != outerhash.size(); j++) - buffer[j % buffer.size()] ^= outerhash[j]; + for(u32bit j = 0; j != mac_val.size(); j++) + buffer[j % buffer.size()] ^= mac_val[j]; cipher->encrypt(buffer); if(counter % ITERATIONS_BEFORE_RESEED == 0) @@ -61,7 +62,8 @@ { const u32bit BLOCK_SIZE = cipher->BLOCK_SIZE; - cipher->set_key(poolhash); + mac->set_key(mac->process(pool)); + cipher->set_key(mac->process(pool)); xor_buf(pool, buffer, BLOCK_SIZE); cipher->encrypt(pool); @@ -72,8 +74,6 @@ xor_buf(this_block, previous_block, BLOCK_SIZE); cipher->encrypt(this_block); } - - poolhash = hash->process(pool); } /************************************************* @@ -82,20 +82,12 @@ void Randpool::add_randomness(const byte data[], u32bit length) { u32bit this_entropy = entropy_estimate(data, length); - entropy += std::min(this_entropy, 8*hash->OUTPUT_LENGTH); + entropy += std::min(this_entropy, 8*mac->OUTPUT_LENGTH); entropy = std::min(entropy, 8 * pool.size()); - while(length) - { - u32bit added = std::min(pool.size() / 2, length); - - xor_buf(pool, data, added); - poolhash = hash->process(pool); - mix_pool(); - - length -= added; - data += added; - } + SecureVector mac_val = mac->process(data, length); + xor_buf(pool, mac_val, mac_val.size()); + mix_pool(); } /************************************************* @@ -112,9 +104,8 @@ void Randpool::clear() throw() { cipher->clear(); - hash->clear(); + mac->clear(); pool.clear(); - poolhash.clear(); buffer.clear(); entropy = counter = 0; } @@ -124,7 +115,7 @@ *************************************************/ std::string Randpool::name() const { - return "Randpool(" + cipher->name() + "," + hash->name() + ")"; + return "Randpool(" + cipher->name() + "," + mac->name() + ")"; } /************************************************* @@ -133,23 +124,24 @@ Randpool::Randpool() : ITERATIONS_BEFORE_RESEED(8), POOL_BLOCKS(32) { const std::string CIPHER_NAME = "AES-256"; - const std::string HASH_NAME = "SHA-256"; + const std::string MAC_NAME = "HMAC(SHA-256)"; cipher = get_block_cipher(CIPHER_NAME); - hash = get_hash(HASH_NAME); + mac = get_mac(MAC_NAME); const u32bit BLOCK_SIZE = cipher->BLOCK_SIZE; - const u32bit OUTPUT_LENGTH = hash->OUTPUT_LENGTH; + const u32bit OUTPUT_LENGTH = mac->OUTPUT_LENGTH; - if(OUTPUT_LENGTH < BLOCK_SIZE || !cipher->valid_keylength(OUTPUT_LENGTH)) + if(OUTPUT_LENGTH < BLOCK_SIZE || + !cipher->valid_keylength(OUTPUT_LENGTH) || + !mac->valid_keylength(OUTPUT_LENGTH)) { delete cipher; - delete hash; + delete mac; throw Internal_Error("Randpool: Invalid algorithm combination " + - CIPHER_NAME + "/" + HASH_NAME); + CIPHER_NAME + "/" + MAC_NAME); } - poolhash = hash->process(pool); buffer.create(BLOCK_SIZE); pool.create(POOL_BLOCKS * BLOCK_SIZE); entropy = counter = 0; @@ -163,7 +155,7 @@ Randpool::~Randpool() { delete cipher; - delete hash; + delete mac; entropy = counter = 0; } ============================================================ --- botan/randpool.h 9e5e53dac9493dd855fa05a563fb80769d5b8988 +++ botan/randpool.h ac16cee42189e9d81f1be3927e6ecfc76240fee9 @@ -30,8 +30,9 @@ const u32bit ITERATIONS_BEFORE_RESEED, POOL_BLOCKS; BlockCipher* cipher; - HashFunction* hash; - SecureVector pool, poolhash, buffer; + MessageAuthenticationCode* mac; + + SecureVector pool, buffer; u32bit entropy, counter; }; ============================================================ --- botan/readme.txt e6d3de9d3e899187f3701bdc2744619db440b22e +++ botan/readme.txt 2e95992aa746384a01dd6ce9c683f040a15539ae @@ -1,31 +1,27 @@ -This version of Botan was modified by Matt Johnston (matt ucc.asn.au) on -November 25 2004 for use with Monotone. +Botan: Version 1.4.10, December 18, 2005 -Changes are the addition of rudimentary gzip (de)compression, and the ability -to decode un-encrypted RAW_BER PKCS8 keys, as well as large amounts of path -rearrangements. - - - -Botan: Version 1.4.3, November 6, 2004 - Botan is a C++ class library for performing a wide variety of cryptographic operations, including encryption, hashing, authentication, public key encryption and signatures, and creating and using X.509v3 certificates and -CRLs. Import/export of PKCS #8 private keys (with optional PKCS #5 v2.0 -encryption), and the creation and processing of PKCS #10 certificate requests -is also supported. Botan includes a large number of algorithms, including: +CRLs. PKCS #8 private keys (including PKCS #5 encryption) and PKCS #10 +certificate requests are also included. As well as various modes, padding +schemes, and so forth, Botan supports the following basic cryptographic +algorithms: * Public Key Algorithms: Diffie-Hellman, DSA, ElGamal, Nyberg-Rueppel, Rabin-Williams, RSA + * Block Ciphers: AES, Blowfish, CAST-128, CAST-256, DES/DESX/TripleDES, GOST, - IDEA, Lion, Luby-Rackoff, MISTY1, RC2, RC5, RC6, SAFER-SK, Serpent, - Skipjack, Square, TEA, Twofish, XTEA + IDEA, KASUMI, Lion, Luby-Rackoff, MARS, MISTY1, RC2, RC5, RC6, SAFER-SK, + SEED, Serpent, Skipjack, Square, TEA, Twofish, XTEA + * Stream Ciphers: ARC4, ISAAC, SEAL, WiderWake4+1 + * Hash Functions: HAS-160, HAVAL, MD2, MD4, MD5, RIPEMD-128, RIPEMD-160, SHA-160, SHA-256, SHA-384, SHA-512, Tiger, Whirlpool -* MACs: ANSI X9.19 MAC, HMAC, OMAC, SSL3-MAC +* MACs: ANSI X9.19 MAC, CMAC, HMAC + For build instructions, read 'doc/building.pdf'. The license can be found in 'doc/license.txt', and the ChangeLog is in 'doc/log.txt'. ============================================================ --- botan/reducer.cpp feddcce261ed731795367445fcf5f316ae598f96 +++ botan/reducer.cpp af05c42c789bbcfcba6ee93371320052a37f7bd5 @@ -1,9 +1,10 @@ /************************************************* * Modular Reducer Source File * * (C) 1999-2005 The Botan Project * *************************************************/ #include +#include namespace Botan { ============================================================ --- botan/rng.cpp 6241291f961c12f562c194b7cd2a57a7fa41e3f9 +++ botan/rng.cpp 7c1cdf73c8815e9bc2dbe381e910c999dca9154c @@ -7,6 +7,7 @@ #include #include #include +#include #include #include ============================================================ --- botan/rsa.cpp 93dedfdfc017f5c2dbb93d548003101f580761d4 +++ botan/rsa.cpp fd012f7422edfebb9f6cc0c979d0e03d5ef36c22 @@ -6,6 +6,7 @@ #include #include #include +#include namespace Botan { @@ -52,7 +53,7 @@ *************************************************/ RSA_PrivateKey::RSA_PrivateKey(u32bit bits, u32bit exp) { - if(bits < 512) + if(bits < 128) throw Invalid_Argument(algo_name() + ": Can't make a key that is only " + to_string(bits) + " bits long"); if(exp < 3 || exp % 2 == 0) ============================================================ --- botan/secmem.h 2aa44f66962bab3f1bba1cc32cc1b4de51e192aa +++ botan/secmem.h dd47f6b950495e2337fcf95bc44d4138d1f993f1 @@ -7,7 +7,6 @@ #define BOTAN_SECURE_MEMORY_BUFFERS_H__ #include -#include #include #include ============================================================ --- botan/secqueue.cpp 47286a3fe1c00e49d0320be854bbef8f16e5df15 +++ botan/secqueue.cpp 930ab85903a98bb87794e938282860e57ea06a32 @@ -48,16 +48,20 @@ /************************************************* * Create a SecureQueue * *************************************************/ -SecureQueue::SecureQueue() : Filter(0) +SecureQueue::SecureQueue() { + set_next(0, 0); head = tail = new SecureQueueNode; } /************************************************* * Copy a SecureQueue * *************************************************/ -SecureQueue::SecureQueue(const SecureQueue& input) : Filter(0), DataSource() +SecureQueue::SecureQueue(const SecureQueue& input) : + Fanout_Filter(), DataSource() { + set_next(0, 0); + head = tail = new SecureQueueNode; SecureQueueNode* temp = input.head; while(temp) ============================================================ --- botan/secqueue.h 88829bd53deeb58ef405f2a51367f0258723fd28 +++ botan/secqueue.h c5ce3de0ceda46423443b1abf297341eb6a702ea @@ -14,7 +14,7 @@ /************************************************* * SecureQueue * *************************************************/ -class SecureQueue : public Filter, public DataSource +class SecureQueue : public Fanout_Filter, public DataSource { public: void write(const byte[], u32bit); ============================================================ --- botan/sha160.cpp 283762dff556d9a03a0921634c178e7d5e84bda5 +++ botan/sha160.cpp 7aa930cdbc87357c36b8df16fb74338df660ce6a @@ -1,9 +1,10 @@ /************************************************* * SHA-160 Source File * * (C) 1999-2005 The Botan Project * *************************************************/ #include +#include namespace Botan { ============================================================ --- botan/sha256.cpp 763f18fe97915f53be1b159f7dd29145384d32ad +++ botan/sha256.cpp 6f8f29549c04f271120115f9c14113dd3b47c502 @@ -1,9 +1,10 @@ /************************************************* * SHA-256 Source File * * (C) 1999-2005 The Botan Project * *************************************************/ #include +#include namespace Botan { ============================================================ --- botan/symkey.cpp 9a1dbc137d57bd32958639b12e0c151d4b9e6f86 +++ botan/symkey.cpp 2769475d3a051cfa8cdaec178c3e23517b5e9d73 @@ -1,9 +1,10 @@ /************************************************* * OctetString Source File * * (C) 1999-2005 The Botan Project * *************************************************/ #include +#include #include #include #include ============================================================ --- botan/symkey.h ae5be2affed3758d5383cd96c60d5643235b2be6 +++ botan/symkey.h 4851cea7540a270a7ac4082c3e1a052664453287 @@ -6,8 +6,8 @@ #ifndef BOTAN_SYMKEY_H__ #define BOTAN_SYMKEY_H__ +#include #include -#include #include namespace Botan { ============================================================ --- botan/timers.cpp 988a7b75cf3464c0176894cddc741fb271e48a16 +++ botan/timers.cpp 0f75eecff82397be0b76891f68c73817e58a8136 @@ -31,6 +31,16 @@ return global_timer->clock(); } +/************************************************* +* Combine a two time values into a single one * +*************************************************/ +u64bit combine_timers(u32bit seconds, u32bit parts, u32bit parts_hz) + { + const u64bit NANOSECONDS_UNITS = 1000000000; + parts *= (NANOSECONDS_UNITS / parts_hz); + return ((seconds * NANOSECONDS_UNITS) + parts); + } + namespace Init { /************************************************* ============================================================ --- botan/types.h be7494e11341bccc6fa12fe984b2a892f88a8532 +++ botan/types.h 6747e38dbc6a39c04386ef1c2b60298a98d6c865 @@ -6,6 +6,8 @@ #ifndef BOTAN_TYPES_H__ #define BOTAN_TYPES_H__ +#include + namespace Botan { typedef unsigned char byte; ============================================================ --- botan/util.cpp 2e15565b61e10420fb51c9e841807dea7fdf9f4e +++ botan/util.cpp ad16ee05002deb5f13a4b9e5e21d2ffa66ae4308 @@ -1,113 +1,16 @@ /************************************************* * Utility Functions Source File * * (C) 1999-2005 The Botan Project * *************************************************/ #include -#include +#include +#include #include namespace Botan { /************************************************* -* XOR arrays together * -*************************************************/ -void xor_buf(byte data[], const byte mask[], u32bit length) - { - while(length >= 8) - { - data[0] ^= mask[0]; data[1] ^= mask[1]; - data[2] ^= mask[2]; data[3] ^= mask[3]; - data[4] ^= mask[4]; data[5] ^= mask[5]; - data[6] ^= mask[6]; data[7] ^= mask[7]; - data += 8; mask += 8; length -= 8; - } - for(u32bit j = 0; j != length; j++) - data[j] ^= mask[j]; - } - -void xor_buf(byte out[], const byte in[], const byte mask[], u32bit length) - { - while(length >= 8) - { - out[0] = in[0] ^ mask[0]; out[1] = in[1] ^ mask[1]; - out[2] = in[2] ^ mask[2]; out[3] = in[3] ^ mask[3]; - out[4] = in[4] ^ mask[4]; out[5] = in[5] ^ mask[5]; - out[6] = in[6] ^ mask[6]; out[7] = in[7] ^ mask[7]; - in += 8; out += 8; mask += 8; length -= 8; - } - for(u32bit j = 0; j != length; j++) - out[j] = in[j] ^ mask[j]; - } - -/************************************************* -* Return true iff arg is 2**n for some n > 0 * -*************************************************/ -bool power_of_2(u64bit arg) - { - if(arg == 0 || arg == 1) - return false; - if((arg & (arg-1)) == 0) - return true; - return false; - } - -/************************************************* -* Combine a two time values into a single one * -*************************************************/ -u64bit combine_timers(u32bit seconds, u32bit parts, u32bit parts_hz) - { - const u64bit NANOSECONDS_UNITS = 1000000000; - parts *= (NANOSECONDS_UNITS / parts_hz); - return ((seconds * NANOSECONDS_UNITS) + parts); - } - -/************************************************* -* Return the index of the highest set bit * -*************************************************/ -u32bit high_bit(u64bit n) - { - for(u32bit count = 64; count > 0; count--) - if((n >> (count - 1)) & 0x01) - return count; - return 0; - } - -/************************************************* -* Return the index of the lowest set bit * -*************************************************/ -u32bit low_bit(u64bit n) - { - for(u32bit count = 0; count != 64; count++) - if((n >> count) & 0x01) - return (count + 1); - return 0; - } - -/************************************************* -* Return the number of significant bytes in n * -*************************************************/ -u32bit significant_bytes(u64bit n) - { - for(u32bit j = 0; j != 8; j++) - if(get_byte(j, n)) - return 8-j; - return 0; - } - -/************************************************* -* Return the Hamming weight of n * -*************************************************/ -u32bit hamming_weight(u64bit n) - { - u32bit weight = 0; - for(u32bit j = 0; j != 64; j++) - if((n >> j) & 0x01) - weight++; - return weight; - } - -/************************************************* * Round up n to multiple of align_to * *************************************************/ u32bit round_up(u32bit n, u32bit align_to) @@ -144,50 +47,6 @@ } /************************************************* -* Convert an integer into a string * -*************************************************/ -std::string to_string(u64bit n, u32bit min_len) - { - std::string lenstr; - if(n) - { - while(n > 0) - { - lenstr = digit2char(n % 10) + lenstr; - n /= 10; - } - } - else - lenstr = "0"; - - while(lenstr.size() < min_len) - lenstr = "0" + lenstr; - - return lenstr; - } - -/************************************************* -* Convert an integer into a string * -*************************************************/ -u32bit to_u32bit(const std::string& number) - { - u32bit n = 0; - - for(std::string::const_iterator j = number.begin(); j != number.end(); j++) - { - const u32bit OVERFLOW_MARK = 0xFFFFFFFF / 10; - - byte digit = char2digit(*j); - - if((n > OVERFLOW_MARK) || (n == OVERFLOW_MARK && digit > 5)) - throw Decoding_Error("to_u32bit: Integer overflow"); - n *= 10; - n += digit; - } - return n; - } - -/************************************************* * Estimate the entropy of the buffer * *************************************************/ u32bit entropy_estimate(const byte buffer[], u32bit length) ============================================================ --- botan/util.h bc34ee6faa38faa9e3a176cf4b046cec86020ad9 +++ botan/util.h 7859becfb3fbbac552c6a78de5b265475fa4a767 @@ -6,56 +6,11 @@ #ifndef BOTAN_UTIL_H__ #define BOTAN_UTIL_H__ -#include -#include -#include -#include -#include -#include +#include namespace Botan { /************************************************* -* Rotation Functions * -*************************************************/ -template inline T rotate_left(T input, u32bit rot) - { return (T)((input << rot) | (input >> (8*sizeof(T)-rot))); } - -template inline T rotate_right(T input, u32bit rot) - { return (T)((input >> rot) | (input << (8*sizeof(T)-rot))); } - -/************************************************* -* Byte Extraction Function * -*************************************************/ -template inline byte get_byte(u32bit byte_num, T input) - { return (byte)(input >> ((sizeof(T)-1-(byte_num&(sizeof(T)-1))) << 3)); } - -/************************************************* -* Byte to Word Conversions * -*************************************************/ -inline u16bit make_u16bit(byte input0, byte input1) - { return (u16bit)(((u16bit)input0 << 8) | input1); } - -inline u32bit make_u32bit(byte input0, byte input1, byte input2, byte input3) - { return (u32bit)(((u32bit)input0 << 24) | ((u32bit)input1 << 16) | - ((u32bit)input2 << 8) | input3); } - -inline u64bit make_u64bit(byte input0, byte input1, byte input2, byte input3, - byte input4, byte input5, byte input6, byte input7) - { - return (u64bit)(((u64bit)input0 << 56) | ((u64bit)input1 << 48) | - ((u64bit)input2 << 40) | ((u64bit)input3 << 32) | - ((u64bit)input4 << 24) | ((u64bit)input5 << 16) | - ((u64bit)input6 << 8) | input7); - } - -/************************************************* -* XOR Functions * -*************************************************/ -void xor_buf(byte[], const byte[], u32bit); -void xor_buf(byte[], const byte[], const byte[], u32bit); - -/************************************************* * Timer Access Functions * *************************************************/ u64bit system_time(); @@ -68,22 +23,8 @@ void unlock_mem(void*, u32bit); /************************************************* -* Parsing functions * -*************************************************/ -std::vector parse_algorithm_name(const std::string&); -std::vector split_on(const std::string&, char); -std::vector parse_asn1_oid(const std::string&); -bool x500_name_cmp(const std::string&, const std::string&); -u32bit parse_expr(const std::string&); - -/************************************************* * Misc Utility Functions * *************************************************/ -bool power_of_2(u64bit); -u32bit high_bit(u64bit); -u32bit low_bit(u64bit); -u32bit significant_bytes(u64bit); -u32bit hamming_weight(u64bit); u32bit round_up(u32bit, u32bit); u32bit round_down(u32bit, u32bit); u64bit combine_timers(u32bit, u32bit, u32bit); @@ -94,12 +35,6 @@ u32bit entropy_estimate(const byte[], u32bit); u32bit dl_work_factor(u32bit); -/************************************************* -* String/Integer Conversions * -*************************************************/ -std::string to_string(u64bit, u32bit = 0); -u32bit to_u32bit(const std::string&); - } #endif ============================================================ --- botan/version.h e73ea207b4bcd5f6bb75baff61666b274b205cb9 +++ botan/version.h f834edcd6981ebe2560d045a4cf24a4fb3946969 @@ -7,7 +7,6 @@ #define BOTAN_VERSION_H__ #include -#include #include namespace Botan { ============================================================ --- botan/x509_ca.cpp 9f52746349237842fd87650177ec418ab196abb3 +++ botan/x509_ca.cpp a6ca91a885bd8be1508fe8348af1282563742659 @@ -10,6 +10,7 @@ #include #include #include +#include #include #include ============================================================ --- botan/x509_crl.cpp f6d30db8bc65b12ed646fe5418bf14d058a01257 +++ botan/x509_crl.cpp e3bdb21e5c44ca51be84f8793316df1f66552737 @@ -1,9 +1,10 @@ /************************************************* * X.509 CRL Source File * * (C) 1999-2005 The Botan Project * *************************************************/ #include +#include #include #include #include ============================================================ --- botan/x509_key.cpp 7b5056172f3f94a53935a8582b4bc42f69bdc036 +++ botan/x509_key.cpp 17699009477db1124b409f6e5e393a1cd709c2e4 @@ -140,7 +140,7 @@ *************************************************/ X509_PublicKey* load_key(const std::string& fsname) { - DataSource_Stream source(fsname); + DataSource_Stream source(fsname, true); return X509::load_key(source); } ============================================================ --- botan/x509_obj.cpp 1d6e176d66362ef556dcdca527924776db81c427 +++ botan/x509_obj.cpp 78e2d735c2a3cf3bb74b5ef36e4a7c132661c4ab @@ -1,9 +1,10 @@ /************************************************* * X.509 SIGNED Object Source File * * (C) 1999-2005 The Botan Project * *************************************************/ #include +#include #include namespace Botan { @@ -21,7 +22,7 @@ *************************************************/ X509_Object::X509_Object(const std::string& file, const std::string& labels) { - DataSource_Stream stream(file); + DataSource_Stream stream(file, true); init(stream, labels); } ============================================================ --- botan/x509cert.cpp 9554fb9bca448dc6ee6236ba3841f67728c857e8 +++ botan/x509cert.cpp 9eea501682d3e1f6cd0c35caf8dcc0c1acc6349d @@ -1,9 +1,10 @@ /************************************************* * X.509 Certificates Source File * * (C) 1999-2005 The Botan Project * *************************************************/ #include +#include #include #include #include ============================================================ --- botan/x509find.cpp 4424040676ed96bf27580bff45226299060557e9 +++ botan/x509find.cpp 3540674cc40657424e46fa805404cb2c782064af @@ -1,9 +1,10 @@ /************************************************* * X.509 Certificate Store Searching Source File * * (C) 1999-2005 The Botan Project * *************************************************/ #include +#include #include #include ============================================================ --- botan/x509opt.cpp 8cc80bac5a3867975b45f3e390a09eb9b72adf0d +++ botan/x509opt.cpp dd7040911c23c5a13f5682f5fe4e9d475db2b0f8 @@ -1,9 +1,11 @@ /************************************************* * X.509 Certificate Options Source File * * (C) 1999-2005 The Botan Project * *************************************************/ #include +#include +#include #include #include #include ============================================================ --- botan/x509stor.cpp ab702468d4cd4cdfbe36adcaf37b0782ac4f643a +++ botan/x509stor.cpp 5d4584af2b3b825022727421f15a65ef72a2ce58 @@ -1,13 +1,15 @@ /************************************************* * X.509 Certificate Store Source File * * (C) 1999-2005 The Botan Project * *************************************************/ #include +#include #include #include #include #include +#include #include #include ============================================================ --- botan/x931_rng.cpp ddea0d278bffdcc62a9a0a9cefca860fc4447c44 +++ botan/x931_rng.cpp 48f15e5b870a4e1ced8dc06df188e7952feef520 @@ -6,6 +6,7 @@ #include #include #include +#include namespace Botan { ============================================================ --- transforms.cc c0734188f05e6d4920dc0509389e77e351d5ff06 +++ transforms.cc f41b6f044da14ded182446f88825ebb71acc0eab @@ -350,7 +350,7 @@ // Best to be safe and check it isn't a dir. assert_path_is_file(file); Botan::Pipe p(new Botan::Hash_Filter("SHA-1"), new Botan::Hex_Encoder()); - Botan::DataSource_Stream infile(file.as_external()); + Botan::DataSource_Stream infile(file.as_external(), true); p.process_msg(infile); ident = lowercase(p.read_all_as_string());