controller: Generate new keys when missing. Fixes #1498