If you buy a phone on a contract with a wireless phone company, that company typically locks the device so it can't be used on a competitor's network. Even when the contract ends, and you've paid off the device, you can't use it with another network without the carrier's permission.

For 19 months, entrepreneur and tech activist Sina Khanifar has been leading a battle to make unlocking legal again.

In February the House passed a bill that did just that, and on Friday, the Senate passed it, too.

Unfortunately, this may not be the end of the situation. Even once the law is signed, it expires in 2015. That's when the Librarian of Congress meets again to decide which technologies violate the Digital Millennium Copyright Act.

Khanifar told Business Insider that he was hoping for a more permanent fix.

"I asked repeatedly for Congress to make the exemption permanent, and Rep. Zoe Lofgren even introduced the excellent 'Unlocking Technology Act of 2013' that would have done just that. Unfortunately, Congress wasn't ready to deal with ... passing a permanent exemption to the DMCA," Khanifar said.

But he's hopeful that, with "such a strong signal from Congress," the Librarian won't make unlocking a crime again.

This is also a major score for grass-roots technology activism. Khanifar's quest to change the law began with an internet petition to the White House in 2013 that got over 120,000 signatures. He's now involved in other tech activism projects such as Stop Watching Us, working to end NSA snooping, and Taskforce.is, which builds tech tools for activism.