Russian President Vladimir Putin has signed legislation to ratify a bilateral treaty with North Korea, which includes a promise of mutual military assistance if either country is attacked, state media reported.