33 #define resetVirtualCursor( attributeListPtr ) \
34 if( attributeListPtr != NULL ) \
35 attributeListPtr->flags |= ATTR_FLAG_CURSORMOVED
44 CRYPT_ATTRIBUTE_NONE };
45 USER_INFO *userInfoPtr = attributeListPtr->value;
48 int iterationCount = 0;
58 attributeID = userInfoPtr->cursorPos = \
59 CRYPT_ENVINFO_SIGNATURE_RESULT;
66 return( attributeID );
76 attributeOrderList[ i ] != attributeID && \
89 attributeOrderList[ i - 1 ];
92 attributeID = attributeOrderList[ i + 1 ];
106 switch( attributeID )
108 case CRYPT_SESSINFO_NAME:
112 if( userInfoPtr->passwordLen <= 0 )
116 case CRYPT_SESSINFO_KEY:
127 attributeListPtr->attributeCursorEntry =
attributeID;
132 #define resetVirtualCursor( attributeListPtr )
153 assert( attributeListPtr == NULL || \
155 assert( groupID == NULL || \
157 assert( attributeID == NULL || \
159 assert( instanceID == NULL || \
165 if( groupID != NULL )
167 if( attributeID != NULL )
169 if( instanceID != NULL )
179 if( attributeListPtr == NULL )
181 subGroupMove = ( attrGetType ==
ATTR_PREV || \
191 attrGetType, &value );
194 subGroupMove =
value;
204 attributeListPtr = ( attrGetType ==
ATTR_PREV ) ? \
205 attributeListPtr->
prev : attributeListPtr->
next;
206 resetVirtualCursor( attributeListPtr );
208 if( attributeListPtr == NULL )
220 if( groupID != NULL && ( attrGetType ==
ATTR_CURRENT || subGroupMove ) )
221 *groupID = attributeListPtr->
groupID;
222 if( attributeID != NULL )
230 *attributeID =
value;
236 return( attributeListPtr );
252 for( attributeListCursor = attributeListHead, iterationCount = 0;
253 attributeListCursor != NULL && \
255 attributeListCursor = attributeListCursor->
next, iterationCount++ )
259 ENSURES_V( iterationCount < FAILSAFE_ITERATIONS_MAX );
273 assert( attributeListHead == NULL || \
276 if( attributeListPtr == NULL )
287 for( iterationCount = 0;
288 ( attributeListPtr = \
297 attributeListPtr = attributeListPtr->
next;
298 if( attributeListPtr == NULL || \
303 attributeListPtr = attributeListPtr->
next;
328 assert( attributeListHead == NULL || \
330 assert( attributeListCursor == NULL || \
332 assert(
isWritePtr( valuePtr,
sizeof(
int ) ) );
345 if( attributeListCursor == NULL )
347 if( attributeListHead == NULL )
349 attributeListCursor = attributeListHead;
350 resetVirtualCursor( attributeListCursor );
351 initAttributeList =
TRUE;
356 *valuePtr = attributeListCursor->groupID;
361 *valuePtr = attributeListCursor->groupID;
367 status = attributeListCursor->accessFunction( attributeListCursor,
387 assert( attributeListHead == NULL || \
401 if( attributeListHead == NULL )
409 attributeListPtr == NULL )
411 attributeListPtr = attributeListHead;
412 resetVirtualCursor( attributeListPtr );
417 if( attributeListPtr == NULL )
430 if( attributeListPtr == NULL )
437 sessionInfoType, position );
438 if( attributeListPtr == NULL )
457 assert( attributeListPtr == NULL || \
463 return( attributeFind( attributeListPtr,
getAttrFunction, attributeID ) );
478 assert( attributeListPtr == NULL || \
480 assert(
isReadPtr( value, valueLength ) );
487 attributeListCursor = attributeFind( attributeListPtr,
getAttrFunction,
489 if( attributeListCursor == NULL )
497 for( iterationCount = 0;
498 attributeListCursor != NULL && \
502 if( attributeListCursor->
attributeID == attributeID && \
503 attributeListCursor->
valueLength == valueLength && \
504 !memcmp( attributeListCursor->value, value, valueLength ) )
506 attributeListCursor = attributeListCursor->
next;
508 ENSURES_N( iterationCount < FAILSAFE_ITERATIONS_MAX );
510 return( attributeListCursor );
539 assert( ( data == NULL ) || \
541 dataLength <= dataMaxLength ) );
547 REQUIRES( ( data == NULL && dataMaxLength == 0 ) || \
549 dataLength > 0 && dataLength <= dataMaxLength && \
555 accessFunction != NULL );
559 if( *listHeadPtr != NULL )
564 for( insertPoint = *listHeadPtr, iterationCount = 0;
565 insertPoint != NULL && \
567 insertPoint = insertPoint->
next, iterationCount++ )
575 prevElement = insertPoint;
577 ENSURES( iterationCount < FAILSAFE_ITERATIONS_MAX );
578 insertPoint = prevElement;
587 dataMaxLength ) ) == NULL )
593 newElement->
flags = flags;
600 memcpy( newElement->value, data, dataLength );
621 return( addInfo( listHeadPtr, attributeID, attributeID, NULL,
628 IN_BUFFER( dataLength )
const void *data,
640 return( addInfo( listHeadPtr, attributeID, attributeID, data,
647 IN_BUFFER( dataLength )
const void *data,
662 return( addInfo( listHeadPtr, attributeID, attributeID, data,
663 dataLength, dataLength, NULL, flags ) );
669 const ATTRACCESSFUNCTION accessFunction,
670 IN_BUFFER( dataLength )
const void *data,
687 return( addInfo( listHeadPtr, attributeID, attributeID, data,
688 dataLength, dataLength, accessFunction, flags ) );
700 IN_BUFFER( dataLength )
const void *data,
712 REQUIRES( dataLength > 0 && dataLength <= dataMaxLength && \
724 if( attributeListPtr != NULL )
728 !memcmp( attributeListPtr->value, \
729 "\x00\x00\x00\x00", 4 ) ) || \
738 memcpy( attributeListPtr->value, data, dataLength );
744 return( addInfo( listHeadPtr, attributeID, attributeID, data,
745 dataLength, dataMaxLength, NULL, flags ) );
771 if( *attributeListCurrent == attributeListPtr )
773 *attributeListCurrent = ( attributeListPtr->next != NULL ) ? \
774 attributeListPtr->next : \
775 attributeListPtr->prev;
783 clFree(
"deleteSessionInfo", attributeListPtr );
799 if( attributeListCursor == NULL )
806 for( iterationCount = 0;
807 attributeListCursor != NULL && \
813 attributeListCursor = attributeListCursor->
next;
814 deleteSessionInfo( attributeListHead, attributeListCurrent,
817 ENSURES_V( iterationCount < FAILSAFE_ITERATIONS_MAX );
818 *attributeListCurrent = NULL;