201019
authorhgs
Fri, 14 May 2010 10:20:11 +0300
changeset 29 000337104c92
parent 21 5aacbb121f34
child 30 8cb97ed1a123
201019
vpnapiimpl/data/vpnerr.ra
vpnengine/ikev1lib/inc/ikev1crack.h
vpnengine/ikev1lib/inc/ikev1dialog.h
vpnengine/ikev1lib/inc/ikev1negotiation.h
vpnengine/ikev1lib/src/ikev1crack.cpp
vpnengine/ikev1lib/src/ikev1dialog.cpp
vpnengine/ikev1lib/src/ikev1negotiation.cpp
--- a/vpnapiimpl/data/vpnerr.ra	Fri May 14 16:52:10 2010 +0300
+++ b/vpnapiimpl/data/vpnerr.ra	Fri May 14 10:20:11 2010 +0300
@@ -1,490 +1,490 @@
-/*
-* Copyright (c) 2003-2006 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Resource definitions for VPN API.
-*
-*/
-
-
-/* IPSec Policy API errors */
-
-RESOURCE ARRAY r_error_array_ipsecpolapi_errors
-	{
-    items=
-		{
-		SINGLE_ERROR
-			{
-			text=r_error_EOpenSocketError;          /* -5135 */
-			},
-		SINGLE_ERROR
-			{
-			text=r_error_EBindSocketError;          /* -5136 */
-			},
-		SINGLE_ERROR
-			{
-			text=r_error_EOpenAlgorithmsFileError;  /* -5137 */
-			},
-		SINGLE_ERROR
-			{
-			text=r_error_ESecpolSocketSetOptError;  /* -5138 */
-			},
-		SINGLE_ERROR
-			{
-			text=r_error_EUnknownPolicyHandle;      /* -5139 */
-			},
-        SINGLE_ERROR
-			{
-			text=r_error_EParsingError;             /* -5140 */
-			},
-		SINGLE_ERROR
-			{
-			text=r_error_EWriteSocketError;         /* -5141 */
-			},
-		SINGLE_ERROR
-			{
-			text=r_error_ESecpolReaderError;        /* -5142 */
-			},
-		SINGLE_ERROR
-			{
-			text=r_error_ENoSelectorFound;          /* -5143 */
-			},
-		SINGLE_ERROR
-			{
-			text=r_error_ENoMemory;                 /* -5144 */
-			},
-		SINGLE_ERROR
-			{
-			text=r_error_EInboundOutboundConflict;  /* -5145 */
-			},
-		SINGLE_ERROR
-			{
-			text=r_error_ESelectorConflict;         /* -5146 */
-			},
-		SINGLE_ERROR
-			{
-			text=r_error_ENoConflictInfoFound;      /* -5147 */
-			}
-		};
-	}
-
-RESOURCE TBUF r_error_EOpenSocketError { buf=STRING_r_error_EOpenSocketError; }
-RESOURCE TBUF r_error_EBindSocketError { buf=STRING_r_error_EBindSocketError; }
-RESOURCE TBUF r_error_EOpenAlgorithmsFileError { buf=STRING_r_error_EOpenAlgorithmsFileError; }
-RESOURCE TBUF r_error_ESecpolSocketSetOptError { buf=STRING_r_error_ESecpolSocketSetOptError; }
-RESOURCE TBUF r_error_EUnknownPolicyHandle { buf=STRING_r_error_EUnknownPolicyHandle; }
-RESOURCE TBUF r_error_EParsingError { buf=STRING_r_error_EParsingError; }
-RESOURCE TBUF r_error_EWriteSocketError { buf=STRING_r_error_EWriteSocketError; }
-RESOURCE TBUF r_error_ESecpolReaderError { buf=STRING_r_error_ESecpolReaderError; }
-RESOURCE TBUF r_error_ENoSelectorFound { buf=STRING_r_error_ENoSelectorFound; }
-RESOURCE TBUF r_error_ENoMemory { buf=STRING_r_error_ENoMemory; }
-RESOURCE TBUF r_error_EInboundOutboundConflict { buf=STRING_r_error_EInboundOutboundConflict; }
-RESOURCE TBUF r_error_ESelectorConflict { buf=STRING_r_error_ESelectorConflict; }
-RESOURCE TBUF r_error_ENoConflictInfoFound { buf=STRING_r_error_ENoConflictInfoFound; }
-
-/* VPN API errors */
-
-RESOURCE ARRAY r_error_array_vpnapi_errors
-	{
-    items=
-		{
-		SINGLE_ERROR
-			{
-			text=r_error_KVpnErrNoPolicyFile;           /* -5229 */
-			},
-		SINGLE_ERROR
-			{
-			text=r_error_KVpnErrNoPolicyInfoFile;       /* -5230 */
-			},
-		SINGLE_ERROR
-			{
-			text=r_error_KVpnErrInvalidPolicyFile;      /* -5231 */
-			},
-		SINGLE_ERROR
-			{
-			text=r_error_KVpnErrPolicyNotFound;         /* -5232 */
-			},
-		SINGLE_ERROR
-			{
-			text=r_error_KVpnErrInvalidCaCertFile;      /* -5233 */
-			},
-		SINGLE_ERROR
-			{
-			text=r_error_KVpnErrPeerCertFileMissing;    /* -5234 */
-			},
-		SINGLE_ERROR
-			{
-			text=r_error_KVpnErrInvalidUserCertFile;    /* -5235 */
-			},
-		SINGLE_ERROR
-			{
-			text=r_error_KVpnErrInvalidUserPrivKeyFile; /* -5236 */
-			},
-		SINGLE_ERROR
-			{
-			text=r_error_KVpnErrImportOngoing;          /* -5237 */
-			},
-		SINGLE_ERROR
-			{
-			text=r_error_KVpnErrPwdChangeOngoing;       /* -5238 */
-			},
-		SINGLE_ERROR
-			{
-			text=r_error_KVpnErrPolicyCountChanged;     /* -5239 */
-			}
-		};
-	}
-
-RESOURCE TBUF r_error_KVpnErrNoPolicyFile { buf=STRING_r_error_KVpnErrNoPolicyFile; }
-RESOURCE TBUF r_error_KVpnErrNoPolicyInfoFile { buf=STRING_r_error_KVpnErrNoPolicyInfoFile; }
-RESOURCE TBUF r_error_KVpnErrInvalidPolicyFile { buf=STRING_r_error_KVpnErrInvalidPolicyFile; }
-RESOURCE TBUF r_error_KVpnErrPolicyNotFound { buf=STRING_r_error_KVpnErrPolicyNotFound; }
-RESOURCE TBUF r_error_KVpnErrInvalidCaCertFile { buf=STRING_r_error_KVpnErrInvalidCaCertFile; }
-RESOURCE TBUF r_error_KVpnErrPeerCertFileMissing { buf=STRING_r_error_KVpnErrPeerCertFileMissing; }
-RESOURCE TBUF r_error_KVpnErrInvalidUserCertFile { buf=STRING_r_error_KVpnErrInvalidUserCertFile; }
-RESOURCE TBUF r_error_KVpnErrInvalidUserPrivKeyFile { buf=STRING_r_error_KVpnErrInvalidUserPrivKeyFile; }
-RESOURCE TBUF r_error_KVpnErrImportOngoing { buf=STRING_r_error_KVpnErrImportOngoing; }
-RESOURCE TBUF r_error_KVpnErrPwdChangeOngoing { buf=STRING_r_error_KVpnErrPwdChangeOngoing; }
-RESOURCE TBUF r_error_KVpnErrPolicyCountChanged { buf=STRING_r_error_KVpnErrPolicyCountChanged; }
-
-/* PKI Service API errors */
-
-RESOURCE ARRAY r_error_array_pkiserviceapi_errors
-	{
-    items=
-		{
-		SINGLE_ERROR
-			{
-			text=r_error_KPKIErrWrongObjectType;        /* -5240 */
-			},
-		SINGLE_ERROR
-			{
-			text=r_error_KPKIErrObjectUninitialized;    /* -5241 */
-			},
-		SINGLE_ERROR
-			{
-			text=r_error_KPKIErrPassword;               /* -5242 */
-			},
-		SINGLE_ERROR
-			{
-			text=r_error_KPKIErrServiceBusy;            /* -5243 */
-			},
-		SINGLE_ERROR
-			{
-			text=r_error_KPKIErrCancel;                 /* -5244 */
-			},
-		SINGLE_ERROR
-			{
-			text=r_error_KPKIErrBufferTooShort;         /* -5245 */
-			},
-		SINGLE_ERROR
-			{
-			text=r_error_KPKIErrCertRequestParam;       /* -5246 */
-			},
-		SINGLE_ERROR
-			{
-			text=r_error_KPKIErrCertRequest;            /*  -5247 */
-			},
-		SINGLE_ERROR
-			{
-			text=r_error_KPKIErrNotFound;               /* -5248 */
-			},
-		SINGLE_ERROR
-			{
-			text=r_error_KPKIErrAmbiguous;              /* -5249 */
-			},
-		SINGLE_ERROR
-			{
-			text=r_error_KPKIErrNotSupported;           /* -5250 */
-			},
-		SINGLE_ERROR
-			{
-			text=r_error_KPKIErrUnexpectedState;        /* -5251 */
-			},
-		SINGLE_ERROR
-			{
-			text=r_error_KPKIErrKeyStoreEmpty;          /* -5252 */
-			}
-        };
-    }
-
-RESOURCE TBUF r_error_KPKIErrWrongObjectType { buf=STRING_r_error_KPKIErrWrongObjectType; }
-RESOURCE TBUF r_error_KPKIErrObjectUninitialized { buf=STRING_r_error_KPKIErrObjectUninitialized; }
-RESOURCE TBUF r_error_KPKIErrPassword { buf=STRING_r_error_KPKIErrPassword; }
-RESOURCE TBUF r_error_KPKIErrServiceBusy { buf=STRING_r_error_KPKIErrServiceBusy; }
-RESOURCE TBUF r_error_KPKIErrCancel { buf=STRING_r_error_KPKIErrCancel; }
-RESOURCE TBUF r_error_KPKIErrBufferTooShort { buf=STRING_r_error_KPKIErrBufferTooShort; }
-RESOURCE TBUF r_error_KPKIErrCertRequestParam { buf=STRING_r_error_KPKIErrCertRequestParam; }
-RESOURCE TBUF r_error_KPKIErrCertRequest { buf=STRING_r_error_KPKIErrCertRequest; }
-RESOURCE TBUF r_error_KPKIErrNotFound { buf=STRING_r_error_KPKIErrNotFound; }
-RESOURCE TBUF r_error_KPKIErrAmbiguous { buf=STRING_r_error_KPKIErrAmbiguous; }
-RESOURCE TBUF r_error_KPKIErrNotSupported { buf=STRING_r_error_KPKIErrNotSupported; }
-RESOURCE TBUF r_error_KPKIErrUnexpectedState { buf=STRING_r_error_KPKIErrUnexpectedState; }
-RESOURCE TBUF r_error_KPKIErrKeyStoreEmpty { buf=STRING_r_error_KPKIErrKeyStoreEmpty; }
-
-/* KMD API errors */
-
-RESOURCE ARRAY r_error_array_kmdapi_errors
-	{
-    items=
-		{
-		SINGLE_ERROR
-			{
-			text=r_error_KKmdTooWeakCryptoLib;          /* -5253 */
-			},
-		SINGLE_ERROR
-			{
-			text=r_error_KKmdNoAlgorithmsFile;          /* -5254 */
-			},
-		SINGLE_ERROR
-			{
-			text=r_error_KKmdIkePolicyFileErr;          /* -5255 */
-			},
-		SINGLE_ERROR
-			{
-			text=r_error_KKmdIkeNegotFailed;            /* -5256 */
-			},
-		SINGLE_ERROR
-			{
-			text=r_error_KKmdIkeNoResponse;             /* -5257 */
-			},
-		SINGLE_ERROR
-			{
-			text=r_error_KKmdIkeNoProposalErr;          /* -5258 */
-			},
-		SINGLE_ERROR
-			{
-			text=r_error_KKmdIkeAuthFailedErr;          /* -5259 */
-			},
-		SINGLE_ERROR
-			{
-			text=r_error_KKmdIkePeerAuthFailed;         /* -5260 */
-			},
-		SINGLE_ERROR
-			{
-			text=r_error_KKmdIkeNoCertFoundErr;         /* -5261 */
-			},
-		SINGLE_ERROR
-			{
-			text=r_error_KKmdIkeNoPolicyErr;            /* -5262 */
-			}
-		};
-	}
-
-RESOURCE TBUF r_error_KKmdTooWeakCryptoLib { buf=STRING_r_error_KKmdTooWeakCryptoLib; }
-RESOURCE TBUF r_error_KKmdNoAlgorithmsFile { buf=STRING_r_error_KKmdNoAlgorithmsFile; }
-RESOURCE TBUF r_error_KKmdIkePolicyFileErr { buf=STRING_r_error_KKmdIkePolicyFileErr; }
-RESOURCE TBUF r_error_KKmdIkeNegotFailed { buf=STRING_r_error_KKmdIkeNegotFailed; }
-RESOURCE TBUF r_error_KKmdIkeNoResponse { buf=STRING_r_error_KKmdIkeNoResponse; }
-RESOURCE TBUF r_error_KKmdIkeNoProposalErr { buf=STRING_r_error_KKmdIkeNoProposalErr; }
-RESOURCE TBUF r_error_KKmdIkeAuthFailedErr { buf=STRING_r_error_KKmdIkeAuthFailedErr; }
-RESOURCE TBUF r_error_KKmdIkePeerAuthFailed { buf=STRING_r_error_KKmdIkePeerAuthFailed; }
-RESOURCE TBUF r_error_KKmdIkeNoCertFoundErr { buf=STRING_r_error_KKmdIkeNoCertFoundErr; }
-RESOURCE TBUF r_error_KKmdIkeNoPolicyErr { buf=STRING_r_error_KKmdIkeNoPolicyErr; }
-
-/* IKE policy parser errors */
-
-RESOURCE ARRAY r_error_array_ikepolparser_errors
-	{
-    items=
-		{
-		SINGLE_ERROR
-			{
-			text=r_error_KSecParserErrMode;             /* -5263 */
-			},
-		SINGLE_ERROR
-			{
-			text=r_error_KSecParserErrNotify;           /* -5264 */
-			},
-		SINGLE_ERROR
-			{
-			text=r_error_KSecParserErrCommit;           /* -5265 */
-			},
-		SINGLE_ERROR
-			{
-			text=r_error_KSecParserErrIpsecExpire;      /* -5266 */
-			},
-		SINGLE_ERROR
-			{
-			text=r_error_KSecParserErrSendCert;         /* -5267 */
-			},
-		SINGLE_ERROR
-			{
-			text=r_error_KSecParserErrInitialContact;   /* -5268 */
-			},
-		SINGLE_ERROR
-			{
-			text=r_error_KSecParserErrResponderLifetime;/* -5269 */
-			},
-		SINGLE_ERROR
-			{
-			text=r_error_KSecParserErrReplayStatus;     /* -5270 */
-			},
-		SINGLE_ERROR
-			{
-			text=r_error_KSecParserErrGroupDesc_II;     /* -5271 */
-			},
-		SINGLE_ERROR
-			{
-			text=r_error_KSecParserErrProposal;         /* -5272 */
-			},
-		SINGLE_ERROR
-			{
-			text=r_error_KSecParserErrEncrAlg;          /* -5273 */
-			},
-		SINGLE_ERROR
-			{
-			text=r_error_KSecParserErrAuthMethod;       /* -5274 */
-			},
-		SINGLE_ERROR
-			{
-			text=r_error_KSecParserErrHashAlg;          /* -5275 */
-			},
-		SINGLE_ERROR
-			{
-			text=r_error_KSecParserErrGroupDesc;        /* -5276 */
-			},
-		SINGLE_ERROR
-			{
-			text=r_error_KSecParserErrGroupType;        /* -5277 */
-			},
-		SINGLE_ERROR
-			{
-			text=r_error_KSecParserErrLifeBytes;        /* -5278 */
-			},
-		SINGLE_ERROR
-			{
-			text=r_error_KSecParserErrLifeSecs;         /* -5279 */
-			},
-		SINGLE_ERROR
-			{
-			text=r_error_KSecParserErrPRF;              /* -5280 */
-			},
-		SINGLE_ERROR
-			{
-			text=r_error_KSecParserErrPreKey;           /* -5281 */
-			},
-		SINGLE_ERROR
-			{
-			text=r_error_KSecParserErrPreFormat;        /* -5282 */
-			},
-		SINGLE_ERROR
-			{
-			text=r_error_KSecParserErrCA;               /* -5283 */
-			},
-		SINGLE_ERROR
-			{
-			text=r_error_KSecParserErrOwnCerts;         /* -5284 */
-			},
-		SINGLE_ERROR
-			{
-			text=r_error_KSecParserErrOwnName;          /* -5285 */
-			},
-		SINGLE_ERROR
-			{
-			text=r_error_KSecParserErrOwnKey;           /* -5286 */
-			},
-		SINGLE_ERROR
-			{
-			text=r_error_KSecParserErrPeerCerts;        /* -5287 */
-			},
-		SINGLE_ERROR
-			{
-			text=r_error_KSecParserErrPeerAddr;         /* -5288 */
-			},
-		SINGLE_ERROR
-			{
-			text=r_error_KSecParserErrPeerMask;         /* -5289 */
-			},
-		SINGLE_ERROR
-			{
-			text=r_error_KSecParserErrMaxLifetimeSec;   /* -5290 */
-			},
-		SINGLE_ERROR
-			{
-			text=r_error_KSecParserErrMaxLifetimeKB;    /* -5291 */
-			},
-		SINGLE_ERROR
-			{
-			text=r_error_KSecParserErrMaxRetrans;       /* -5292 */
-			},
-		SINGLE_ERROR
-			{
-			text=r_error_KSecParserErrNoSeparator;      /* -5293 */
-			},
-		SINGLE_ERROR
-			{
-			text=r_error_KSecParserErrCRACKLAMType;     /* -5294 */
-			},
-		SINGLE_ERROR
-			{
-			text=r_error_KSecParserErrUseIntAddr;       /* -5295 */
-			},
-		SINGLE_ERROR
-			{
-			text=r_error_KSecParserErrUseNATProbe;      /* -5296 */
-			},
-		SINGLE_ERROR
-			{
-			text=r_error_KSecParserErrUnknown;          /* -5297 */
-			}
-        };
-    }
-
-RESOURCE TBUF r_error_KSecParserErrMode { buf=STRING_r_error_KSecParserErrMode; }
-RESOURCE TBUF r_error_KSecParserErrNotify { buf=STRING_r_error_KSecParserErrNotify; }
-RESOURCE TBUF r_error_KSecParserErrCommit { buf=STRING_r_error_KSecParserErrCommit; }
-RESOURCE TBUF r_error_KSecParserErrIpsecExpire { buf=STRING_r_error_KSecParserErrIpsecExpire; }
-RESOURCE TBUF r_error_KSecParserErrSendCert { buf=STRING_r_error_KSecParserErrSendCert; }
-RESOURCE TBUF r_error_KSecParserErrInitialContact { buf=STRING_r_error_KSecParserErrInitialContact; }
-RESOURCE TBUF r_error_KSecParserErrResponderLifetime { buf=STRING_r_error_KSecParserErrResponderLifetime; }
-RESOURCE TBUF r_error_KSecParserErrReplayStatus { buf=STRING_r_error_KSecParserErrReplayStatus; }
-RESOURCE TBUF r_error_KSecParserErrGroupDesc_II { buf=STRING_r_error_KSecParserErrGroupDesc_II; }
-RESOURCE TBUF r_error_KSecParserErrProposal { buf=STRING_r_error_KSecParserErrProposal; }
-RESOURCE TBUF r_error_KSecParserErrEncrAlg { buf=STRING_r_error_KSecParserErrEncrAlg; }
-RESOURCE TBUF r_error_KSecParserErrAuthMethod { buf=STRING_r_error_KSecParserErrAuthMethod; }
-RESOURCE TBUF r_error_KSecParserErrHashAlg { buf=STRING_r_error_KSecParserErrHashAlg; }
-RESOURCE TBUF r_error_KSecParserErrGroupDesc { buf=STRING_r_error_KSecParserErrGroupDesc; }
-RESOURCE TBUF r_error_KSecParserErrGroupType { buf=STRING_r_error_KSecParserErrGroupType; }
-RESOURCE TBUF r_error_KSecParserErrLifeBytes { buf=STRING_r_error_KSecParserErrLifeBytes; }
-RESOURCE TBUF r_error_KSecParserErrLifeSecs { buf=STRING_r_error_KSecParserErrLifeSecs; }
-RESOURCE TBUF r_error_KSecParserErrPRF { buf=STRING_r_error_KSecParserErrPRF; }
-RESOURCE TBUF r_error_KSecParserErrPreKey { buf=STRING_r_error_KSecParserErrPreKey; }
-RESOURCE TBUF r_error_KSecParserErrPreFormat { buf=STRING_r_error_KSecParserErrPreFormat; }
-RESOURCE TBUF r_error_KSecParserErrCA { buf=STRING_r_error_KSecParserErrCA; }
-RESOURCE TBUF r_error_KSecParserErrOwnCerts { buf=STRING_r_error_KSecParserErrOwnCerts; }
-RESOURCE TBUF r_error_KSecParserErrOwnName { buf=STRING_r_error_KSecParserErrOwnName; }
-RESOURCE TBUF r_error_KSecParserErrOwnKey { buf=STRING_r_error_KSecParserErrOwnKey; }
-RESOURCE TBUF r_error_KSecParserErrPeerCerts { buf=STRING_r_error_KSecParserErrPeerCerts; }
-RESOURCE TBUF r_error_KSecParserErrPeerAddr { buf=STRING_r_error_KSecParserErrPeerAddr; }
-RESOURCE TBUF r_error_KSecParserErrPeerMask { buf=STRING_r_error_KSecParserErrPeerMask; }
-RESOURCE TBUF r_error_KSecParserErrMaxLifetimeSec { buf=STRING_r_error_KSecParserErrMaxLifetimeSec; }
-RESOURCE TBUF r_error_KSecParserErrMaxLifetimeKB { buf=STRING_r_error_KSecParserErrMaxLifetimeKB; }
-RESOURCE TBUF r_error_KSecParserErrMaxRetrans { buf=STRING_r_error_KSecParserErrMaxRetrans; }
-RESOURCE TBUF r_error_KSecParserErrNoSeparator { buf=STRING_r_error_KSecParserErrNoSeparator; }
-RESOURCE TBUF r_error_KSecParserErrCRACKLAMType { buf=STRING_r_error_KSecParserErrCRACKLAMType; }
-RESOURCE TBUF r_error_KSecParserErrUseIntAddr { buf=STRING_r_error_KSecParserErrUseIntAddr; }
-RESOURCE TBUF r_error_KSecParserErrUseNATProbe { buf=STRING_r_error_KSecParserErrUseNATProbe; }
-RESOURCE TBUF r_error_KSecParserErrUnknown { buf=STRING_r_error_KSecParserErrUnknown; }
-
-RESOURCE ARRAY r_error_array_vpnapi_errors_2
-	{
-    items=
-		{
-		SINGLE_ERROR
-			{
-			text=r_error_KVpnErrPolicySizeChanged;           /* -5298 */
-			}
-        };
-    }
-
-RESOURCE TBUF r_error_KVpnErrPolicySizeChanged { buf=STRING_r_error_KVpnErrPolicySizeChanged; }
+/*
+* Copyright (c) 2003-2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Resource definitions for VPN API.
+*
+*/
+
+
+/* IPSec Policy API errors */
+
+RESOURCE ARRAY r_error_array_ipsecpolapi_errors
+	{
+    items=
+		{
+		SINGLE_ERROR
+			{
+			text=r_error_EOpenSocketError;          /* -5135 */
+			},
+		SINGLE_ERROR
+			{
+			text=r_error_EBindSocketError;          /* -5136 */
+			},
+		SINGLE_ERROR
+			{
+			text=r_error_EOpenAlgorithmsFileError;  /* -5137 */
+			},
+		SINGLE_ERROR
+			{
+			text=r_error_ESecpolSocketSetOptError;  /* -5138 */
+			},
+		SINGLE_ERROR
+			{
+			text=r_error_EUnknownPolicyHandle;      /* -5139 */
+			},
+        SINGLE_ERROR
+			{
+			text=r_error_EParsingError;             /* -5140 */
+			},
+		SINGLE_ERROR
+			{
+			text=r_error_EWriteSocketError;         /* -5141 */
+			},
+		SINGLE_ERROR
+			{
+			text=r_error_ESecpolReaderError;        /* -5142 */
+			},
+		SINGLE_ERROR
+			{
+			text=r_error_ENoSelectorFound;          /* -5143 */
+			},
+		SINGLE_ERROR
+			{
+			text=r_error_ENoMemory;                 /* -5144 */
+			},
+		SINGLE_ERROR
+			{
+			text=r_error_EInboundOutboundConflict;  /* -5145 */
+			},
+		SINGLE_ERROR
+			{
+			text=r_error_ESelectorConflict;         /* -5146 */
+			},
+		SINGLE_ERROR
+			{
+			text=r_error_ENoConflictInfoFound;      /* -5147 */
+			}
+		};
+	}
+
+RESOURCE TBUF r_error_EOpenSocketError { buf=STRING_r_error_EOpenSocketError; }
+RESOURCE TBUF r_error_EBindSocketError { buf=STRING_r_error_EBindSocketError; }
+RESOURCE TBUF r_error_EOpenAlgorithmsFileError { buf=STRING_r_error_EOpenAlgorithmsFileError; }
+RESOURCE TBUF r_error_ESecpolSocketSetOptError { buf=STRING_r_error_ESecpolSocketSetOptError; }
+RESOURCE TBUF r_error_EUnknownPolicyHandle { buf=STRING_r_error_EUnknownPolicyHandle; }
+RESOURCE TBUF r_error_EParsingError { buf=STRING_r_error_EParsingError; }
+RESOURCE TBUF r_error_EWriteSocketError { buf=STRING_r_error_EWriteSocketError; }
+RESOURCE TBUF r_error_ESecpolReaderError { buf=STRING_r_error_ESecpolReaderError; }
+RESOURCE TBUF r_error_ENoSelectorFound { buf=STRING_r_error_ENoSelectorFound; }
+RESOURCE TBUF r_error_ENoMemory { buf=STRING_r_error_ENoMemory; }
+RESOURCE TBUF r_error_EInboundOutboundConflict { buf=STRING_r_error_EInboundOutboundConflict; }
+RESOURCE TBUF r_error_ESelectorConflict { buf=STRING_r_error_ESelectorConflict; }
+RESOURCE TBUF r_error_ENoConflictInfoFound { buf=STRING_r_error_ENoConflictInfoFound; }
+
+/* VPN API errors */
+
+RESOURCE ARRAY r_error_array_vpnapi_errors
+	{
+    items=
+		{
+		SINGLE_ERROR
+			{
+			text=r_error_KVpnErrNoPolicyFile;           /* -5229 */
+			},
+		SINGLE_ERROR
+			{
+			text=r_error_KVpnErrNoPolicyInfoFile;       /* -5230 */
+			},
+		SINGLE_ERROR
+			{
+			text=r_error_KVpnErrInvalidPolicyFile;      /* -5231 */
+			},
+		SINGLE_ERROR
+			{
+			text=r_error_KVpnErrPolicyNotFound;         /* -5232 */
+			},
+		SINGLE_ERROR
+			{
+			text=r_error_KVpnErrInvalidCaCertFile;      /* -5233 */
+			},
+		SINGLE_ERROR
+			{
+			text=r_error_KVpnErrPeerCertFileMissing;    /* -5234 */
+			},
+		SINGLE_ERROR
+			{
+			text=r_error_KVpnErrInvalidUserCertFile;    /* -5235 */
+			},
+		SINGLE_ERROR
+			{
+			text=r_error_KVpnErrInvalidUserPrivKeyFile; /* -5236 */
+			},
+		SINGLE_ERROR
+			{
+			text=r_error_KVpnErrImportOngoing;          /* -5237 */
+			},
+		SINGLE_ERROR
+			{
+			text=r_error_KVpnErrPwdChangeOngoing;       /* -5238 */
+			},
+		SINGLE_ERROR
+			{
+			text=r_error_KVpnErrPolicyCountChanged;     /* -5239 */
+			}
+		};
+	}
+
+RESOURCE TBUF r_error_KVpnErrNoPolicyFile { buf=STRING_r_error_KVpnErrNoPolicyFile; }
+RESOURCE TBUF r_error_KVpnErrNoPolicyInfoFile { buf=STRING_r_error_KVpnErrNoPolicyInfoFile; }
+RESOURCE TBUF r_error_KVpnErrInvalidPolicyFile { buf=STRING_r_error_KVpnErrInvalidPolicyFile; }
+RESOURCE TBUF r_error_KVpnErrPolicyNotFound { buf=STRING_r_error_KVpnErrPolicyNotFound; }
+RESOURCE TBUF r_error_KVpnErrInvalidCaCertFile { buf=STRING_r_error_KVpnErrInvalidCaCertFile; }
+RESOURCE TBUF r_error_KVpnErrPeerCertFileMissing { buf=STRING_r_error_KVpnErrPeerCertFileMissing; }
+RESOURCE TBUF r_error_KVpnErrInvalidUserCertFile { buf=STRING_r_error_KVpnErrInvalidUserCertFile; }
+RESOURCE TBUF r_error_KVpnErrInvalidUserPrivKeyFile { buf=STRING_r_error_KVpnErrInvalidUserPrivKeyFile; }
+RESOURCE TBUF r_error_KVpnErrImportOngoing { buf=STRING_r_error_KVpnErrImportOngoing; }
+RESOURCE TBUF r_error_KVpnErrPwdChangeOngoing { buf=STRING_r_error_KVpnErrPwdChangeOngoing; }
+RESOURCE TBUF r_error_KVpnErrPolicyCountChanged { buf=STRING_r_error_KVpnErrPolicyCountChanged; }
+
+/* PKI Service API errors */
+
+RESOURCE ARRAY r_error_array_pkiserviceapi_errors
+	{
+    items=
+		{
+		SINGLE_ERROR
+			{
+			text=r_error_KPKIErrWrongObjectType;        /* -5240 */
+			},
+		SINGLE_ERROR
+			{
+			text=r_error_KPKIErrObjectUninitialized;    /* -5241 */
+			},
+		SINGLE_ERROR
+			{
+			text=r_error_KPKIErrPassword;               /* -5242 */
+			},
+		SINGLE_ERROR
+			{
+			text=r_error_KPKIErrServiceBusy;            /* -5243 */
+			},
+		SINGLE_ERROR
+			{
+			text=r_error_KPKIErrCancel;                 /* -5244 */
+			},
+		SINGLE_ERROR
+			{
+			text=r_error_KPKIErrBufferTooShort;         /* -5245 */
+			},
+		SINGLE_ERROR
+			{
+			text=r_error_KPKIErrCertRequestParam;       /* -5246 */
+			},
+		SINGLE_ERROR
+			{
+			text=r_error_KPKIErrCertRequest;            /*  -5247 */
+			},
+		SINGLE_ERROR
+			{
+			text=r_error_KPKIErrNotFound;               /* -5248 */
+			},
+		SINGLE_ERROR
+			{
+			text=r_error_KPKIErrAmbiguous;              /* -5249 */
+			},
+		SINGLE_ERROR
+			{
+			text=r_error_KPKIErrNotSupported;           /* -5250 */
+			},
+		SINGLE_ERROR
+			{
+			text=r_error_KPKIErrUnexpectedState;        /* -5251 */
+			},
+		SINGLE_ERROR
+			{
+			text=r_error_KPKIErrKeyStoreEmpty;          /* -5252 */
+			}
+        };
+    }
+
+RESOURCE TBUF r_error_KPKIErrWrongObjectType { buf=STRING_r_error_KPKIErrWrongObjectType; }
+RESOURCE TBUF r_error_KPKIErrObjectUninitialized { buf=STRING_r_error_KPKIErrObjectUninitialized; }
+RESOURCE TBUF r_error_KPKIErrPassword { buf=STRING_r_error_KPKIErrPassword; }
+RESOURCE TBUF r_error_KPKIErrServiceBusy { buf=STRING_r_error_KPKIErrServiceBusy; }
+RESOURCE TBUF r_error_KPKIErrCancel { buf=STRING_r_error_KPKIErrCancel; }
+RESOURCE TBUF r_error_KPKIErrBufferTooShort { buf=STRING_r_error_KPKIErrBufferTooShort; }
+RESOURCE TBUF r_error_KPKIErrCertRequestParam { buf=STRING_r_error_KPKIErrCertRequestParam; }
+RESOURCE TBUF r_error_KPKIErrCertRequest { buf=STRING_r_error_KPKIErrCertRequest; }
+RESOURCE TBUF r_error_KPKIErrNotFound { buf=STRING_r_error_KPKIErrNotFound; }
+RESOURCE TBUF r_error_KPKIErrAmbiguous { buf=STRING_r_error_KPKIErrAmbiguous; }
+RESOURCE TBUF r_error_KPKIErrNotSupported { buf=STRING_r_error_KPKIErrNotSupported; }
+RESOURCE TBUF r_error_KPKIErrUnexpectedState { buf=STRING_r_error_KPKIErrUnexpectedState; }
+RESOURCE TBUF r_error_KPKIErrKeyStoreEmpty { buf=STRING_r_error_KPKIErrKeyStoreEmpty; }
+
+/* KMD API errors */
+
+RESOURCE ARRAY r_error_array_kmdapi_errors
+	{
+    items=
+		{
+		SINGLE_ERROR
+			{
+			text=r_error_KKmdTooWeakCryptoLib;          /* -5253 */
+			},
+		SINGLE_ERROR
+			{
+			text=r_error_KKmdNoAlgorithmsFile;          /* -5254 */
+			},
+		SINGLE_ERROR
+			{
+			text=r_error_KKmdIkePolicyFileErr;          /* -5255 */
+			},
+		SINGLE_ERROR
+			{
+			text=r_error_KKmdIkeNegotFailed;            /* -5256 */
+			},
+		SINGLE_ERROR
+			{
+			text=r_error_KKmdIkeNoResponse;             /* -5257 */
+			},
+		SINGLE_ERROR
+			{
+			text=r_error_KKmdIkeNoProposalErr;          /* -5258 */
+			},
+		SINGLE_ERROR
+			{
+			text=r_error_KKmdIkeAuthFailedErr;          /* -5259 */
+			},
+		SINGLE_ERROR
+			{
+			text=r_error_KKmdIkePeerAuthFailed;         /* -5260 */
+			},
+		SINGLE_ERROR
+			{
+			text=r_error_KKmdIkeNoCertFoundErr;         /* -5261 */
+			},
+		SINGLE_ERROR
+			{
+			text=r_error_KKmdIkeNoPolicyErr;            /* -5262 */
+			}
+		};
+	}
+
+RESOURCE TBUF r_error_KKmdTooWeakCryptoLib { buf=STRING_r_error_KKmdTooWeakCryptoLib; }
+RESOURCE TBUF r_error_KKmdNoAlgorithmsFile { buf=STRING_r_error_KKmdNoAlgorithmsFile; }
+RESOURCE TBUF r_error_KKmdIkePolicyFileErr { buf=STRING_r_error_KKmdIkePolicyFileErr; }
+RESOURCE TBUF r_error_KKmdIkeNegotFailed { buf=STRING_r_error_KKmdIkeNegotFailed; }
+RESOURCE TBUF r_error_KKmdIkeNoResponse { buf=STRING_r_error_KKmdIkeNoResponse; }
+RESOURCE TBUF r_error_KKmdIkeNoProposalErr { buf=STRING_r_error_KKmdIkeNoProposalErr; }
+RESOURCE TBUF r_error_KKmdIkeAuthFailedErr { buf=STRING_r_error_KKmdIkeAuthFailedErr; }
+RESOURCE TBUF r_error_KKmdIkePeerAuthFailed { buf=STRING_r_error_KKmdIkePeerAuthFailed; }
+RESOURCE TBUF r_error_KKmdIkeNoCertFoundErr { buf=STRING_r_error_KKmdIkeNoCertFoundErr; }
+RESOURCE TBUF r_error_KKmdIkeNoPolicyErr { buf=STRING_r_error_KKmdIkeNoPolicyErr; }
+
+/* IKE policy parser errors */
+
+RESOURCE ARRAY r_error_array_ikepolparser_errors
+	{
+    items=
+		{
+		SINGLE_ERROR
+			{
+			text=r_error_KSecParserErrMode;             /* -5263 */
+			},
+		SINGLE_ERROR
+			{
+			text=r_error_KSecParserErrNotify;           /* -5264 */
+			},
+		SINGLE_ERROR
+			{
+			text=r_error_KSecParserErrCommit;           /* -5265 */
+			},
+		SINGLE_ERROR
+			{
+			text=r_error_KSecParserErrIpsecExpire;      /* -5266 */
+			},
+		SINGLE_ERROR
+			{
+			text=r_error_KSecParserErrSendCert;         /* -5267 */
+			},
+		SINGLE_ERROR
+			{
+			text=r_error_KSecParserErrInitialContact;   /* -5268 */
+			},
+		SINGLE_ERROR
+			{
+			text=r_error_KSecParserErrResponderLifetime;/* -5269 */
+			},
+		SINGLE_ERROR
+			{
+			text=r_error_KSecParserErrReplayStatus;     /* -5270 */
+			},
+		SINGLE_ERROR
+			{
+			text=r_error_KSecParserErrGroupDesc_II;     /* -5271 */
+			},
+		SINGLE_ERROR
+			{
+			text=r_error_KSecParserErrProposal;         /* -5272 */
+			},
+		SINGLE_ERROR
+			{
+			text=r_error_KSecParserErrEncrAlg;          /* -5273 */
+			},
+		SINGLE_ERROR
+			{
+			text=r_error_KSecParserErrAuthMethod;       /* -5274 */
+			},
+		SINGLE_ERROR
+			{
+			text=r_error_KSecParserErrHashAlg;          /* -5275 */
+			},
+		SINGLE_ERROR
+			{
+			text=r_error_KSecParserErrGroupDesc;        /* -5276 */
+			},
+		SINGLE_ERROR
+			{
+			text=r_error_KSecParserErrGroupType;        /* -5277 */
+			},
+		SINGLE_ERROR
+			{
+			text=r_error_KSecParserErrLifeBytes;        /* -5278 */
+			},
+		SINGLE_ERROR
+			{
+			text=r_error_KSecParserErrLifeSecs;         /* -5279 */
+			},
+		SINGLE_ERROR
+			{
+			text=r_error_KSecParserErrPRF;              /* -5280 */
+			},
+		SINGLE_ERROR
+			{
+			text=r_error_KSecParserErrPreKey;           /* -5281 */
+			},
+		SINGLE_ERROR
+			{
+			text=r_error_KSecParserErrPreFormat;        /* -5282 */
+			},
+		SINGLE_ERROR
+			{
+			text=r_error_KSecParserErrCA;               /* -5283 */
+			},
+		SINGLE_ERROR
+			{
+			text=r_error_KSecParserErrOwnCerts;         /* -5284 */
+			},
+		SINGLE_ERROR
+			{
+			text=r_error_KSecParserErrOwnName;          /* -5285 */
+			},
+		SINGLE_ERROR
+			{
+			text=r_error_KSecParserErrOwnKey;           /* -5286 */
+			},
+		SINGLE_ERROR
+			{
+			text=r_error_KSecParserErrPeerCerts;        /* -5287 */
+			},
+		SINGLE_ERROR
+			{
+			text=r_error_KSecParserErrPeerAddr;         /* -5288 */
+			},
+		SINGLE_ERROR
+			{
+			text=r_error_KSecParserErrPeerMask;         /* -5289 */
+			},
+		SINGLE_ERROR
+			{
+			text=r_error_KSecParserErrMaxLifetimeSec;   /* -5290 */
+			},
+		SINGLE_ERROR
+			{
+			text=r_error_KSecParserErrMaxLifetimeKB;    /* -5291 */
+			},
+		SINGLE_ERROR
+			{
+			text=r_error_KSecParserErrMaxRetrans;       /* -5292 */
+			},
+		SINGLE_ERROR
+			{
+			text=r_error_KSecParserErrNoSeparator;      /* -5293 */
+			},
+		SINGLE_ERROR
+			{
+			text=r_error_KSecParserErrCRACKLAMType;     /* -5294 */
+			},
+		SINGLE_ERROR
+			{
+			text=r_error_KSecParserErrUseIntAddr;       /* -5295 */
+			},
+		SINGLE_ERROR
+			{
+			text=r_error_KSecParserErrUseNATProbe;      /* -5296 */
+			},
+		SINGLE_ERROR
+			{
+			text=r_error_KSecParserErrUnknown;          /* -5297 */
+			}
+        };
+    }
+
+RESOURCE TBUF r_error_KSecParserErrMode { buf=STRING_r_error_KSecParserErrMode; }
+RESOURCE TBUF r_error_KSecParserErrNotify { buf=STRING_r_error_KSecParserErrNotify; }
+RESOURCE TBUF r_error_KSecParserErrCommit { buf=STRING_r_error_KSecParserErrCommit; }
+RESOURCE TBUF r_error_KSecParserErrIpsecExpire { buf=STRING_r_error_KSecParserErrIpsecExpire; }
+RESOURCE TBUF r_error_KSecParserErrSendCert { buf=STRING_r_error_KSecParserErrSendCert; }
+RESOURCE TBUF r_error_KSecParserErrInitialContact { buf=STRING_r_error_KSecParserErrInitialContact; }
+RESOURCE TBUF r_error_KSecParserErrResponderLifetime { buf=STRING_r_error_KSecParserErrResponderLifetime; }
+RESOURCE TBUF r_error_KSecParserErrReplayStatus { buf=STRING_r_error_KSecParserErrReplayStatus; }
+RESOURCE TBUF r_error_KSecParserErrGroupDesc_II { buf=STRING_r_error_KSecParserErrGroupDesc_II; }
+RESOURCE TBUF r_error_KSecParserErrProposal { buf=STRING_r_error_KSecParserErrProposal; }
+RESOURCE TBUF r_error_KSecParserErrEncrAlg { buf=STRING_r_error_KSecParserErrEncrAlg; }
+RESOURCE TBUF r_error_KSecParserErrAuthMethod { buf=STRING_r_error_KSecParserErrAuthMethod; }
+RESOURCE TBUF r_error_KSecParserErrHashAlg { buf=STRING_r_error_KSecParserErrHashAlg; }
+RESOURCE TBUF r_error_KSecParserErrGroupDesc { buf=STRING_r_error_KSecParserErrGroupDesc; }
+RESOURCE TBUF r_error_KSecParserErrGroupType { buf=STRING_r_error_KSecParserErrGroupType; }
+RESOURCE TBUF r_error_KSecParserErrLifeBytes { buf=STRING_r_error_KSecParserErrLifeBytes; }
+RESOURCE TBUF r_error_KSecParserErrLifeSecs { buf=STRING_r_error_KSecParserErrLifeSecs; }
+RESOURCE TBUF r_error_KSecParserErrPRF { buf=STRING_r_error_KSecParserErrPRF; }
+RESOURCE TBUF r_error_KSecParserErrPreKey { buf=STRING_r_error_KSecParserErrPreKey; }
+RESOURCE TBUF r_error_KSecParserErrPreFormat { buf=STRING_r_error_KSecParserErrPreFormat; }
+RESOURCE TBUF r_error_KSecParserErrCA { buf=STRING_r_error_KSecParserErrCA; }
+RESOURCE TBUF r_error_KSecParserErrOwnCerts { buf=STRING_r_error_KSecParserErrOwnCerts; }
+RESOURCE TBUF r_error_KSecParserErrOwnName { buf=STRING_r_error_KSecParserErrOwnName; }
+RESOURCE TBUF r_error_KSecParserErrOwnKey { buf=STRING_r_error_KSecParserErrOwnKey; }
+RESOURCE TBUF r_error_KSecParserErrPeerCerts { buf=STRING_r_error_KSecParserErrPeerCerts; }
+RESOURCE TBUF r_error_KSecParserErrPeerAddr { buf=STRING_r_error_KSecParserErrPeerAddr; }
+RESOURCE TBUF r_error_KSecParserErrPeerMask { buf=STRING_r_error_KSecParserErrPeerMask; }
+RESOURCE TBUF r_error_KSecParserErrMaxLifetimeSec { buf=STRING_r_error_KSecParserErrMaxLifetimeSec; }
+RESOURCE TBUF r_error_KSecParserErrMaxLifetimeKB { buf=STRING_r_error_KSecParserErrMaxLifetimeKB; }
+RESOURCE TBUF r_error_KSecParserErrMaxRetrans { buf=STRING_r_error_KSecParserErrMaxRetrans; }
+RESOURCE TBUF r_error_KSecParserErrNoSeparator { buf=STRING_r_error_KSecParserErrNoSeparator; }
+RESOURCE TBUF r_error_KSecParserErrCRACKLAMType { buf=STRING_r_error_KSecParserErrCRACKLAMType; }
+RESOURCE TBUF r_error_KSecParserErrUseIntAddr { buf=STRING_r_error_KSecParserErrUseIntAddr; }
+RESOURCE TBUF r_error_KSecParserErrUseNATProbe { buf=STRING_r_error_KSecParserErrUseNATProbe; }
+RESOURCE TBUF r_error_KSecParserErrUnknown { buf=STRING_r_error_KSecParserErrUnknown; }
+
+RESOURCE ARRAY r_error_array_vpnapi_errors_2
+	{
+    items=
+		{
+		SINGLE_ERROR
+			{
+			text=r_error_KVpnErrPolicySizeChanged;           /* -5298 */
+			}
+        };
+    }
+
+RESOURCE TBUF r_error_KVpnErrPolicySizeChanged { buf=STRING_r_error_KVpnErrPolicySizeChanged; }
--- a/vpnengine/ikev1lib/inc/ikev1crack.h	Fri May 14 16:52:10 2010 +0300
+++ b/vpnengine/ikev1lib/inc/ikev1crack.h	Fri May 14 10:20:11 2010 +0300
@@ -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 "Eclipse Public License v1.0"
@@ -100,6 +100,7 @@
     TInt    GetDataL(HBufC8* aChallenge);
     TInt    GetDatafromUserL(HBufC8 *aChallenge);
     TInt    GetUNPWDFromPolicyL();
