diff -r 30e048a7b597 -r bad0cc58d154 eapol/eapol_framework/eapol_symbian/am/type/aka/symbian/eap_am_type_aka_symbian.cpp --- a/eapol/eapol_framework/eapol_symbian/am/type/aka/symbian/eap_am_type_aka_symbian.cpp Thu Aug 19 09:58:27 2010 +0300 +++ b/eapol/eapol_framework/eapol_symbian/am/type/aka/symbian/eap_am_type_aka_symbian.cpp Tue Aug 31 15:16:37 2010 +0300 @@ -16,7 +16,7 @@ */ /* -* %version: 49 % +* %version: 46.1.10 % */ // This is enumeration of EAPOL source code. @@ -36,7 +36,7 @@ #include "EapAkaDbDefaults.h" #include "EapAkaDbParameterNames.h" #include "EapAkaDbUtils.h" -#include "eap_am_trace_symbian.h" +#include "EapTraceSymbian.h" #include // For DBMS #include // For RReadStream @@ -154,16 +154,6 @@ { EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT); -#ifdef USE_EAP_EXPANDED_TYPES - - m_tunneling_vendor_type = m_tunneling_type.get_vendor_type(); - -#else - - m_tunneling_vendor_type = static_cast(m_tunneling_type); - -#endif //#ifdef USE_EAP_EXPANDED_TYPES - if (receive_network_id != 0 && receive_network_id->get_is_valid_data() == true) { @@ -205,6 +195,10 @@ } #endif // #if defined (USE_EAP_TYPE_SERVER_AKA) + TInt error = m_session.Connect(); + EAP_TRACE_DEBUG_SYMBIAN((_L("eap_am_type_aka_symbian_c::ConstructL(): - m_session.Connect(), error=%d\n"), error)); + User::LeaveIfError(error); + // Open/create database EapAkaDbUtils::OpenDatabaseL(m_database, m_session, m_index_type, m_index, m_tunneling_type); @@ -225,7 +219,7 @@ //-------------------------------------------------- -eap_am_type_aka_symbian_c* eap_am_type_aka_symbian_c::NewL( +EAP_FUNC_EXPORT eap_am_type_aka_symbian_c* eap_am_type_aka_symbian_c::NewL( abs_eap_am_tools_c * const aTools, abs_eap_base_type_c * const aPartner, const TIndexType aIndexType, @@ -314,7 +308,7 @@ // Read Maximum Session Validity Time from the config file eap_variable_data_c sessionTimeFromFile(m_am_tools); - eap_status_e status = m_partner->read_configure( + eap_status_e status = type_configure_read( cf_str_EAP_AKA_max_session_validity_time.get_field(), &sessionTimeFromFile); @@ -337,7 +331,7 @@ // We have to set the values for K, OP and AMF in simulator. { - eap_status_e status = m_partner->read_configure( + eap_status_e status = type_configure_read( cf_str_EAP_AKA_simulator_aka_k.get_field(), &m_simulator_aka_K); if (status == eap_status_ok @@ -366,7 +360,7 @@ } { - eap_status_e status = m_partner->read_configure( + eap_status_e status = type_configure_read( cf_str_EAP_AKA_simulator_aka_op.get_field(), &m_simulator_aka_OP); if (status == eap_status_ok @@ -395,7 +389,7 @@ } { - eap_status_e status = m_partner->read_configure( + eap_status_e status = type_configure_read( cf_str_EAP_AKA_simulator_aka_amf.get_field(), &m_simulator_aka_AMF); if (status == eap_status_ok @@ -582,9 +576,19 @@ HBufC* buf = HBufC::NewLC(KMaxSqlQueryLength); TPtr sqlStatement = buf->Des(); - _LIT(KSQLInsert, "SELECT %S FROM %S WHERE %S=%d AND %S=%d AND %S=%d"); - sqlStatement.Format(KSQLInsert, &KPseudonymId, &KAkaTableName, - &KServiceType, m_index_type, &KServiceIndex, m_index, &KTunnelingType, m_tunneling_vendor_type); + _LIT(KSQLInsert, "SELECT %S FROM %S WHERE %S=%d AND %S=%d AND %S=%d AND %S=%d"); + sqlStatement.Format( + KSQLInsert, + &KPseudonymId, + &KAkaTableName, + &KServiceType, + m_index_type, + &KServiceIndex, + m_index, + &KTunnelingTypeVendorId, + m_tunneling_type.get_vendor_id(), + &KTunnelingType, + m_tunneling_type.get_vendor_type()); // Evaluate view RDbView view; @@ -684,9 +688,19 @@ HBufC* buf = HBufC::NewLC(KMaxSqlQueryLength); TPtr sqlStatement = buf->Des(); - _LIT(KSQLInsert, "SELECT %S FROM %S WHERE %S=%d AND %S=%d AND %S=%d"); - sqlStatement.Format(KSQLInsert, &KReauthId, &KAkaTableName, - &KServiceType, m_index_type, &KServiceIndex, m_index, &KTunnelingType, m_tunneling_vendor_type); + _LIT(KSQLInsert, "SELECT %S FROM %S WHERE %S=%d AND %S=%d AND %S=%d AND %S=%d"); + sqlStatement.Format( + KSQLInsert, + &KReauthId, + &KAkaTableName, + &KServiceType, + m_index_type, + &KServiceIndex, + m_index, + &KTunnelingTypeVendorId, + m_tunneling_type.get_vendor_id(), + &KTunnelingType, + m_tunneling_type.get_vendor_type()); // Evaluate view RDbView view; @@ -812,9 +826,22 @@ HBufC* buf = HBufC::NewLC(KMaxSqlQueryLength); TPtr sqlStatement = buf->Des(); - _LIT(KSQLInsert, "SELECT %S, %S, %S, %S FROM %S WHERE %S=%d AND %S=%d AND %S=%d"); - sqlStatement.Format(KSQLInsert, &KXKey, &KK_aut, &KK_encr, &KReauthCounter, &KAkaTableName, - &KServiceType, m_index_type, &KServiceIndex, m_index, &KTunnelingType, m_tunneling_vendor_type); + _LIT(KSQLInsert, "SELECT %S, %S, %S, %S FROM %S WHERE %S=%d AND %S=%d AND %S=%d AND %S=%d"); + sqlStatement.Format( + KSQLInsert, + &KXKey, + &KK_aut, + &KK_encr, + &KReauthCounter, + &KAkaTableName, + &KServiceType, + m_index_type, + &KServiceIndex, + m_index, + &KTunnelingTypeVendorId, + m_tunneling_type.get_vendor_id(), + &KTunnelingType, + m_tunneling_type.get_vendor_type()); // Evaluate view RDbView view; @@ -953,9 +980,22 @@ TPtr sqlStatement = buf->Des(); // Form the query - _LIT(KSQLQuery, "SELECT %S, %S, %S, %S FROM %S WHERE %S=%d AND %S=%d AND %S=%d"); - sqlStatement.Format(KSQLQuery, &KXKey, &KK_aut, &KK_encr, &KReauthCounter, &KAkaTableName, - &KServiceType, m_index_type, &KServiceIndex, m_index, &KTunnelingType, m_tunneling_vendor_type); + _LIT(KSQLQuery, "SELECT %S, %S, %S, %S FROM %S WHERE %S=%d AND %S=%d AND %S=%d AND %S=%d"); + sqlStatement.Format( + KSQLQuery, + &KXKey, + &KK_aut, + &KK_encr, + &KReauthCounter, + &KAkaTableName, + &KServiceType, + m_index_type, + &KServiceIndex, + m_index, + &KTunnelingTypeVendorId, + m_tunneling_type.get_vendor_id(), + &KTunnelingType, + m_tunneling_type.get_vendor_type()); RDbView view; // Evaluate view @@ -1064,9 +1104,19 @@ HBufC* buf = HBufC::NewLC(KMaxSqlQueryLength); TPtr sqlStatement = buf->Des(); - _LIT(KSQLInsert, "SELECT %S FROM %S WHERE %S=%d AND %S=%d AND %S=%d"); - sqlStatement.Format(KSQLInsert, &KReauthCounter, &KAkaTableName, - &KServiceType, m_index_type, &KServiceIndex, m_index, &KTunnelingType, m_tunneling_vendor_type); + _LIT(KSQLInsert, "SELECT %S FROM %S WHERE %S=%d AND %S=%d AND %S=%d AND %S=%d"); + sqlStatement.Format( + KSQLInsert, + &KReauthCounter, + &KAkaTableName, + &KServiceType, + m_index_type, + &KServiceIndex, + m_index, + &KTunnelingTypeVendorId, + m_tunneling_type.get_vendor_id(), + &KTunnelingType, + m_tunneling_type.get_vendor_type()); // Evaluate view RDbView view; @@ -1179,11 +1229,22 @@ m_stored_reauth_id.reset(); m_previous_imsi.reset(); - _LIT(KSQLQuery, "SELECT %S, %S, %S, %S FROM %S WHERE %S=%d AND %S=%d AND %S=%d"); - sqlStatement.Format(KSQLQuery, &KReauthId, &KReauthCounter, &KPseudonymId, - &KPreviousIMSI, &KAkaTableName, - &KServiceType, m_index_type, - &KServiceIndex, m_index, &KTunnelingType, m_tunneling_vendor_type); + _LIT(KSQLQuery, "SELECT %S, %S, %S, %S FROM %S WHERE %S=%d AND %S=%d AND %S=%d AND %S=%d"); + sqlStatement.Format( + KSQLQuery, + &KReauthId, + &KReauthCounter, + &KPseudonymId, + &KPreviousIMSI, + &KAkaTableName, + &KServiceType, + m_index_type, + &KServiceIndex, + m_index, + &KTunnelingTypeVendorId, + m_tunneling_type.get_vendor_id(), + &KTunnelingType, + m_tunneling_type.get_vendor_type()); RDbView view; // Evaluate view @@ -1386,7 +1447,7 @@ //-------------------------------------------------- -eap_status_e eap_am_type_aka_symbian_c::complete_AKA_imsi_L( +EAP_FUNC_EXPORT eap_status_e eap_am_type_aka_symbian_c::complete_AKA_imsi_L( const eap_variable_data_c * const IMSI, const eap_status_e completion_status ) { @@ -1544,9 +1605,19 @@ HBufC* buf = HBufC::NewLC(KMaxSqlQueryLength); TPtr sqlStatement = buf->Des(); - _LIT(KSQLInsert, "SELECT %S FROM %S WHERE %S=%d AND %S=%d AND %S=%d"); - sqlStatement.Format(KSQLInsert, &KPreviousIMSI, &KAkaTableName, - &KServiceType, m_index_type, &KServiceIndex, m_index, &KTunnelingType, m_tunneling_vendor_type); + _LIT(KSQLInsert, "SELECT %S FROM %S WHERE %S=%d AND %S=%d AND %S=%d AND %S=%d"); + sqlStatement.Format( + KSQLInsert, + &KPreviousIMSI, + &KAkaTableName, + &KServiceType, + m_index_type, + &KServiceIndex, + m_index, + &KTunnelingTypeVendorId, + m_tunneling_type.get_vendor_id(), + &KTunnelingType, + m_tunneling_type.get_vendor_type()); // Evaluate view RDbView view; @@ -1700,7 +1771,7 @@ //-------------------------------------------------- -eap_status_e eap_am_type_aka_symbian_c::complete_AKA_RES_L( +EAP_FUNC_EXPORT eap_status_e eap_am_type_aka_symbian_c::complete_AKA_RES_L( eap_variable_data_c * const aRES, eap_variable_data_c * const aCK, eap_variable_data_c * const aIK, @@ -2605,7 +2676,7 @@ //-------------------------------------------------- -eap_status_e eap_am_type_aka_symbian_c::generate_reauthentication_id( +EAP_FUNC_EXPORT eap_status_e eap_am_type_aka_symbian_c::generate_reauthentication_id( const eap_am_network_id_c * const send_network_id, const eap_variable_data_c * const imsi, eap_variable_data_c * const reauthentication_identity, @@ -2818,9 +2889,19 @@ HBufC* buf = HBufC::NewLC(KMaxSqlQueryLength); TPtr sqlStatement = buf->Des(); - _LIT(KSQLQueryRow, "SELECT %S FROM %S WHERE %S=%d AND %S=%d AND %S=%d"); - sqlStatement.Format(KSQLQueryRow, &unicodeString, &KAkaTableName, - &KServiceType, m_index_type, &KServiceIndex, m_index, &KTunnelingType, m_tunneling_vendor_type); + _LIT(KSQLQueryRow, "SELECT %S FROM %S WHERE %S=%d AND %S=%d AND %S=%d AND %S=%d"); + sqlStatement.Format( + KSQLQueryRow, + &unicodeString, + &KAkaTableName, + &KServiceType, + m_index_type, + &KServiceIndex, + m_index, + &KTunnelingTypeVendorId, + m_tunneling_type.get_vendor_id(), + &KTunnelingType, + m_tunneling_type.get_vendor_type()); RDbView view; User::LeaveIfError(view.Prepare(m_database, TDbQuery(sqlStatement), TDbWindow::EUnlimited)); @@ -2982,7 +3063,7 @@ //-------------------------------------------------- -bool eap_am_type_aka_symbian_c::is_session_valid() +EAP_FUNC_EXPORT bool eap_am_type_aka_symbian_c::is_session_valid() { EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT); @@ -3016,11 +3097,20 @@ TPtr sqlStatement = buf->Des(); // Query all the relevant parameters - _LIT(KSQLQuery, "SELECT %S, %S FROM %S WHERE %S=%d AND %S=%d AND %S=%d"); - sqlStatement.Format(KSQLQuery, &cf_str_EAP_AKA_max_session_validity_time_literal, - &KAKALastFullAuthTime, &KAkaTableName, - &KServiceType, m_index_type, - &KServiceIndex, m_index, &KTunnelingType, m_tunneling_vendor_type); + _LIT(KSQLQuery, "SELECT %S, %S FROM %S WHERE %S=%d AND %S=%d AND %S=%d AND %S=%d"); + sqlStatement.Format( + KSQLQuery, + &cf_str_EAP_AKA_max_session_validity_time_literal, + &KAKALastFullAuthTime, + &KAkaTableName, + &KServiceType, + m_index_type, + &KServiceIndex, + m_index, + &KTunnelingTypeVendorId, + m_tunneling_type.get_vendor_id(), + &KTunnelingType, + m_tunneling_type.get_vendor_type()); RDbView view; // Evaluate view @@ -3138,10 +3228,19 @@ TPtr sqlStatement = buf->Des(); // Query all the relevant parameters - _LIT(KSQLQuery, "SELECT %S FROM %S WHERE %S=%d AND %S=%d AND %S=%d"); - sqlStatement.Format(KSQLQuery, &KAKALastFullAuthTime, &KAkaTableName, - &KServiceType, m_index_type, - &KServiceIndex, m_index, &KTunnelingType, m_tunneling_vendor_type); + _LIT(KSQLQuery, "SELECT %S FROM %S WHERE %S=%d AND %S=%d AND %S=%d AND %S=%d"); + sqlStatement.Format( + KSQLQuery, + &KAKALastFullAuthTime, + &KAkaTableName, + &KServiceType, + m_index_type, + &KServiceIndex, + m_index, + &KTunnelingTypeVendorId, + m_tunneling_type.get_vendor_id(), + &KTunnelingType, + m_tunneling_type.get_vendor_type()); RDbView view; // Evaluate view