zuluCrypt  5.7.1
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.
  Fossies Dox: zuluCrypt-5.7.1.tar.xz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

open_volume.c
Go to the documentation of this file.
1 /*
2  *
3  * Copyright (c) 2011-2015
4  * name : Francis Banyikwa
5  * email: mhogomchungu@gmail.com
6  * This program is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation, either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program. If not, see <http://www.gnu.org/licenses/>.
18  */
19 
20 #include "includes.h"
21 #include "../lib/includes.h"
22 #include <sys/types.h>
23 #include <string.h>
24 #include <locale.h>
25 #include <stdio.h>
26 #include <libintl.h>
27 #include <sys/stat.h>
28 #include <unistd.h>
29 
30 stringList_t zuluCryptCreateKeyFiles( const char * const * list,int s )
31 {
32  #define buffer_size 32
33  char buffer[ buffer_size ] ;
34  const char * e ;
35 
36  int i ;
37 
39 
40  string_t xt ;
41  string_t zt ;
42 
43  for( i = 0 ; list[ i ] != NULL ; i++ ){
44 
45  e = *( list + i ) ;
46 
48  /*
49  * TrueCrypt only uses the first 1MB of keyfile.
50  */
51  if( StringGetFromFile_3( &xt,e,0,1048576 ) == 0 ){
52 
54 
55  e = StringIntToString_1( buffer,buffer_size,i + s ) ;
56  /*
57  * zuluCryptCreateKeyFile_1() is defined in ../lib/open_tcrypt.c
58  */
59  zt = zuluCryptCreateKeyFile_1( xt,e ) ;
60 
61  StringDelete( &xt ) ;
62 
63  StringListAppendString_1( &stz,&zt ) ;
64  }
65  }
66 
68  return stz ;
69 }
70 
72 {
74  StringListIterator end ;
75 
76  StringListGetIterators( stl,&it,&end ) ;
77 
79 
80  while( it != end ){
81  /*
82  * zuluCryptDeleteFile_1() is defined in ../lib/file_path_security.c
83  */
84  zuluCryptDeleteFile_1( *it ) ;
85  it++ ;
86  }
87 
89 }
90 
91 static char * _device_path( const char * device )
92 {
93  char * path ;
94 
95  if( StringPrefixEqual( device,"/dev/loop" ) ){
96 
98  /*
99  * zuluCryptLoopDeviceAddress_1() is defined in ../zuluCrypt-cli/create_loop_device.c
100  */
101  path = zuluCryptLoopDeviceAddress_1( device ) ;
102 
104 
105  if( path == NULL ){
106 
107  return StringCopy_2( device ) ;
108  }else{
109  return path ;
110  }
111  }else{
112  return StringCopy_2( device ) ;
113  }
114 }
115 
116 static void _printResult( const char * device,const char * m_point )
117 {
118  char * e ;
119 
121 
122  /*
123  * zuluCryptGetVolumeTypeFromMapperPath() is defined in ../lib/status.c
124  */
126 
128 
129  if( StringHasComponent( e,"LUKS" ) ){
130 
131  printf( gettext( "SUCCESS: %s volume opened successfully\n" ),"luks" ) ;
132 
133  }else if( StringHasComponent( e,"PLAIN" ) ){
134 
135  printf( gettext( "SUCCESS: %s volume opened successfully\n" ),"plain" ) ;
136 
137  }else if( StringHasComponent( e,"TCRYPT" ) ){
138 
139  printf( gettext( "SUCCESS: %s volume opened successfully\n" ),"tcrypt" ) ;
140 
141  }else if( StringHasComponent( e,"VCRYPT" ) ){
142 
143  printf( gettext( "SUCCESS: %s volume opened successfully\n" ),"vcrypt" ) ;
144 
145  }else if( StringHasComponent( e,"BITLK" ) ){
146 
147  printf( gettext( "SUCCESS: %s volume opened successfully\n" ),"bitlocker" ) ;
148  }else{
149  printf( gettext( "SUCCESS: volume opened successfully\n" ) ) ;
150  }
151 
152  StringFree( e ) ;
153 
154  if( m_point != NULL ){
155 
156  printf( gettext( "volume mounted at: %s\n" ),m_point ) ;
157  }
158 }
159 
160 static int zuluExit( int st,const char * device,const char * m_point,stringList_t stl )
161 {
162  switch( st ){
163 
164  case 0 : _printResult( device,m_point ) ; break ;
165  case 1 : printf( gettext( "ERROR: Failed to mount ntfs/exfat file system using ntfs-3g,is ntfs-3g/exfat package installed?\n" ) ) ;break ;
166  case 2 : printf( gettext( "ERROR: There seem to be an open volume accociated with given address\n" ) ) ; break ;
167  case 3 : printf( gettext( "ERROR: No file or device exist on given path\n" ) ) ; break ;
168  case 4 : printf( gettext( "ERROR: Volume could not be opened with the presented key\n" ) ) ; break ;
169  case 5 : printf( gettext( "ERROR: Insufficient privilege to mount the device with given options\n" ) ) ; break ;
170  case 6 : printf( gettext( "ERROR: Insufficient privilege to open device in read write mode or device does not exist\n" ) ) ; break ;
171  case 7 : printf( gettext( "ERROR: Only root user can perform this operation\n" ) ) ; break ;
172  case 8 : printf( gettext( "ERROR: -O and -m options can not be used together\n" ) ) ; break ;
173  case 9 : printf( gettext( "ERROR: Could not create mount point, invalid path or path already taken\n" ) ) ; break ;
174  case 10: printf( gettext( "ERROR: Shared mount point path aleady taken\n" ) ) ; break ;
175  case 11: printf( gettext( "ERROR: There seem to be an opened mapper associated with the device\n" ) ) ; break ;
176  case 12: printf( gettext( "ERROR: Could not get a passphrase from the module\n" ) ) ; break ;
177  case 13: printf( gettext( "ERROR: Could not get passphrase in silent mode\n" ) ); break ;
178  case 14: printf( gettext( "ERROR: Insufficient memory to hold passphrase\n" ) ) ; break ;
179  case 15: printf( gettext( "ERROR: One or more required argument(s) for this operation is missing\n" ) ) ; break ;
180  case 16: printf( gettext( "ERROR: Invalid path to key file\n" ) ) ; break ;
181  case 17: printf( gettext( "ERROR: Could not get enought memory to hold the key file\n" ) ) ; break ;
182  case 18: printf( gettext( "ERROR: Insufficient privilege to open key file for reading\n" ) ); break ;
183  case 19: printf( gettext( "ERROR: Could not get a passphrase through a local socket\n" ) ); break ;
184  case 20: printf( gettext( "ERROR: Failed to mount a filesystem:invalid/unsupported mount option or unsupported file system encountered\n" ) );break ;
185  case 21: printf( gettext( "ERROR: Could not create a lock on /etc/mtab\n" ) ) ; break ;
186  case 22: printf( gettext( "ERROR: Insufficient privilege to open a system volume\n" ) ) ; break ;
187  default: printf( gettext( "ERROR: Unrecognized error with status number %d encountered\n" ),st ) ;
188  }
189 
191  StringListClearDelete( &stl ) ;
192 
193  return st ;
194 }
195 
196 /*
197  * open_volume function below can be devided into two, the first part is before the mount point folder is created and the
198  * other part is after. This function is called after the mount point is created to see if it the mount point folder
199  * should be removed first before calling the above function.The above function is called directly when "open_volume"
200  * function is to be exited before the mount point is created. *
201  */
202 static int zuluExit_1( int st,const struct_opts * opts,const char * device,const char * m_point,stringList_t stl )
203 {
204  if( opts->open_mount && st != 0 ){
205 
207 
208  rmdir( m_point ) ;
209 
211  }
212  return zuluExit( st,device,m_point,stl ) ;
213 }
214 
215 static int _open_volume( const open_struct_t * volume )
216 {
217  int r ;
219  /*
220  * zuluCryptOpenVolume_2() is defined in ../lib/open_volume.c
221  */
222  r = zuluCryptOpenVolume_2( volume ) ;
223 
225 
226  return r ;
227 }
228 
230 {
231  stringList_t stl = StringListSplit( type,'.' ) ;
232 
233  size_t p = StringListSize( stl ) ;
234 
235  const char * q ;
236 
237  memset( e,'\0',sizeof( tvcrypt ) ) ;
238 
239  if( p > 0 ){
240 
241  e->type = StringListCopyStringAtFirstPlace( stl ) ;
242 
243  if( p > 1 ){
244 
245  q = StringListContentAtSecondPlace( stl ) ;
246 
247  e->iteration_count = ( int )StringConvertToInt( q ) ;
248  }
249  }
250 
251  StringListDelete( &stl ) ;
252 }
253 
254 int zuluCryptEXEOpenVolume( const struct_opts * opts,const char * mapping_name,uid_t uid )
255 {
256  int share = opts->share ;
257  int open_mount = opts->open_mount ;
258  const char * device = opts->device ;
259  const char * mount_point = opts->mount_point ;
260  const char * m_opts = opts->m_opts ;
261  const char * source = opts->key_source ;
262  const char * pass = opts->key ;
263  const char * plugin_path = opts->plugin_path ;
264  const char * fs_opts = opts->fs_opts ;
265  const char * const * tcrypt_keyfiles = opts->tcrypt_multiple_keyfiles ;
266  /*
267  * Below is a form of memory management.All strings are collected in a stringlist object to easily delete them
268  * when the function returns.This allows for the function to have multiple exit points without risks of leaking
269  * memory from manually examining each exit point to make sure all strings are deleted or go with multiple goto
270  * code deleting blocks to take into account different exit points.
271  */
272  stringList_t stl ;
273  string_t * stringArray = StringListArray( &stl,8 ) ;
274  string_t * passphrase = &stringArray[ 0 ] ;
275  string_t * m_name = &stringArray[ 1 ] ;
276  string_t * data = &stringArray[ 2 ] ;
277  string_t * m_point = &stringArray[ 3 ] ;
278  string_t * mapper = &stringArray[ 4 ] ;
279  string_t * mapper_path = &stringArray[ 5 ] ;
280  string_t * offset = &stringArray[ 6 ] ;
281  string_t * bitlk = &stringArray[ 7 ] ;
282 
283  const char * key = NULL ;
284  const char * mapper_name ;
285  const char * path_mapper ;
286 
287  size_t key_len = 0 ;
288  int st = 0 ;
289 
290  int bitlockerVolume ;
291 
292  stringList_t stz ;
293  tvcrypt v_info ;
294 
295  unsigned long m_flags ;
296 
297  int tcrypt_keyfile = 0 ;
298 
299  const char * uuid ;
300  char * device_path ;
301 
302  /*
303  * open_struct_t is declared in ../lib/include.h
304  */
305  open_struct_t volume ;
306 
307  struct stat statstr ;
308 #if 0
309  /*
310  * zuluCryptVolumeIsInSystemVolumeList() is defined in volumes.c
311  */
312  if( zuluCryptVolumeIsInSystemVolumeList( device ) ){
313  /*
314  * check permissions only if volume is explicity mentioned as system.
315  * This is an exception to avoid some udev bad behaviors on udev enabled build
316  */
317  if( !zuluCryptUserIsAMemberOfAGroup( uid,"zulucrypt" ) ){
318  return zuluExit( 22,device,mount_point,stl ) ;
319  }
320  }
321 #endif
322  if( m_opts == NULL ){
323 
324  m_opts = "rw" ;
325  }
326  /*
327  * zuluCryptMountFlagsAreNotCorrect() is defined in ./mount_flags.c
328  */
329  if( zuluCryptMountFlagsAreNotCorrect( m_opts,uid,&m_flags ) ){
330 
331  return zuluExit( 5,device,mount_point,stl ) ;
332  }
333  if( StringHasComponent( m_opts,"rw" ) ){
334  /*
335  * zuluCryptSecurityDeviceIsWritable() is defined in path_access.c
336  */
337  st = zuluCryptCanOpenPathForWriting( device,uid ) ;
338  }else{
339  /*
340  * zuluCryptSecurityDeviceIsReadable() is defined in path_access.c
341  */
342  st = zuluCryptCanOpenPathForReading( device,uid ) ;
343  }
344 
345  /*
346  * 1-permissions denied
347  * 2-invalid path
348  * 3-shenanigans
349  * 4-common error
350  */
351  switch( st ){
352 
353  case 0 : break ;
354  case 1 : return zuluExit( 6,device,mount_point,stl ) ;
355  case 2 : return zuluExit( 6,device,mount_point,stl ) ;
356  case 3 : return zuluExit( 6,device,mount_point,stl ) ;
357  case 4 : return zuluExit( 6,device,mount_point,stl ) ;
358  default: return zuluExit( 6,device,mount_point,stl ) ;
359  }
360 
361  if( open_mount ){
362  /*
363  * zuluCryptCreateMountPoint() is defined in create_mount_point.c
364  */
365  *m_point = zuluCryptCreateMountPoint( device,mount_point,m_opts,uid ) ;
366 
367  mount_point = StringContent( *m_point ) ;
368 
369  if( mount_point == NULL ){
370 
371  return zuluExit( 9,device,mount_point,stl ) ;
372  }
373  }else{
374  if( uid != 0 ){
375 
376  return zuluExit( 7,device,mount_point,stl ) ;
377  }
378  if( mount_point != NULL ){
379 
380  return zuluExit( 8,device,mount_point,stl ) ;
381  }
382  }
383 
384  if( share ){
385  /*
386  * zuluCryptBindSharedMountPointPathTaken() is defined in bind.c
387  */
388  if( zuluCryptBindSharedMountPointPathTaken( *m_point ) ){
389 
390  return zuluExit_1( 10,opts,device,mount_point,stl ) ;
391  }
392  }
393 
395 
396  bitlockerVolume = zuluCryptDeviceHasAgivenFileSystem( device,zuluCryptBitLockerType() ) ;
397 
399 
400  if( bitlockerVolume && zuluCryptUseDislockerBitLocker( opts->use_cryptsetup_for_bitlocker ) ){
401 
402  *mapper_path = zuluCryptBitLockerMapperPath( uid ) ;
403 
405 
406  *m_name = zuluCryptBitLockerMapperName( device ) ;
407 
408  mapper_name = StringContent( *m_name ) ;
409  path_mapper = StringContent( *mapper_path ) ;
410 
412 
414  }else{
415  /*
416  * zuluCryptCreateMapperName() is defined in ../lib/create_mapper_name.c
417  */
418  *m_name = zuluCryptCreateMapperName( device,mapping_name,uid,ZULUCRYPTshortMapperPath ) ;
419 
420  *mapper = StringCopy( *m_name ) ;
421  mapper_name = StringContent( *m_name ) ;
422 
423  *mapper_path = String( zuluCryptMapperPrefix() ) ;
424 
425  path_mapper = StringMultipleAppend( *mapper_path,"/",mapper_name,NULL ) ;
426 
427  if( stat( path_mapper,&statstr ) == 0 ){
428 
429  return zuluExit_1( 11,opts,device,mount_point,stl ) ;
430  }
431  }
432 
433  if( plugin_path != NULL ){
434 
435  /*
436  * zuluCryptPrepareSocketPath() is defined in path_access.c
437  */
439 
440  /*
441  * zuluCryptUUIDFromPath() is defined in path_access.c
442  */
443  uuid = zuluCryptUUIDFromPath( device ) ;
444 
445  device_path = _device_path( device ) ;
446  /*
447  * zuluCryptPluginManagerGetKeyFromModule is defined in ../pluginManager/zuluCryptPluginManager.c
448  */
449  *passphrase = zuluCryptPluginManagerGetKeyFromModule( device_path,
450  plugin_path,
451  uuid,
452  uid,
453  opts,
455  &st ) ;
456 
457  StringFree( device_path ) ;
458  StringFree( uuid ) ;
459 
460  if( st != 0 || *passphrase == StringVoid ){
461 
462  return zuluExit_1( 12,opts,device,mount_point,stl ) ;
463  }
464 
465  key_len = StringLength( *passphrase ) ;
466  key = StringContent( *passphrase ) ;
467 
468  zuluCryptSecurityLockMemory_1( *passphrase ) ;
469 
470  }else if( source == NULL && tcrypt_keyfiles[ 0 ] == NULL ){
471 
472  printf( gettext( "Enter passphrase: " ) ) ;
473  /*
474  * ZULUCRYPT_KEY_MAX_SIZE is set in ../constants.h
475  */
477 
478  case 1 : return zuluExit_1( 13,opts,device,mount_point,stl ) ;
479  case 2 : return zuluExit_1( 14,opts,device,mount_point,stl ) ;
480  }
481 
482  printf( "\n" ) ;
483  key = StringContent( *passphrase ) ;
484  key_len = StringLength( *passphrase ) ;
485 
486  zuluCryptSecurityLockMemory_1( *passphrase ) ;
487  }else{
488  if( source == NULL || pass == NULL ){
489 
490  if( tcrypt_keyfiles == NULL ){
491 
492  return zuluExit_1( 15,opts,device,mount_point,stl ) ;
493  }
494  }
495  if( StringsAreEqual( source,"-p" ) ){
496 
497  key = pass ;
498  key_len = StringSize( pass ) ;
499 
500  }else if( StringsAreEqual( source,"-f" ) ){
501 
503 
504  tcrypt_keyfile = 1 ;
505  }
506  /*
507  * function is defined at "path_access.c"
508  */
509  switch( zuluCryptGetPassFromFile( NULL,pass,uid,data ) ){
510 
511  case 1 : return zuluExit_1( 16,opts,device,mount_point,stl ) ;
512  case 2 : return zuluExit_1( 17,opts,device,mount_point,stl ) ;
513  case 4 : return zuluExit_1( 18,opts,device,mount_point,stl ) ;
514  case 5 : return zuluExit_1( 19,opts,device,mount_point,stl ) ;
515  }
516 
517  if( *data == StringVoid ){
518 
519  return zuluExit_1( 12,opts,device,mount_point,stl ) ;
520  }
521 
522  key = StringContent( *data ) ;
523  key_len = StringLength( *data ) ;
524 
526  }
527  }
528 
529  memset( &volume,'\0',sizeof( open_struct_t ) ) ;
530 
531  if( key != NULL ){
532 
533  volume.key = key ;
534  volume.key_len = key_len ;
535  }else{
536  volume.key = "" ;
537  volume.key_len = 0 ;
538  }
539 
540  volume.device = device ;
541  volume.mapper_name = mapper_name ;
542  volume.mapper_path = path_mapper ;
543  volume.m_point = mount_point ;
544  volume.fs_opts = fs_opts ;
545  volume.uid = uid ;
546  volume.m_opts = m_opts ;
547  volume.m_flags = m_flags ;
548  volume.bitlocker_volume = bitlockerVolume ;
551 
552  /*
553  * zuluCryptTrueCryptVeraCryptVolumeInfo() is defined in this source file.
554  */
556 
557  volume.iteration_count = v_info.iteration_count ;
558 
559  if( StringAtLeastOneMatch( v_info.type,"tcrypt","truecrypt",NULL ) ){
560 
561  volume.trueCrypt_volume = 1 ;
562 
563  }else if( StringAtLeastOneMatch( v_info.type,"vcrypt","veracrypt","vera",NULL ) ){
564 
565  volume.veraCrypt_volume = 1 ;
566 
567  }else if( StringAtLeastOneMatch( v_info.type,"vcrypt-sys","veracrypt-sys","vera-sys",NULL ) ){
568 
569  volume.veraCrypt_volume = 1 ;
570  volume.system_volume = 1 ;
571 
572  }else if( StringAtLeastOneMatch( v_info.type,"vcrypt-hbk","veracrypt-hbk","vera-hbk",NULL ) ){
573 
574  volume.veraCrypt_volume = 1 ;
575  volume.use_backup_header = 1 ;
576 
577  }else if( StringAtLeastOneMatch( v_info.type,"vcrypt-sys-hbk","veracrypt-sys-hbk","vera-sys-hbk",NULL ) ){
578 
579  volume.veraCrypt_volume = 1 ;
580  volume.system_volume = 1 ;
581  volume.use_backup_header = 1 ;
582  }
583 
584  if( !volume.veraCrypt_volume && !volume.trueCrypt_volume ){
585 
586  if( opts->offset != NULL ){
587 
588  *offset = String( "/dev/urandom.aes.cbc-essiv:sha256.256.ripemd160." ) ;
589  volume.plain_dm_properties = StringAppend( *offset,opts->offset ) ;
590  }else{
591  if( StringsAreEqual( opts->type,"plain" ) ){
592 
593  volume.plain_dm_properties = "aes.cbc-essiv:sha256.256.sha256.0" ;
594 
595  }else if( StringsAreNotEqual( opts->type,"luks" ) ){
596 
597  volume.plain_dm_properties = opts->type ;
598  }
599  }
600  }
601 
602  StringDelete( &v_info.type ) ;
603 
604  if( plugin_path != NULL ){
605 
606  plugin_path = plugin_path + StringLastIndexOfChar_1( plugin_path,'/' ) + 1 ;
607  }
608 
609  if( tcrypt_keyfile ){
610 
611  volume.key_source = TCRYPT_KEYFILE ;
612  }
613 
614  if( tcrypt_keyfiles[ 0 ] != NULL ){
615 
616  /*
617  * Here, we take a list of keyfiles supplied by the user and then copy them to a safe
618  * location at "/run/zuluCrypt" and then we pass these safe copies to cryptsetup.
619  *
620  * The idea is not to let cryptsetup, a privileged process handle user managed files.
621  */
622 
623  stz = zuluCryptCreateKeyFiles( tcrypt_keyfiles,0 ) ;
624 
625  volume.tcrypt_keyfiles_count = StringListSize( stz ) ;
626  volume.tcrypt_keyfiles = StringListStringArray_0( stz ) ;
627 
628  st = _open_volume( &volume ) ;
629 
630  zuluCryptDeleteKeyFiles( stz ) ;
631 
632  StringFree( volume.tcrypt_keyfiles ) ;
633  StringListDelete( &stz ) ;
634  }else{
635  st = _open_volume( &volume ) ;
636  }
637  /*
638  * below two return values comes from ../lib/mount_volume.c
639  */
640  if( st == -1 ){
641  st = 20 ;
642  }
643  if( st == 12 ){
644  st = 21 ;
645  }
646  if( st == 8 || st == 3 ){
647  st = 3 ;
648  }
649 
650  if( volume.bitlocker_volume ){
651 
653 
654  device = StringMultiplePrepend( *mapper,"/",zuluCryptMapperPrefix(),NULL ) ;
655  }else{
656  *bitlk = zuluCryptBitLockerFullMapperPath( uid,device ) ;
657 
658  device = StringContent( *bitlk ) ;
659  }
660  }else{
661  device = StringMultiplePrepend( *mapper,"/",zuluCryptMapperPrefix(),NULL ) ;
662  }
663 
664  if( st == 0 && share ){
665 
666  /*
667  * user wish to share the mount point bind the mount point to a publicly accessed path at /run/media/public/
668  */
669  /*
670  * zuluCryptBindMountVolume() is defined in ../zuluCrypt-cli/bin/bind.c
671  */
672  zuluCryptBindMountVolume( device,*m_point,m_flags ) ;
673  }
674 
675  /*
676  * zuluCryptCheckInvalidKey() is defined in check_invalid_key.c
677  */
679  return zuluExit_1( st,opts,device,mount_point,stl ) ;
680 }
struct_opts_1::tcrypt_multiple_keyfiles
const char * tcrypt_multiple_keyfiles[16+1]
Definition: libzuluCrypt-exe.h:54
open_struct_t::fs_opts
const char * fs_opts
Definition: includes.h:75
StringListVoid
#define StringListVoid
Definition: StringList.h:41
StringSilentlyGetFromTerminal_1
int StringSilentlyGetFromTerminal_1(string_t *q, size_t s)
Definition: String.c:1752
_printResult
static void _printResult(const char *device, const char *m_point)
Definition: open_volume.c:116
StringAtLeastOneMatch
int StringAtLeastOneMatch(string_t st,...)
Definition: String.c:1478
StringListContentAtSecondPlace
static const __inline__ char * StringListContentAtSecondPlace(stringList_t stl)
Definition: StringList.h:187
open_struct_t::mapper_name
const char * mapper_name
Definition: includes.h:71
struct_opts_1::type
const char * type
Definition: libzuluCrypt-exe.h:44
struct_opts_1::key
const char * key
Definition: libzuluCrypt-exe.h:42
open_struct_t
Definition: includes.h:68
zuluCryptVolumeIsInSystemVolumeList
int zuluCryptVolumeIsInSystemVolumeList(const char *device)
Definition: volumes.c:715
zuluCryptEXEOpenVolume
int zuluCryptEXEOpenVolume(const struct_opts *opts, const char *mapping_name, uid_t uid)
Definition: open_volume.c:254
StringCopy
string_t StringCopy(string_t st)
Definition: String.c:260
zuluCryptTrueCryptVeraCryptVolumeInfo
void zuluCryptTrueCryptVeraCryptVolumeInfo(const char *type, tvcrypt *e)
Definition: open_volume.c:229
struct_opts_1::device
const char * device
Definition: libzuluCrypt-exe.h:37
open_struct_t::uid
uid_t uid
Definition: includes.h:80
zuluCryptCheckInvalidKey
void zuluCryptCheckInvalidKey(const char *device)
Definition: check_invalid_key.c:23
StringLength
size_t StringLength(string_t st)
Definition: String.c:678
StringsAreNotEqual
#define StringsAreNotEqual(x, y)
Definition: zuluSafe.c:47
zuluCryptCreateKeyFiles
stringList_t zuluCryptCreateKeyFiles(const char *const *list, int s)
Definition: open_volume.c:30
open_struct_t::key_source
int key_source
Definition: includes.h:82
zuluCryptGetVolumeTypeFromMapperPath
char * zuluCryptGetVolumeTypeFromMapperPath(const char *mapper)
Definition: status.c:449
zuluCryptMountFlagsAreNotCorrect
int zuluCryptMountFlagsAreNotCorrect(const char *mode, uid_t uid, unsigned long *flags)
Definition: mount_flags.c:41
StringListSize
size_t StringListSize(stringList_t stl)
Definition: StringList.c:492
open_struct_t::plain_dm_properties
const char * plain_dm_properties
Definition: includes.h:70
struct_opts_1::open_mount
int open_mount
Definition: libzuluCrypt-exe.h:63
struct_opts_1::plugin_path
const char * plugin_path
Definition: libzuluCrypt-exe.h:36
StringListAppendString_1
void StringListAppendString_1(stringList_t *stl, string_t *st)
Definition: StringList.c:659
StringListGetIterators
void StringListGetIterators(stringList_t stl, StringListIterator *begin, StringListIterator *end)
Definition: StringList.c:210
open_struct_t::tcrypt_keyfiles_count
int tcrypt_keyfiles_count
Definition: includes.h:84
open_struct_t::m_point
const char * m_point
Definition: includes.h:74
open_struct_t::bitlocker_volume
int bitlocker_volume
Definition: includes.h:87
zuluCryptCanOpenPathForWriting
int zuluCryptCanOpenPathForWriting(const char *path, uid_t uid)
Definition: path_access.c:103
StringIntToString_1
char * StringIntToString_1(char *x, size_t y, u_int64_t z)
Definition: String.c:1444
zuluCryptLoopDeviceAddress_1
char * zuluCryptLoopDeviceAddress_1(const char *device)
Definition: create_loop_device.c:140
struct_opts_1
Definition: libzuluCrypt-exe.h:35
open_struct_t::use_cryptsetup_for_bitlocker
int use_cryptsetup_for_bitlocker
Definition: includes.h:89
zuluCryptDeleteKeyFiles
void zuluCryptDeleteKeyFiles(stringList_t stl)
Definition: open_volume.c:71
struct_opts_1::key_source
const char * key_source
Definition: libzuluCrypt-exe.h:41
zuluCryptBindMountVolume
int zuluCryptBindMountVolume(const char *device, string_t z_path, unsigned long flags)
Definition: bind.c:240
zuluCryptCreateMapperName
string_t zuluCryptCreateMapperName(const char *device, const char *mapping_name, uid_t uid, int i)
Definition: create_mapper_name.c:42
zuluCryptUserIsAMemberOfAGroup
int zuluCryptUserIsAMemberOfAGroup(uid_t uid, const char *groupname)
Definition: mount_fs_options.c:172
zuluCryptBitLockerMapperName
string_t zuluCryptBitLockerMapperName(const char *e)
Definition: bitlocker.c:81
zuluCryptBitLockerMapperPath
string_t zuluCryptBitLockerMapperPath(uid_t uid)
Definition: bitlocker.c:74
StringListDelete
void StringListDelete(stringList_t *stl)
Definition: StringList.c:1184
zuluCryptCanOpenPathForReading
int zuluCryptCanOpenPathForReading(const char *path, uid_t uid)
Definition: path_access.c:98
StringMultipleAppend
const char * StringMultipleAppend(string_t st,...)
Definition: String.c:1123
StringCopy_2
char * StringCopy_2(const char *str)
Definition: String.c:725
open_struct_t::use_backup_header
int use_backup_header
Definition: includes.h:92
StringHasNoComponent
static __inline__ int StringHasNoComponent(const char *x, const char *y)
Definition: String.h:973
StringsAreEqual
#define StringsAreEqual(x, y)
Definition: zuluSafe.c:46
zuluCryptMapperPrefix
const char * zuluCryptMapperPrefix(void)
Definition: create_mapper_name.c:95
buffer_size
#define buffer_size
zuluCryptOpenVolume_2
int zuluCryptOpenVolume_2(const open_struct_t *opts)
Definition: open_volume.c:169
zuluCryptBindSharedMountPointPathTaken
int zuluCryptBindSharedMountPointPathTaken(string_t path)
Definition: bind.c:223
zuluCryptUUIDFromPath
char * zuluCryptUUIDFromPath(const char *device)
Definition: path_access.c:197
zuluExit
static int zuluExit(int st, const char *device, const char *m_point, stringList_t stl)
Definition: open_volume.c:160
open_struct_t::system_volume
int system_volume
Definition: includes.h:88
StringSize
static __inline__ size_t StringSize(const char *str)
Definition: String.h:846
zuluCryptRunTimePath
const char * zuluCryptRunTimePath()
Definition: security.c:49
StringContent
static const __inline__ char * StringContent(string_t st)
Definition: String.h:1011
open_struct_t::device
const char * device
Definition: includes.h:69
zuluExit_1
static int zuluExit_1(int st, const struct_opts *opts, const char *device, const char *m_point, stringList_t stl)
Definition: open_volume.c:202
StringType
Definition: String.c:49
open_struct_t::trueCrypt_volume
int trueCrypt_volume
Definition: includes.h:86
zuluCryptCreateKeyFile_1
string_t zuluCryptCreateKeyFile_1(string_t key, const char *fileName)
Definition: open_tcrypt.c:167
zuluCryptSecurityDropElevatedPrivileges
int zuluCryptSecurityDropElevatedPrivileges(void)
Definition: security.c:109
struct_opts_1::offset
const char * offset
Definition: libzuluCrypt-exe.h:56
tvcrypt
Definition: includes.h:37
open_struct_t::iteration_count
int iteration_count
Definition: includes.h:83
StringLastIndexOfChar_1
static __inline__ ssize_t StringLastIndexOfChar_1(const char *str, char s)
Definition: String.h:982
String
string_t String(const char *cstring)
Definition: String.c:318
zuluCryptSecurityUnlockMemory
void zuluCryptSecurityUnlockMemory(stringList_t stl)
Definition: security.c:229
zuluCryptUseCryptsetupBitLocker
int zuluCryptUseCryptsetupBitLocker(int r)
Definition: bitlocker.c:55
zuluCryptSecurityGainElevatedPrivileges
int zuluCryptSecurityGainElevatedPrivileges(void)
Definition: security.c:64
zuluCryptPrepareSocketPath
void zuluCryptPrepareSocketPath(uid_t uid)
Definition: path_access.c:108
zuluCryptBitLockerType
const char * zuluCryptBitLockerType()
Definition: bitlocker.c:36
struct_opts_1::share
int share
Definition: libzuluCrypt-exe.h:66
StringListArray
string_t * StringListArray(stringList_t *stz, size_t arraySize)
Definition: StringList.c:244
open_struct_t::key
const char * key
Definition: includes.h:73
ZULUCRYPT_KEY_MAX_SIZE
#define ZULUCRYPT_KEY_MAX_SIZE
Definition: constants.h:49
StringListCopyStringAtFirstPlace
static __inline__ string_t StringListCopyStringAtFirstPlace(stringList_t stl)
Definition: StringList.h:470
StringListType
Definition: StringList.c:33
StringHasComponent
static __inline__ int StringHasComponent(const char *x, const char *y)
Definition: String.h:964
open_struct_t::tcrypt_keyfiles
const char *const * tcrypt_keyfiles
Definition: includes.h:90
e
static QString e
Definition: about.cpp:31
StringListSplit
stringList_t StringListSplit(const char *cstring, char splitter)
Definition: StringList.c:428
StringMultiplePrepend
const char * StringMultiplePrepend(string_t st,...)
Definition: String.c:1159
TCRYPT_KEYFILE
#define TCRYPT_KEYFILE
Definition: libzuluCrypt.h:306
open_struct_t::veraCrypt_volume
int veraCrypt_volume
Definition: includes.h:85
zuluCryptSecurityLockMemory_1
void zuluCryptSecurityLockMemory_1(string_t st)
Definition: security.c:185
zuluCryptDeleteFile_1
void zuluCryptDeleteFile_1(string_t st)
Definition: file_path_security.c:83
struct_opts_1::luks_external_header
const char * luks_external_header
Definition: libzuluCrypt-exe.h:58
StringGetFromFile_3
int StringGetFromFile_3(string_t *str, const char *path, size_t offset, size_t length)
Definition: String.c:1868
zuluCryptGetPassFromFile
int zuluCryptGetPassFromFile(int *socket_path, const char *path, uid_t uid, string_t *st)
Definition: path_access.c:121
StringDelete
void StringDelete(string_t *st)
Definition: String.c:162
zuluCryptUseDislockerBitLocker
int zuluCryptUseDislockerBitLocker(int r)
Definition: bitlocker.c:64
StringConvertToInt
u_int64_t StringConvertToInt(const char *s)
Definition: String.c:1416
zuluCryptDeviceHasAgivenFileSystem
int zuluCryptDeviceHasAgivenFileSystem(const char *device, const char *fs)
Definition: blkid_evaluate_tag.c:176
struct_opts_1::fs_opts
const char * fs_opts
Definition: libzuluCrypt-exe.h:40
zuluCryptCreateMountPoint
string_t zuluCryptCreateMountPoint(const char *device, const char *label, const char *m_opts, uid_t uid)
Definition: create_mount_point.c:370
StringListClearDelete
void StringListClearDelete(stringList_t *stl)
Definition: StringList.c:1216
struct_opts_1::m_opts
const char * m_opts
Definition: libzuluCrypt-exe.h:39
open_struct_t::luks_detached_header
const char * luks_detached_header
Definition: includes.h:77
tvcrypt::iteration_count
int iteration_count
Definition: includes.h:39
StringListStringArray_0
static const __inline__ char *const * StringListStringArray_0(stringList_t stl)
Definition: StringList.h:402
open_struct_t::mapper_path
const char * mapper_path
Definition: includes.h:72
open_struct_t::key_len
size_t key_len
Definition: includes.h:79
_open_volume
static int _open_volume(const open_struct_t *volume)
Definition: open_volume.c:215
struct_opts_1::mount_point
const char * mount_point
Definition: libzuluCrypt-exe.h:38
open_struct_t::m_flags
unsigned long m_flags
Definition: includes.h:91
StringAppend
const char * StringAppend(string_t st, const char *s)
Definition: String.c:1052
includes.h
_device_path
static char * _device_path(const char *device)
Definition: open_volume.c:91
zuluCryptPluginManagerGetKeyFromModule
string_t zuluCryptPluginManagerGetKeyFromModule(const char *device, const char *name, const char *uuid, uid_t uid, const struct_opts *opts, const char *run_path, int *r)
Definition: zuluCryptPluginManager.c:164
ZULUCRYPTshortMapperPath
#define ZULUCRYPTshortMapperPath
Definition: constants.h:35
struct_opts_1::use_cryptsetup_for_bitlocker
int use_cryptsetup_for_bitlocker
Definition: libzuluCrypt-exe.h:67
zuluCryptBitLockerFullMapperPath
string_t zuluCryptBitLockerFullMapperPath(uid_t uid, const char *e)
Definition: bitlocker.c:127
open_struct_t::m_opts
const char * m_opts
Definition: includes.h:76
tvcrypt::type
string_t type
Definition: includes.h:40
StringPrefixEqual
static __inline__ int StringPrefixEqual(const char *x, const char *y)
Definition: String.h:905
StringFree
static __inline__ void StringFree(const void *str)
Definition: String.h:823
zuluCryptCreateMountPointPrefix
void zuluCryptCreateMountPointPrefix(uid_t uid)
Definition: create_mount_point.c:359
StringVoid
#define StringVoid
Definition: String.h:47