+    TInt    GetUNPWDFromNegotiationL();
     TInt    ProcessCHREAttibutesL(const TCHREISAKMP *aCHRE_PAYLOAD);
     void    SendCredentialsL(TUint16 aAttr1, TUint16 aAttr2, TUint16 aAttr3,
                              HBufC8* aBfr1, HBufC8* aBfr2, HBufC8* aBfr3);
--- a/vpnengine/ikev1lib/inc/ikev1dialog.h	Fri May 14 16:52:10 2010 +0300
+++ b/vpnengine/ikev1lib/inc/ikev1dialog.h	Fri May 14 10:20:11 2010 +0300
@@ -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 "Eclipse Public License v1.0"
@@ -82,7 +82,6 @@
     void ShowErrorDialogL(TInt aDialogType, TAny *aUserInfo, MIkeDialogComplete*  aCallback);
 	void StoreUserNameL(TPtr8 aUserName);
 	void StartDialogL();
-	TInt GetSyncUNPWCacheDialog(TDes& aUserName, TDes& aPassword);
 	
     static TInt GetSyncUNPWDialog(TDes& aUserName, TDes& aPassword);
     static void PurgeDialogQueue(CIkev1Dialog* aQueuedDialog);
--- a/vpnengine/ikev1lib/inc/ikev1negotiation.h	Fri May 14 16:52:10 2010 +0300
+++ b/vpnengine/ikev1lib/inc/ikev1negotiation.h	Fri May 14 10:20:11 2010 +0300
@@ -25,6 +25,8 @@
 #include "ikev1SAdata.h"
 #include "ikepolparser.h"
 #include "ipsecsaspiretriever.h"
