diff options
author | lloyd <[email protected]> | 2009-03-30 18:27:18 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2009-03-30 18:27:18 +0000 |
commit | 96d6eb6f29c55e16a37cf11899547886f735b065 (patch) | |
tree | 9f13901e9b44c98d58b2589c9b09c6a7443eb7cd /src/pbe | |
parent | 3cc3dd72c5f87b76852a55c1f2d1821dba967d8c (diff) |
Thomas Moschny passed along a request from the Fedora packagers which came
up during the Fedora submission review, that each source file include some
text about the license. One handy Perl script later and each file now has
the line
Distributed under the terms of the Botan license
after the copyright notices.
While I was in there modifying every file anyway, I also stripped out the
remainder of the block comments (lots of astericks before and after the
text); this is stylistic thing I picked up when I was first learning C++
but in retrospect it is not a good style as the structure makes it harder
to modify comments (with the result that comments become fewer, shorter and
are less likely to be updated, which are not good things).
Diffstat (limited to 'src/pbe')
-rw-r--r-- | src/pbe/get_pbe.cpp | 22 | ||||
-rw-r--r-- | src/pbe/get_pbe.h | 10 | ||||
-rw-r--r-- | src/pbe/pbes1/pbes1.cpp | 70 | ||||
-rw-r--r-- | src/pbe/pbes1/pbes1.h | 16 | ||||
-rw-r--r-- | src/pbe/pbes2/pbes2.cpp | 4 | ||||
-rw-r--r-- | src/pbe/pbes2/pbes2.h | 16 |
6 files changed, 75 insertions, 63 deletions
diff --git a/src/pbe/get_pbe.cpp b/src/pbe/get_pbe.cpp index 961da4afc..3217101ef 100644 --- a/src/pbe/get_pbe.cpp +++ b/src/pbe/get_pbe.cpp @@ -1,7 +1,9 @@ -/************************************************* -* PBE Retrieval Source File * -* (C) 1999-2007 Jack Lloyd * -*************************************************/ +/* +* PBE Retrieval +* (C) 1999-2007 Jack Lloyd +* +* Distributed under the terms of the Botan license +*/ #include <botan/get_pbe.h> #include <botan/oids.h> @@ -19,9 +21,9 @@ namespace Botan { -/************************************************* -* Get an encryption PBE, set new parameters * -*************************************************/ +/* +* Get an encryption PBE, set new parameters +*/ PBE* get_pbe(const std::string& algo_spec) { SCAN_Name request(algo_spec); @@ -69,9 +71,9 @@ PBE* get_pbe(const std::string& algo_spec) throw Algorithm_Not_Found(algo_spec); } -/************************************************* -* Get a decryption PBE, decode parameters * -*************************************************/ +/* +* Get a decryption PBE, decode parameters +*/ PBE* get_pbe(const OID& pbe_oid, DataSource& params) { SCAN_Name request(OIDS::lookup(pbe_oid)); diff --git a/src/pbe/get_pbe.h b/src/pbe/get_pbe.h index b73a79c80..04eda6696 100644 --- a/src/pbe/get_pbe.h +++ b/src/pbe/get_pbe.h @@ -1,7 +1,9 @@ -/************************************************* -* PBE Lookup Header File * -* (C) 1999-2007 Jack Lloyd * -*************************************************/ +/* +* PBE Lookup +* (C) 1999-2007 Jack Lloyd +* +* Distributed under the terms of the Botan license +*/ #ifndef BOTAN_LOOKUP_PBE_H__ #define BOTAN_LOOKUP_PBE_H__ diff --git a/src/pbe/pbes1/pbes1.cpp b/src/pbe/pbes1/pbes1.cpp index c663865cf..21bd330ff 100644 --- a/src/pbe/pbes1/pbes1.cpp +++ b/src/pbe/pbes1/pbes1.cpp @@ -1,7 +1,9 @@ -/************************************************* -* PKCS #5 PBES1 Source File * -* (C) 1999-2007 Jack Lloyd * -*************************************************/ +/* +* PKCS #5 PBES1 +* (C) 1999-2007 Jack Lloyd +* +* Distributed under the terms of the Botan license +*/ #include <botan/pbes1.h> #include <botan/pbkdf1.h> @@ -12,9 +14,9 @@ namespace Botan { -/************************************************* -* Encrypt some bytes using PBES1 * -*************************************************/ +/* +* Encrypt some bytes using PBES1 +*/ void PBE_PKCS5v15::write(const byte input[], u32bit length) { while(length) @@ -26,9 +28,9 @@ void PBE_PKCS5v15::write(const byte input[], u32bit length) } } -/************************************************* -* Start encrypting with PBES1 * -*************************************************/ +/* +* Start encrypting with PBES1 +*/ void PBE_PKCS5v15::start_msg() { if(direction == ENCRYPTION) @@ -45,9 +47,9 @@ void PBE_PKCS5v15::start_msg() pipe.set_default_msg(pipe.default_msg() + 1); } -/************************************************* -* Finish encrypting with PBES1 * -*************************************************/ +/* +* Finish encrypting with PBES1 +*/ void PBE_PKCS5v15::end_msg() { pipe.end_msg(); @@ -55,9 +57,9 @@ void PBE_PKCS5v15::end_msg() pipe.reset(); } -/************************************************* -* Flush the pipe * -*************************************************/ +/* +* Flush the pipe +*/ void PBE_PKCS5v15::flush_pipe(bool safe_to_skip) { if(safe_to_skip && pipe.remaining() < 64) @@ -71,9 +73,9 @@ void PBE_PKCS5v15::flush_pipe(bool safe_to_skip) } } -/************************************************* -* Set the passphrase to use * -*************************************************/ +/* +* Set the passphrase to use +*/ void PBE_PKCS5v15::set_key(const std::string& passphrase) { PKCS5_PBKDF1 pbkdf(hash_function->clone()); @@ -86,9 +88,9 @@ void PBE_PKCS5v15::set_key(const std::string& passphrase) iv.set(key_and_iv.begin() + 8, 8); } -/************************************************* -* Create a new set of PBES1 parameters * -*************************************************/ +/* +* Create a new set of PBES1 parameters +*/ void PBE_PKCS5v15::new_params(RandomNumberGenerator& rng) { iterations = 2048; @@ -96,9 +98,9 @@ void PBE_PKCS5v15::new_params(RandomNumberGenerator& rng) rng.randomize(salt, salt.size()); } -/************************************************* -* Encode PKCS#5 PBES1 parameters * -*************************************************/ +/* +* Encode PKCS#5 PBES1 parameters +*/ MemoryVector<byte> PBE_PKCS5v15::encode_params() const { return DER_Encoder() @@ -109,9 +111,9 @@ MemoryVector<byte> PBE_PKCS5v15::encode_params() const .get_contents(); } -/************************************************* -* Decode PKCS#5 PBES1 parameters * -*************************************************/ +/* +* Decode PKCS#5 PBES1 parameters +*/ void PBE_PKCS5v15::decode_params(DataSource& source) { BER_Decoder(source) @@ -125,9 +127,9 @@ void PBE_PKCS5v15::decode_params(DataSource& source) throw Decoding_Error("PBES1: Encoded salt is not 8 octets"); } -/************************************************* -* Return an OID for this PBES1 type * -*************************************************/ +/* +* Return an OID for this PBES1 type +*/ OID PBE_PKCS5v15::get_oid() const { const OID base_pbes1_oid("1.2.840.113549.1.5"); @@ -151,9 +153,9 @@ OID PBE_PKCS5v15::get_oid() const throw Internal_Error("PBE-PKCS5 v1.5: get_oid() has run out of options"); } -/************************************************* -* PKCS#5 v1.5 PBE Constructor * -*************************************************/ +/* +* PKCS#5 v1.5 PBE Constructor +*/ PBE_PKCS5v15::PBE_PKCS5v15(BlockCipher* cipher, HashFunction* hash, Cipher_Dir dir) : diff --git a/src/pbe/pbes1/pbes1.h b/src/pbe/pbes1/pbes1.h index 2c96a8d1e..2e1855dc2 100644 --- a/src/pbe/pbes1/pbes1.h +++ b/src/pbe/pbes1/pbes1.h @@ -1,7 +1,9 @@ -/************************************************* -* PKCS #5 v1.5 PBE Header File * -* (C) 1999-2007 Jack Lloyd * -*************************************************/ +/* +* PKCS #5 v1.5 PBE +* (C) 1999-2007 Jack Lloyd +* +* Distributed under the terms of the Botan license +*/ #ifndef BOTAN_PBE_PKCS_V15_H__ #define BOTAN_PBE_PKCS_V15_H__ @@ -13,9 +15,9 @@ namespace Botan { -/************************************************* -* PKCS#5 v1.5 PBE * -*************************************************/ +/* +* PKCS#5 v1.5 PBE +*/ class BOTAN_DLL PBE_PKCS5v15 : public PBE { public: diff --git a/src/pbe/pbes2/pbes2.cpp b/src/pbe/pbes2/pbes2.cpp index e4d11eda5..b7e2589d0 100644 --- a/src/pbe/pbes2/pbes2.cpp +++ b/src/pbe/pbes2/pbes2.cpp @@ -1,6 +1,8 @@ /** -* PKCS #5 PBES2 Source File +* PKCS #5 PBES2 * (C) 1999-2008 Jack Lloyd +* +* Distributed under the terms of the Botan license */ #include <botan/pbes2.h> diff --git a/src/pbe/pbes2/pbes2.h b/src/pbe/pbes2/pbes2.h index a07fcca68..fc460a228 100644 --- a/src/pbe/pbes2/pbes2.h +++ b/src/pbe/pbes2/pbes2.h @@ -1,7 +1,9 @@ -/************************************************* -* PKCS #5 v2.0 PBE Header File * -* (C) 1999-2007 Jack Lloyd * -*************************************************/ +/* +* PKCS #5 v2.0 PBE +* (C) 1999-2007 Jack Lloyd +* +* Distributed under the terms of the Botan license +*/ #ifndef BOTAN_PBE_PKCS_v20_H__ #define BOTAN_PBE_PKCS_v20_H__ @@ -13,9 +15,9 @@ namespace Botan { -/************************************************* -* PKCS#5 v2.0 PBE * -*************************************************/ +/* +* PKCS#5 v2.0 PBE +*/ class BOTAN_DLL PBE_PKCS5v20 : public PBE { public: |