Two small checks in keymgmt.

1. Enforce the state check in listkey().
2. Enforce the password length check.
3 files changed