Added ip spoofing protectection.

This commit is contained in:
phr0z3nt04st
2010-06-22 15:31:11 -05:00
parent 80b7af4809
commit b13bbd7b40
11 changed files with 553 additions and 4 deletions

View File

@@ -784,6 +784,28 @@
<string>S32</string>
<key>Value</key>
<integer>5</integer>
</map>
<key>SpoofProtectionAlerts</key>
<map>
<key>Comment</key>
<string>Enables IP Spoofing protection alerts</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>SpoofProtectionLevel</key>
<map>
<key>Comment</key>
<string>IP Spoofing protection level</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>U32</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>Socks5ProxyEnabled</key>
<map>

View File

@@ -74,6 +74,7 @@ private:
U32 mLinksForChattingObjects;
U32 mTimeFormat;
U32 mDateFormat;
U32 mSpoofProtectionAtOpen;
};
@@ -180,6 +181,7 @@ void LLPrefsInertImpl::refresh()
{
combo->setCurrentByIndex(mDateFormat);
}
mSpoofProtectionAtOpen = gSavedSettings.getU32("SpoofProtectionLevel");
}
void LLPrefsInertImpl::cancel()
@@ -199,7 +201,8 @@ void LLPrefsInertImpl::cancel()
gSavedSettings.setBOOL("RevokePermsOnStandUp", mRevokePermsOnStandUp);
gSavedSettings.setBOOL("WindEnabled", mEnableLLWind);
gSavedSettings.setBOOL("BroadcastViewerEffects", mBroadcastViewerEffects);
gSavedSettings.setU32("SpoofProtectionLevel", mSpoofProtectionAtOpen);
gLLWindEnabled = mEnableLLWind;
if(mInitialEnableClouds != gSavedSettings.getBOOL("CloudsEnabled"))
@@ -261,7 +264,16 @@ void LLPrefsInertImpl::apply()
gSavedSettings.setString("ShortTimeFormat", short_time);
gSavedSettings.setString("LongTimeFormat", long_time);
gSavedSettings.setString("TimestampFormat", timestamp);
if(gMessageSystem)
{
U32 new_spoof_protection = gSavedSettings.getU32("SpoofProtectionLevel");
if(new_spoof_protection != mSpoofProtectionAtOpen)
{
mSpoofProtectionAtOpen = new_spoof_protection;
gMessageSystem->stopSpoofProtection();
gMessageSystem->startSpoofProtection(new_spoof_protection);
}
}
refreshValues();
}

View File

@@ -926,6 +926,14 @@ bool idle_startup()
LLAppViewer::instance()->earlyExit("LoginFailedNoNetwork", LLSD().insert("DIAGNOSTIC", diagnostic));
}
// <edit>
if(gMessageSystem)
{
gMessageSystem->startSpoofProtection(gSavedSettings.getU32("SpoofProtectionLevel"));
gMessageSystem->setSpoofDroppedCallback(spoof_dropped_callback);
}
// </edit>
#if LL_WINDOWS
// On the windows dev builds, unpackaged, the message.xml file will
// be located in indra/build-vc**/newview/<config>/app_settings.

View File

@@ -5915,3 +5915,15 @@ void LLOfferInfo::forceResponse(InventoryOfferResponse response)
LLNotifications::instance().forceResponse(params, response);
}
// <edit> lol
void spoof_dropped_callback(LLNetCanary::entry entry)
{
if(gSavedSettings.getBOOL("SpoofProtectionAlerts"))
{
LLSD args;
args["[MESSAGE]"] = llformat("A suspicious %s packet was dropped based on your IP Spoofing Protection settings.", entry.name.c_str());
LLNotifications::instance().add("SystemMessageTip",args);
}
}
// </edit>

View File

@@ -197,6 +197,10 @@ void process_decline_callingcard(LLMessageSystem* msg, void**);
// Message system exception prototypes
void invalid_message_callback(LLMessageSystem*, void*, EMessageException);
// <edit>
void spoof_dropped_callback(LLNetCanary::entry entry);
// </edit>
void process_initiate_download(LLMessageSystem* msg, void**);
void start_new_inventory_observer();

View File

@@ -96,6 +96,25 @@
mouse_opaque="true" name="enable_clouds" radio_style="false"
width="400" />
</panel>
<panel border="true" left="1" bottom="-408" height="408" width="500" mouse_opaque="true"
follows="left|top|right|bottom" label="Security" name="Security">
<text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
bottom="-20" drop_shadow_visible="true" enabled="true" follows="left|top"
font="SansSerifSmall" h_pad="0" halign="left" height="10" left="12"
mouse_opaque="false" name="text_box" v_pad="0" width="500">
IP Spoofing Protection (0 being off, 3 being highest)
</text>
<slider bottom_delta="-25" can_edit_text="false"
decimal_digits="0" enabled="true" follows="left|top" height="15"
increment="1" initial_val="0" left_delta="0" max_val="3" min_val="0"
mouse_opaque="true" control_name="SpoofProtectionLevel" name="ip_spoof_slider" show_text="true"
width="180" />
<check_box bottom_delta="-25" control_name="SpoofProtectionAlerts" enabled="true"
follows="left|top" font="SansSerifSmall" height="16" initial_value="true"
label="Enable Alerts" left="10"
mouse_opaque="true" name="enable_alerts" radio_style="false"
width="400" />
</panel>
<panel border="true" left="1" bottom="-408" height="408" width="500" mouse_opaque="true"
follows="left|top|right|bottom" label="Miscellaneous" name="Miscellaneous">
<check_box bottom_delta="-30" control_name="DoubleClickTeleport" enabled="true"