static char *format="%-23s %s Kx=%-8s Au=%-4s Enc=%-9s Mac=%-4s%s AL=%lx\n";
static const char *format="%-23s %s Kx=%-8s Au=%-4s Enc=%-9s Mac=%-4s%s AL=%lx\n";
char *SSL_CIPHER_description(SSL_CIPHER *cipher, char *buf, int len)	{	int is_export,pkl,kl;	char *ver,*exp_str;	char *kx,*au,*enc,*mac;	unsigned long alg,alg2,alg_s;#ifdef KSSL_DEBUG	static char *format="%-23s %s Kx=%-8s Au=%-4s Enc=%-9s Mac=%-4s%s AL=%lx\n";#else	static char *format="%-23s %s Kx=%-8s Au=%-4s Enc=%-9s Mac=%-4s%s\n";#endif /* KSSL_DEBUG */	alg=cipher->algorithms;	alg_s=cipher->algo_strength;	alg2=cipher->algorithm2;	is_export=SSL_C_IS_EXPORT(cipher);	pkl=SSL_C_EXPORT_PKEYLENGTH(cipher);	kl=SSL_C_EXPORT_KEYLENGTH(cipher);	exp_str=is_export?" export":"";		if (alg & SSL_SSLV2)		ver="SSLv2";	else if (alg & SSL_SSLV3)		ver="SSLv3";	else		ver="unknown";	switch (alg&SSL_MKEY_MASK)		{	case SSL_kRSA:		kx=is_export?(pkl == 512 ? "RSA(512)" : "RSA(1024)"):"RSA";		break;	case SSL_kDHr:		kx="DH/RSA";		break;	case SSL_kDHd:		kx="DH/DSS";		break;        case SSL_kKRB5:         /* VRS */        case SSL_KRB5:          /* VRS */            kx="KRB5";            break;	case SSL_kFZA:		kx="Fortezza";		break;	case SSL_kEDH:		kx=is_export?(pkl == 512 ? "DH(512)" : "DH(1024)"):"DH";		break;	case SSL_kECDH:	case SSL_kECDHE:		kx=is_export?"ECDH(<=163)":"ECDH";		break;	default:		kx="unknown";		}	switch (alg&SSL_AUTH_MASK)		{	case SSL_aRSA:		au="RSA";		break;	case SSL_aDSS:		au="DSS";		break;	case SSL_aDH:		au="DH";		break;        case SSL_aKRB5:         /* VRS */        case SSL_KRB5:          /* VRS */            au="KRB5";            break;	case SSL_aFZA:	case SSL_aNULL:		au="None";		break;	case SSL_aECDSA:		au="ECDSA";		break;	default:		au="unknown";		break;		}	switch (alg&SSL_ENC_MASK)		{	case SSL_DES:		enc=(is_export && kl == 5)?"DES(40)":"DES(56)";		break;	case SSL_3DES:		enc="3DES(168)";		break;	case SSL_RC4:		enc=is_export?(kl == 5 ? "RC4(40)" : "RC4(56)")		  :((alg2&SSL2_CF_8_BYTE_ENC)?"RC4(64)":"RC4(128)");		break;	case SSL_RC2:		enc=is_export?(kl == 5 ? "RC2(40)" : "RC2(56)"):"RC2(128)";		break;	case SSL_IDEA:		enc="IDEA(128)";		break;	case SSL_eFZA:		enc="Fortezza";		break;	case SSL_eNULL:		enc="None";		break;	case SSL_AES:		switch(cipher->strength_bits)			{		case 128: enc="AES(128)"; break;		case 192: enc="AES(192)"; break;		case 256: enc="AES(256)"; break;		default: enc="AES(?""?""?)"; break;			}		break;	default:		enc="unknown";		break;		}	switch (alg&SSL_MAC_MASK)		{	case SSL_MD5:		mac="MD5";		break;	case SSL_SHA1:		mac="SHA1";		break;	default:		mac="unknown";		break;		}	if (buf == NULL)		{		len=128;		buf=OPENSSL_malloc(len);		if (buf == NULL) return("OPENSSL_malloc Error");		}	else if (len < 128)		return("Buffer too small");#ifdef KSSL_DEBUG	BIO_snprintf(buf,len,format,cipher->name,ver,kx,au,enc,mac,exp_str,alg);#else	BIO_snprintf(buf,len,format,cipher->name,ver,kx,au,enc,mac,exp_str);#endif /* KSSL_DEBUG */	return(buf);	}