clean up some formatting issues w/ standard type PR, etc.
This commit is contained in:
parent
c9e32170ba
commit
15dfea4d85
|
@ -103,6 +103,7 @@ void cFCOSpecList::Add(iFCOSpec* pSpec, cFCOSpecAttr* pAttr)
|
|||
pAttr = new cFCOSpecAttr;
|
||||
else
|
||||
pAttr->AddRef();
|
||||
|
||||
for (itr = mCanonicalList.begin();; ++itr)
|
||||
{
|
||||
if (itr == mCanonicalList.end() || iFCOSpecUtil::FCOSpecLessThan(*pSpec, *itr->first))
|
||||
|
@ -118,18 +119,22 @@ iFCOSpec* cFCOSpecList::Lookup(iFCOSpec* pSpec) const
|
|||
{
|
||||
std::list<PairType>::iterator itr;
|
||||
for (itr = mCanonicalList.begin(); itr != mCanonicalList.end(); ++itr)
|
||||
{
|
||||
if (itr->first == pSpec)
|
||||
{
|
||||
pSpec->AddRef();
|
||||
return itr->first;
|
||||
}
|
||||
}
|
||||
|
||||
for (itr = mCanonicalList.begin(); itr != mCanonicalList.end(); ++itr)
|
||||
{
|
||||
if (iFCOSpecUtil::FCOSpecEqual(*pSpec, *itr->first))
|
||||
{
|
||||
itr->first->AddRef();
|
||||
return itr->first;
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
@ -141,11 +146,10 @@ void cFCOSpecList::Read(iSerializer* pSerializer, int32_t version)
|
|||
|
||||
Clear();
|
||||
|
||||
int i;
|
||||
int32_t size;
|
||||
pSerializer->ReadInt32(size);
|
||||
|
||||
for (i = 0; i < size; ++i)
|
||||
for (int i = 0; i < size; ++i)
|
||||
{
|
||||
iFCOSpec* pReadInSpec = static_cast<iFCOSpec*>(pSerializer->ReadObjectDynCreate());
|
||||
cFCOSpecAttr* pSpecAttr = static_cast<cFCOSpecAttr*>(pSerializer->ReadObjectDynCreate());
|
||||
|
|
|
@ -128,10 +128,10 @@ private:
|
|||
|
||||
typedef std::map<int64_t, TSTRING> INT64_TO_STRING_MAP;
|
||||
|
||||
bool GetUsername( const int64_t& i64uid, TSTRING& tstrUsername) const;
|
||||
bool GetGroupname( const int64_t& i64uid, TSTRING& tstrGroupname) const;
|
||||
bool AddUsernameMapping( const int64_t& i64ID, const TSTRING& tstrUsername);
|
||||
bool AddGroupnameMapping( const int64_t& i64ID, const TSTRING& tstrGroupname);
|
||||
bool GetUsername(const int64_t& i64uid, TSTRING& tstrUsername) const;
|
||||
bool GetGroupname(const int64_t& i64uid, TSTRING& tstrGroupname) const;
|
||||
bool AddUsernameMapping(const int64_t& i64ID, const TSTRING& tstrUsername);
|
||||
bool AddGroupnameMapping(const int64_t& i64ID, const TSTRING& tstrGroupname);
|
||||
|
||||
// storage for conversion stuff
|
||||
INT64_TO_STRING_MAP uidToUsername;
|
||||
|
|
|
@ -343,7 +343,7 @@ void cKeyFile::WriteMem(int8_t* pMem) const // throw eKeyFile()
|
|||
memcpy(pMem, mpPrivateKeyMem, mPrivateKeyMemLen);
|
||||
}
|
||||
|
||||
int32_t cKeyFile::GetWriteLen() // throw eKeyFile()
|
||||
int cKeyFile::GetWriteLen() // throw eKeyFile()
|
||||
{
|
||||
if (!KeysLoaded())
|
||||
{
|
||||
|
@ -359,7 +359,7 @@ int32_t cKeyFile::GetWriteLen() // throw eKeyFile()
|
|||
mPrivateKeyMemLen; // the private key
|
||||
}
|
||||
|
||||
void cKeyFile::ProtectKeys(int8_t* passphrase, int32_t passphraseLen) // throw eKeyFile()
|
||||
void cKeyFile::ProtectKeys(int8_t* passphrase, int passphraseLen) // throw eKeyFile()
|
||||
{
|
||||
int i;
|
||||
int16_t i16;
|
||||
|
@ -470,7 +470,7 @@ const cElGamalSigPrivateKey* cKeyFile::GetPrivateKey(int8_t* passphrase, int pas
|
|||
ASSERT(des.GetBlockSizeCipher() == des.GetBlockSizePlain());
|
||||
|
||||
// get a copy of the ciphertext and decrypt it
|
||||
uint8_t* plainPrivateKeyMem = new uint8_t[mPrivateKeyMemLen];
|
||||
int8_t* plainPrivateKeyMem = new int8_t[mPrivateKeyMemLen];
|
||||
memcpy(plainPrivateKeyMem, mpPrivateKeyMem, mPrivateKeyMemLen);
|
||||
|
||||
ASSERT(mPrivateKeyMemLen % des.GetBlockSizePlain() == 0);
|
||||
|
@ -486,7 +486,7 @@ const cElGamalSigPrivateKey* cKeyFile::GetPrivateKey(int8_t* passphrase, int pas
|
|||
|
||||
if (len + cHashedKey128::GetWriteLen() + sizeof(int16_t) > (unsigned int)mPrivateKeyMemLen)
|
||||
{
|
||||
RandomizeBytes((int8_t*)plainPrivateKeyMem, mPrivateKeyMemLen);
|
||||
RandomizeBytes(plainPrivateKeyMem, mPrivateKeyMemLen);
|
||||
delete [] plainPrivateKeyMem;
|
||||
RandomizeBytes(passphrase, passphraseLen);
|
||||
return 0;
|
||||
|
@ -498,7 +498,7 @@ const cElGamalSigPrivateKey* cKeyFile::GetPrivateKey(int8_t* passphrase, int pas
|
|||
if (memcmp(plainPrivateKeyMem, privateHash.GetKey(), cHashedKey128::GetWriteLen()) != 0)
|
||||
{
|
||||
// passphrase didn't do the job
|
||||
RandomizeBytes((int8_t*)plainPrivateKeyMem, mPrivateKeyMemLen);
|
||||
RandomizeBytes(plainPrivateKeyMem, mPrivateKeyMemLen);
|
||||
delete [] plainPrivateKeyMem;
|
||||
RandomizeBytes(passphrase, passphraseLen);
|
||||
return 0;
|
||||
|
@ -506,7 +506,7 @@ const cElGamalSigPrivateKey* cKeyFile::GetPrivateKey(int8_t* passphrase, int pas
|
|||
|
||||
mpPrivateKey = new cElGamalSigPrivateKey(plainPrivateKeyMem + cHashedKey128::GetWriteLen() + sizeof(int16_t));
|
||||
|
||||
RandomizeBytes((int8_t*)plainPrivateKeyMem, mPrivateKeyMemLen);
|
||||
RandomizeBytes(plainPrivateKeyMem, mPrivateKeyMemLen);
|
||||
delete [] plainPrivateKeyMem;
|
||||
|
||||
RandomizeBytes(passphrase, passphraseLen);
|
||||
|
|
Loading…
Reference in New Issue