result = SSL_GetChannelInfo(fd, &info, sizeof info); if (result != SECSuccess) return; if (info.length >= offsetof(SSLChannelInfo, reserved)) { FPRINTF(stderr, "selfserv: SSL version %d.%d using %d-bit %s with %d-bit %s MAC\n", info.protocolVersion >> 8, info.protocolVersion & 0xff, info.effectiveKeyBits, info.symCipherName, info.macBits, info.macAlgorithmName); FPRINTF(stderr, "selfserv: Server Auth: %d-bit %s, Key Exchange: %d-bit %s\n", info.authKeyBits, info.authAlgorithmName, info.keaKeyBits,  info.keaTypeName);
result = SSL_GetChannelInfo(fd, &channel, sizeof channel); if (result == SECSuccess && channel.length == sizeof channel && channel.cipherSuite) { result = SSL_GetCipherSuiteInfo(channel.cipherSuite, &suite, sizeof suite); if (result == SECSuccess) { FPRINTF(stderr, "selfserv: SSL version %d.%d using %d-bit %s with %d-bit %s MAC\n", channel.protocolVersion >> 8, channel.protocolVersion & 0xff, suite.effectiveKeyBits, suite.symCipherName, suite.macBits, suite.macAlgorithmName); FPRINTF(stderr, "selfserv: Server Auth: %d-bit %s, Key Exchange: %d-bit %s\n", channel.authKeyBits, suite.authAlgorithmName, channel.keaKeyBits,  suite.keaTypeName); }
printSecurityInfo(PRFileDesc *fd){    CERTCertificate * cert      = NULL;    SSL3Statistics *  ssl3stats = SSL_GetStatistics();    SECStatus         result;    SSLChannelInfo    info;    PRINTF(    	"selfserv: %ld cache hits; %ld cache misses, %ld cache not reusable\n",    	ssl3stats->hch_sid_cache_hits, ssl3stats->hch_sid_cache_misses,	ssl3stats->hch_sid_cache_not_ok);    result = SSL_GetChannelInfo(fd, &info, sizeof info);    if (result != SECSuccess)    	return;    if (info.length >= offsetof(SSLChannelInfo, reserved)) {	FPRINTF(stderr, 	   "selfserv: SSL version %d.%d using %d-bit %s with %d-bit %s MAC\n",	       info.protocolVersion >> 8, info.protocolVersion & 0xff,	       info.effectiveKeyBits, info.symCipherName, 	       info.macBits, info.macAlgorithmName);	FPRINTF(stderr, 	   "selfserv: Server Auth: %d-bit %s, Key Exchange: %d-bit %s\n",	       info.authKeyBits, info.authAlgorithmName,	       info.keaKeyBits,  info.keaTypeName);    }    if (requestCert)	cert = SSL_RevealCert(fd);    if (cert) {	char * ip = CERT_NameToAscii(&cert->issuer);	char * sp = CERT_NameToAscii(&cert->subject);        if (sp) {	    FPRINTF(stderr, "selfserv: subject DN: %s\n", sp);	    PR_Free(sp);	}        if (ip) {	    FPRINTF(stderr, "selfserv: issuer  DN: %s\n", ip);	    PR_Free(ip);	}	CERT_DestroyCertificate(cert);	cert = NULL;    }    FLUSH;}