You are misunderstanding the situation regarding the restricted
repository.
The following excerpt from the official Ubuntu website explains why it is called 'restricted'.
Our commitment is to only promote free software – or software available under a free licence. However, we make exceptions for a small set of tools and drivers that make it possible to install Ubuntu and its free applications on everyday hardware. These proprietary drivers are kept in the restricted component. Please note that it may not be possible to provide complete support for this software because we are unable to fix the software ourselves - we can only forward problem reports to the actual authors. Some software from restricted will be installed on Ubuntu CDs but is clearly separated to ensure that it is easy to remove. We will only use non-open-source software when there is no other way to install Ubuntu. The Ubuntu team works with vendors to accelerate the open-sourcing of their software to ensure that as much software as possible is available under a free licence.
So when they say "separated for legal reasons", they are referring to reasons that are affected by legal issues, not that the software is illegal to download.
In other words, don't sweat it. Downloading from the restricted
repository is completely legal.
Source