00001 /* BEGIN_COPYRIGHT */ 00002 /* */ 00003 /* Open Diameter: Open-source software for the Diameter and */ 00004 /* Diameter related protocols */ 00005 /* */ 00006 /* Copyright (C) 2002-2004 Open Diameter Project */ 00007 /* */ 00008 /* This library is free software; you can redistribute it and/or modify */ 00009 /* it under the terms of the GNU Lesser General Public License as */ 00010 /* published by the Free Software Foundation; either version 2.1 of the */ 00011 /* License, or (at your option) any later version. */ 00012 /* */ 00013 /* This library is distributed in the hope that it will be useful, */ 00014 /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ 00015 /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU */ 00016 /* Lesser General Public License for more details. */ 00017 /* */ 00018 /* You should have received a copy of the GNU Lesser General Public */ 00019 /* License along with this library; if not, write to the Free Software */ 00020 /* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 */ 00021 /* USA. */ 00022 /* */ 00023 /* In addition, when you copy and redistribute some or the entire part of */ 00024 /* the source code of this software with or without modification, you */ 00025 /* MUST include this copyright notice in each copy. */ 00026 /* */ 00027 /* If you make any changes that are appeared to be useful, please send */ 00028 /* sources that include the changed part to */ 00029 /* diameter-developers@lists.sourceforge.net so that we can reflect your */ 00030 /* changes to one unified version of this software. */ 00031 /* */ 00032 /* END_COPYRIGHT */ 00033 // $Id: eap_notification.hxx,v 1.15 2004/06/17 21:13:36 yohba Exp $ 00034 00035 // eap_notification.hxx: Notification method state machine 00036 // Written by Yoshihiro Ohba 00037 00038 #ifndef __EAP_NOTIFICATION_HXX__ 00039 #define __EAP_NOTIFICATION_HXX__ 00040 00041 /* Notification Request/Response 00042 00043 According to RFC2284bis, there are the following rules on 00044 processing Notification Request/Response messages. 00045 00046 Section 2.1. Support for sequences: 00047 00048 A Notification Response is only used as confirmation that the 00049 peer received the Notification Request, not that it has 00050 processed it, or displayed the message to the user. It cannot be 00051 assumed that the contents of the Notification Request or 00052 Response is available to another method. 00053 00054 Given these considerations, the Success, Failure, Nak Response 00055 and Notification Request/Response messages MUST NOT used to 00056 carry data destined for delivery to other EAP methods. 00057 00058 Section 4.2.1. Processing of success and failure: 00059 00060 In order to provide additional protection against tampering, EAP 00061 methods MAY support a MIC that covers some or all of the EAP 00062 packet, including headers. In addition, such a MIC MAY include 00063 coverage of previous Request and Response messages, so as to 00064 enable protection of other packets to that do not contain MICs, 00065 such as Identity Request/Response, Notification Request/Response 00066 and Nak Response. 00067 00068 Section 5.2. Notification: 00069 00070 Description 00071 00072 The Notification Type is optionally used to convey a 00073 displayable message from the authenticator to the peer. An 00074 authenticator MAY send a Notification Request to the peer at 00075 any time, The peer MUST respond to a Notification Request 00076 with a Notification Response; a Nak Response MUST NOT be 00077 sent. 00078 00079 The peer SHOULD display this message to the user or log it if 00080 it cannot be displayed. The Notification Type is intended to 00081 provide an acknowledged notification of some imperative 00082 nature, but it is not an error indication, and therefore does 00083 not change the state of the peer. Examples include a password 00084 with an expiration time that is about to expire, an OTP 00085 sequence integer which is nearing 0, an authentication 00086 failure warning, etc. In most circumstances, Notification 00087 should not be required. 00088 00089 Type 00090 00091 2 00092 00093 Type-Data 00094 00095 The Type-Data field in the Request contains a displayable 00096 message greater than zero octets in length, containing UTF-8 00097 encoded ISO 10646 characters [RFC2279]. The length of the 00098 message is determined by Length field of the Request packet. 00099 The message MUST NOT be null terminated. A Response MUST be 00100 sent in reply to the Request with a Type field of 2 00101 (Notification). The Type-Data field of the Response is zero 00102 octets in length. The Response should be sent immediately 00103 (independent of how the message is displayed or logged). 00104 */ 00105 00106 #include "eap_fsm.hxx" 00107 #include "eap_authfsm.hxx" 00108 #include "eap_peerfsm.hxx" 00109 #include "eap_log.hxx" 00110 #include "eap_method_registrar.hxx" 00111 00119 class EAP_EXPORTS EapAuthNotificationStateMachine : 00120 public EapMethodStateMachine, 00121 public EapStateMachine<EapAuthNotificationStateMachine> 00122 { 00123 friend class EapMethodStateMachineCreator<EapAuthNotificationStateMachine>; 00124 friend class EapAuthNotificationStateTable_S; 00125 public: 00126 00128 void Start() throw(AAA_Error) 00129 { 00130 EapStateMachine<EapAuthNotificationStateMachine>::Start(); 00131 } 00132 00134 inline void Notify(AAA_Event ev) 00135 { 00136 EapStateMachine<EapAuthNotificationStateMachine>::Notify(ev); 00137 } 00138 00139 void Receive(AAAMessageBlock *b) {} 00140 EapAuthNotificationStateMachine(EapSwitchStateMachine &s); 00141 ~EapAuthNotificationStateMachine() {} 00142 private: 00143 00144 }; 00145 00146 #endif // __EAP_NOTIFICATION_HXX__