+#include "ikev1dialog.h"
+
 
 #define INITIATOR   0
 #define RESPONDER   1
@@ -84,7 +86,8 @@
 //  Class CIkev1Negotiation: Contains all the info for each negotiation in progress
 //
 NONSHARABLE_CLASS(CIkev1Negotiation) : public CBase,
-                                       public MIpsecSaSpiRetrieverCallback
+                                       public MIpsecSaSpiRetrieverCallback,
+                                       public MIkeDialogComplete
     {
     friend class CIkev1InfoNegotiation;
     friend class TIkev1IsakmpStream;
@@ -173,6 +176,10 @@
     void IpsecSaSpiRetrieved(TUint32 aSpiRequestId, 
                              TInt aStatus, 
                              TUint32 aSpi);	
+    
+    TInt   ProcessUserResponseL(CAuthDialogInfo *aUserInfo);
+    TInt   DialogCompleteL(CIkev1Dialog* /*aDialog*/, TAny* aUserInfo, HBufC8* aUsername, HBufC8* aSecret, HBufC8* aDomain);
+
 	
 private:
 
@@ -536,6 +543,11 @@
 	CIpsecSaSpiRetriever* iIpsecSaSpiRetriever;
 	CPFKeySocketIf& iPFKeySocketIf;	
 	MIkeDebug& iDebug;
+	
+	HBufC8* iCRACKLAMUserName;
+	HBufC8* iCRACKLAMPassword;
+    CIkev1Dialog*      iDialog;      // Pending dialog object
+    CAuthDialogInfo*   iDialogInfo;  // Dialog info object
     };
 
 #endif // C_IKEV1NEGOTIATION_H
