Look, there are a lot of legal issues surrounding unlocking, but the most applicable law in the US is everyone's favorite piece of legislation, the DMCA. Just like any other piece of code, the iPhone's firmware is protected by the Copyright Act, and circumventing the access controls in place to get at that code is a violation of the DMCA. However, the Copyright Office issued six exemptions to the DMCA last year, one of which allows consumers to unlock their cellphones "for the sole purpose of lawfully connecting to a wireless telephone communication network."
That's great! What's the "but?"
There are a lot of "buts," actually. For example, it's most likely not legal to unlock iPhones and sell them on eBay, because your "sole purpose" wouldn't be to connect to a cell network -- it would be to profit from the sale of unlocked phones. TracFone has been suing resellers that unlock its phones and getting settlements, even though this exemption exists. So you might want to put those dreams of being the exclusive iPhone supplier to the Saudi royal family to bed -- for now.
Well, that's not so bad.
There's more. Just because Apple and AT&T can't sue you for violating the DMCA, there's nothing saying they can't sue you under some other law. Remember, all the ruling says is that cellphone firmware isn't protected under the DMCA when you unlock to lawfully connect to a wireless network. That's a pretty narrow rule, and it's most certainly not the same as a rule saying it's legal to unlock your cellphone.
Still more. Under the DMCA, the Copyright Office is allowed to make these exemptions, but they only last for three years. Since the unlocking rule was published in November of last year, that means it'll expire in November of 2009. Of course, we'll probably be on the third generation of the iPhone by then, but it still doesn't bode well for that unlocking business you were about to start.
Wait, I thought you said this was legal?
Well, the truth of the matter is that unlocking your iPhone probably isn't going to get you in any trouble, as long you're only doing it for your personal benefit. If that's what you intend to do, go right ahead. Just be aware of the risks, and keep in mind that you've probably hosed your warranty, and that Apple might well stop supporting your phone.
Since when has Engadget cared about warranties?
(Whistles, walks away.)