Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spelling and shellcheck fixes #79

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -105,4 +105,3 @@ me know! Thanks to all the bug reporters as well.
their standard header files.

* Fixed typos

1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)

1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

1 change: 0 additions & 1 deletion crypto-dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -162,4 +162,3 @@ tc_crypto_init(void)

return 0;
}

1 change: 0 additions & 1 deletion generic_xts.c
Original file line number Diff line number Diff line change
Expand Up @@ -172,4 +172,3 @@ xts_uninit(struct xts_ctx *ctx)

return 0;
}

1 change: 0 additions & 1 deletion generic_xts.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);

2 changes: 1 addition & 1 deletion hdr.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 0 additions & 1 deletion humanize.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,3 @@

int _humanize_number(char *buf, size_t bufsz, uint64_t num);
int _dehumanize_number(const char *buf, uint64_t *dest);

4 changes: 2 additions & 2 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) \
Expand Down
1 change: 0 additions & 1 deletion pbkdf2-gcrypt.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,3 @@ pbkdf2(struct pbkdf_prf_algo *hash, const char *pass, int passlen,

return 0;
}

1 change: 0 additions & 1 deletion pbkdf2-openssl.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,3 @@ pbkdf2(struct pbkdf_prf_algo *hash, const char *pass, int passlen,

return 0;
}

12 changes: 6 additions & 6 deletions tcplay.3
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
6 changes: 3 additions & 3 deletions tcplay.8
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion tcplay.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
1 change: 0 additions & 1 deletion tcplay_api_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,3 @@ main(void)

return 0;
}

4 changes: 2 additions & 2 deletions test/features/step_definitions/libtcplay_steps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions test/features/step_definitions/tcplay_steps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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'] ||= ''

Expand Down Expand Up @@ -377,4 +377,3 @@

@files_to_delete.each { |f| File.unlink(f) }
end

1 change: 0 additions & 1 deletion test/features/support/env.rb
Original file line number Diff line number Diff line change
Expand Up @@ -120,4 +120,3 @@ def detach_all
end
end
end

1 change: 0 additions & 1 deletion test/features/veracrypt_cli.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand Down
13 changes: 1 addition & 12 deletions test/features/vol_test1_api.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand All @@ -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 |
Expand All @@ -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:
Expand All @@ -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 |
Expand All @@ -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 |
Expand All @@ -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 |

4 changes: 0 additions & 4 deletions test/features/vol_test1_cli.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand All @@ -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 |
Expand Down
10 changes: 0 additions & 10 deletions test/features/vol_test2_api.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand All @@ -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 |
Expand All @@ -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 |
Expand All @@ -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 |
Expand All @@ -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 |
Expand Down
4 changes: 0 additions & 4 deletions test/features/vol_test2_cli.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand All @@ -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 |
Expand Down
16 changes: 7 additions & 9 deletions test/reduce_test_vol.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Loading