Improve valid() for openssl-enc, fixing #458

~~crap, not fixing #498, but #458.~~

A segfault was caused by am empty "known plaintext" field at the
end of the hash.

Another fix for django's valid(), fixing #460