# HG changeset patch # User Pat Downey # Date 1279055400 -3600 # Node ID 1ff75f0383590a22cddce8fc52d410b187fb49f4 # Parent a5e05e7296f98b5335aaf284af1f4aebde7a0961# Parent 831589831d0461d8fc33dac80069c1a0fcfb9213 Merge fixes for bug 1170 and bug 1301. diff -r 831589831d04 -r 1ff75f038359 crypto/weakcryptospi/source/bigint/bigint.cpp --- a/crypto/weakcryptospi/source/bigint/bigint.cpp Mon Jun 28 09:47:25 2010 +0530 +++ b/crypto/weakcryptospi/source/bigint/bigint.cpp Tue Jul 13 22:10:00 2010 +0100 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2003-2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of the License "Eclipse Public License v1.0" @@ -1084,16 +1084,13 @@ // For i from 1 to (2^(k-1) -1) do g2i+1 <- g2i-1 * g2 TUint count = (1 << (slider.WindowSize()-1)) - 1; //2^(k-1) -1 RRArray powerArray(count+1); //+1 because we append g1 - User::LeaveIfError(powerArray.Append(g1)); + powerArray.AppendL(g1); CleanupStack::Pop(); //g1 CleanupClosePushL(powerArray); for(TUint k=1; k <= count; k++) { RInteger g2iplus1 = g2.TimesL(powerArray[k-1]); - //This append can't fail as the granularity is set high enough - //plus we've already called Append once which will alloc to the - //set granularity - powerArray.Append(g2iplus1); + powerArray.AppendL(g2iplus1); } // 2 A <- 1, i <- t diff -r 831589831d04 -r 1ff75f038359 cryptoservices/certificateandkeymgmt/tcertstore/T_ccttokentypeinfoattributes.cpp --- a/cryptoservices/certificateandkeymgmt/tcertstore/T_ccttokentypeinfoattributes.cpp Mon Jun 28 09:47:25 2010 +0530 +++ b/cryptoservices/certificateandkeymgmt/tcertstore/T_ccttokentypeinfoattributes.cpp Tue Jul 13 22:10:00 2010 +0100 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2005-2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of the License "Eclipse Public License v1.0" @@ -70,8 +70,8 @@ RArray uidArray; CleanupClosePushL(uidArray); TUid uid1 = { KInterfaceCertStore }; - - uidArray.Append(uid1); + + uidArray.AppendL(uid1); TCTFindTokenTypesByInterface filter(uidArray.Array()); CCTTokenTypeInfo::ListL(iTokenTypes, filter); diff -r 831589831d04 -r 1ff75f038359 cryptoservices/certificateandkeymgmt/tpkixcert/Taction_build.cpp --- a/cryptoservices/certificateandkeymgmt/tpkixcert/Taction_build.cpp Mon Jun 28 09:47:25 2010 +0530 +++ b/cryptoservices/certificateandkeymgmt/tpkixcert/Taction_build.cpp Tue Jul 13 22:10:00 2010 +0100 @@ -1,5 +1,5 @@ /* -* Copyright (c) 1998-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 1998-2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of the License "Eclipse Public License v1.0" @@ -161,7 +161,7 @@ { } - while(AddAddCalls(*aBody, pos)) + while(AddAddCallsL(*aBody, pos)) { } @@ -354,13 +354,14 @@ return EFalse; } -TBool CTestActionBuild::AddAddCalls(const TDesC& aBuf, TInt& aPos) +TBool CTestActionBuild::AddAddCallsL(const TDesC& aBuf, TInt& aPos) { TPtrC addCallsBuf = Input::ParseElement(aBuf, KAddCallStart, KAddCallEnd, aPos); if (addCallsBuf != KNullDesC) { - CAddCall* addCall = CAddCall::NewL(addCallsBuf); - iAddCalls.Append(addCall); + CAddCall* addCall = CAddCall::NewLC(addCallsBuf); + iAddCalls.AppendL(addCall); + CleanupStack::Pop(addCall); return ETrue; } return EFalse; diff -r 831589831d04 -r 1ff75f038359 cryptoservices/certificateandkeymgmt/tpkixcert/taction_build.h --- a/cryptoservices/certificateandkeymgmt/tpkixcert/taction_build.h Mon Jun 28 09:47:25 2010 +0530 +++ b/cryptoservices/certificateandkeymgmt/tpkixcert/taction_build.h Tue Jul 13 22:10:00 2010 +0100 @@ -1,5 +1,5 @@ /* -* Copyright (c) 1998-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 1998-2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of the License "Eclipse Public License v1.0" @@ -69,7 +69,7 @@ TBool AddCert(const TDesC& aBuf, const TDesC& aStart, const TDesC& aEnd, TInt& aPos, CDesCArray& aCertsFileName, CDesCArray& aCertsLabel); - TBool AddAddCalls(const TDesC& aBuf, TInt& aPos); + TBool AddAddCallsL(const TDesC& aBuf, TInt& aPos); TBool CompareChainsL(const CPKIXCertChain& aChain); TBool CompareCertL(const CX509Certificate& aCert, const TDesC& aFilename); diff -r 831589831d04 -r 1ff75f038359 cryptoservices/certificateandkeymgmt/tpkixcert_tef/src/validateteststep.cpp --- a/cryptoservices/certificateandkeymgmt/tpkixcert_tef/src/validateteststep.cpp Mon Jun 28 09:47:25 2010 +0530 +++ b/cryptoservices/certificateandkeymgmt/tpkixcert_tef/src/validateteststep.cpp Tue Jul 13 22:10:00 2010 +0100 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of the License "Eclipse Public License v1.0" @@ -123,7 +123,7 @@ if (policyIndex > 0) { TValidationError error = (TValidationError) qualifierWarning; - processedPolicyQualifiers.Append(TValidationStatus(error, policyIndex)); + processedPolicyQualifiers.AppendL(TValidationStatus(error, policyIndex)); } CleanupStack::PopAndDestroy(key); @@ -157,7 +157,7 @@ for (TInt i=0; i < configOldWarnings.Count(); ++i) { TValidationError error = (TValidationError) configOldWarnings[i]; - processedConfigOldWarnings.Append(TValidationStatus(error, cert_index)); + processedConfigOldWarnings.AppendL(TValidationStatus(error, cert_index)); } TransferToNewWarningsL(configOldWarnings, configNewWarnings, cert_index); @@ -198,7 +198,7 @@ if (policyIndex > 0) { TValidationError error = (TValidationError) qualifierWarning; - configNewWarnings.Append(TValidationStatus(error, policyIndex)); + configNewWarnings.AppendL(TValidationStatus(error, policyIndex)); } CleanupStack::PopAndDestroy(key); diff -r 831589831d04 -r 1ff75f038359 cryptoservices/certificateandkeymgmt/tx509/extensiontest.cpp --- a/cryptoservices/certificateandkeymgmt/tx509/extensiontest.cpp Mon Jun 28 09:47:25 2010 +0530 +++ b/cryptoservices/certificateandkeymgmt/tx509/extensiontest.cpp Tue Jul 13 22:10:00 2010 +0100 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2005-2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of the License "Eclipse Public License v1.0" @@ -135,11 +135,13 @@ // if it exists. TPtrC str = Input::ParseElement(aBuf, aTag, pos, err); if (err >= 0) - { - aStrings.Append(str.AllocL()); + { + HBufC* string = str.AllocLC(); + aStrings.AppendL(string); + CleanupStack::Pop(string); } } - while (err >= 0); + while (err >= 0); } void CExtensionTest::BuildIntList(RArray& aInts, const TDesC& aBuf, const TDesC& aTag) @@ -153,7 +155,9 @@ TInt n = Input::ParseIntElement(aBuf, aTag, pos, err); if (err >= 0) { - aInts.Append(n); + // This append should not fail as the parsing went fine. + // So, ignoring the leave just to satisfy non leaving method convention. + TRAP_IGNORE(aInts.AppendL(n)); } } while (err >= 0); diff -r 831589831d04 -r 1ff75f038359 cryptoservices/filebasedcertificateandkeystores/source/certapps/server/CFSCertAppsServer.cpp --- a/cryptoservices/filebasedcertificateandkeystores/source/certapps/server/CFSCertAppsServer.cpp Mon Jun 28 09:47:25 2010 +0530 +++ b/cryptoservices/filebasedcertificateandkeystores/source/certapps/server/CFSCertAppsServer.cpp Tue Jul 13 22:10:00 2010 +0100 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2002-2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of the License "Eclipse Public License v1.0" @@ -123,7 +123,7 @@ for (TInt i = 0; i < count; ++i) { - aAppArray.Append(iClients[i]); + aAppArray.AppendL(iClients[i]); } } diff -r 831589831d04 -r 1ff75f038359 cryptoservices/filebasedcertificateandkeystores/source/keystore/Server/CKeyDataManager.cpp --- a/cryptoservices/filebasedcertificateandkeystores/source/keystore/Server/CKeyDataManager.cpp Mon Jun 28 09:47:25 2010 +0530 +++ b/cryptoservices/filebasedcertificateandkeystores/source/keystore/Server/CKeyDataManager.cpp Tue Jul 13 22:10:00 2010 +0100 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2004-2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of the License "Eclipse Public License v1.0" @@ -77,12 +77,14 @@ TInt count = lookupStream.ReadInt32L(); for (TInt index = 0; index < count; index++) { - const CFileKeyData* keyData = CFileKeyData::NewL(lookupStream); + CFileKeyData* keyData = CFileKeyData::NewL(lookupStream); + CleanupStack::PushL(keyData); if (keyData->Handle() > iKeyIdentifier) iKeyIdentifier = keyData->Handle(); - iKeys.Append(keyData); + iKeys.AppendL(keyData); + CleanupStack::Pop(keyData); } CleanupStack::PopAndDestroy(&lookupStream);