--- a/vpnengine/ikev1lib/src/ikev1crack.cpp	Fri May 14 16:52:10 2010 +0300
+++ b/vpnengine/ikev1lib/src/ikev1crack.cpp	Fri May 14 10:20:11 2010 +0300
@@ -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 "Eclipse Public License v1.0"
@@ -223,6 +223,14 @@
         {
         return GetUNPWDFromPolicyL();
         }
+    
+    else if ( iLAMType == CRACK_PASSWORD &&
+              iNegotiation->iCRACKLAMUserName &&
+              iNegotiation->iCRACKLAMPassword)
+        {
+        return GetUNPWDFromNegotiationL();
+        }
+    
     else
         {
         return GetDatafromUserL(aChallenge); 
@@ -297,6 +305,42 @@
     return CRACK_CONTINUE;
 }
 
+
+TInt CIKECRACKNegotiation::GetUNPWDFromNegotiationL()
+{
+    ASSERT(iLAMType == CRACK_PASSWORD);
+    
+    iNegotiation->iTimer->Cancel();   //Cancel previous timer because reply received & processed
+    DEBUG_LOG(_L("Timer Cancelled!"));
+    iNegotiation->iRetryNum = 0;
+
+    /*--------------------------------------------------------
+    *
+    *  Store attributes: User name, Secret, Domain
+    *
+    *--------------------------------------------------------*/
+
+    TUint16 attr1 = CRACK_T_USERNAME;
+    HBufC8* bfr1  = iNegotiation->iCRACKLAMUserName;
+    TUint16 attr2 = CRACK_T_SECRET;
+    HBufC8* bfr2  = iNegotiation->iCRACKLAMPassword;
+    HBufC8* bfr3  = iDomain;
+    TUint16 attr3 = 0;
+    if ( bfr3 )
+        {
+        attr3 = CRACK_T_DOMAIN;                  
+        }
+
+    SendCredentialsL(attr1, attr2, attr3, bfr1, bfr2, bfr3);
+
+    delete iNegotiation->iCRACKLAMUserName;
+    iNegotiation->iCRACKLAMUserName = NULL;
+    delete iNegotiation->iCRACKLAMPassword;
+    iNegotiation->iCRACKLAMPassword = NULL;
+    
+    return CRACK_CONTINUE;
+}
+
 void CIKECRACKNegotiation::SendCredentialsL(TUint16 aAttr1, TUint16 aAttr2, TUint16 aAttr3,
                                             HBufC8* aBfr1, HBufC8* aBfr2, HBufC8* aBfr3)
 {
--- a/vpnengine/ikev1lib/src/ikev1dialog.cpp	Fri May 14 16:52:10 2010 +0300
+++ b/vpnengine/ikev1lib/src/ikev1dialog.cpp	Fri May 14 10:20:11 2010 +0300
@@ -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 "Eclipse Public License v1.0"
@@ -240,37 +240,6 @@
     return status;
 }
 
