In a case brought by Nintendo, the EUCJ has ruled
that the European Directive on the Harmonisation of copyright "is designed only to protect the copyright holder against acts which require his authorisation" and "that the legal protection covers only the technological measures
intended to prevent or eliminate unauthorised acts of reproduction, communication, public offer or distribution, for which authorisation from the copyrightholder is required
. That legal protection must respect the principle of proportionality without prohibiting devices or activities which have a commercially significant purpose or use
other than to circumvent the technical protection for unlawful purposes." (bold in the original)
In short, circumventing DRM might be legal if it is not done to infringe the copyright holder's copyright. And sale/distribution of DRM circumvention tools might be legal so long as they are mainly used for purposes which do not infringe copyright.
The full ruling (in English) can be read here
. Other European Languages are available
NB I am not a lawyer. Do not rely on this message for legal advice!