No check that keylen doesn't exceed EVP_MAX_KEY_LENGTH, so have to make "key" be malloc'ed.