Where and how can I upgrade my Galaxy 5 legally to Froyo?
If the update is available in your region, take it to your nearest Samsung authorised service centre and get it flashed. Make sure to back up all your data and perform a factory reset before handing it across.

I'm uncertain about what you intend to mean by "legal"?