1 /* |
1 /* |
2 * Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). |
2 * Copyright (c) 2005-2010 Nokia Corporation and/or its subsidiary(-ies). |
3 * All rights reserved. |
3 * All rights reserved. |
4 * This component and the accompanying materials are made available |
4 * This component and the accompanying materials are made available |
5 * under the terms of "Eclipse Public License v1.0" |
5 * under the terms of "Eclipse Public License v1.0" |
6 * which accompanies this distribution, and is available |
6 * which accompanies this distribution, and is available |
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
148 if ( aCAList && aCAList->Count() ) |
148 if ( aCAList && aCAList->Count() ) |
149 { |
149 { |
150 delete iCaName; |
150 delete iCaName; |
151 |
151 |
152 iCaName = NULL; |
152 iCaName = NULL; |
153 iCaName = HBufC8::NewL(256); |
153 iCaName = HBufC8::NewL( KMaxX500DN ); |
154 iCaNameList = aCAList; |
154 iCaNameList = aCAList; |
155 iCurrIndex = 0; |
155 iCurrIndex = 0; |
156 iOperation = KBuildingCaList; |
156 iOperation = KBuildingCaList; |
157 |
157 |
158 Status = GetNextCaElemL(); |
158 Status = GetNextCaElemL(); |
1006 |
1006 |
1007 #ifdef _DEBUG |
1007 #ifdef _DEBUG |
1008 |
1008 |
1009 void CIkeV1PkiService::CertReadCompleted(TBool aCaCert, TInt aStatus, TInt aLine ) |
1009 void CIkeV1PkiService::CertReadCompleted(TBool aCaCert, TInt aStatus, TInt aLine ) |
1010 { |
1010 { |
1011 TBuf<320>DebugMsg; |
1011 if ( aCaCert ) |
1012 if ( aCaCert ) |
1012 { |
1013 { |
1013 DEBUG_LOG2(_L("Trusted CA certificate read completed with status = %d (line = %d)\n"), |
|
1014 aStatus, aLine); |
|
1015 |
1014 ASSERT( iCurrIndex < iCaNameList->Count() ); |
1016 ASSERT( iCurrIndex < iCaNameList->Count() ); |
1015 DebugMsg.Format(_L("Trusted CA certificate read completed with status = %d (line = %d)"), |
1017 |
1016 aStatus, aLine); |
1018 TCertInfo* CertInfo = iCaNameList->At(iCurrIndex); |
1017 DebugMsg.AppendFormat(_L(" ; Search criteria: ")); |
1019 |
1018 TCertInfo* CertInfo = iCaNameList->At(iCurrIndex); |
1020 switch ( CertInfo->iFormat ) |
1019 switch ( CertInfo->iFormat ) |
1021 { |
1020 { |
1022 case CA_NAME: |
1021 case CA_NAME: |
1023 case KEY_ID: |
1022 DebugMsg.AppendFormat(_L("CA_NAME = %S\n"), &CertInfo->iData); |
1024 DEBUG_LOG1(_L("Search data = %S\n"), &CertInfo->iData); |
1023 break; |
1025 break; |
1024 case KEY_ID: |
1026 default: |
1025 DebugMsg.AppendFormat(_L("KEY_ID = %S\n"), &CertInfo->iData); |
1027 TBuf<48> KeyIdString; |
1026 break; |
|
1027 default: |
|
1028 TBuf<48> KeyIdString; |
|
1029 ASSERT( iListIndex < iCaCertList->Count() ); |
1028 ASSERT( iListIndex < iCaCertList->Count() ); |
1030 HexToString(iCaCertList->At(iListIndex).iSubjectKeyId, KeyIdString); |
1029 HexToString(iCaCertList->At(iListIndex).iSubjectKeyId, KeyIdString); |
1031 DebugMsg.AppendFormat(_L("APPL_UID/<KEY_ID> = %S\n"), &KeyIdString); |
1030 DEBUG_LOG1(_L("APPL_UID/<KEY_ID> = %S\n"), &KeyIdString); |
1032 break; |
1031 break; |
1033 } |
1032 } |
1034 } |
1033 } |
1035 else |
1034 else |
1036 { |
1035 { |
1037 DEBUG_LOG2(_L("End user certificate read completed with status = %d (line = %d)\n"), |
1036 DEBUG_LOG2(_L("End user certificate read completed with status = %d (line = %d)\n"), |
1038 aStatus, aLine); |
1037 aStatus, aLine); |
1039 } |
1038 } |
1040 DEBUG_LOG(DebugMsg); |
|
1041 } |
1039 } |
1042 |
1040 |
1043 void CIkeV1PkiService::HexToString(const TDesC8& aKeyId, TDes16& aKeyIdString) |
1041 void CIkeV1PkiService::HexToString(const TDesC8& aKeyId, TDes16& aKeyIdString) |
1044 { |
1042 { |
1045 TInt i = 0; |
1043 TInt i = 0; |