"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "zuluCrypt-cli/lib/status.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.

status.c  (zuluCrypt-5.7.0.tar.xz):status.c  (zuluCrypt-5.7.1.tar.xz)
skipping to change at line 340 skipping to change at line 340
StringMultipleAppend( p,"\n mount point2:\t",e,NULL ) ; StringMultipleAppend( p,"\n mount point2:\t",e,NULL ) ;
}else{ }else{
StringAppend( p,"\n mount point2:\tNil" ) ; StringAppend( p,"\n mount point2:\tNil" ) ;
} }
} }
StringDelete( &q ) ; StringDelete( &q ) ;
} }
int zuluCryptTrueCryptOrVeraCryptVolume( const char * mapper ) static int _string_starts_with( const char * a,const char * b )
{ {
char buffer[ 1024 ] ; return strncmp( a,b,strlen( b ) ) == 0 ;
}
tc_api_get_volume_type( buffer,sizeof( buffer ),mapper ) ; static int _string_ends_with( const char * e,size_t ee,const char * s,size_t ss
)
{
if( ee >= ss ){
return memcmp( e + ee - ss,s,ss ) == 0 ;
}else{
return 0 ;
}
}
return StringAtLeastOneMatch_1( buffer,"TCRYPT","VCRYPT",NULL ) ; static int _string_starts_and_ends_with( const char * a,const char * b,const cha
r * c )
{
if( _string_starts_with( a,b ) ){
return _string_ends_with( a,strlen( a ),c,strlen( c ) ) ;
}else{
return 0 ;
}
}
static int _created_with_tcplay( const char * map_name )
{
DIR * dir = opendir( "/dev/disk/by-id/" ) ;
struct dirent * e ;
const char * m = strrchr( map_name,'/' ) ;
if( m != NULL ){
map_name = m + 1 ;
}
if( dir != NULL ){
while( ( e = readdir( dir ) ) != NULL ){
if ( _string_starts_and_ends_with( e->d_name,"dm-uuid-CRY
PT-",map_name ) ){
if ( _string_starts_with( e->d_name,"dm-uuid-CRYP
T-TCRYPT" ) ){
if ( _string_starts_with( e->d_name,"dm-u
uid-CRYPT-TCRYPT-zuluCrypt" ) ){
return 0 ;
}else{
return 1 ;
}
}else if( _string_starts_with( e->d_name,"dm-uuid
-CRYPT-VCRYPT" ) ) {
return 1 ;
}
break ;
}
}
closedir( dir ) ;
}
return 0 ;
}
int zuluCryptVolumeManagedByTcplay( const char * mapper )
{
if( zuluCryptBitLockerVolume( mapper ) ){
return 0 ;
}else{
return _created_with_tcplay( mapper ) ;
}
} }
static char * _get_type( struct crypt_device * cd,const char * mapper ) static char * _get_type( struct crypt_device * cd,const char * mapper )
{ {
char * r ; char * r ;
string_t st ; string_t st ;
const char * type = crypt_get_type( cd ) ; const char * type = crypt_get_type( cd ) ;
if( type == NULL ){ if( type == NULL ){
skipping to change at line 387 skipping to change at line 454
} }
return r ; return r ;
} }
char * zuluCryptGetVolumeTypeFromMapperPath( const char * mapper ) char * zuluCryptGetVolumeTypeFromMapperPath( const char * mapper )
{ {
struct crypt_device * cd ; struct crypt_device * cd ;
char * r ; char * r ;
if( zuluCryptBitLockerVolume( mapper ) ){
return StringCopy_2( zuluCryptBitLockerType() ) ;
}
if( crypt_init_by_name( &cd,mapper ) < 0 ){ if( crypt_init_by_name( &cd,mapper ) < 0 ){
return StringCopy_2( "Nil" ) ; return StringCopy_2( "Nil" ) ;
} }
r = _get_type( cd,mapper ) ; r = _get_type( cd,mapper ) ;
crypt_free( cd ) ; crypt_free( cd ) ;
return r ; return r ;
skipping to change at line 677 skipping to change at line 748
} }
if( info == CRYPT_ACTIVE || info == CRYPT_BUSY ){ if( info == CRYPT_ACTIVE || info == CRYPT_BUSY ){
StringAppend( p," type: \t" ) ; StringAppend( p," type: \t" ) ;
type = crypt_get_type( cd ) ; type = crypt_get_type( cd ) ;
if( type != NULL ){ if( type != NULL ){
q = String( type ) ; if( StringsAreEqual( type,zuluCryptCryptsetupBitLockerTyp
e() ) ){
q = String( zuluCryptBitLockerType() ) ;
StringReplaceString( q,"crypto_","" ) ;
}else{
q = String( type ) ;
}
StringAppend( p,StringToLowerCase( q ) ) ; StringAppend( p,StringToLowerCase( q ) ) ;
if( StringsAreEqual_2( q,"luks2" ) && auth_luks2.integrit y_hash ){ if( StringsAreEqual_2( q,"luks2" ) && auth_luks2.integrit y_hash ){
StringAppend( p,"+" ) ; StringAppend( p,"+" ) ;
} }
StringDelete( &q ) ; StringDelete( &q ) ;
}else{ }else{
skipping to change at line 777 skipping to change at line 855
return p ; return p ;
} }
char * zuluCryptVolumeStatus( const char * mapper ) char * zuluCryptVolumeStatus( const char * mapper )
{ {
char * path ; char * path ;
string_t p ; string_t p ;
if( zuluCryptTrueCryptOrVeraCryptVolume( mapper ) ){ if( zuluCryptVolumeManagedByTcplay( mapper ) ){
p = _get_crypto_info_from_tcplay( mapper ) ; p = _get_crypto_info_from_tcplay( mapper ) ;
}else{ }else{
p = _get_crypto_info_from_cryptsetup( mapper ) ; p = _get_crypto_info_from_cryptsetup( mapper ) ;
} }
if( p == StringVoid ){ if( p == StringVoid ){
return NULL ; return NULL ;
}else{ }else{
skipping to change at line 828 skipping to change at line 906
{ {
struct crypt_device * cd ; struct crypt_device * cd ;
mapper_info m ; mapper_info m ;
info_device d ; info_device d ;
char * f = NULL ; char * f = NULL ;
const char * e ; const char * e ;
if( zuluCryptTrueCryptOrVeraCryptVolume( mapper ) ){ if( zuluCryptVolumeManagedByTcplay( mapper ) ){
memset( &m,'\0',sizeof( m ) ) ; memset( &m,'\0',sizeof( m ) ) ;
memset( &d,'\0',sizeof( d ) ) ; memset( &d,'\0',sizeof( d ) ) ;
/* /*
* zuluCryptResolvePath_3() is defined in resolve_path.c * zuluCryptResolvePath_3() is defined in resolve_path.c
*/ */
d.function = zuluCryptResolvePath_3 ; d.function = zuluCryptResolvePath_3 ;
 End of changes. 8 change blocks. 
7 lines changed or deleted 92 lines changed or added

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