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

The segfault as caused by am empty "known plaintext" field at the
end of the hash