diff --git a/CHANGELOG b/CHANGELOG index 1398c7d..41fad31 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -105,4 +105,3 @@ me know! Thanks to all the bug reporters as well. their standard header files. * Fixed typos - diff --git a/CMakeLists.txt b/CMakeLists.txt index a4a0310..dde7c75 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -153,4 +153,3 @@ include(CPack) cpack_add_component(bin DISPLAY_NAME bin REQUIRED INSTALL_TYPES all) cpack_add_component(lib DISPLAY_NAME lib REQUIRED INSTALL_TYPES all) cpack_add_component(lib-dev DISPLAY_NAME lib-dev REQUIRED INSTALL_TYPES all DEPENDS lib) - diff --git a/README.md b/README.md index dfd252b..d0e2d59 100644 --- a/README.md +++ b/README.md @@ -174,4 +174,3 @@ Some notable differences between actual implementation and documentation: in the documentation. - All two-way cipher cascades are the wrong way round in the documentation, but all three-way cipher cascades are correct. - diff --git a/crypto-dev.c b/crypto-dev.c index b61fcc9..1cb972d 100644 --- a/crypto-dev.c +++ b/crypto-dev.c @@ -162,4 +162,3 @@ tc_crypto_init(void) return 0; } - diff --git a/generic_xts.c b/generic_xts.c index 8202040..eff4013 100644 --- a/generic_xts.c +++ b/generic_xts.c @@ -172,4 +172,3 @@ xts_uninit(struct xts_ctx *ctx) return 0; } - diff --git a/generic_xts.h b/generic_xts.h index 1c31450..9bef09f 100644 --- a/generic_xts.h +++ b/generic_xts.h @@ -46,4 +46,3 @@ int xts_init(struct xts_ctx *ctxp, void *arg1, void *arg2, set_key_fn set_key_fn int xts_encrypt(struct xts_ctx *ctx, uint8_t *data, size_t len, uint8_t *iv); int xts_decrypt(struct xts_ctx *ctx, uint8_t *data, size_t len, uint8_t *iv); int xts_uninit(struct xts_ctx *ctxp); - diff --git a/hdr.c b/hdr.c index b3d2f78..fb4df42 100644 --- a/hdr.c +++ b/hdr.c @@ -43,7 +43,7 @@ #include "crc32.h" #include "tcplay.h" -/* Endianess macros */ +/* Endianness macros */ #define BE_TO_HOST(n, v) v = be ## n ## toh(v) #define LE_TO_HOST(n, v) v = le ## n ## toh(v) #define HOST_TO_BE(n, v) v = htobe ## n (v) diff --git a/humanize.h b/humanize.h index 6a45b1d..f52851f 100644 --- a/humanize.h +++ b/humanize.h @@ -29,4 +29,3 @@ int _humanize_number(char *buf, size_t bufsz, uint64_t num); int _dehumanize_number(const char *buf, uint64_t *dest); - diff --git a/main.c b/main.c index e210150..5b69771 100644 --- a/main.c +++ b/main.c @@ -234,8 +234,8 @@ static struct option longopts[] = { { "weak-keys", no_argument, NULL, 'w' }, { "insecure-erase", no_argument, NULL, 'z' }, { "help", no_argument, NULL, 'h' }, - { "no-retries", no_argument, NULL, FLAG_LONG_NO_RETRIES }, - { NULL, 0, NULL, 0 }, + { "no-retries", no_argument, NULL, FLAG_LONG_NO_RETRIES }, + { NULL, 0, NULL, 0 }, }; #define _set_str_opt(opt) \ diff --git a/pbkdf2-gcrypt.c b/pbkdf2-gcrypt.c index fc7b679..99b7c96 100644 --- a/pbkdf2-gcrypt.c +++ b/pbkdf2-gcrypt.c @@ -74,4 +74,3 @@ pbkdf2(struct pbkdf_prf_algo *hash, const char *pass, int passlen, return 0; } - diff --git a/pbkdf2-openssl.c b/pbkdf2-openssl.c index e3cbcc1..9bf5d31 100644 --- a/pbkdf2-openssl.c +++ b/pbkdf2-openssl.c @@ -58,4 +58,3 @@ pbkdf2(struct pbkdf_prf_algo *hash, const char *pass, int passlen, return 0; } - diff --git a/tcplay.3 b/tcplay.3 index f8294a7..ec4727d 100644 --- a/tcplay.3 +++ b/tcplay.3 @@ -1,10 +1,10 @@ .\" .\" Copyright (c) 2011 The DragonFly Project. All rights reserved. -.\" +.\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: -.\" +.\" .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright @@ -14,7 +14,7 @@ .\" 3. Neither the name of The DragonFly Project nor the names of its .\" contributors may be used to endorse or promote products derived .\" from this software without specific, prior written permission. -.\" +.\" .\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT .\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS @@ -180,7 +180,7 @@ does, but without changing the passphrase, keyfiles or PRF algorithm. .Pp The .Fn tc_api_task_set -function allows settting a number of different options for the current task. +function allows setting a number of different options for the current task. The following table shows which keys are available on calls to .Fn tc_api_task_set for each of the operations. @@ -521,7 +521,7 @@ null character). To be compatible with it, .Nm tcplay does the same. -All passphrases (exlcuding keyfiles) are trimmed to 64 characters. +All passphrases (excluding keyfiles) are trimmed to 64 characters. Similarly, keyfiles are limited to a size of 1 MB, but up to 256 keyfiles can be used. .Sh RETURN VALUES @@ -536,7 +536,7 @@ to indicate that the operation completed successfully, or to indicate that the operation is not implemented , or .Dv TC_ERR -to indicate that any other error occured. +to indicate that any other error occurred. .Pp The .Fn tc_api_task_get_error diff --git a/tcplay.8 b/tcplay.8 index df9d6da..c3a20a9 100644 --- a/tcplay.8 +++ b/tcplay.8 @@ -360,7 +360,7 @@ volume. Which volume is accessed solely depends on the passphrase and keyfile(s) used. If the passphrase and keyfiles for the outer volume are specified, -no information about the existance of the hidden volume is exposed. +no information about the existence of the hidden volume is exposed. Without knowledge of the passphrase and keyfile(s) of the hidden volume its existence remains unexposed. The hidden volume can be protected when mapping the outer volume by @@ -496,7 +496,7 @@ Or alternatively: .Nm Fl -unmap Ns = Ns Cm truecrypt2 .Ed .Pp -A hidden volume whose existance can be plausibly denied and its outer volume +A hidden volume whose existence can be plausibly denied and its outer volume can for example be created with .Bd -ragged -offset indent .Nm Fl -create @@ -522,7 +522,7 @@ and options. Which volume is later accessed depends only on which passphrase and keyfile(s) are being used, -so that the existance of the hidden volume remains unknown without knowledge +so that the existence of the hidden volume remains unknown without knowledge of the passphrase and keyfile it is protected by since it is located within the outer volume. To map the outer volume without potentially damaging the hidden volume, diff --git a/tcplay.c b/tcplay.c index c268e6e..1b07cde 100644 --- a/tcplay.c +++ b/tcplay.c @@ -1882,7 +1882,7 @@ dm_setup(const char *mapname, struct tcplay_info *info) out: /* - * If an error occured, try to unroll changes made before it + * If an error occurred, try to unroll changes made before it * happened. */ if (ret) { diff --git a/tcplay_api_test.c b/tcplay_api_test.c index 3be7ae6..6944a14 100644 --- a/tcplay_api_test.c +++ b/tcplay_api_test.c @@ -55,4 +55,3 @@ main(void) return 0; } - diff --git a/test/features/step_definitions/libtcplay_steps.rb b/test/features/step_definitions/libtcplay_steps.rb index 2b45d22..0d716a1 100644 --- a/test/features/step_definitions/libtcplay_steps.rb +++ b/test/features/step_definitions/libtcplay_steps.rb @@ -209,7 +209,7 @@ r = TCplayLib.tc_api_task_info_get(task, "iv_offset", :size_t, 8, :pointer, buf) r.should == TCplayLib::TC_OK - @info['iv offset'] = "#{buf.get_int64(0)} bytes" + @info['iv offset'] = "#{buf.get_int64(0)} bytes" r = TCplayLib.tc_api_task_info_get(task, "block_offset", :size_t, 8, :pointer, buf) r.should == TCplayLib::TC_OK @@ -262,7 +262,7 @@ r = TCplayLib.tc_api_task_info_get(task, "iv_offset", :size_t, 8, :pointer, buf) r.should == TCplayLib::TC_OK - @info['iv offset'] = "#{buf.get_int64(0)} bytes" + @info['iv offset'] = "#{buf.get_int64(0)} bytes" r = TCplayLib.tc_api_task_info_get(task, "block_offset", :size_t, 8, :pointer, buf) r.should == TCplayLib::TC_OK diff --git a/test/features/step_definitions/tcplay_steps.rb b/test/features/step_definitions/tcplay_steps.rb index fbdb22d..d190f8c 100644 --- a/test/features/step_definitions/tcplay_steps.rb +++ b/test/features/step_definitions/tcplay_steps.rb @@ -89,7 +89,7 @@ @args << "-b #{s['cipher'].strip}" unless s['cipher'].nil? @args << "-x #{s['pbkdf_prf_hidden'].strip}" unless s['pbkdf_prf_hidden'].nil? @args << "-y #{s['cipher_hidden'].strip}" unless s['cipher_hidden'].nil? - + s['passphrase'] ||= '' s['passphrase_hidden'] ||= '' @@ -377,4 +377,3 @@ @files_to_delete.each { |f| File.unlink(f) } end - diff --git a/test/features/support/env.rb b/test/features/support/env.rb index 24b7d5a..80c63b6 100644 --- a/test/features/support/env.rb +++ b/test/features/support/env.rb @@ -120,4 +120,3 @@ def detach_all end end end - diff --git a/test/features/veracrypt_cli.feature b/test/features/veracrypt_cli.feature index 4c9ba5f..dcdc112 100644 --- a/test/features/veracrypt_cli.feature +++ b/test/features/veracrypt_cli.feature @@ -39,7 +39,6 @@ Feature: Command line info/map using VeraCrypt volumes | IV offset | 256 sectors | | Block offset | 256 sectors | - Scenario: Info about volume test_sha256.vc Given I request information about volume test_sha256.vc using the following settings: | passphrase | testtest | diff --git a/test/features/vol_test1_api.feature b/test/features/vol_test1_api.feature index 04bac37..bc881a0 100644 --- a/test/features/vol_test1_api.feature +++ b/test/features/vol_test1_api.feature @@ -15,8 +15,6 @@ Feature: API mapping/info tests using volume test1.tc | IV offset | 131072 bytes | | Block offset | 131072 bytes | - - Scenario: Map hidden volume Given I map volume test1.tc as tcplay_test with the API using the following settings: | passphrase | hidden | @@ -31,8 +29,6 @@ Feature: API mapping/info tests using volume test1.tc | IV offset | 15597568 bytes | | Block offset | 15597568 bytes | - - Scenario: Map outer volume protecting hidden volume Given I map volume test1.tc as tcplay_test with the API using the following settings: | passphrase | test | @@ -49,9 +45,7 @@ Feature: API mapping/info tests using volume test1.tc | IV offset | 131072 bytes | | Block offset | 131072 bytes | - - - Scenario: Info on outer volume + Scenario: Info on outer volume Given I request information about volume test1.tc with the API using the following settings: | passphrase | test | Then I expect tcplay to report the following: @@ -62,8 +56,6 @@ Feature: API mapping/info tests using volume test1.tc | IV offset | 131072 bytes | | Block offset | 131072 bytes | - - Scenario: Info on hidden volume Given I request information about volume test1.tc with the API using the following settings: | passphrase | hidden | @@ -75,8 +67,6 @@ Feature: API mapping/info tests using volume test1.tc | IV offset | 15597568 bytes | | Block offset | 15597568 bytes | - - Scenario: Info on outer volume protecting hidden volume Given I request information about volume test1.tc with the API using the following settings: | passphrase | test | @@ -89,4 +79,3 @@ Feature: API mapping/info tests using volume test1.tc | Volume size | 15466496 bytes | | IV offset | 131072 bytes | | Block offset | 131072 bytes | - diff --git a/test/features/vol_test1_cli.feature b/test/features/vol_test1_cli.feature index 946dd7f..2935468 100644 --- a/test/features/vol_test1_cli.feature +++ b/test/features/vol_test1_cli.feature @@ -15,8 +15,6 @@ Feature: Command line mapping/info tests using volume test1.tc | IV offset | 256 sectors | | Block offset | 256 sectors | - - Scenario: Map hidden volume Given I map volume test1.tc as tcplay_test using the following settings: | passphrase | hidden | @@ -31,8 +29,6 @@ Feature: Command line mapping/info tests using volume test1.tc | IV offset | 30464 sectors | | Block offset | 30464 sectors | - - Scenario: Map outer volume protecting hidden volume Given I map volume test1.tc as tcplay_test using the following settings: | passphrase | test | diff --git a/test/features/vol_test2_api.feature b/test/features/vol_test2_api.feature index 1b763c5..edcf5b7 100644 --- a/test/features/vol_test2_api.feature +++ b/test/features/vol_test2_api.feature @@ -17,8 +17,6 @@ Feature: API mapping/info tests using volume test2.tc | IV offset | 131072 bytes | | Block offset | 131072 bytes | - - Scenario: Map hidden volume Given I map volume test2.tc as tcplay_test with the API using the following settings: | passphrase | hidden | @@ -35,8 +33,6 @@ Feature: API mapping/info tests using volume test2.tc | IV offset | 4063232 bytes | | Block offset | 4063232 bytes | - - Scenario: Map outer volume protecting hidden volume Given I map volume test2.tc as tcplay_test with the API using the following settings: | passphrase | test | @@ -56,8 +52,6 @@ Feature: API mapping/info tests using volume test2.tc | IV offset | 131072 bytes | | Block offset | 131072 bytes | - - Scenario: Info on outer volume Given I request information about volume test2.tc with the API using the following settings: | passphrase | test | @@ -69,8 +63,6 @@ Feature: API mapping/info tests using volume test2.tc | IV offset | 131072 bytes | | Block offset | 131072 bytes | - - Scenario: Map hidden volume Given I request information about volume test2.tc with the API using the following settings: | passphrase | hidden | @@ -83,8 +75,6 @@ Feature: API mapping/info tests using volume test2.tc | IV offset | 4063232 bytes | | Block offset | 4063232 bytes | - - Scenario: Map outer volume protecting hidden volume Given I request information about volume test2.tc with the API using the following settings: | passphrase | test | diff --git a/test/features/vol_test2_cli.feature b/test/features/vol_test2_cli.feature index ce85257..f187e45 100644 --- a/test/features/vol_test2_cli.feature +++ b/test/features/vol_test2_cli.feature @@ -17,8 +17,6 @@ Feature: Command line mapping/info tests using volume test2.tc | IV offset | 256 sectors | | Block offset | 256 sectors | - - Scenario: Map hidden volume in test2.tc Given I map volume test2.tc as tcplay_test using the following settings: | passphrase | hidden | @@ -35,8 +33,6 @@ Feature: Command line mapping/info tests using volume test2.tc | IV offset | 7936 sectors | | Block offset | 7936 sectors | - - Scenario: Map outer volume protecting hidden volume in test2.tc Given I map volume test2.tc as tcplay_test using the following settings: | passphrase | test | diff --git a/test/reduce_test_vol.sh b/test/reduce_test_vol.sh index 2ec9e61..b5552b5 100755 --- a/test/reduce_test_vol.sh +++ b/test/reduce_test_vol.sh @@ -19,29 +19,27 @@ SRC_VOL=$1 DST_VOL=$2 # Find the total size of the source volume, in bytes. -SZ=`stat -c "%s" $SRC_VOL` +SZ=`stat -c "%s" "$SRC_VOL"` # Find the total size of the source volume, in blocks. -SZ_BLOCKS=`echo $SZ / 512 | bc` +SZ_BLOCKS=`echo "$SZ / 512" | bc` # Find the block at which the backup header area starts. -BCK_HDR_START=`echo $SZ_BLOCKS - 256 | bc` +BCK_HDR_START=`echo "$SZ_BLOCKS - 256" | bc` # Define the sizes of the header and backup header areas, # in blocks. HDR_AREA_BLOCKS=256 BCK_HDR_AREA_BLOCKS=256 - # Create new zero-filled volume with the same size as the # source volume. -dd if=/dev/zero of=$DST_VOL bs=512 count=$SZ_BLOCKS +dd if=/dev/zero of="$DST_VOL" bs=512 count="$SZ_BLOCKS" # Copy over the header area. -dd if=$SRC_VOL of=$DST_VOL bs=512 count=$HDR_AREA_BLOCKS \ +dd if="$SRC_VOL" of="$DST_VOL" bs=512 count="$HDR_AREA_BLOCKS" \ conv=notrunc # Copy over the backup header area. -dd if=$SRC_VOL of=$DST_VOL bs=512 count=$BCK_HDR_AREA_BLOCKS \ - conv=notrunc seek=$BCK_HDR_START skip=$BCK_HDR_START - +dd if="$SRC_VOL" of="$DST_VOL" bs=512 count="$BCK_HDR_AREA_BLOCKS" \ + conv=notrunc seek="$BCK_HDR_START" skip="$BCK_HDR_START" diff --git a/test/volumes/test2.desc b/test/volumes/test2.desc index 32d1530..1432e99 100644 --- a/test/volumes/test2.desc +++ b/test/volumes/test2.desc @@ -33,24 +33,24 @@ Filesystem: 5) Linux Ext4 Select [2]: 1 -Enter password: +Enter password: WARNING: Short passwords are easy to crack using brute force techniques! We recommend choosing a password consisting of more than 20 characters. Are you sure you want to use a short password? (y=Yes/n=No) [No]: y -Re-enter password: +Re-enter password: -Enter keyfile path [none]: +Enter keyfile path [none]: Please type at least 320 randomly chosen characters and then press Enter: Characters remaining: 172 Characters remaining: 33 -Done: 100.000% Speed: 11 MB/s Left: 0 s +Done: 100.000% Speed: 11 MB/s Left: 0 s The TrueCrypt volume has been successfully created. -21:21:29 alex-laptop:~/src/truecrypt-7.1a-source +21:21:29 alex-laptop:~/src/truecrypt-7.1a-source % Main/truecrypt -t -c Volume type: 1) Normal @@ -88,16 +88,16 @@ Filesystem: 5) Linux Ext4 Select [2]: 1 -Enter password: +Enter password: WARNING: Short passwords are easy to crack using brute force techniques! We recommend choosing a password consisting of more than 20 characters. Are you sure you want to use a short password? (y=Yes/n=No) [No]: yes -Re-enter password: +Re-enter password: Enter keyfile path [none]: /home/alex/src/tc-play/test/key.1 Enter keyfile path [finish]: /home/alex/src/tc-play/test/key.2 -Enter keyfile path [finish]: +Enter keyfile path [finish]: