kbx: Fix handling of overlong keys.