Fix generate_signature_hash error and handle in check_signature.

It's hazardous to allow a sentinel to fall through here, especially since sign() accepts the sentinel as a valid signature hash.