if (ss->useSecurity && ss->firstHsDone && ss->sec.ci.sid) {
if (ss->opt.useSecurity && ss->firstHsDone && ss->sec.ci.sid) {
SSL_GetSessionID(PRFileDesc *fd){    sslSocket *    ss;    SECItem *      item = NULL;    ss = ssl_FindSocket(fd);    if (ss) {	ssl_Get1stHandshakeLock(ss);	ssl_GetSSL3HandshakeLock(ss);	if (ss->useSecurity && ss->firstHsDone && ss->sec.ci.sid) {	    item = (SECItem *)PORT_Alloc(sizeof(SECItem));	    if (item) {		sslSessionID * sid = ss->sec.ci.sid;		if (sid->version < SSL_LIBRARY_VERSION_3_0) {		    item->len = SSL2_SESSIONID_BYTES;		    item->data = (unsigned char*)PORT_Alloc(item->len);		    PORT_Memcpy(item->data, sid->u.ssl2.sessionID, item->len);		} else {		    item->len = sid->u.ssl3.sessionIDLength;		    item->data = (unsigned char*)PORT_Alloc(item->len);		    PORT_Memcpy(item->data, sid->u.ssl3.sessionID, item->len);		}	    }	}	ssl_ReleaseSSL3HandshakeLock(ss);	ssl_Release1stHandshakeLock(ss);    }    return item;}