sid->lastAccessTime = sid->creationTime = ssl_Time(); sid->expirationTime = sid->creationTime + ssl_sid_timeout;
ssl2_FillInSID(sslSessionID * sid,           int            cipher,	  PRUint8       *keyData, 	  int            keyLen,	  PRUint8       *ca, 	  int            caLen,	  int            keyBits, 	  int            secretKeyBits,	  SSLSignType    authAlgorithm,	  PRUint32       authKeyBits,	  SSLKEAType     keaType,	  PRUint32       keaKeyBits){    PORT_Assert(sid->references == 1);    PORT_Assert(sid->cached == never_cached);    PORT_Assert(sid->u.ssl2.masterKey.data == 0);    PORT_Assert(sid->u.ssl2.cipherArg.data == 0);    sid->version = SSL_LIBRARY_VERSION_2;    sid->u.ssl2.cipherType = cipher;    sid->u.ssl2.masterKey.data = (PRUint8*) PORT_Alloc(keyLen);    if (!sid->u.ssl2.masterKey.data) {	return SECFailure;    }    PORT_Memcpy(sid->u.ssl2.masterKey.data, keyData, keyLen);    sid->u.ssl2.masterKey.len = keyLen;    sid->u.ssl2.keyBits       = keyBits;    sid->u.ssl2.secretKeyBits = secretKeyBits;    sid->authAlgorithm        = authAlgorithm;    sid->authKeyBits          = authKeyBits;    sid->keaType              = keaType;    sid->keaKeyBits           = keaKeyBits;    if (caLen) {	sid->u.ssl2.cipherArg.data = (PRUint8*) PORT_Alloc(caLen);	if (!sid->u.ssl2.cipherArg.data) {	    return SECFailure;	}	sid->u.ssl2.cipherArg.len = caLen;	PORT_Memcpy(sid->u.ssl2.cipherArg.data, ca, caLen);    }    return SECSuccess;}