buf = xmalloc(len); BN_bn2bin(k->rsa->n, buf); BN_bn2bin(k->rsa->e, buf + nlen);
blob = xmalloc(len); BN_bn2bin(k->rsa->n, blob); BN_bn2bin(k->rsa->e, blob + nlen);
key_fingerprint(Key *k){	static char retval[80];	unsigned char *buf = NULL;	int len = 0;	int nlen, elen, plen, qlen, glen, publen;	switch (k->type) {	case KEY_RSA:		nlen = BN_num_bytes(k->rsa->n);		elen = BN_num_bytes(k->rsa->e);		len = nlen + elen;		buf = xmalloc(len);		BN_bn2bin(k->rsa->n, buf);		BN_bn2bin(k->rsa->e, buf + nlen);		break;	case KEY_DSA:		plen = BN_num_bytes(k->dsa->p);		qlen = BN_num_bytes(k->dsa->q);		glen = BN_num_bytes(k->dsa->g);		publen = BN_num_bytes(k->dsa->pub_key);		len = qlen + qlen + glen + publen;		buf = xmalloc(len);		BN_bn2bin(k->dsa->p, buf);		BN_bn2bin(k->dsa->q, buf + plen);		BN_bn2bin(k->dsa->g, buf + plen + qlen);		BN_bn2bin(k->dsa->pub_key , buf + plen + qlen + glen);		break;	default:		fatal("key_fingerprint: bad key type %d", k->type);		break;	}	if (buf != NULL) {		unsigned char d[16];		EVP_MD_CTX md;		EVP_DigestInit(&md, EVP_md5());		EVP_DigestUpdate(&md, buf, len);		EVP_DigestFinal(&md, d, NULL);		snprintf(retval, sizeof(retval), FPRINT,		    d[0], d[1], d[2], d[3], d[4], d[5], d[6], d[7],		    d[8], d[9], d[10], d[11], d[12], d[13], d[14], d[15]);		memset(buf, 0, len);		xfree(buf);	}	return retval;}