-/*--------------------------------------------------------------------
- *
- *  Get user name and password data for Legacy authentication
- *  This is a synchronous dialog which does NOT convert user name and
- *  password data into the 8-bit ASCII text
- *  Uses username cache
- *
- *---------------------------------------------------------------------*/
-TInt CIkev1Dialog::GetSyncUNPWCacheDialog(TDes& aUserName, TDes& aPassword)
-{
-    TInt status = KErrGeneral;
-    TIPSecDialogOutput output;
-
-    TIPSecDialogInfo dialog_input(TKMDDialog::EUserPwd, 0);
-    
-    iInputData = CreateDialogInput(dialog_input, ETrue);// TRUE = Use user name cache       
-    
-    TPckgBuf<TIPSecDialogOutput> ResponseBuf(output);//create the buf to receive the response
-
-    if ( iInputData )
-        status = LauchSyncDialog((TPckgBuf<TIPSecDialogInfo>&)*iInputData, ResponseBuf);
-    
-    if ( status == KErrNone ) {
-        TIPSecDialogOutput& resp = ResponseBuf();
-        aUserName = resp.iOutBuf;
-        aPassword = resp.iOutBuf2;      
-    }
-
-    return status;
-}
-
 void CIkev1Dialog::ShowErrorDialogL(TInt aDialogText, TAny *aUserInfo, MIkeDialogComplete*  aCallback )
 {
     iDialogType = TNoteDialog::EInfo;
--- a/vpnengine/ikev1lib/src/ikev1negotiation.cpp	Fri May 14 16:52:10 2010 +0300
+++ b/vpnengine/ikev1lib/src/ikev1negotiation.cpp	Fri May 14 10:20:11 2010 +0300
@@ -217,6 +217,9 @@
     delete iNatDiscovery;
 	delete iSARekeyInfo;
 	delete iLastMsg;
+
+	delete iDialog;
+    delete iDialogInfo;
 }
 
 
