PORT_Assert( ssl_Have1stHandshakeLock(ss) ); PORT_Assert( ssl_HaveRecvBufLock(ss)   );
PORT_Assert( ss->opt.noLocks || ssl_Have1stHandshakeLock(ss) ); PORT_Assert( ss->opt.noLocks || ssl_HaveRecvBufLock(ss)   );
ssl2_QualifyCypherSpecs(sslSocket *ss,                         PRUint8 *  cs, /* cipher specs in client hello msg. */		        int        csLen){    PRUint8 *    ms;    PRUint8 *    hs;    PRUint8 *    qs;    int          mc;    int          hc;    PRUint8      qualifiedSpecs[ssl2_NUM_SUITES_IMPLEMENTED * 3];    PORT_Assert( ssl_Have1stHandshakeLock(ss) );    PORT_Assert( ssl_HaveRecvBufLock(ss)   );    if (!ss->cipherSpecs) {	ssl2_ConstructCipherSpecs(ss);    }    PRINT_BUF(10, (ss, "specs from client:", cs, csLen));    qs = qualifiedSpecs;    ms = ss->cipherSpecs;    for (mc = ss->sizeCipherSpecs; mc > 0; mc -= 3, ms += 3) {	if (ms[0] == 0)	    continue;	for (hs = cs, hc = csLen; hc > 0; hs += 3, hc -= 3) {	    if ((hs[0] == ms[0]) &&		(hs[1] == ms[1]) &&		(hs[2] == ms[2])) {		/* Copy this cipher spec into the "keep" section */		qs[0] = hs[0];		qs[1] = hs[1];		qs[2] = hs[2];		qs   += 3;		break;	    }	}    }    hc = qs - qualifiedSpecs;    PRINT_BUF(10, (ss, "qualified specs from client:", qualifiedSpecs, hc));    PORT_Memcpy(cs, qualifiedSpecs, hc);    return hc;}