|
1 /* |
|
2 * Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Implementation |
|
15 * |
|
16 */ |
|
17 |
|
18 #include "TCmdAuthenticate.h" |
|
19 #include "SIPConstants.h" |
|
20 #include "CTcSIPIMSAuthenticator.h" |
|
21 #include "CTcSIPContext.h" |
|
22 |
|
23 /** |
|
24 * INPUT: |
|
25 * Headers: - |
|
26 * Parameters: AuthenticationNonce |
|
27 * IDs: - |
|
28 * |
|
29 * OUTPUT: |
|
30 * Parameters: AuthenticationRes, AuthenticationIk, AuthenticationCk, |
|
31 * AuthenticationAuts |
|
32 * IDs: - |
|
33 */ |
|
34 |
|
35 void TCmdAuthenticate::ExecuteL() |
|
36 { |
|
37 HBufC8* nonce = ExtractHBufLC( KParamAuthenticationNonce ); |
|
38 __ASSERT_ALWAYS( nonce, User::Leave( KErrNotFound ) ); |
|
39 |
|
40 CTcSIPIMSAuthenticationParams& params = |
|
41 iContext.AuthenticateL( *nonce ); |
|
42 |
|
43 AddTextResponseL( KParamAuthenticationRes, params.Res() ); |
|
44 AddTextResponseL( KParamAuthenticationIk, params.Ik() ); |
|
45 AddTextResponseL( KParamAuthenticationCk, params.Ck() ); |
|
46 AddTextResponseL( KParamAuthenticationAuts, params.Auts() ); |
|
47 |
|
48 CleanupStack::PopAndDestroy( nonce ); |
|
49 } |
|
50 |
|
51 TBool TCmdAuthenticate::Match( const TTcIdentifier& aId ) |
|
52 { |
|
53 return TTcSIPCommandBase::Match( aId, _L8("Authenticate") ); |
|
54 } |
|
55 |
|
56 TTcCommandBase* TCmdAuthenticate::CreateL( MTcTestContext& aContext ) |
|
57 { |
|
58 return new( ELeave ) TCmdAuthenticate( aContext ); |
|
59 } |