@@ -1073,24 +1076,28 @@
     else 
     {
        if ( iCRACKneg )
+       {
             status = iCRACKneg->ProcessUserResponseL(aUserInfo);       
-       else status = CRACK_FAILED;
-
-       if ( status == CRACK_FAILED ) 
-       {
-         /*--------------------------------------------------------
-          *
-          *  Crack negotiation failed. Negotiation shall be deleted
-          *
-          *--------------------------------------------------------*/
-		  LOG_KMD_EVENT( MKmdEventLoggerIf::KLogError,
-		                 R_VPN_MSG_VPN_GW_AUTH_FAIL,
-		                 status,
-		                 iPluginSession->VpnIapId(),
-		                 &iRemoteAddr );		   
-		  SetErrorStatus(KKmdIkeAuthFailedErr);		  
-          AcquireSAErrorResponse(KKmdIkeAuthFailedErr);
-       }      
+
+           if ( status == CRACK_FAILED ) 
+           {
+             /*--------------------------------------------------------
+              *
+              *  Crack negotiation failed. Negotiation shall be deleted
+              *
+              *--------------------------------------------------------*/
+              LOG_KMD_EVENT( MKmdEventLoggerIf::KLogError,
+                             R_VPN_MSG_VPN_GW_AUTH_FAIL,
+                             status,
+                             iPluginSession->VpnIapId(),
+                             &iRemoteAddr );		   
+              SetErrorStatus(KKmdIkeAuthFailedErr);		  
+              AcquireSAErrorResponse(KKmdIkeAuthFailedErr);
+           }
+       }
+       else 
+           status = ProcessUserResponseL(aUserInfo);;
+           
     }
 }
 
