Commit Graph

5 Commits

Author SHA1 Message Date
Lars Noschinski 86a4bfa43f Remove deprecated constructor for FromMatchesFilter (SMACK-71) 2014-03-09 11:20:32 +01:00
Lars Noschinski 6c7296a37b Add and use IQReplyFilter (SMACK-533)
In the absence of checks on the from address, it is possible for other
clients to fake an answer to an IQ request.

This commit adds an IQReplyFilter, which drops all packets which are not
a valid reply to an IQ request. In particular, it checks for packet id,
from address and packet type.

Most(?) places waiting for a reply to an IQ request are converted to use
the IQReplyFilter.

For a discussion of the issues, see the thread "Spoofing of iq ids and
misbehaving servers" from 2014-01 on the jdev@jabber.org mailing list
and following discussion in February and March.
2014-03-07 16:13:07 +01:00
Lars Noschinski 980047c4e1 Create accurate filter for matching on from address (SMACK-71)
Smack contains two PacketFilters to filter on the from address.
FromContainsFilter simply does a substring match, which is problematic
as explained in SMACK-71. FromMatchesFilter partially fixes this
weakness, but it still uses String#startsWith to filter on bare
addresses. For example, when setup to match all JIDs with bare JID
"foo@example.co", it will still match "foo@example.com".

This commit changes FromMatchesFilter to test equality with the bare
from instead of startsWith with the full from.

Moreover, we convert all uses of FromContainsFilter to FromMatchesFilter
and remove FromContainsFilter. Additionally, the unused ToContainsFilter
(which as the same weaknesses) is removed, too.
2014-03-05 06:48:40 +01:00
Florian Schmaus 1e57f1c659 Activate checkstyle and add missing license headers
Delete also all "All rights reserved" statements, as they are
unnecessary and conflict with checkstyle's header check. Delete unused
imports.
2014-02-17 20:09:55 +01:00
Florian Schmaus 201152ef42 Migrate from Ant to Gradle (SMACK-265) 2014-02-14 18:46:33 +01:00
Renamed from source/org/jivesoftware/smack/filter/FromMatchesFilter.java (Browse further)