Is it legal to sell someone's iphone not reset and passcode still on?

Is it legal to sell someone's iphone not reset and passcode still on?

Added (1). Under 18, Iphone is being sold but the passcode is still on the phone, SIM is out and icloud isn't deactivated.

Hmm…

Sounds like you've stolen it and trying to sell it on.

Immoral for sure, illegal if the phone is NOT yours! Selling stolen items is a CRIME, If the phone was really "your" phone them you could just unlock the phone, right.