@@ -1266,6 +1273,19 @@
 //Sends the initial IKE packets to start the negotiation. PHASE I
 void CIkev1Negotiation::InitNegotiationL()   //Equiv. to stage 1
 {
+    
+    if (iProposal_I.iAttrList->iAuthMethod == IKE_A_CRACK &&
+        !iHostData->iCRACKLAMUserName && 
+        !iHostData->iCRACKLAMPassword &&
+        !iCRACKLAMUserName && 
+        !iCRACKLAMPassword)
+        {
+            
+            iDialog     = CIkev1Dialog::NewL( iPluginSession, iPluginSession->DialogAnchor(), iDebug );
+            iDialogInfo = new(ELeave) CAuthDialogInfo(iPluginSession, DIALOG_INFO_ID, SAId(), 0);
+            iDialog->GetAsyncUNPWDialogL(iDialogInfo, (MIkeDialogComplete*)this);
+            return;
+    }
     TIkev1IsakmpStream* msg = SaveIkeMsgBfr( new (ELeave) TIkev1IsakmpStream(iDebug) );
 	
     TInt  vendor_id_type;
@@ -1308,7 +1328,6 @@
 
     TBool cert_required = EFalse;   //If any proposal requires a cert to send a CR if needed
     TBool preshared_key = EFalse;   //Preshared key authentication        
-    TBool crack_used = EFalse;
     
     TAttrib *transf = iProposal_I.iAttrList;
     for (TInt i=0; (i < iProposal_I.iNumTransforms) && (!cert_required); i++)
@@ -1321,7 +1340,6 @@
             break;
         case IKE_A_CRACK:           
             cert_required = ETrue;
-            crack_used = ETrue;
             break;
         default:    // No cert involved
             preshared_key = ETrue;
@@ -1329,24 +1347,6 @@
         }
     }
     
