92 const PROTOCOL_INFO *protocolInfoPtr = sessionInfoPtr->protocolInfo;
103 if( sessionInfoPtr->transportSession !=
CRYPT_ERROR )
106 return( exitErrorInited( sessionInfoPtr,
115 status = sNetParseURL( &urlInfo, url, urlLength,
142 status = addSessionInfoS( &sessionInfoPtr->attributeList,
144 urlInfo.host, urlInfo.
hostLen );
152 memcpy( urlBuffer, urlInfo.host, urlInfo.
hostLen );
153 memcpy( urlBuffer + urlInfo.
hostLen, urlInfo.location,
155 status = addSessionInfoS( &sessionInfoPtr->attributeList,
168 if( urlInfo.
port > 0 )
195 #ifdef USE_CMP_TRANSPORT
235 assert(
isWritePtr( valuePtr,
sizeof(
int ) ) );
252 status = getSessionAttributeCursor( sessionInfoPtr->attributeList,
253 sessionInfoPtr->attributeListCurrent,
254 attribute, &attributeID );
259 sessionInfoPtr->attributeListCurrent =
\
265 return( exitError( sessionInfoPtr, attribute,
274 if( sessionInfoPtr->connectTimeout ==
CRYPT_ERROR )
275 return( exitErrorNotInited( sessionInfoPtr,
277 *valuePtr = sessionInfoPtr->connectTimeout;
282 return( exitErrorNotInited( sessionInfoPtr,
284 *valuePtr = sessionInfoPtr->readTimeout;
289 return( exitErrorNotInited( sessionInfoPtr,
291 *valuePtr = sessionInfoPtr->writeTimeout;
295 *valuePtr = sessionInfoPtr->errorType;
299 *valuePtr = sessionInfoPtr->errorLocus;
303 *valuePtr = sessionInfoPtr->receiveBufSize;
314 *valuePtr = sessionInfoPtr->iCryptInContext !=
CRYPT_ERROR && \
328 findSessionInfo( sessionInfoPtr->attributeList,
330 if( attributeListPtr == NULL )
331 return( exitErrorNotInited( sessionInfoPtr, attribute ) );
332 *valuePtr = attributeListPtr->
intValue;
337 *valuePtr = sessionInfoPtr->version;
342 return( exitErrorNotFound( sessionInfoPtr,
373 return( exitErrorNotFound( sessionInfoPtr, attribute ) );
380 if( errorInfo->errorStringLength > 0 )
382 return( attributeCopy( msgData, errorInfo->errorString,
383 errorInfo->errorStringLength ) );
400 if( attributeListPtr == NULL )
401 return( exitErrorNotInited( sessionInfoPtr, attribute ) );
402 return( attributeCopy( msgData, attributeListPtr->value,
442 status = setSessionAttributeCursor( sessionInfoPtr->attributeList,
443 &attributeListPtr, attribute, value );
445 return( exitError( sessionInfoPtr, attribute,
452 sessionInfoPtr->connectTimeout =
value;
456 sessionInfoPtr->readTimeout =
value;
460 sessionInfoPtr->writeTimeout =
value;
466 sessionInfoPtr->receiveBufSize =
value;
508 return( exitErrorNotInited( sessionInfoPtr,
513 missingInfo = checkMissingInfo( sessionInfoPtr->attributeList,
516 return( exitErrorNotInited( sessionInfoPtr, missingInfo ) );
518 status = activateSession( sessionInfoPtr );
526 DEBUG_DIAG((
"Session activate returned argError status" ));
536 if( sessionInfoPtr->transportSession !=
CRYPT_ERROR )
537 return( exitErrorInited( sessionInfoPtr,
540 return( exitErrorInited( sessionInfoPtr,
543 return( addSessionInfo( &sessionInfoPtr->attributeList,
548 value > sessionInfoPtr->protocolInfo->maxVersion )
550 sessionInfoPtr->version =
value;
555 const int requiredAttributeFlags =
isServer( sessionInfoPtr ) ?
\
633 if( requiredAttributeFlags & ( SESSION_NEEDS_PRIVKEYCERT | \
634 SESSION_NEEDS_PRIVKEYCACERT ) )
636 status = checkServerCertValid( value, &sessionInfoPtr->errorLocus,
637 &sessionInfoPtr->errorType );
643 if( sessionInfoPtr->checkAttributeFunction != NULL )
645 status = sessionInfoPtr->checkAttributeFunction( sessionInfoPtr,
659 sessionInfoPtr->privateKey =
value;
676 CRYPT_IATTRIBUTE_SUBTYPE );
692 sessionInfoPtr->cryptKeyset =
value;
699 AUTHRESPONSE_FAILURE;
707 return( exitErrorInited( sessionInfoPtr,
710 return( exitErrorInited( sessionInfoPtr,
716 sessionInfoPtr->transportSession =
value;
729 return( exitErrorInited( sessionInfoPtr,
731 if( sessionInfoPtr->transportSession !=
CRYPT_ERROR )
732 return( exitErrorInited( sessionInfoPtr,
738 sessionInfoPtr->readTimeout,
743 &connectInfo, &sessionInfoPtr->errorInfo );
746 sNetDisconnect( &stream );
749 sessionInfoPtr->networkSocket =
value;
787 int flags =
isServer( sessionInfoPtr ) ? \
795 if( !
isServer( sessionInfoPtr ) && \
797 attribute ) != NULL )
798 return( exitErrorInited( sessionInfoPtr, attribute ) );
802 status = setSessionAttributeCursor( sessionInfoPtr->attributeList,
813 return( exitErrorInited( sessionInfoPtr,
815 if( findSessionInfoEx( sessionInfoPtr->attributeList,
816 attribute, data, dataLength ) != NULL )
818 return( exitError( sessionInfoPtr, attribute,
840 return( exitErrorNotInited( sessionInfoPtr,
845 if( dataLength >= 15 && isPKIUserValue( data, dataLength ) )
851 status = decodePKIUserValue( decodedValue,
853 &decodedValueLen, data,
862 if( sessionInfoPtr->checkAttributeFunction != NULL )
867 status = sessionInfoPtr->checkAttributeFunction( sessionInfoPtr,
868 &msgData, attribute );
880 return( addSessionInfoEx( &sessionInfoPtr->attributeList,
881 attribute, data, dataLength, flags ) );
886 return( addSessionInfoS( &sessionInfoPtr->attributeList,
887 attribute, data, dataLength ) );
890 return( addUrl( sessionInfoPtr, data, dataLength ) );
919 if( sessionInfoPtr->connectTimeout ==
CRYPT_ERROR )
920 return( exitErrorNotFound( sessionInfoPtr,
927 return( exitErrorNotFound( sessionInfoPtr,
934 return( exitErrorNotFound( sessionInfoPtr,
945 findSessionInfo( sessionInfoPtr->attributeList, attribute );
946 if( attributeListPtr == NULL )
947 return( exitErrorNotFound( sessionInfoPtr, attribute ) );
962 deleteSessionInfo( &sessionInfoPtr->attributeList,
963 &sessionInfoPtr->attributeListCurrent,
969 return( exitErrorNotFound( sessionInfoPtr,
979 sessionInfoPtr->sessionTSP->imprintSize <= 0 )
980 return( exitErrorNotFound( sessionInfoPtr,
983 sessionInfoPtr->sessionTSP->imprintSize = 0;