unsigned char *hash, int hlen)
unsigned char *data, int datalen)
dsa_sign(    Key *key,    unsigned char **sigp, int *lenp,    unsigned char *hash, int hlen){	unsigned char *digest;	unsigned char *ret;	DSA_SIG *sig;	EVP_MD *evp_md = EVP_sha1();	EVP_MD_CTX md;	unsigned int rlen;	unsigned int slen;	unsigned int len;	unsigned char sigblob[SIGBLOB_LEN];	Buffer b;	if (key == NULL || key->type != KEY_DSA || key->dsa == NULL) {		error("dsa_sign: no DSA key");		return -1;	}	digest = xmalloc(evp_md->md_size);	EVP_DigestInit(&md, evp_md);	EVP_DigestUpdate(&md, hash, hlen);	EVP_DigestFinal(&md, digest, NULL);	sig = DSA_do_sign(digest, evp_md->md_size, key->dsa);	rlen = BN_num_bytes(sig->r);	slen = BN_num_bytes(sig->s);	if (rlen > INTBLOB_LEN || slen > INTBLOB_LEN) {		error("bad sig size %d %d", rlen, slen);		DSA_SIG_free(sig);		return -1;	}	debug("sig size %d %d", rlen, slen);	memset(sigblob, 0, SIGBLOB_LEN);	BN_bn2bin(sig->r, sigblob+ SIGBLOB_LEN - INTBLOB_LEN - rlen);	BN_bn2bin(sig->s, sigblob+ SIGBLOB_LEN - slen);	DSA_SIG_free(sig);	if (datafellows) {		debug("datafellows");		ret = xmalloc(SIGBLOB_LEN);		memcpy(ret, sigblob, SIGBLOB_LEN);		if (lenp != NULL)			*lenp = SIGBLOB_LEN;		if (sigp != NULL)			*sigp = ret;	} else {		/* ietf-drafts */		buffer_init(&b);		buffer_put_cstring(&b, KEX_DSS);		buffer_put_string(&b, sigblob, SIGBLOB_LEN);		len = buffer_len(&b);		ret = xmalloc(len);		memcpy(ret, buffer_ptr(&b), len);		buffer_free(&b);		if (lenp != NULL)			*lenp = len;		if (sigp != NULL)			*sigp = ret;	}	return 0;}