"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "zuluCrypt-cli/bin/open_volume.c" between
zuluCrypt-5.7.0.tar.xz and zuluCrypt-5.7.1.tar.xz

About: zuluCrypt is a simple but feature rich solution for hard drives encryption. It can manage PLAIN dm-crypt, LUKS, TrueCrypt and VeraCrypt encrypted volumes.

open_volume.c  (zuluCrypt-5.7.0.tar.xz):open_volume.c  (zuluCrypt-5.7.1.tar.xz)
skipping to change at line 144 skipping to change at line 144
printf( gettext( "SUCCESS: %s volume opened successfully\n" ),"pl ain" ) ; printf( gettext( "SUCCESS: %s volume opened successfully\n" ),"pl ain" ) ;
}else if( StringHasComponent( e,"TCRYPT" ) ){ }else if( StringHasComponent( e,"TCRYPT" ) ){
printf( gettext( "SUCCESS: %s volume opened successfully\n" ),"tc rypt" ) ; printf( gettext( "SUCCESS: %s volume opened successfully\n" ),"tc rypt" ) ;
}else if( StringHasComponent( e,"VCRYPT" ) ){ }else if( StringHasComponent( e,"VCRYPT" ) ){
printf( gettext( "SUCCESS: %s volume opened successfully\n" ),"vc rypt" ) ; printf( gettext( "SUCCESS: %s volume opened successfully\n" ),"vc rypt" ) ;
}else if( StringHasComponent( e,"BITLK" ) ){
printf( gettext( "SUCCESS: %s volume opened successfully\n" ),"bi
tlocker" ) ;
}else{ }else{
printf( gettext( "SUCCESS: volume opened successfully\n" ) ) ; printf( gettext( "SUCCESS: volume opened successfully\n" ) ) ;
} }
StringFree( e ) ; StringFree( e ) ;
if( m_point != NULL ){ if( m_point != NULL ){
printf( gettext( "volume mounted at: %s\n" ),m_point ) ; printf( gettext( "volume mounted at: %s\n" ),m_point ) ;
} }
skipping to change at line 269 skipping to change at line 273
const char * plugin_path = opts->plugin_path ; const char * plugin_path = opts->plugin_path ;
const char * fs_opts = opts->fs_opts ; const char * fs_opts = opts->fs_opts ;
const char * const * tcrypt_keyfiles = opts->tcrypt_multiple_keyfiles ; const char * const * tcrypt_keyfiles = opts->tcrypt_multiple_keyfiles ;
/* /*
* Below is a form of memory management.All strings are collected in a st ringlist object to easily delete them * Below is a form of memory management.All strings are collected in a st ringlist object to easily delete them
* when the function returns.This allows for the function to have multipl e exit points without risks of leaking * when the function returns.This allows for the function to have multipl e exit points without risks of leaking
* memory from manually examining each exit point to make sure all string s are deleted or go with multiple goto * memory from manually examining each exit point to make sure all string s are deleted or go with multiple goto
* code deleting blocks to take into account different exit points. * code deleting blocks to take into account different exit points.
*/ */
stringList_t stl ; stringList_t stl ;
string_t * stringArray = StringListArray( &stl,7 ) ; string_t * stringArray = StringListArray( &stl,8 ) ;
string_t * passphrase = &stringArray[ 0 ] ; string_t * passphrase = &stringArray[ 0 ] ;
string_t * m_name = &stringArray[ 1 ] ; string_t * m_name = &stringArray[ 1 ] ;
string_t * data = &stringArray[ 2 ] ; string_t * data = &stringArray[ 2 ] ;
string_t * m_point = &stringArray[ 3 ] ; string_t * m_point = &stringArray[ 3 ] ;
string_t * mapper = &stringArray[ 4 ] ; string_t * mapper = &stringArray[ 4 ] ;
string_t * mapper_path = &stringArray[ 5 ] ; string_t * mapper_path = &stringArray[ 5 ] ;
string_t * offset = &stringArray[ 6 ] ; string_t * offset = &stringArray[ 6 ] ;
string_t * bitlk = &stringArray[ 7 ] ;
const char * key = NULL ; const char * key = NULL ;
const char * mapper_name ; const char * mapper_name ;
const char * path_mapper ; const char * path_mapper ;
size_t key_len = 0 ; size_t key_len = 0 ;
int st = 0 ; int st = 0 ;
int bitlockerVolume ; int bitlockerVolume ;
skipping to change at line 395 skipping to change at line 400
return zuluExit_1( 10,opts,device,mount_point,stl ) ; return zuluExit_1( 10,opts,device,mount_point,stl ) ;
} }
} }
zuluCryptSecurityGainElevatedPrivileges() ; zuluCryptSecurityGainElevatedPrivileges() ;
bitlockerVolume = zuluCryptDeviceHasAgivenFileSystem( device,zuluCryptBit LockerType() ) ; bitlockerVolume = zuluCryptDeviceHasAgivenFileSystem( device,zuluCryptBit LockerType() ) ;
zuluCryptSecurityDropElevatedPrivileges() ; zuluCryptSecurityDropElevatedPrivileges() ;
if( bitlockerVolume ){ if( bitlockerVolume && zuluCryptUseDislockerBitLocker( opts->use_cryptset up_for_bitlocker ) ){
*mapper_path = zuluCryptBitLockerMapperPath( uid ) ; *mapper_path = zuluCryptBitLockerMapperPath( uid ) ;
zuluCryptSecurityGainElevatedPrivileges() ; zuluCryptSecurityGainElevatedPrivileges() ;
*m_name = zuluCryptBitLockerMapperName( device ) ; *m_name = zuluCryptBitLockerMapperName( device ) ;
zuluCryptSecurityDropElevatedPrivileges() ;
mapper_name = StringContent( *m_name ) ; mapper_name = StringContent( *m_name ) ;
path_mapper = StringContent( *mapper_path ) ; path_mapper = StringContent( *mapper_path ) ;
zuluCryptCreateMountPointPrefix( uid ) ;
zuluCryptSecurityDropElevatedPrivileges() ;
}else{ }else{
/* /*
* zuluCryptCreateMapperName() is defined in ../lib/create_mapper _name.c * zuluCryptCreateMapperName() is defined in ../lib/create_mapper _name.c
*/ */
*m_name = zuluCryptCreateMapperName( device,mapping_name,uid,ZULU CRYPTshortMapperPath ) ; *m_name = zuluCryptCreateMapperName( device,mapping_name,uid,ZULU CRYPTshortMapperPath ) ;
*mapper = StringCopy( *m_name ) ; *mapper = StringCopy( *m_name ) ;
mapper_name = StringContent( *m_name ) ; mapper_name = StringContent( *m_name ) ;
*mapper_path = String( zuluCryptMapperPrefix() ) ; *mapper_path = String( zuluCryptMapperPrefix() ) ;
path_mapper = StringMultipleAppend( *mapper_path,"/",mapper_name, NULL ) ; path_mapper = StringMultipleAppend( *mapper_path,"/",mapper_name, NULL ) ;
}
if( stat( path_mapper,&statstr ) == 0 ){ if( stat( path_mapper,&statstr ) == 0 ){
return zuluExit_1( 11,opts,device,mount_point,stl ) ; return zuluExit_1( 11,opts,device,mount_point,stl ) ;
}
} }
if( plugin_path != NULL ){ if( plugin_path != NULL ){
/* /*
* zuluCryptPrepareSocketPath() is defined in path_access.c * zuluCryptPrepareSocketPath() is defined in path_access.c
*/ */
zuluCryptPrepareSocketPath( uid ) ; zuluCryptPrepareSocketPath( uid ) ;
/* /*
skipping to change at line 542 skipping to change at line 549
volume.device = device ; volume.device = device ;
volume.mapper_name = mapper_name ; volume.mapper_name = mapper_name ;
volume.mapper_path = path_mapper ; volume.mapper_path = path_mapper ;
volume.m_point = mount_point ; volume.m_point = mount_point ;
volume.fs_opts = fs_opts ; volume.fs_opts = fs_opts ;
volume.uid = uid ; volume.uid = uid ;
volume.m_opts = m_opts ; volume.m_opts = m_opts ;
volume.m_flags = m_flags ; volume.m_flags = m_flags ;
volume.bitlocker_volume = bitlockerVolume ; volume.bitlocker_volume = bitlockerVolume ;
volume.luks_detached_header = opts->luks_external_header ;
volume.use_cryptsetup_for_bitlocker = opts->use_cryptsetup_for_bitlocker
;
/* /*
* zuluCryptTrueCryptVeraCryptVolumeInfo() is defined in this source file . * zuluCryptTrueCryptVeraCryptVolumeInfo() is defined in this source file .
*/ */
zuluCryptTrueCryptVeraCryptVolumeInfo( opts->type,&v_info ) ; zuluCryptTrueCryptVeraCryptVolumeInfo( opts->type,&v_info ) ;
volume.iteration_count = v_info.iteration_count ; volume.iteration_count = v_info.iteration_count ;
if( StringAtLeastOneMatch( v_info.type,"tcrypt","truecrypt",NULL ) ){ if( StringAtLeastOneMatch( v_info.type,"tcrypt","truecrypt",NULL ) ){
skipping to change at line 600 skipping to change at line 609
} }
} }
StringDelete( &v_info.type ) ; StringDelete( &v_info.type ) ;
if( plugin_path != NULL ){ if( plugin_path != NULL ){
plugin_path = plugin_path + StringLastIndexOfChar_1( plugin_path, '/' ) + 1 ; plugin_path = plugin_path + StringLastIndexOfChar_1( plugin_path, '/' ) + 1 ;
} }
volume.luks_detached_header = StringHasComponent( plugin_path,"luks" ) ;
volume.general_detached_header = StringHasComponent( plugin_path,"generic
_header" ) ;
if( tcrypt_keyfile ){ if( tcrypt_keyfile ){
volume.key_source = TCRYPT_KEYFILE ; volume.key_source = TCRYPT_KEYFILE ;
} }
if( tcrypt_keyfiles[ 0 ] != NULL ){ if( tcrypt_keyfiles[ 0 ] != NULL ){
/* /*
* Here, we take a list of keyfiles supplied by the user and then copy them to a safe * Here, we take a list of keyfiles supplied by the user and then copy them to a safe
* location at "/run/zuluCrypt" and then we pass these safe copie s to cryptsetup. * location at "/run/zuluCrypt" and then we pass these safe copie s to cryptsetup.
skipping to change at line 645 skipping to change at line 650
if( st == -1 ){ if( st == -1 ){
st = 20 ; st = 20 ;
} }
if( st == 12 ){ if( st == 12 ){
st = 21 ; st = 21 ;
} }
if( st == 8 || st == 3 ){ if( st == 8 || st == 3 ){
st = 3 ; st = 3 ;
} }
if( !volume.bitlocker_volume ){ if( volume.bitlocker_volume ){
if( zuluCryptUseCryptsetupBitLocker( opts->use_cryptsetup_for_bit
locker ) ){
device = StringMultiplePrepend( *mapper,"/",zuluCryptMapp
erPrefix(),NULL ) ;
}else{
*bitlk = zuluCryptBitLockerFullMapperPath( uid,device ) ;
device = StringContent( *bitlk ) ;
}
}else{
device = StringMultiplePrepend( *mapper,"/",zuluCryptMapperPrefix (),NULL ) ; device = StringMultiplePrepend( *mapper,"/",zuluCryptMapperPrefix (),NULL ) ;
} }
if( st == 0 && share ){ if( st == 0 && share ){
/* /*
* user wish to share the mount point bind the mount point to a p ublicly accessed path at /run/media/public/ * user wish to share the mount point bind the mount point to a p ublicly accessed path at /run/media/public/
*/ */
/* /*
* zuluCryptBindMountVolume() is defined in ../zuluCrypt-cli/bin/ bind.c * zuluCryptBindMountVolume() is defined in ../zuluCrypt-cli/bin/ bind.c
 End of changes. 13 change blocks. 
13 lines changed or deleted 30 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)