46 "Default cryptlib user", 21,
47 "<<<<DEFAULT_USER>>>>",
"<<<<DEFAULT_USER>>>>",
94 switch( trustMgtType )
99 *iCertificate, NULL, 0,
TRUE );
102 userInfoPtr->trustInfoChanged =
TRUE;
103 return( setOption( userInfoPtr->configOptions,
104 userInfoPtr->configOptionsCount,
114 *iCertificate,
FALSE ) ) == NULL )
117 userInfoPtr->trustInfoChanged =
TRUE;
118 return( setOption( userInfoPtr->configOptions,
119 userInfoPtr->configOptionsCount,
127 *iCertificate,
FALSE ) != NULL ) ? \
132 void *trustedIssuerInfo;
137 *iCertificate,
TRUE );
138 if( trustedIssuerInfo == NULL )
144 return( trustedCert );
145 ENSURES( trustedCert != *iCertificate );
146 *iCertificate = trustedCert;
194 ( void ) zeroiseUsers( userInfoPtr );
225 return( getUserAttribute( userInfoPtr,
226 (
int * ) messageDataPtr,
229 return( getUserAttributeS( userInfoPtr,
237 if( messageValue == CRYPT_IATTRIBUTE_INITIALISED )
244 return( setUserAttribute( userInfoPtr,
245 *( (
int * ) messageDataPtr ),
252 return( setUserAttributeS( userInfoPtr, msgData->data,
253 msgData->
length, messageValue ) );
256 return( deleteUserAttribute( userInfoPtr, messageValue ) );
263 return( processUserManagement( userInfoPtr, messageDataPtr,
266 return( processTrustManagement( userInfoPtr, messageDataPtr,
283 static const MAP_TABLE subtypeMapTbl[] = {
315 !memcmp( userInfoTemplate->userName, defaultUserInfo.userName,
321 *userInfoPtrPtr = NULL;
324 status = mapValue( userInfoTemplate->
type, &value, subtypeMapTbl,
328 status = krnlCreateObject( iCryptUser, (
void ** ) &userInfoPtr,
335 *userInfoPtrPtr = userInfoPtr;
338 userFileInfo->
type = userInfoTemplate->
type;
339 userFileInfo->
state = userInfoTemplate->
state;
341 memcpy( userFileInfo->userName, userInfoTemplate->userName,
344 memcpy( userFileInfo->userID, userInfoTemplate->userID,
KEYID_SIZE );
345 memcpy( userFileInfo->creatorID, userInfoTemplate->creatorID,
KEYID_SIZE );
365 char userFileName[ 16 + 8 ];
366 int fileRef, initStatus,
status;
370 REQUIRES( auxDataPtr == NULL && auxValue == 0 );
380 !
strCompare( createInfo->strArg1, defaultUserInfo.userName,
395 status = fileRef = findUserIndexEntry(
USERID_NAME, createInfo->strArg1,
396 createInfo->strArgLen1 );
403 status = ( isZeroisePassword( createInfo->strArg2, \
404 createInfo->strArgLen2 ) ) ? \
412 assert( isZeroisePassword( createInfo->strArg2, \
413 createInfo->strArgLen2 ) );
414 initStatus = openUser( &iCryptUser, createInfo->cryptOwner,
423 if( isZeroisePassword( createInfo->strArg2, createInfo->strArgLen2 ) )
428 status = getCheckUserInfo( &userFileInfo, fileRef );
433 assert( createInfo->strArgLen1 == userFileInfo.
userNameLength && \
434 !memcmp( createInfo->strArg1, userFileInfo.userName,
436 initStatus = openUser( &iCryptUser, createInfo->cryptOwner,
437 &userFileInfo, &userInfoPtr );
451 if( userInfoPtr == NULL )
452 return( initStatus );
473 sprintf_s( userFileName, 16,
"u%06x", fileRef );
474 status = readConfig( iCryptUser, userFileName,
484 createInfo->cryptHandle = iCryptUser;
491 static
int createDefaultUserObject(
void )
517 if( userInfoPtr == NULL )
518 return( initStatus );
527 initStatus = initUserIndex( &userInfoPtr->
userIndexPtr );
548 status = readConfig( iUserObject,
"cryptlib", userInfoPtr->
trustInfoPtr );
551 DEBUG_DIAG((
"Couldn't read config data, using default config" ));
553 DEBUG_PRINT((
"Configuration file read failed with status %d.\n",
560 CRYPT_IATTRIBUTE_INITIALISED ) );
576 status = createDefaultUserObject();
579 DEBUG_DIAG((
"User object creation failed" ));