The man who fatally ambushed a Virginia Tech police officer had legally purchased the handgun used in the shooting, Virginia State Police said Tuesday.