Raise ValueError if the password doesn't fit

Fixes #1235. OpenSSL only allows password up to 1024 bytes.
There are tests for that so it's certainly the intention.