int zuluCryptOpenPlain_2( const char * device,const char * mapper, const char * mode,const char * key,size_t key_len, const char * options ) { open_struct_t opt ; stringList_t stl ; int r ; char * const * e = NULL ; size_t n = 0 ; args s = { "/dev/urandom","aes","cbc-essiv:sha256","256","ripemd160","0" } ; memset( &opt,'\0',sizeof( open_struct_t ) ) ; opt.device = device ; opt.mapper_name = mapper ; opt.key = key ; opt.key_len = key_len ; opt.m_opts = mode ; opt.variables = &s ; stl = StringListSplit( options,'.' ) ; StringListStringArray_1( &e,&n,stl ) ; if( n == 6 ){ s.rng = *( e + 0 ) ; s.algo = *( e + 1 ) ; s.cipher = *( e + 2 ) ; s.keySize = *( e + 3 ) ; s.hash = *( e + 4 ) ; s.offset = *( e + 5 ) ; }else if( n == 5 ){ s.algo = *( e + 0 ) ; s.cipher = *( e + 1 ) ; s.keySize = *( e + 2 ) ; s.hash = *( e + 3 ) ; s.offset = *( e + 4 ) ; } /* * zuluCryptResolveDevicePath_0() is defined in resolve_path.c */ r = zuluCryptResolveDevicePath_0( _open_plain,&opt,2 ) ; StringListDelete( &stl ) ; StringFree( e ) ; return r ; }
static stringList_t _add_entry( stringList_t stx,stringList_t tmp,string_t ( *function )( const vInfo * ), char * const ** entry,size_t * entry_len ) { string_t st ; u_int64_t e ; vInfo volumeInfo ; StringListStringArray_1( entry,entry_len,tmp ) ; volumeInfo.device = *( *entry + *entry_len - 2 ) ; volumeInfo.mountPoint = *( *entry + 4 ) ; volumeInfo.fileSystem = *( *entry + *entry_len - 3 ) ; volumeInfo.mountOptions = *( *entry + 5 ) ; volumeInfo.rootPath = *( *entry + 3 ) ; if( StringsAreEqual( volumeInfo.fileSystem,"fuse.encfs" ) ) { st = StringListStringAt( tmp,*entry_len - 2 ) ; StringReset( st ) ; e = StringJenkinsOneAtATimeHash( volumeInfo.mountPoint ) ; volumeInfo.device = StringAppendInt( st,e ) ; } if( _valid_entry( &volumeInfo ) ) { st = function( &volumeInfo ) ; stx = StringListAppendString_1( stx,&st ) ; } return stx ; }