# # patch "ChangeLog" # from [6140cbe75000f7567aebb500b15c8191d7dab8d9] # to [5b3d7c54d7c8bf7d28f3e8cea1704596e98e680e] # # patch "hmac.cc" # from [006266ad1f563121dcb9d3130459a5b6ba073c0e] # to [fc84ce73650948cf8c3e6c9e1471a9d5d657e90c] # # patch "hmac.hh" # from [4b012fb5898d3f51103b7805053a4ed3d3da8677] # to [416753e704f4a6294e4f76b57e732dfa36a733e0] # # patch "keys.cc" # from [25b21dafac6dfc724af030bb11ed7a1d69d1333a] # to [a02951c9ede0f03585c8802a09335de479c80f5c] # =============================================== --- ChangeLog 6140cbe75000f7567aebb500b15c8191d7dab8d9 +++ ChangeLog 5b3d7c54d7c8bf7d28f3e8cea1704596e98e680e @@ -1,13 +1,9 @@ -2005-07-08 Matt Johnston +2005-07-11 Matt Johnston - * propagate mainline to botan branch + * keys.cc (encrypt_rsa): fix typo + * hmac.{cc,hh}: store key as SymmetricKey, pass correctly to + MAC_Filter - * constants.{cc,hh}: add sha1_digest_length as botan - doesn't provide a convenient definition. - * hmac.{cc,hh}: convert to use botan - * keys.cc (encrypt_rsa, decrypt_rsa): use botan - * transforms.{cc,hh}: use botan - 2005-07-10 Nathaniel Smith * ChangeLog, configure.ac: Re-remove mysteriously revived @@ -71,6 +67,16 @@ 2005-07-08 Matt Johnston + * propagate mainline to botan branch + + * constants.{cc,hh}: add sha1_digest_length as botan + doesn't provide a convenient definition. + * hmac.{cc,hh}: convert to use botan + * keys.cc (encrypt_rsa, decrypt_rsa): use botan + * transforms.{cc,hh}: use botan + +2005-07-08 Matt Johnston + * tests/t_normalized_filenames.at: expect exit code of 1 not 3 for "cat manifest" with a directory in MT/work * file_io.cc, netcmd.cc, transforms.cc, vocab.hh: revert changes which =============================================== --- hmac.cc 006266ad1f563121dcb9d3130459a5b6ba073c0e +++ hmac.cc fc84ce73650948cf8c3e6c9e1471a9d5d657e90c @@ -8,7 +8,8 @@ #include "constants.hh" chained_hmac::chained_hmac(netsync_session_key const & session_key) : - key(session_key), hmac_length(constants::sha1_digest_length) + hmac_length(constants::sha1_digest_length), + key(reinterpret_cast(session_key().data()), session_key().size()) { chain_val.assign(hmac_length, 0x00); } @@ -16,8 +17,8 @@ void chained_hmac::set_key(netsync_session_key const & session_key) { - P(F("setkey here, size %d\n") % session_key().size()); - key = session_key; + key = Botan::SymmetricKey(reinterpret_cast(session_key().data()), + session_key().size()); } std::string @@ -29,7 +30,8 @@ I(pos + n <= str.size()); - Botan::Pipe p(new Botan::MAC_Filter("HMAC(SHA-1)", key(), key().size())); + Botan::Pipe p(new Botan::MAC_Filter("HMAC(SHA-1)", key, + constants::sha1_digest_length)); p.start_msg(); p.write(chain_val); p.write(reinterpret_cast(str.data() + pos), n); =============================================== --- hmac.hh 4b012fb5898d3f51103b7805053a4ed3d3da8677 +++ hmac.hh 416753e704f4a6294e4f76b57e732dfa36a733e0 @@ -1,8 +1,9 @@ #ifndef __HMAC_HH__ #define __HMAC_HH__ #include +#include "botan/botan.h" #include "vocab.hh" #include "constants.hh" @@ -17,7 +18,7 @@ size_t const hmac_length; private: - netsync_session_key key; + Botan::SymmetricKey key; std::string chain_val; }; =============================================== --- keys.cc 25b21dafac6dfc724af030bb11ed7a1d69d1333a +++ keys.cc a02951c9ede0f03585c8802a09335de479c80f5c @@ -366,7 +366,7 @@ throw informative_failure("Failed to get RSA encrypting key"); shared_ptr encryptor; - encryptor = shared_ptr(get_pk_encryptor(*pub_key, "EME(SHA-1)")); + encryptor = shared_ptr(get_pk_encryptor(*pub_key, "EME1(SHA-1)")); SecureVector ct; ct = encryptor->encrypt(