|
1 // Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 #ifndef __CHAPMD5_H__ |
|
17 #define __CHAPMD5_H__ |
|
18 |
|
19 /** |
|
20 @file |
|
21 @brief Header file for the implementation PPP Challenge Handshake |
|
22 Authentication Protocol with MD5 (CHAP with MD5) - RFC 1994. |
|
23 @internalComponent |
|
24 */ |
|
25 |
|
26 #include "PPPCHAP.H" |
|
27 |
|
28 class CMD5; |
|
29 |
|
30 // protocol specific definitions for CHAP with MD5 |
|
31 |
|
32 /** |
|
33 The size of the CHAP with MD5 Value field. |
|
34 @internalComponent |
|
35 */ |
|
36 const TUint8 KPppChapMd5ValueSize = 16u; |
|
37 |
|
38 |
|
39 /*final*/ NONSHARABLE_CLASS(CPppChapMd5) : public CPppChap |
|
40 /** |
|
41 Class that implements the PPP Challenge Handshake Authentication |
|
42 Protocol (CHAP) with MD5 - RFC 1994. |
|
43 @internalComponent |
|
44 */ |
|
45 { |
|
46 public: |
|
47 static CPppAuthentication* NewL(); |
|
48 |
|
49 virtual ~CPppChapMd5(); |
|
50 |
|
51 virtual void InitL(CPppLcp* aLcp); |
|
52 |
|
53 protected: |
|
54 virtual void MakeResponseL(TUint8 aChallengeId, |
|
55 const TDesC8& aChallengeValue, |
|
56 TPtrC8& aResponseValue, |
|
57 TPtrC8& aResponseName); |
|
58 |
|
59 private: |
|
60 CPppChapMd5(); |
|
61 |
|
62 /* Pointer to the CMD5 object used for computing the CHAP Response |
|
63 value. */ |
|
64 CMD5* iMd5; |
|
65 |
|
66 #ifdef _UNICODE |
|
67 /* A buffer containing the user name. */ |
|
68 HBufC8* iUserName; |
|
69 #endif |
|
70 }; |
|
71 |
|
72 inline CPppAuthentication* CPppChapMd5::NewL() |
|
73 /** |
|
74 Object factory for CPppChapMd5. |
|
75 @leave Standard Symbian OS error codes. e.g. KErrNoMemory. |
|
76 @note This function will not initialize the created object. The |
|
77 InitL member function shall be called first in order to initialize |
|
78 the created object before using it. This behavior is in agreement |
|
79 with the requirements for a migration to a plugin architecture. |
|
80 */ |
|
81 { |
|
82 return new(ELeave) CPppChapMd5; |
|
83 } |
|
84 |
|
85 #endif |