-    if (crack_used &&
-        !iHostData->iCRACKLAMUserName && 
-        !iHostData->iCRACKLAMPassword)
-        {
-        TBuf<256> UserName;
-        TBuf<64> Password;
-        CIkev1Dialog* Dialog = CIkev1Dialog::NewL(iPluginSession, iPluginSession->DialogAnchor(), iDebug);                     
-        if (KErrNone != Dialog->GetSyncUNPWCacheDialog(UserName, Password))
-            {
-            DEBUG_LOG(_L("Failed to get credentials for crack auth!"));
-            SetFinished();
-            delete Dialog;
-            return;
-            }
-        iHostData->iCRACKLAMUserName = TStringData::NewL(UserName);
-        iHostData->iCRACKLAMPassword = TStringData::NewL(Password);
-        delete Dialog;
-    }
 
     if (iExchange == ISAKMP_EXCHANGE_AGGR) //Aggressive contains more payloads
     {
@@ -8393,4 +8393,55 @@
         }    
 }
 
-
+TInt CIkev1Negotiation::ProcessUserResponseL(CAuthDialogInfo *aDialogInfo )
+{
+    delete iDialog;  /* delete dialog object */
+    iDialog = NULL;
+    
+    iCRACKLAMUserName = aDialogInfo->iUsername->AllocL();
+    iCRACKLAMPassword = aDialogInfo->iSecret->AllocL();
+    
+    delete aDialogInfo;  /* release dialog info object */
+    iDialogInfo = NULL;  /* reset dialog info pointer  */
+    DEBUG_LOG(_L("Continue negotiation from begining"));
+    InitNegotiationL();
+    
+    return KErrNone;
+
+}
+//
+// The implementation for class MIkeDialogComplete virtual function
+//
+TInt CIkev1Negotiation::DialogCompleteL(CIkev1Dialog* /*aDialog*/, TAny* aUserInfo,
+                                            HBufC8* aUsername, HBufC8* aSecret, HBufC8* aDomain)
+{
+/*---------------------------------------------------------------------------
+ *  
+ *  A response received from client user (through asynchronous dialog)
+ *  This method is introduced as a TUserCallback for CGetIKEPassword dialog
+ *  object is created. When the dialog is completed this callback function
+ *  is called 
+ *  
+ *-------------------------------------------------------------------------*/
+    TUint32 obj_id = 1;
+     CAuthDialogInfo* info = (CAuthDialogInfo*)aUserInfo;
+     DEBUG_LOG1(_L("CIkev1Negotiation::DialogCompleteL(), aUserInfo =  %x"), aUserInfo);
+             
+     if ( info )
+     {
+        obj_id = info->GetObjId();
+        DEBUG_LOG1(_L("Preparing to call AuthDialogCompletedL(), ObjId = %x"), obj_id);
+        if ( obj_id == DIALOG_INFO_ID )
+        {
+           info->iUsername = aUsername;
+           info->iSecret   = aSecret;
+           info->iDomain   = aDomain;
+           obj_id = info->PluginSession()->AuthDialogCompletedL(info);
+        }   
+     }
+
+     return obj_id;
+    
+}
+
+