mirror of
https://github.com/veracrypt/VeraCrypt.git
synced 2026-08-28 20:06:36 +00:00
Compare commits
384
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5db8cdb98f | ||
|
|
0cf2885e84 | ||
|
|
f9c3bcd384 | ||
|
|
96520e22bd | ||
|
|
ff0ab2da93 | ||
|
|
174f7f498a | ||
|
|
041024fbb9 | ||
|
|
a23943694b | ||
|
|
e760d69bfd | ||
|
|
c2d0d5e344 | ||
|
|
a06c41c5c9 | ||
|
|
ee511e95b2 | ||
|
|
8454c23fcc | ||
|
|
2aa558d6f4 | ||
|
|
0eeff69332 | ||
|
|
1a897f8714 | ||
|
|
d94304f419 | ||
|
|
4535aee30f | ||
|
|
6ca598f841 | ||
|
|
69a8ad5bba | ||
|
|
78aa7de9bc | ||
|
|
94ccaf1ab4 | ||
|
|
4fcf5c921c | ||
|
|
5158953428 | ||
|
|
63818bcaa4 | ||
|
|
88ef238593 | ||
|
|
046513b7c9 | ||
|
|
7d6cd0c92d | ||
|
|
103018b367 | ||
|
|
52146825de | ||
|
|
a43a5ebb21 | ||
|
|
8fc08b1e46 | ||
|
|
b23cbf384f | ||
|
|
2d0d4b06b1 | ||
|
|
944b6aa53f | ||
|
|
6ef41abdd2 | ||
|
|
7a01453f00 | ||
|
|
b809cf62ae | ||
|
|
0ddd19d4ab | ||
|
|
6a78f7eae2 | ||
|
|
724043be0b | ||
|
|
c3b77fba25 | ||
|
|
218f63b4b6 | ||
|
|
b4b51bd909 | ||
|
|
bef713de1a | ||
|
|
8f4b970dc1 | ||
|
|
439e0a9588 | ||
|
|
da8aec4292 | ||
|
|
d73df9bbd4 | ||
|
|
d734ce4635 | ||
|
|
2cd39b37c2 | ||
|
|
ea27cace41 | ||
|
|
9913af3a8e | ||
|
|
f927ce9b58 | ||
|
|
5d9d49e989 | ||
|
|
d31466ae7a | ||
|
|
7d55b028f2 | ||
|
|
44234a0ccc | ||
|
|
6be12f4889 | ||
|
|
b7eadfd310 | ||
|
|
a7a8d57bca | ||
|
|
00cd134720 | ||
|
|
c3c1bdd29d | ||
|
|
550e2bcf3b | ||
|
|
57343ce04c | ||
|
|
fdc2143bfa | ||
|
|
5867250820 | ||
|
|
70215e3682 | ||
|
|
8ebf5ac605 | ||
|
|
85e5e383f9 | ||
|
|
a8651ac014 | ||
|
|
1c08ea01f1 | ||
|
|
0d23312886 | ||
|
|
c44c1ac9ce | ||
|
|
32ba1ebcff | ||
|
|
138d22a254 | ||
|
|
330bed0c42 | ||
|
|
f72125ea71 | ||
|
|
4695920b41 | ||
|
|
e95c075f0c | ||
|
|
4a5154e750 | ||
|
|
b3646b3237 | ||
|
|
061292130d | ||
|
|
d1c1aa369c | ||
|
|
7d52dda67c | ||
|
|
0f2d32f011 | ||
|
|
a1f1e34789 | ||
|
|
eac440ae9e | ||
|
|
dc3bc64b86 | ||
|
|
9ccb8a97af | ||
|
|
bf8e07966b | ||
|
|
093fada00b | ||
|
|
4890a65106 | ||
|
|
2ec75c5f8e | ||
|
|
29501638d1 | ||
|
|
856395962b | ||
|
|
bb2149aac8 | ||
|
|
8e4a68af3b | ||
|
|
4a8040735b | ||
|
|
ae28d51016 | ||
|
|
32f11001c0 | ||
|
|
a0ebc22d1f | ||
|
|
9159a0777d | ||
|
|
0718a4ec20 | ||
|
|
f2cda804dc | ||
|
|
b68fec97ea | ||
|
|
eefaefccc0 | ||
|
|
2784652ab8 | ||
|
|
a284922ce4 | ||
|
|
c4d30b34ba | ||
|
|
a5203dd006 | ||
|
|
474505d704 | ||
|
|
d3db2548b5 | ||
|
|
f397f70fbe | ||
|
|
ae5867f8b1 | ||
|
|
ec4be21492 | ||
|
|
ed604cf0f3 | ||
|
|
ef196b5ca5 | ||
|
|
279c99fdf8 | ||
|
|
f80f7d47d5 | ||
|
|
8e6707cc22 | ||
|
|
f09f8e3a31 | ||
|
|
21be04cb6e | ||
|
|
ba1e9c8f4d | ||
|
|
6e73a8a393 | ||
|
|
176bec1bb2 | ||
|
|
31b238872e | ||
|
|
b730e965c5 | ||
|
|
a916135f3c | ||
|
|
b2020c9fb7 | ||
|
|
188b459d28 | ||
|
|
39bf211ebe | ||
|
|
06af5ce7fd | ||
|
|
7fb5af6ada | ||
|
|
cb9859fa0e | ||
|
|
717ffadf93 | ||
|
|
419586d4a2 | ||
|
|
450cde5fac | ||
|
|
b2d119f781 | ||
|
|
7818c0e0e3 | ||
|
|
86529dadde | ||
|
|
544c55debc | ||
|
|
2b826843de | ||
|
|
b920bb2a6a | ||
|
|
5012e0941a | ||
|
|
1eb8aec9fa | ||
|
|
2b8aa2df16 | ||
|
|
5f252f2c50 | ||
|
|
d5f34ad49d | ||
|
|
608e86c7bc | ||
|
|
516da2229d | ||
|
|
28a9eaf0e3 | ||
|
|
de0c30dded | ||
|
|
1ab00f3e3c | ||
|
|
651bea29b4 | ||
|
|
4e03adc2e7 | ||
|
|
d1a3316e44 | ||
|
|
2c96d17748 | ||
|
|
ad4af09d88 | ||
|
|
96b39a5973 | ||
|
|
b16cfa959d | ||
|
|
f98a691933 | ||
|
|
35497f87a7 | ||
|
|
d01fa11983 | ||
|
|
3d8d088b06 | ||
|
|
89a9763b11 | ||
|
|
1efb782666 | ||
|
|
38f3fc816a | ||
|
|
3794df4f31 | ||
|
|
3502681f77 | ||
|
|
8252cc3ec7 | ||
|
|
6a254778e2 | ||
|
|
41607d126a | ||
|
|
f53554a46a | ||
|
|
03e64e842a | ||
|
|
2894bade88 | ||
|
|
cc02c78a8c | ||
|
|
4f56a0a53d | ||
|
|
cbc28bd4fe | ||
|
|
9a31c23881 | ||
|
|
55b3400afa | ||
|
|
8f5fd67ff3 | ||
|
|
ad9b40d599 | ||
|
|
271d39d942 | ||
|
|
696166c9d4 | ||
|
|
aba8840625 | ||
|
|
ac981c62c5 | ||
|
|
41c12afefd | ||
|
|
7c050d681d | ||
|
|
c178e325b8 | ||
|
|
8d787dcd71 | ||
|
|
25c3d15ed7 | ||
|
|
ec9ff0fc1d | ||
|
|
9a228ff045 | ||
|
|
a8cc93f995 | ||
|
|
2b1a166d23 | ||
|
|
a27792cfcf | ||
|
|
e18f3cf381 | ||
|
|
f4c864e88e | ||
|
|
a8112b8373 | ||
|
|
2dbbd6b9d2 | ||
|
|
c92d51e040 | ||
|
|
258ba629a2 | ||
|
|
d90d9f0c40 | ||
|
|
bbcc944855 | ||
|
|
e1157ea935 | ||
|
|
9267450346 | ||
|
|
bb5e96a679 | ||
|
|
b8373ae933 | ||
|
|
5ef923f26c | ||
|
|
7a89f0f0e1 | ||
|
|
496701851f | ||
|
|
4b9f8b232b | ||
|
|
02cbecff64 | ||
|
|
fbe1bbaffd | ||
|
|
94737b2a7a | ||
|
|
07156b6c09 | ||
|
|
18dc75ee62 | ||
|
|
a3f7bcf45b | ||
|
|
c98400a2b7 | ||
|
|
5b151492bd | ||
|
|
c27461572c | ||
|
|
6349162303 | ||
|
|
e935ec55dd | ||
|
|
d328269492 | ||
|
|
134ef04140 | ||
|
|
c8c8cc517d | ||
|
|
e673006969 | ||
|
|
520d885840 | ||
|
|
eb9cb16aeb | ||
|
|
32e72d1117 | ||
|
|
fd0e434087 | ||
|
|
84a279a83f | ||
|
|
9a6b371c96 | ||
|
|
078614fbce | ||
|
|
ec327c006e | ||
|
|
03afe1224a | ||
|
|
11013ce71e | ||
|
|
a185b540bd | ||
|
|
a5df5d981a | ||
|
|
dfff927389 | ||
|
|
e6ebc63c66 | ||
|
|
f31c7b3a88 | ||
|
|
bc9005968a | ||
|
|
b2438b5029 | ||
|
|
51fa86b246 | ||
|
|
b5dfe9c9ed | ||
|
|
c3353c71d4 | ||
|
|
de93034485 | ||
|
|
f1a596109b | ||
|
|
2c6e9fc15c | ||
|
|
ce7fab744b | ||
|
|
65e4b3a91b | ||
|
|
2cdfbd2703 | ||
|
|
81b9e28993 | ||
|
|
d7498fae01 | ||
|
|
3c471383d9 | ||
|
|
0a09314336 | ||
|
|
b0bb124772 | ||
|
|
f7d8e565b4 | ||
|
|
3f2e20e339 | ||
|
|
714a2ce0ae | ||
|
|
c1378f781a | ||
|
|
c61f8c70de | ||
|
|
e1a0826ef5 | ||
|
|
9c1ddff7e3 | ||
|
|
ea03100d9e | ||
|
|
067394d110 | ||
|
|
f05f6a00a6 | ||
|
|
905a3ff4a5 | ||
|
|
922a09b634 | ||
|
|
f043e6cbf0 | ||
|
|
68f16dae24 | ||
|
|
f38cf0b694 | ||
|
|
bd7d151abf | ||
|
|
2fe23a3fa3 | ||
|
|
effb5c7c1e | ||
|
|
50ca9fe46f | ||
|
|
0178a6d33f | ||
|
|
411e8599f3 | ||
|
|
b80ee2b7b9 | ||
|
|
8a028aca45 | ||
|
|
fb12b635ed | ||
|
|
d761e95133 | ||
|
|
f7d783dda8 | ||
|
|
ccbc2cff0b | ||
|
|
809394d383 | ||
|
|
7c501359b3 | ||
|
|
f82e16f0a1 | ||
|
|
4fa4d6d227 | ||
|
|
e0efb36f33 | ||
|
|
ef4355acf8 | ||
|
|
5fcb262539 | ||
|
|
d6aa653648 | ||
|
|
6de2c143b9 | ||
|
|
9083f95db0 | ||
|
|
03cf7cc566 | ||
|
|
f158df394e | ||
|
|
bb7ef68040 | ||
|
|
37891c2bb0 | ||
|
|
3e2cf28d92 | ||
|
|
92af806488 | ||
|
|
ce44ad4c57 | ||
|
|
a857f6c087 | ||
|
|
0d6443e05a | ||
|
|
41a31ac76f | ||
|
|
4fefd61cee | ||
|
|
8ee17fd727 | ||
|
|
7aceaf124e | ||
|
|
f143182cbc | ||
|
|
f94707e4ef | ||
|
|
73bf608efc | ||
|
|
6688c9d85a | ||
|
|
e8fbc912ce | ||
|
|
80a26745a6 | ||
|
|
88b4628c34 | ||
|
|
ee9f3101fd | ||
|
|
cb6dad6bd2 | ||
|
|
4d8d59c23d | ||
|
|
1c11ee428d | ||
|
|
97154aaf51 | ||
|
|
1ddae20932 | ||
|
|
a5c1978eef | ||
|
|
75f7808719 | ||
|
|
0594532cf1 | ||
|
|
c220db0128 | ||
|
|
c01f392a7b | ||
|
|
bbc738c490 | ||
|
|
8bf58486af | ||
|
|
ba733dd032 | ||
|
|
016edc150b | ||
|
|
5c1db9d0e1 | ||
|
|
f3625a080f | ||
|
|
3137d36d9a | ||
|
|
516fda09a7 | ||
|
|
626a3aedd7 | ||
|
|
c7c8e28655 | ||
|
|
469f1dba40 | ||
|
|
515495f2f3 | ||
|
|
7bb812af66 | ||
|
|
9d027b02b9 | ||
|
|
899a22b840 | ||
|
|
5281e2d3b9 | ||
|
|
2a288a7e12 | ||
|
|
f67748ae8e | ||
|
|
d6817f941a | ||
|
|
f19cfb3361 | ||
|
|
9bb962c8bb | ||
|
|
0dda93ca47 | ||
|
|
c2d4bf6207 | ||
|
|
a9404c2bff | ||
|
|
5218b6dfe8 | ||
|
|
41a22ca4e7 | ||
|
|
17823cb58c | ||
|
|
a81790329f | ||
|
|
4b6594325f | ||
|
|
e1de322ed3 | ||
|
|
b6dc9e9e15 | ||
|
|
b9e34c30e8 | ||
|
|
95c6072a57 | ||
|
|
859393caf1 | ||
|
|
437cbd9c8b | ||
|
|
f34d894f6e | ||
|
|
7875d3ec3f | ||
|
|
f701dc1c29 | ||
|
|
bacd720279 | ||
|
|
31fd16979f | ||
|
|
4d12001e10 | ||
|
|
084a8ee85c | ||
|
|
c386beb69c | ||
|
|
be4ca4bac6 | ||
|
|
0c95ed3691 | ||
|
|
a27f345832 | ||
|
|
08e653c926 | ||
|
|
751a454e6c | ||
|
|
9b19baf73e | ||
|
|
5ebd79745d | ||
|
|
1763e8a2ba | ||
|
|
49f679ca53 | ||
|
|
edc9f36322 | ||
|
|
34370b9933 | ||
|
|
7ffce028d0 | ||
|
|
97011f179c | ||
|
|
235f0b85ea |
+503
@@ -0,0 +1,503 @@
|
||||
TrueCrypt License Version 3.0
|
||||
|
||||
Software distributed under this license is distributed on an "AS
|
||||
IS" BASIS WITHOUT WARRANTIES OF ANY KIND. THE AUTHORS AND
|
||||
DISTRIBUTORS OF THE SOFTWARE DISCLAIM ANY LIABILITY. ANYONE WHO
|
||||
USES, COPIES, MODIFIES, OR (RE)DISTRIBUTES ANY PART OF THE
|
||||
SOFTWARE IS, BY SUCH ACTION(S), ACCEPTING AND AGREEING TO BE
|
||||
BOUND BY ALL TERMS AND CONDITIONS OF THIS LICENSE. IF YOU DO NOT
|
||||
ACCEPT THEM, DO NOT USE, COPY, MODIFY, NOR (RE)DISTRIBUTE THE
|
||||
SOFTWARE, NOR ANY PART(S) THEREOF.
|
||||
|
||||
|
||||
I. Definitions
|
||||
|
||||
1. "This Product" means the work (including, but not limited to,
|
||||
source code, graphics, texts, and accompanying files) made
|
||||
available under and governed by this version of this license
|
||||
("License"), as may be indicated by, but is not limited to,
|
||||
copyright notice(s) attached to or included in the work.
|
||||
|
||||
2. "You" means (and "Your" refers to) an individual or a legal
|
||||
entity (e.g., a non-profit organization, commercial
|
||||
organization, government agency, etc.) exercising permissions
|
||||
granted by this License.
|
||||
|
||||
3. "Modification" means (and "modify" refers to) any alteration
|
||||
of This Product, including, but not limited to, addition to or
|
||||
deletion from the substance or structure of This Product,
|
||||
translation into another language, repackaging, alteration or
|
||||
removal of any file included with This Product, and addition of
|
||||
any new files to This Product.
|
||||
|
||||
4. "Your Product" means This Product modified by You, or any
|
||||
work You derive from (or base on) any part of This Product. In
|
||||
addition, "Your Product" means any work in which You include any
|
||||
(modified or unmodified) portion of This Product. However, if
|
||||
the work in which you include it is an aggregate software
|
||||
distribution (such as an operating system distribution or a
|
||||
cover CD-ROM of a magazine) containing multiple separate
|
||||
products, then the term "Your Product" includes only those
|
||||
products (in the aggregate software distribution) that use,
|
||||
include, or depend on a modified or unmodified version of This
|
||||
Product (and the term "Your Product" does not include the whole
|
||||
aggregate software distribution). For the purposes of this
|
||||
License, a product suite consisting of two or more products is
|
||||
considered a single product (operating system distributions and
|
||||
cover media of magazines are not considered product suites).
|
||||
|
||||
5. "Distribution" means (and "distribute" refers to), regardless
|
||||
of means or methods, conveyance, transfer, providing, or making
|
||||
available of This/Your Product or portions thereof to third
|
||||
parties (including, but not limited to, making This/Your
|
||||
Product, or portions thereof, available for download to third
|
||||
parties, whether or not any third party has downloaded the
|
||||
product, or any portion thereof, made available for download).
|
||||
|
||||
|
||||
|
||||
II. Use, Copying, and Distribution of This Product
|
||||
|
||||
1. Provided that You comply with all applicable terms and
|
||||
conditions of this License, You may make copies of This Product
|
||||
(unmodified) and distribute copies of This Product (unmodified)
|
||||
that are not included in another product forming Your Product
|
||||
(except as permitted under Chapter III). Note: For terms and
|
||||
conditions for copying and distribution of modified versions of
|
||||
This Product, see Chapter III.
|
||||
|
||||
2. Provided that You comply with all applicable terms and
|
||||
conditions of this License, You may use This Product freely (see
|
||||
also Chapter III) on any number of computers/systems for non-
|
||||
commercial and/or commercial purposes.
|
||||
|
||||
|
||||
|
||||
III. Modification, Derivation, and Inclusion in Other Products
|
||||
|
||||
1. If all conditions specified in the following paragraphs in
|
||||
this Chapter (III) are met (for exceptions, see Section III.2)
|
||||
and if You comply with all other applicable terms and conditions
|
||||
of this License, You may modify This Product (thus forming Your
|
||||
Product), derive new works from This Product or portions thereof
|
||||
(thus forming Your Product), include This Product or portions
|
||||
thereof in another product (thus forming Your Product, unless
|
||||
defined otherwise in Chapter I), and You may use (for non-
|
||||
commercial and/or commercial purposes), copy, and/or distribute
|
||||
Your Product.
|
||||
|
||||
a. The name of Your Product (or of Your modified version of
|
||||
This Product) must not contain the name TrueCrypt (for
|
||||
example, the following names are not allowed: TrueCrypt,
|
||||
TrueCrypt+, TrueCrypt Professional, iTrueCrypt, etc.) nor
|
||||
any other names confusingly similar to the name TrueCrypt
|
||||
(e.g., True-Crypt, True Crypt, TruKrypt, etc.)
|
||||
|
||||
All occurrences of the name TrueCrypt that could reasonably
|
||||
be considered to identify Your Product must be removed from
|
||||
Your Product and from any associated materials. Logo(s)
|
||||
included in (or attached to) Your Product (and in/to
|
||||
associated materials) must not incorporate and must not be
|
||||
confusingly similar to any of the TrueCrypt logos
|
||||
(including, but not limited to, the non-textual logo
|
||||
consisting primarily of a key in stylized form) or
|
||||
portion(s) thereof. All graphics contained in This Product
|
||||
(logos, icons, etc.) must be removed from Your Product (or
|
||||
from Your modified version of This Product) and from any
|
||||
associated materials.
|
||||
|
||||
b. The following phrases must be removed from Your Product
|
||||
and from any associated materials, except the text of this
|
||||
License: "A TrueCrypt Foundation Release", "Released by
|
||||
TrueCrypt Foundation", "This is a TrueCrypt Foundation
|
||||
release."
|
||||
|
||||
c. Phrase "Based on TrueCrypt, freely available at
|
||||
http://www.truecrypt.org/" must be displayed by Your Product
|
||||
(if technically feasible) and contained in its
|
||||
documentation. Alternatively, if This Product or its portion
|
||||
You included in Your Product constitutes only a minor
|
||||
portion of Your Product, phrase "Portions of this product
|
||||
are based in part on TrueCrypt, freely available at
|
||||
http://www.truecrypt.org/" may be displayed instead. In each
|
||||
of the cases mentioned above in this paragraph,
|
||||
"http://www.truecrypt.org/" must be a hyperlink (if
|
||||
technically feasible) pointing to http://www.truecrypt.org/
|
||||
and You may freely choose the location within the user
|
||||
interface (if there is any) of Your Product (e.g., an
|
||||
"About" window, etc.) and the way in which Your Product will
|
||||
display the respective phrase.
|
||||
|
||||
Your Product (and any associated materials, e.g., the
|
||||
documentation, the content of the official web site of Your
|
||||
Product, etc.) must not present any Internet address
|
||||
containing the domain name truecrypt.org (or any domain name
|
||||
that forwards to the domain name truecrypt.org) in a manner
|
||||
that might suggest that it is where information about Your
|
||||
Product may be obtained or where bugs found in Your Product
|
||||
may be reported or where support for Your Product may be
|
||||
available or otherwise attempt to indicate that the domain
|
||||
name truecrypt.org is associated with Your Product.
|
||||
|
||||
d. The complete source code of Your Product must be freely
|
||||
and publicly available (for exceptions, see Section III.2)
|
||||
at least until You cease to distribute Your Product. This
|
||||
condition can be met in one or both of the following ways:
|
||||
(i) You include the complete source code of Your Product
|
||||
with every copy of Your Product that You make and distribute
|
||||
and You make all such copies of Your Product available to
|
||||
the general public free of charge, and/or (ii) You include
|
||||
information (valid and correct at least until You cease to
|
||||
distribute Your Product) about where the complete source
|
||||
code of Your Product can be obtained free of charge (e.g.,
|
||||
an Internet address) or for a reasonable reproduction fee
|
||||
with every copy of Your Product that You make and distribute
|
||||
and, if there is a web site officially associated with Your
|
||||
Product, You include the aforementioned information about
|
||||
the source code on a freely and publicly accessible web
|
||||
page to which such web site links via an easily viewable
|
||||
hyperlink (at least until You cease to distribute Your
|
||||
Product).
|
||||
|
||||
The source code of Your Product must not be deliberately
|
||||
obfuscated and it must not be in an intermediate form (e.g.,
|
||||
the output of a preprocessor). Source code means the
|
||||
preferred form in which a programmer would usually modify
|
||||
the program.
|
||||
|
||||
Portions of the source code of Your Product not contained in
|
||||
This Product (e.g., portions added by You in creating Your
|
||||
Product, whether created by You or by third parties) must be
|
||||
available under license(s) that (however, see also
|
||||
Subsection III.1.e) allow(s) anyone to modify and derive new
|
||||
works from the portions of the source code that are not
|
||||
contained in This Product and to use, copy, and redistribute
|
||||
such modifications and/or derivative works. The license(s)
|
||||
must be perpetual, non-exclusive, royalty-free, no-charge,
|
||||
and worldwide, and must not invalidate, weaken, restrict,
|
||||
interpret, amend, modify, interfere with or otherwise affect
|
||||
any part, term, provision, or clause of this License. The
|
||||
text(s) of the license(s) must be included with every copy
|
||||
of Your Product that You make and distribute.
|
||||
|
||||
e. You must not change the license terms of This Product in
|
||||
any way (adding any new terms is considered changing the
|
||||
license terms even if the original terms are retained),
|
||||
which means, e.g., that no part of This Product may be put
|
||||
under another license. You must keep intact all the legal
|
||||
notices contained in the source code files. You must include
|
||||
the following items with every copy of Your Product that You
|
||||
make and distribute: a clear and conspicuous notice stating
|
||||
that Your Product or portion(s) thereof is/are governed by
|
||||
this version of the TrueCrypt License, a verbatim copy of
|
||||
this version of the TrueCrypt License (as contained herein),
|
||||
a clear and conspicuous notice containing information about
|
||||
where the included copy of the License can be found, and an
|
||||
appropriate copyright notice.
|
||||
|
||||
|
||||
2. You are not obligated to comply with Subsection III.1.d if
|
||||
Your Product is not distributed (i.e., Your Product is available
|
||||
only to You).
|
||||
|
||||
|
||||
|
||||
IV. Disclaimer of Liability, Disclaimer of Warranty,
|
||||
Indemnification
|
||||
|
||||
You expressly acknowledge and agree to the following:
|
||||
|
||||
1. IN NO EVENT WILL ANY (CO)AUTHOR OF THIS PRODUCT, OR ANY
|
||||
APPLICABLE INTELLECTUAL-PROPERTY OWNER, OR ANY OTHER PARTY WHO
|
||||
MAY COPY AND/OR (RE)DISTRIBUTE THIS PRODUCT OR PORTIONS THEREOF,
|
||||
AS MAY BE PERMITTED HEREIN, BE LIABLE TO YOU OR TO ANY OTHER
|
||||
PARTY FOR ANY DAMAGES, INCLUDING, BUT NOT LIMITED TO, ANY
|
||||
DIRECT, INDIRECT, GENERAL, SPECIAL, INCIDENTAL, PUNITIVE,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
|
||||
TO, CORRUPTION OR LOSS OF DATA, ANY LOSSES SUSTAINED BY YOU OR
|
||||
THIRD PARTIES, A FAILURE OF THIS PRODUCT TO OPERATE WITH ANY
|
||||
OTHER PRODUCT, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR
|
||||
BUSINESS INTERRUPTION), WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
TORT (INCLUDING, BUT NOT LIMITED TO, NEGLIGENCE) OR OTHERWISE,
|
||||
ARISING OUT OF THE USE, COPYING, MODIFICATION, OR
|
||||
(RE)DISTRIBUTION OF THIS PRODUCT (OR A PORTION THEREOF) OR OF
|
||||
YOUR PRODUCT (OR A PORTION THEREOF), OR INABILITY TO USE THIS
|
||||
PRODUCT (OR A PORTION THEREOF), EVEN IF SUCH DAMAGES (OR THE
|
||||
POSSIBILITY OF SUCH DAMAGES) ARE/WERE PREDICTABLE OR KNOWN TO
|
||||
ANY (CO)AUTHOR, INTELLECTUAL-PROPERTY OWNER, OR ANY OTHER PARTY.
|
||||
|
||||
2. THIS PRODUCT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
|
||||
KIND, WHETHER EXPRESS, IMPLIED, OR STATUTORY, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
|
||||
PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THE ENTIRE RISK AS TO
|
||||
THE QUALITY AND PERFORMANCE OF THIS PRODUCT IS WITH YOU. SHOULD
|
||||
THIS PRODUCT PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL
|
||||
NECESSARY SERVICING, REPAIR, OR CORRECTION.
|
||||
|
||||
3. THIS PRODUCT MAY INCORPORATE IMPLEMENTATIONS OF CRYPTOGRAPHIC
|
||||
ALGORITHMS THAT ARE REGULATED (E.G., SUBJECT TO EXPORT/IMPORT
|
||||
CONTROL REGULATIONS) OR ILLEGAL IN SOME COUNTRIES. IT IS SOLELY
|
||||
YOUR RESPONSIBILITY TO VERIFY THAT IT IS LEGAL TO IMPORT AND/OR
|
||||
(RE)EXPORT AND/OR USE THIS PRODUCT (OR PORTIONS THEREOF) IN
|
||||
COUNTRIES WHERE YOU INTEND TO USE IT AND/OR TO WHICH YOU INTEND
|
||||
TO IMPORT IT AND/OR FROM WHICH YOU INTEND TO EXPORT IT, AND IT
|
||||
IS SOLELY YOUR RESPONSIBILITY TO COMPLY WITH ANY APPLICABLE
|
||||
REGULATIONS, RESTRICTIONS, AND LAWS.
|
||||
|
||||
4. YOU SHALL INDEMNIFY, DEFEND AND HOLD ALL (CO)AUTHORS OF THIS
|
||||
PRODUCT, AND APPLICABLE INTELLECTUAL-PROPERTY OWNERS, HARMLESS
|
||||
FROM AND AGAINST ANY AND ALL LIABILITY, DAMAGES, LOSSES,
|
||||
SETTLEMENTS, PENALTIES, FINES, COSTS, EXPENSES (INCLUDING
|
||||
REASONABLE ATTORNEYS' FEES), DEMANDS, CAUSES OF ACTION, CLAIMS,
|
||||
ACTIONS, PROCEEDINGS, AND SUITS, DIRECTLY RELATED TO OR ARISING
|
||||
OUT OF YOUR USE, INABILITY TO USE, COPYING, (RE)DISTRIBUTION,
|
||||
IMPORT AND/OR (RE)EXPORT OF THIS PRODUCT (OR PORTIONS THEREOF)
|
||||
AND/OR YOUR BREACH OF ANY TERM OF THIS LICENSE.
|
||||
|
||||
|
||||
|
||||
V. Trademarks
|
||||
|
||||
This License does not grant permission to use trademarks
|
||||
associated with (or applying to) This Product, except for fair
|
||||
use as defined by applicable law and except for use expressly
|
||||
permitted or required by this License. Any attempt otherwise to
|
||||
use trademarks associated with (or applying to) This Product
|
||||
automatically and immediately terminates Your rights under This
|
||||
License and may constitute trademark infringement (which may be
|
||||
prosecuted).
|
||||
|
||||
|
||||
|
||||
VI. General Terms and Conditions, Miscellaneous Provisions
|
||||
|
||||
1. ANYONE WHO USES AND/OR COPIES AND/OR MODIFIES AND/OR CREATES
|
||||
DERIVATIVE WORKS OF AND/OR (RE)DISTRIBUTES THIS PRODUCT, OR ANY
|
||||
PORTION(S) THEREOF, IS, BY SUCH ACTION(S), AGREEING TO BE BOUND
|
||||
BY AND ACCEPTING ALL TERMS AND CONDITIONS OF THIS LICENSE (AND
|
||||
THE RESPONSIBILITIES AND OBLIGATIONS CONTAINED IN THIS LICENSE).
|
||||
IF YOU DO NOT ACCEPT (AND AGREE TO BE BOUND BY) ALL TERMS AND
|
||||
CONDITIONS OF THIS LICENSE, DO NOT USE, COPY, MODIFY, CREATE
|
||||
DERIVATIVE WORKS OF, NOR (RE)DISTRIBUTE THIS PRODUCT, NOR ANY
|
||||
PORTION(S) THEREOF.
|
||||
|
||||
2. YOU MAY NOT USE, MODIFY, COPY, CREATE DERIVATIVE WORKS OF,
|
||||
(RE)DISTRIBUTE, OR SUBLICENSE THIS PRODUCT, OR PORTION(S)
|
||||
THEREOF, EXCEPT AS EXPRESSLY PROVIDED IN THIS LICENSE (EVEN IF
|
||||
APPLICABLE LAW GIVES YOU MORE RIGHTS). ANY ATTEMPT (EVEN IF
|
||||
PERMITTED BY APPLICABLE LAW) OTHERWISE TO USE, MODIFY, COPY,
|
||||
CREATE DERIVATIVE WORKS OF, (RE)DISTRIBUTE, OR SUBLICENSE THIS
|
||||
PRODUCT, OR PORTION(S) THEREOF, AUTOMATICALLY AND IMMEDIATELY
|
||||
TERMINATES YOUR RIGHTS UNDER THIS LICENSE AND CAN CONSTITUTE
|
||||
COPYRIGHT INFRINGEMENT (WHICH MAY BE PROSECUTED). ANY CONDITIONS
|
||||
AND RESTRICTIONS CONTAINED IN THIS LICENSE ARE ALSO LIMITATIONS
|
||||
ON THE SCOPE OF THIS LICENSE AND ALSO DEFINE THE SCOPE OF YOUR
|
||||
RIGHTS UNDER THIS LICENSE. YOUR FAILURE TO COMPLY WITH THE TERMS
|
||||
AND CONDITIONS OF THIS LICENSE OR FAILURE TO PERFORM ANY
|
||||
APPLICABLE OBLIGATION IMPOSED BY THIS LICENSE AUTOMATICALLY AND
|
||||
IMMEDIATELY TERMINATES YOUR RIGHTS UNDER THIS LICENSE AND CAN
|
||||
CAUSE OR BE CONSIDERED COPYRIGHT INFRINGEMENT (WHICH MAY BE
|
||||
PROSECUTED). NOTHING IN THIS LICENSE SHALL IMPLY OR BE CONSTRUED
|
||||
AS A PROMISE, OBLIGATION, OR COVENANT NOT TO SUE FOR COPYRIGHT
|
||||
OR TRADEMARK INFRINGEMENT IF YOU DO NOT COMPLY WITH THE TERMS
|
||||
AND CONDITIONS OF THIS LICENSE.
|
||||
|
||||
3. This License does not constitute or imply a waiver of any
|
||||
intellectual property rights except as may be otherwise
|
||||
expressly provided in this License. This License does not
|
||||
transfer, assign, or convey any intellectual property rights
|
||||
(e.g., it does not transfer ownership of copyrights or
|
||||
trademarks).
|
||||
|
||||
4. Subject to the terms and conditions of this License, You may
|
||||
allow a third party to use Your copy of This Product (or a copy
|
||||
that You make and distribute, or Your Product) provided that the
|
||||
third party explicitly accepts and agrees to be bound by all
|
||||
terms and conditions of this License and the third party is not
|
||||
prohibited from using This Product (or portions thereof) by this
|
||||
License (see, e.g., Section VI.7) or by applicable law. However,
|
||||
You are not obligated to ensure that the third party accepts
|
||||
(and agrees to be bound by all terms of) this License if You
|
||||
distribute only the self-extracting package (containing This
|
||||
Product) that does not allow the user to install (nor extract)
|
||||
the files contained in the package until he or she accepts and
|
||||
agrees to be bound by all terms and conditions of this License.
|
||||
|
||||
5. Without specific prior written permission from the authors of
|
||||
This Product (or from their common representative), You must not
|
||||
use the name of This Product, the names of the authors of This
|
||||
Product, or the names of the legal entities (or informal groups)
|
||||
of which the authors were/are members/employees, to endorse or
|
||||
promote Your Product or any work in which You include a modified
|
||||
or unmodified version of This Product, or to endorse or promote
|
||||
You or Your affiliates, or in a way that might suggest that Your
|
||||
Product (or any work in which You include a modified or
|
||||
unmodified version of This Product), You, or Your affiliates
|
||||
is/are endorsed by one or more authors of This Product, or in a
|
||||
way that might suggest that one or more authors of This Product
|
||||
is/are affiliated with You (or Your affiliates) or directly
|
||||
participated in the creation of Your Product or of any work in
|
||||
which You include a modified or unmodified version of This
|
||||
Product.
|
||||
|
||||
6. IF YOU ARE NOT SURE WHETHER YOU UNDERSTAND ALL PARTS OF THIS
|
||||
LICENSE OR IF YOU ARE NOT SURE WHETHER YOU CAN COMPLY WITH ALL
|
||||
TERMS AND CONDITIONS OF THIS LICENSE, YOU MUST NOT USE, COPY,
|
||||
MODIFY, CREATE DERIVATIVE WORKS OF, NOR (RE)DISTRIBUTE THIS
|
||||
PRODUCT, NOR ANY PORTION(S) OF IT. YOU SHOULD CONSULT WITH A
|
||||
LAWYER.
|
||||
|
||||
7. IF (IN RELEVANT CONTEXT) ANY PROVISION OF CHAPTER IV OF THIS
|
||||
LICENSE IS UNENFORCEABLE, INVALID, OR PROHIBITED UNDER
|
||||
APPLICABLE LAW IN YOUR JURISDICTION, YOU HAVE NO RIGHTS UNDER
|
||||
THIS LICENSE AND YOU MUST NOT USE, COPY, MODIFY, CREATE
|
||||
DERIVATIVE WORKS OF, NOR (RE)DISTRIBUTE THIS PRODUCT, NOR ANY
|
||||
PORTION(S) THEREOF.
|
||||
|
||||
8. Except as otherwise provided in this License, if any
|
||||
provision of this License, or a portion thereof, is found to be
|
||||
invalid or unenforceable under applicable law, it shall not
|
||||
affect the validity or enforceability of the remainder of this
|
||||
License, and such invalid or unenforceable provision shall be
|
||||
construed to reflect the original intent of the provision and
|
||||
shall be enforced to the maximum extent permitted by applicable
|
||||
law so as to effect the original intent of the provision as
|
||||
closely as possible.
|
||||
|
||||
____________________________________________________________
|
||||
|
||||
|
||||
Third-Party Licenses
|
||||
|
||||
This Product contains components that were created by third
|
||||
parties and that are governed by third-party licenses, which are
|
||||
contained hereinafter (separated by lines consisting of
|
||||
underscores). Each of the third-party licenses applies only to
|
||||
(portions of) the source code file(s) in which the third-party
|
||||
license is contained or in which it is explicitly referenced,
|
||||
and to compiled or otherwise processed forms of such source
|
||||
code. None of the third-party licenses applies to This Product
|
||||
as a whole, even when it uses terms such as "product",
|
||||
"program", or any other equivalent terms/phrases. This Product
|
||||
as a whole is governed by the TrueCrypt License (see above).
|
||||
Some of the third-party components have been modified by the
|
||||
authors of This Product. Unless otherwise stated, such
|
||||
modifications and additions are governed by the TrueCrypt
|
||||
License (see above). Note: Unless otherwise stated, graphics and
|
||||
files that are not part of the source code are governed by the
|
||||
TrueCrypt License.
|
||||
|
||||
____________________________________________________________
|
||||
|
||||
License agreement for Encryption for the Masses.
|
||||
|
||||
Copyright (C) 1998-2000 Paul Le Roux. All Rights Reserved.
|
||||
|
||||
This product can be copied and distributed free of charge,
|
||||
including source code.
|
||||
|
||||
You may modify this product and source code, and distribute such
|
||||
modifications, and you may derive new works based on this
|
||||
product, provided that:
|
||||
|
||||
1. Any product which is simply derived from this product cannot
|
||||
be called E4M, or Encryption for the Masses.
|
||||
|
||||
2. If you use any of the source code in your product, and your
|
||||
product is distributed with source code, you must include this
|
||||
notice with those portions of this source code that you use.
|
||||
|
||||
Or,
|
||||
|
||||
If your product is distributed in binary form only, you must
|
||||
display on any packaging, and marketing materials which
|
||||
reference your product, a notice which states:
|
||||
|
||||
"This product uses components written by Paul Le Roux
|
||||
<pleroux@swprofessionals.com>"
|
||||
|
||||
3. If you use any of the source code originally by Eric Young,
|
||||
you must in addition follow his terms and conditions.
|
||||
|
||||
4. Nothing requires that you accept this License, as you have
|
||||
not signed it. However, nothing else grants you permission to
|
||||
modify or distribute the product or its derivative works.
|
||||
|
||||
These actions are prohibited by law if you do not accept this
|
||||
License.
|
||||
|
||||
5. If any of these license terms is found to be to broad in
|
||||
scope, and declared invalid by any court or legal process, you
|
||||
agree that all other terms shall not be so affected, and shall
|
||||
remain valid and enforceable.
|
||||
|
||||
6. THIS PROGRAM IS DISTRIBUTED FREE OF CHARGE, THEREFORE THERE
|
||||
IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. UNLESS OTHERWISE STATED THE PROGRAM IS PROVIDED
|
||||
"AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR
|
||||
IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE
|
||||
ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS
|
||||
WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE
|
||||
COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
7. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
|
||||
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY
|
||||
MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE
|
||||
LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL,
|
||||
INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR
|
||||
INABILITY TO USE THE PROGRAM, INCLUDING BUT NOT LIMITED TO LOSS
|
||||
OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
||||
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH
|
||||
ANY OTHER PROGRAMS, EVEN IF SUCH HOLDER OR OTHER PARTY HAD
|
||||
PREVIOUSLY BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
____________________________________________________________
|
||||
|
||||
Copyright (c) 1998-2008, Brian Gladman, Worcester, UK.
|
||||
All rights reserved.
|
||||
|
||||
LICENSE TERMS
|
||||
|
||||
The free distribution and use of this software is allowed (with
|
||||
or without changes) provided that:
|
||||
|
||||
1. source code distributions include the above copyright
|
||||
notice, this list of conditions and the following
|
||||
disclaimer;
|
||||
|
||||
2. binary distributions include the above copyright notice,
|
||||
this list of conditions and the following disclaimer in
|
||||
their documentation;
|
||||
|
||||
3. the name of the copyright holder is not used to endorse
|
||||
products built using this software without specific written
|
||||
permission.
|
||||
|
||||
DISCLAIMER
|
||||
|
||||
This software is provided 'as is' with no explicit or implied
|
||||
warranties in respect of its properties, including, but not
|
||||
limited to, correctness and/or fitness for purpose.
|
||||
____________________________________________________________
|
||||
|
||||
Copyright (C) 2002-2004 Mark Adler, all rights reserved
|
||||
version 1.8, 9 Jan 2004
|
||||
|
||||
This software is provided 'as-is', without any express or
|
||||
implied warranty. In no event will the author be held liable
|
||||
for any damages arising from the use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any
|
||||
purpose, including commercial applications, and to alter it and
|
||||
redistribute it freely, subject to the following restrictions:
|
||||
|
||||
1. The origin of this software must not be misrepresented; you
|
||||
must not claim that you wrote the original software. If you
|
||||
use this software in a product, an acknowledgment in the
|
||||
product documentation would be appreciated but is not
|
||||
required.
|
||||
2. Altered source versions must be plainly marked as such, and
|
||||
must not be misrepresented as being the original software.
|
||||
3. This notice may not be removed or altered from any source
|
||||
distribution.
|
||||
____________________________________________________________
|
||||
@@ -0,0 +1,260 @@
|
||||
This archive contains the source code of VeraCrypt.
|
||||
It is based on original TrueCrypt 7.1a with security enhancements and modifications.
|
||||
|
||||
|
||||
Important
|
||||
=========
|
||||
|
||||
You may use the source code contained in this archive only if you accept and
|
||||
agree to the license terms contained in the file 'License.txt', which is
|
||||
included in this archive.
|
||||
|
||||
Note that the license specifies, for example, that a derived work must not be
|
||||
called 'TrueCrypt' or 'VeraCrypt'
|
||||
|
||||
|
||||
|
||||
Contents
|
||||
========
|
||||
|
||||
I. Windows
|
||||
Requirements for Building VeraCrypt for Windows
|
||||
Instructions for Building VeraCrypt for Windows
|
||||
Instructions for Signing and Packaging VeraCrypt for Windows
|
||||
|
||||
II. Linux and Mac OS X
|
||||
Requirements for Building VeraCrypt for Linux and Mac OS X
|
||||
Instructions for Building VeraCrypt for Linux and Mac OS X
|
||||
Mac OS X specifics
|
||||
|
||||
III. FreeBSD and OpenSolaris
|
||||
|
||||
IV. Third-Party Developers (Contributors)
|
||||
|
||||
V. Legal Information
|
||||
|
||||
VI. Further Information
|
||||
|
||||
|
||||
|
||||
I. Windows
|
||||
==========
|
||||
|
||||
Requirements for Building VeraCrypt for Windows:
|
||||
------------------------------------------------
|
||||
|
||||
- Microsoft Visual C++ 2008 SP1 (Professional Edition or compatible)
|
||||
- Microsoft Visual C++ 1.52 (available from MSDN Subscriber Downloads)
|
||||
- Microsoft Windows SDK for Windows 7 (configured for Visual C++)
|
||||
- Microsoft Windows Driver Kit 7.1.0 (build 7600.16385.1)
|
||||
- RSA Security Inc. PKCS #11 Cryptographic Token Interface (Cryptoki) 2.20
|
||||
header files (available at ftp://ftp.rsasecurity.com/pub/pkcs/pkcs-11/v2-20)
|
||||
- NASM assembler 2.08 or compatible
|
||||
- gzip compressor
|
||||
|
||||
IMPORTANT:
|
||||
|
||||
The 64-bit editions of Windows Vista and later versions of Windows, and in
|
||||
some cases (e.g. playback of HD DVD content) also the 32-bit editions, do not
|
||||
allow the VeraCrypt driver to run without an appropriate digital signature.
|
||||
Therefore, all .sys files in official VeraCrypt binary packages are digitally
|
||||
signed with the digital certificate of the IDRIX, which was
|
||||
issued by Thawt certification authority. At the end of each official .exe and
|
||||
.sys file, there are embedded digital signatures and all related certificates
|
||||
(i.e. all certificates in the relevant certification chain, such as the
|
||||
certification authority certificates, CA-MS cross-certificate, and the
|
||||
IDRIX certificate). Keep this in mind if you compile VeraCrypt
|
||||
and compare your binaries with the official binaries. If your binaries are
|
||||
unsigned, the sizes of the official binaries will usually be approximately
|
||||
10 KB greater than sizes of your binaries (there may be further differences
|
||||
if you use a different version of the compiler, or if you install a different
|
||||
or no service pack for Visual Studio, or different hotfixes for it, or if you
|
||||
use different versions of the required SDKs).
|
||||
|
||||
|
||||
Instructions for Building VeraCrypt for Windows:
|
||||
------------------------------------------------
|
||||
|
||||
1) Create an environment variable 'MSVC16_ROOT' pointing to the folder 'MSVC15'
|
||||
extracted from the Visual C++ 1.52 self-extracting package.
|
||||
|
||||
Note: The 16-bit installer MSVC15\SETUP.EXE cannot be run on 64-bit Windows,
|
||||
but it is actually not necessary to run it. You only need to extract the
|
||||
folder 'MSVC15', which contains the 32-bit binaries required to build the
|
||||
VeraCrypt Boot Loader.
|
||||
|
||||
2) If you have installed the Windows Driver Development Kit in another
|
||||
directory than '%SYSTEMDRIVE%\WinDDK', create an environment variable
|
||||
'WINDDK_ROOT' pointing to the DDK installation directory.
|
||||
|
||||
3) Copy the PKCS #11 header files to a standard include path or create an
|
||||
environment variable 'PKCS11_INC' pointing to the directory where
|
||||
the PKCS #11 header files are installed.
|
||||
|
||||
4) Open the solution file 'VeraCrypt.sln' in Microsoft Visual Studio 2008.
|
||||
|
||||
5) Select 'All' as the active solution configuration.
|
||||
|
||||
6) Build the solution.
|
||||
|
||||
7) If successful, there should be newly built VeraCrypt binaries in the
|
||||
'Release' folder.
|
||||
|
||||
Instructions for Signing VeraCrypt for Windows:
|
||||
------------------------------------------------
|
||||
|
||||
The folder "Signing" contains a batch file (sign.bat) that will sign all
|
||||
VeraCrypt components using a code signing certificate present on the
|
||||
certificate store and also build the final installation setup.
|
||||
The batch file suppose that the code signing certificate is issued by Thawt.
|
||||
This is the case for IDRIX's certificate. If yours is issued by another CA,
|
||||
then you should put the Root and Intermediate certificates in the "Signing"
|
||||
folder and then modify sign.bat accordingly.
|
||||
|
||||
|
||||
II. Linux and Mac OS X
|
||||
======================
|
||||
|
||||
Requirements for Building VeraCrypt for Linux and Mac OS X:
|
||||
-----------------------------------------------------------
|
||||
|
||||
- GNU Make
|
||||
- GNU C++ Compiler 4.0 or compatible
|
||||
- Apple Xcode (Mac OS X only)
|
||||
- NASM assembler 2.08 or compatible (x86/x64 architecture only)
|
||||
- pkg-config
|
||||
- makeself (Linux only)
|
||||
- wxWidgets 3.0 shared library and header files installed or
|
||||
wxWidgets 3.0 library source code (available at http://www.wxwidgets.org)
|
||||
- FUSE library and header files (available at http://fuse.sourceforge.net
|
||||
and https://osxfuse.github.io/)
|
||||
- RSA Security Inc. PKCS #11 Cryptographic Token Interface (Cryptoki) 2.20
|
||||
header files (available at ftp://ftp.rsasecurity.com/pub/pkcs/pkcs-11/v2-20).
|
||||
They are already included in the source tree under the directory PKCS11 but
|
||||
it is possible to override it using the environment variable 'PKCS11_INC'.
|
||||
|
||||
|
||||
Instructions for Building VeraCrypt for Linux and Mac OS X:
|
||||
-----------------------------------------------------------
|
||||
|
||||
1) Change the current directory to the root of the VeraCrypt source code.
|
||||
|
||||
2) If you have no wxWidgets shared library installed, run the following
|
||||
command to configure the wxWidgets static library for VeraCrypt and to
|
||||
build it:
|
||||
|
||||
$ make WXSTATIC=1 WX_ROOT=/usr/src/wxWidgets wxbuild
|
||||
|
||||
The variable WX_ROOT must point to the location of the source code of the
|
||||
wxWidgets library. Output files will be placed in the './wxrelease/'
|
||||
directory.
|
||||
|
||||
3) To build VeraCrypt, run the following command:
|
||||
|
||||
$ make
|
||||
|
||||
or if you have no wxWidgets shared library installed:
|
||||
|
||||
$ make WXSTATIC=1
|
||||
|
||||
4) If successful, the VeraCrypt executable should be located in the directory
|
||||
'Main'.
|
||||
|
||||
By default, a universal executable supporting both graphical and text user
|
||||
interface (through the switch --text) is built.
|
||||
On Linux, a console-only executable, which requires no GUI library, can be
|
||||
built using the 'NOGUI' parameter:
|
||||
|
||||
$ make NOGUI=1 WXSTATIC=1 WX_ROOT=/usr/src/wxWidgets wxbuild
|
||||
$ make NOGUI=1 WXSTATIC=1
|
||||
|
||||
On MacOSX, building a console-only executable is not supported.
|
||||
|
||||
Mac OS X specifics:
|
||||
-----------------------------------------------------------
|
||||
|
||||
Under MacOSX, the SDK for OSX 10.7 is used by default. To use another version
|
||||
of the SDK (e.i. 10.6), you can export the environment variable VC_OSX_TARGET :
|
||||
|
||||
$ export VC_OSX_TARGET=10.6
|
||||
|
||||
|
||||
Before building under MacOSX, pkg-config must be installed if not yet available.
|
||||
Get it from http://pkgconfig.freedesktop.org/releases/pkg-config-0.28.tar.gz and
|
||||
compile using the following commands :
|
||||
|
||||
$ ./configure --with-internal-glib
|
||||
$ make
|
||||
$ sudo make install
|
||||
|
||||
After making sure pkg-config is available, download and install OSXFuse from
|
||||
https://osxfuse.github.io/ (MacFUSE compatibility layer must selected)
|
||||
|
||||
The script build_veracrypt_macosx.sh available under "src/Build" performs the
|
||||
full build of VeraCrypt including the creation of the installer pkg. It expects
|
||||
to find the wxWidgets 3.0.2 sources at the same level as where you put
|
||||
VeraCrypt sources (e.i. if "src" path is "/Users/joe/Projects/VeraCrypt/src"
|
||||
then wxWidgets should be at "/Users/joe/Projects/wxWidgets-wxWidgets-3.0.2")
|
||||
|
||||
The build process uses Code Signing certificates whose ID is specified in
|
||||
src/Main/Main.make (lines 167 & 169). You'll have to modify these lines to put
|
||||
the ID of your Code Signing certificates or comment them if you don't have one.
|
||||
|
||||
Because of incompatibility issues with OSXFUSE, the SDK 10.9 generates a
|
||||
VeraCrypt binary that has issues communicating with the OSXFUSE kernel extension.
|
||||
Thus, we recommend to use the SDK 10.8 or earlier for building VeraCrypt.
|
||||
|
||||
|
||||
|
||||
III. FreeBSD and OpenSolaris
|
||||
============================
|
||||
|
||||
FreeBSD and OpenSolaris are not yet supported.
|
||||
|
||||
|
||||
|
||||
IV. Third-Party Developers (Contributors)
|
||||
=========================================
|
||||
|
||||
If you intend to implement a feature, please contact us first to make sure:
|
||||
|
||||
1) That the feature has not been implemented (we may have already implemented
|
||||
it, but haven't released the code yet).
|
||||
2) That the feature is acceptable.
|
||||
3) Whether we need help of third-party developers with implementing the feature.
|
||||
|
||||
Information on how to contact us can be found at:
|
||||
https://veracrypt.codeplex.com/
|
||||
|
||||
|
||||
|
||||
V. Legal Information
|
||||
====================
|
||||
|
||||
Copyright Information
|
||||
---------------------
|
||||
|
||||
This software as a whole:
|
||||
Copyright (c) 2013-2015 IDRIX. All rights reserved.
|
||||
|
||||
Portions of this software:
|
||||
Copyright (c) 2003-2012 TrueCrypt Developers Association. All rights reserved.
|
||||
Copyright (c) 1998-2000 Paul Le Roux. All rights reserved.
|
||||
Copyright (c) 1998-2008 Brian Gladman, Worcester, UK. All rights reserved.
|
||||
Copyright (c) 2002-2004 Mark Adler. All rights reserved.
|
||||
For more information, please see the legal notices attached to parts of the
|
||||
source code.
|
||||
|
||||
Trademark Information
|
||||
---------------------
|
||||
|
||||
Any trademarks contained in the source code, binaries, and/or in the
|
||||
documentation, are the sole property of their respective owners.
|
||||
|
||||
|
||||
|
||||
VI. Further Information
|
||||
=======================
|
||||
|
||||
http://www.veracrypt.fr
|
||||
|
||||
+286
@@ -0,0 +1,286 @@
|
||||
@echo off
|
||||
|
||||
setlocal
|
||||
|
||||
call :freedrive mydriveletter && goto :cont
|
||||
echo ERROR: No free drive letter found.
|
||||
goto :exit
|
||||
:cont
|
||||
|
||||
echo Using drive letter %mydriveletter%: for our tests
|
||||
echo.
|
||||
|
||||
rem Get start time:
|
||||
for /F "tokens=1-4 delims=:.," %%a in ("%time%") do (
|
||||
set /A "start=(((%%a*60)+1%%b %% 100)*60+1%%c %% 100)*100+1%%d %% 100"
|
||||
)
|
||||
|
||||
rem Mount SHA-512 container (Normal)
|
||||
"c:\Program Files\VeraCrypt\veracrypt.exe" /volume test.sha512.hc /hash sha512 /l %mydriveletter% /password test /q /silent /m ro
|
||||
|
||||
rem Get end time:
|
||||
for /F "tokens=1-4 delims=:.," %%a in ("%time%") do (
|
||||
set /A "end=(((%%a*60)+1%%b %% 100)*60+1%%c %% 100)*100+1%%d %% 100"
|
||||
)
|
||||
|
||||
rem Get elapsed time:
|
||||
set /A elapsed=end-start
|
||||
|
||||
rem Show elapsed time:
|
||||
set /A hh=elapsed/(60*60*100), rest=elapsed%%(60*60*100), mm=rest/(60*100), rest%%=60*100, ss=rest/100, cc=rest%%100
|
||||
if %hh% lss 10 set hh=0%hh%
|
||||
if %mm% lss 10 set mm=0%mm%
|
||||
if %ss% lss 10 set ss=0%ss%
|
||||
if %cc% lss 10 set cc=0%cc%
|
||||
echo SHA-512 (Normal) = %hh%:%mm%:%ss%,%cc%
|
||||
|
||||
"c:\Program Files\VeraCrypt\veracrypt.exe" /dismount %mydriveletter% /silent /q
|
||||
|
||||
rem Get start time:
|
||||
for /F "tokens=1-4 delims=:.," %%a in ("%time%") do (
|
||||
set /A "start=(((%%a*60)+1%%b %% 100)*60+1%%c %% 100)*100+1%%d %% 100"
|
||||
)
|
||||
|
||||
rem Mount SHA-512 container (Hidden)
|
||||
"c:\Program Files\VeraCrypt\veracrypt.exe" /volume test.sha512.hc /hash sha512 /l %mydriveletter% /password testhidden /q /silent /m ro
|
||||
|
||||
rem Get end time:
|
||||
for /F "tokens=1-4 delims=:.," %%a in ("%time%") do (
|
||||
set /A "end=(((%%a*60)+1%%b %% 100)*60+1%%c %% 100)*100+1%%d %% 100"
|
||||
)
|
||||
|
||||
rem Get elapsed time:
|
||||
set /A elapsed=end-start
|
||||
|
||||
rem Show elapsed time:
|
||||
set /A hh=elapsed/(60*60*100), rest=elapsed%%(60*60*100), mm=rest/(60*100), rest%%=60*100, ss=rest/100, cc=rest%%100
|
||||
if %hh% lss 10 set hh=0%hh%
|
||||
if %mm% lss 10 set mm=0%mm%
|
||||
if %ss% lss 10 set ss=0%ss%
|
||||
if %cc% lss 10 set cc=0%cc%
|
||||
echo SHA-512 (Hidden) = %hh%:%mm%:%ss%,%cc%
|
||||
echo.
|
||||
|
||||
"c:\Program Files\VeraCrypt\veracrypt.exe" /dismount %mydriveletter% /silent /q
|
||||
|
||||
rem Get start time:
|
||||
for /F "tokens=1-4 delims=:.," %%a in ("%time%") do (
|
||||
set /A "start=(((%%a*60)+1%%b %% 100)*60+1%%c %% 100)*100+1%%d %% 100"
|
||||
)
|
||||
|
||||
rem Mount Whirlpool container (Normal).
|
||||
"c:\Program Files\VeraCrypt\veracrypt.exe" /volume test.whirlpool.hc /hash whirlpool /l %mydriveletter% /password test /q /silent /m ro
|
||||
|
||||
rem Get end time:
|
||||
for /F "tokens=1-4 delims=:.," %%a in ("%time%") do (
|
||||
set /A "end=(((%%a*60)+1%%b %% 100)*60+1%%c %% 100)*100+1%%d %% 100"
|
||||
)
|
||||
|
||||
rem Get elapsed time:
|
||||
set /A elapsed=end-start
|
||||
|
||||
rem Show elapsed time:
|
||||
set /A hh=elapsed/(60*60*100), rest=elapsed%%(60*60*100), mm=rest/(60*100), rest%%=60*100, ss=rest/100, cc=rest%%100
|
||||
if %hh% lss 10 set hh=0%hh%
|
||||
if %mm% lss 10 set mm=0%mm%
|
||||
if %ss% lss 10 set ss=0%ss%
|
||||
if %cc% lss 10 set cc=0%cc%
|
||||
echo Whirlpool (Normal) = %hh%:%mm%:%ss%,%cc%
|
||||
|
||||
"c:\Program Files\VeraCrypt\veracrypt.exe" /dismount %mydriveletter% /silent /q
|
||||
|
||||
rem Get start time:
|
||||
for /F "tokens=1-4 delims=:.," %%a in ("%time%") do (
|
||||
set /A "start=(((%%a*60)+1%%b %% 100)*60+1%%c %% 100)*100+1%%d %% 100"
|
||||
)
|
||||
|
||||
rem Mount Whirlpool container (Hidden).
|
||||
"c:\Program Files\VeraCrypt\veracrypt.exe" /volume test.whirlpool.hc /hash whirlpool /l %mydriveletter% /password testhidden /q /silent /m ro
|
||||
|
||||
rem Get end time:
|
||||
for /F "tokens=1-4 delims=:.," %%a in ("%time%") do (
|
||||
set /A "end=(((%%a*60)+1%%b %% 100)*60+1%%c %% 100)*100+1%%d %% 100"
|
||||
)
|
||||
|
||||
rem Get elapsed time:
|
||||
set /A elapsed=end-start
|
||||
|
||||
rem Show elapsed time:
|
||||
set /A hh=elapsed/(60*60*100), rest=elapsed%%(60*60*100), mm=rest/(60*100), rest%%=60*100, ss=rest/100, cc=rest%%100
|
||||
if %hh% lss 10 set hh=0%hh%
|
||||
if %mm% lss 10 set mm=0%mm%
|
||||
if %ss% lss 10 set ss=0%ss%
|
||||
if %cc% lss 10 set cc=0%cc%
|
||||
echo Whirlpool (Hidden) = %hh%:%mm%:%ss%,%cc%
|
||||
echo.
|
||||
|
||||
"c:\Program Files\VeraCrypt\veracrypt.exe" /dismount %mydriveletter% /silent /q
|
||||
|
||||
rem Get start time:
|
||||
for /F "tokens=1-4 delims=:.," %%a in ("%time%") do (
|
||||
set /A "start=(((%%a*60)+1%%b %% 100)*60+1%%c %% 100)*100+1%%d %% 100"
|
||||
)
|
||||
|
||||
rem Mount SHA-256 container (Normal)
|
||||
"c:\Program Files\VeraCrypt\veracrypt.exe" /volume test.sha256.hc /hash sha256 /l %mydriveletter% /password test /q /silent /m ro
|
||||
|
||||
rem Get end time:
|
||||
for /F "tokens=1-4 delims=:.," %%a in ("%time%") do (
|
||||
set /A "end=(((%%a*60)+1%%b %% 100)*60+1%%c %% 100)*100+1%%d %% 100"
|
||||
)
|
||||
|
||||
rem Get elapsed time:
|
||||
set /A elapsed=end-start
|
||||
|
||||
rem Show elapsed time:
|
||||
set /A hh=elapsed/(60*60*100), rest=elapsed%%(60*60*100), mm=rest/(60*100), rest%%=60*100, ss=rest/100, cc=rest%%100
|
||||
if %hh% lss 10 set hh=0%hh%
|
||||
if %mm% lss 10 set mm=0%mm%
|
||||
if %ss% lss 10 set ss=0%ss%
|
||||
if %cc% lss 10 set cc=0%cc%
|
||||
echo SHA-256 (Normal) = %hh%:%mm%:%ss%,%cc%
|
||||
|
||||
"c:\Program Files\VeraCrypt\veracrypt.exe" /dismount %mydriveletter% /silent /q
|
||||
|
||||
rem Get start time:
|
||||
for /F "tokens=1-4 delims=:.," %%a in ("%time%") do (
|
||||
set /A "start=(((%%a*60)+1%%b %% 100)*60+1%%c %% 100)*100+1%%d %% 100"
|
||||
)
|
||||
|
||||
rem Mount SHA-256 container (Hidden)
|
||||
"c:\Program Files\VeraCrypt\veracrypt.exe" /volume test.sha256.hc /hash sha256 /l %mydriveletter% /password testhidden /q /silent /m ro
|
||||
|
||||
rem Get end time:
|
||||
for /F "tokens=1-4 delims=:.," %%a in ("%time%") do (
|
||||
set /A "end=(((%%a*60)+1%%b %% 100)*60+1%%c %% 100)*100+1%%d %% 100"
|
||||
)
|
||||
|
||||
rem Get elapsed time:
|
||||
set /A elapsed=end-start
|
||||
|
||||
rem Show elapsed time:
|
||||
set /A hh=elapsed/(60*60*100), rest=elapsed%%(60*60*100), mm=rest/(60*100), rest%%=60*100, ss=rest/100, cc=rest%%100
|
||||
if %hh% lss 10 set hh=0%hh%
|
||||
if %mm% lss 10 set mm=0%mm%
|
||||
if %ss% lss 10 set ss=0%ss%
|
||||
if %cc% lss 10 set cc=0%cc%
|
||||
echo SHA-256 (Hidden) = %hh%:%mm%:%ss%,%cc%
|
||||
echo.
|
||||
|
||||
"c:\Program Files\VeraCrypt\veracrypt.exe" /dismount %mydriveletter% /silent /q
|
||||
|
||||
rem Get start time:
|
||||
for /F "tokens=1-4 delims=:.," %%a in ("%time%") do (
|
||||
set /A "start=(((%%a*60)+1%%b %% 100)*60+1%%c %% 100)*100+1%%d %% 100"
|
||||
)
|
||||
|
||||
rem Mount RIPEMD-160 container (Normal)
|
||||
"c:\Program Files\VeraCrypt\veracrypt.exe" /volume test.ripemd160.hc /hash ripemd160 /l %mydriveletter% /password test /q /silent /m ro
|
||||
|
||||
rem Get end time:
|
||||
for /F "tokens=1-4 delims=:.," %%a in ("%time%") do (
|
||||
set /A "end=(((%%a*60)+1%%b %% 100)*60+1%%c %% 100)*100+1%%d %% 100"
|
||||
)
|
||||
|
||||
rem Get elapsed time:
|
||||
set /A elapsed=end-start
|
||||
|
||||
rem Show elapsed time:
|
||||
set /A hh=elapsed/(60*60*100), rest=elapsed%%(60*60*100), mm=rest/(60*100), rest%%=60*100, ss=rest/100, cc=rest%%100
|
||||
if %hh% lss 10 set hh=0%hh%
|
||||
if %mm% lss 10 set mm=0%mm%
|
||||
if %ss% lss 10 set ss=0%ss%
|
||||
if %cc% lss 10 set cc=0%cc%
|
||||
echo RIPEMD-160 (Normal) = %hh%:%mm%:%ss%,%cc%
|
||||
|
||||
"c:\Program Files\VeraCrypt\veracrypt.exe" /dismount %mydriveletter% /silent /q
|
||||
|
||||
rem Get start time:
|
||||
for /F "tokens=1-4 delims=:.," %%a in ("%time%") do (
|
||||
set /A "start=(((%%a*60)+1%%b %% 100)*60+1%%c %% 100)*100+1%%d %% 100"
|
||||
)
|
||||
|
||||
rem Mount RIPEMD-160 container (Hidden)
|
||||
"c:\Program Files\VeraCrypt\veracrypt.exe" /volume test.ripemd160.hc /hash ripemd160 /l %mydriveletter% /password testhidden /q /silent /m ro
|
||||
|
||||
rem Get end time:
|
||||
for /F "tokens=1-4 delims=:.," %%a in ("%time%") do (
|
||||
set /A "end=(((%%a*60)+1%%b %% 100)*60+1%%c %% 100)*100+1%%d %% 100"
|
||||
)
|
||||
|
||||
rem Get elapsed time:
|
||||
set /A elapsed=end-start
|
||||
|
||||
rem Show elapsed time:
|
||||
set /A hh=elapsed/(60*60*100), rest=elapsed%%(60*60*100), mm=rest/(60*100), rest%%=60*100, ss=rest/100, cc=rest%%100
|
||||
if %hh% lss 10 set hh=0%hh%
|
||||
if %mm% lss 10 set mm=0%mm%
|
||||
if %ss% lss 10 set ss=0%ss%
|
||||
if %cc% lss 10 set cc=0%cc%
|
||||
echo RIPEMD-160 (Hidden) = %hh%:%mm%:%ss%,%cc%
|
||||
echo.
|
||||
|
||||
"c:\Program Files\VeraCrypt\veracrypt.exe" /dismount %mydriveletter% /silent /q
|
||||
|
||||
rem Get start time:
|
||||
for /F "tokens=1-4 delims=:.," %%a in ("%time%") do (
|
||||
set /A "start=(((%%a*60)+1%%b %% 100)*60+1%%c %% 100)*100+1%%d %% 100"
|
||||
)
|
||||
|
||||
rem Try to mount with a wrong password and PRF autodetection
|
||||
"c:\Program Files\VeraCrypt\veracrypt.exe" /volume test.sha512.hc /l %mydriveletter% /password wrongpassword /q /silent /m ro
|
||||
|
||||
rem Get end time:
|
||||
for /F "tokens=1-4 delims=:.," %%a in ("%time%") do (
|
||||
set /A "end=(((%%a*60)+1%%b %% 100)*60+1%%c %% 100)*100+1%%d %% 100"
|
||||
)
|
||||
|
||||
rem Get elapsed time:
|
||||
set /A elapsed=end-start
|
||||
|
||||
rem Show elapsed time:
|
||||
set /A hh=elapsed/(60*60*100), rest=elapsed%%(60*60*100), mm=rest/(60*100), rest%%=60*100, ss=rest/100, cc=rest%%100
|
||||
if %hh% lss 10 set hh=0%hh%
|
||||
if %mm% lss 10 set mm=0%mm%
|
||||
if %ss% lss 10 set ss=0%ss%
|
||||
if %cc% lss 10 set cc=0%cc%
|
||||
echo Wrong Password (PRF Auto-detection)= %hh%:%mm%:%ss%,%cc%
|
||||
echo.
|
||||
|
||||
|
||||
goto :exit
|
||||
|
||||
rem Finds a free drive letter.
|
||||
rem
|
||||
rem Parameters:
|
||||
rem %1 = Output variable name.
|
||||
rem
|
||||
rem Example:
|
||||
rem call :freedrive mydriveletter && goto :cont
|
||||
rem echo ERROR: No free drive letter found.
|
||||
rem goto :EOF
|
||||
rem :cont
|
||||
rem echo Found drive letter: %mydriveletter%
|
||||
:freedrive
|
||||
setlocal EnableDelayedExpansion
|
||||
set exitcode=0
|
||||
set "output_var=%~1"
|
||||
for %%i in (C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z) do (
|
||||
set "drive=%%i:"
|
||||
rem If 'subst' fails, the drive letter is already in use.
|
||||
rem This way we can even detect optical drives that have a drive
|
||||
rem letter but no media in them, a case that goes undetected when
|
||||
rem using 'if exist'.
|
||||
subst !drive! %SystemDrive%\ >nul
|
||||
if !errorlevel! == 0 (
|
||||
subst !drive! /d >nul
|
||||
set "drive=%%i"
|
||||
goto :freedrive0
|
||||
)
|
||||
)
|
||||
set exitcode=1
|
||||
set drive=
|
||||
:freedrive0
|
||||
endlocal & set "%output_var%=%drive%" & exit /b %exitcode%
|
||||
|
||||
:exit
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,9 +1,13 @@
|
||||
/*
|
||||
Copyright (c) 2008 TrueCrypt Developers Association. All rights reserved.
|
||||
Derived from source code of TrueCrypt 7.1a, which is
|
||||
Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
|
||||
by the TrueCrypt License 3.0.
|
||||
|
||||
Governed by the TrueCrypt License 3.0 the full text of which is contained in
|
||||
the file License.txt included in TrueCrypt binary and source code distribution
|
||||
packages.
|
||||
Modifications and additions to the original source code (contained in this file)
|
||||
and all other portions of this file are Copyright (c) 2013-2015 IDRIX
|
||||
and are governed by the Apache License 2.0 the full text of which is
|
||||
contained in the file License.txt included in VeraCrypt binary and source
|
||||
code distribution packages.
|
||||
*/
|
||||
|
||||
#ifndef TC_HEADER_Boot_Bios
|
||||
|
||||
@@ -24,9 +24,9 @@
|
||||
>
|
||||
<Tool
|
||||
Name="VCNMakeTool"
|
||||
BuildCommandLine="md Release 2>NUL:
nmake.exe /nologo RELEASE=1

md Release_AES 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=AES

md Release_Serpent 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=SERPENT

md Release_Twofish 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=TWOFISH

md Rescue 2>NUL:
nmake.exe /nologo RELEASE=1 RESCUE_DISK=1

md Rescue_AES 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=AES RESCUE_DISK=1

md Rescue_Serpent 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=SERPENT RESCUE_DISK=1

md Rescue_Twofish 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=TWOFISH RESCUE_DISK=1"
|
||||
ReBuildCommandLine="del /q /s Release >NUL:
md Release 2>NUL:
nmake.exe /nologo RELEASE=1

del /q /s Release_AES >NUL:
md Release_AES 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=AES

del /q /s Release_Serpent >NUL:
md Release_Serpent 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=SERPENT

del /q /s Release_Twofish >NUL:
md Release_Twofish 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=TWOFISH

del /q /s Rescue >NUL:
md Rescue 2>NUL:
nmake.exe /nologo RELEASE=1 RESCUE_DISK=1

del /q /s Rescue_AES >NUL:
md Rescue_AES 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=AES RESCUE_DISK=1

del /q /s Rescue_Serpent >NUL:
md Rescue_Serpent 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=SERPENT RESCUE_DISK=1

del /q /s Rescue_Twofish >NUL:
md Rescue_Twofish 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=TWOFISH RESCUE_DISK=1"
|
||||
CleanCommandLine="del /q /s Release Release_AES Release_Serpent Release_Twofish Rescue Rescue_AES Rescue_Serpent Rescue_Twofish >NUL:"
|
||||
BuildCommandLine="md Release 2>NUL:
nmake.exe /nologo RELEASE=1

md Release_SHA2 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_PRF=SHA2

md Release_AES 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=AES

md Release_AES_SHA2 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=AES SINGLE_PRF=SHA2

md Release_Serpent 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=SERPENT

md Release_Serpent_SHA2 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=SERPENT SINGLE_PRF=SHA2

md Release_Twofish 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=TWOFISH

md Release_Twofish_SHA2 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=TWOFISH SINGLE_PRF=SHA2

md Rescue 2>NUL:
nmake.exe /nologo RELEASE=1 RESCUE_DISK=1

md Rescue_SHA2 2>NUL:
nmake.exe /nologo RELEASE=1 RESCUE_DISK=1 SINGLE_PRF=SHA2

md Rescue_AES 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=AES RESCUE_DISK=1

md Rescue_AES_SHA2 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=AES RESCUE_DISK=1 SINGLE_PRF=SHA2

md Rescue_Serpent 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=SERPENT RESCUE_DISK=1

md Rescue_Serpent_SHA2 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=SERPENT RESCUE_DISK=1 SINGLE_PRF=SHA2

md Rescue_Twofish 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=TWOFISH RESCUE_DISK=1

md Rescue_Twofish_SHA2 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=TWOFISH RESCUE_DISK=1 SINGLE_PRF=SHA2"
|
||||
ReBuildCommandLine="del /q /s Release >NUL:
md Release 2>NUL:
nmake.exe /nologo RELEASE=1

del /q /s Release_SHA2 >NUL:
md Release_SHA2 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_PRF=SHA2

del /q /s Release_AES >NUL:
md Release_AES 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=AES

del /q /s Release_AES_SHA2 >NUL:
md Release_AES_SHA2 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=AES SINGLE_PRF=SHA2

del /q /s Release_Serpent >NUL:
md Release_Serpent 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=SERPENT

del /q /s Release_Serpent_SHA2 >NUL:
md Release_Serpent_SHA2 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=SERPENT SINGLE_PRF=SHA2

del /q /s Release_Twofish >NUL:
md Release_Twofish 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=TWOFISH

del /q /s Release_Twofish_SHA2 >NUL:
md Release_Twofish_SHA2 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=TWOFISH SINGLE_PRF=SHA2

del /q /s Rescue >NUL:
md Rescue 2>NUL:
nmake.exe /nologo RELEASE=1 RESCUE_DISK=1

del /q /s Rescue_SHA2 >NUL:
md Rescue_SHA2 2>NUL:
nmake.exe /nologo RELEASE=1 RESCUE_DISK=1 SINGLE_PRF=SHA2

del /q /s Rescue_AES >NUL:
md Rescue_AES 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=AES RESCUE_DISK=1

del /q /s Rescue_AES_SHA2 >NUL:
md Rescue_AES_SHA2 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=AES RESCUE_DISK=1 SINGLE_PRF=SHA2

del /q /s Rescue_Serpent >NUL:
md Rescue_Serpent 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=SERPENT RESCUE_DISK=1

del /q /s Rescue_Serpent_SHA2 >NUL:
md Rescue_Serpent_SHA2 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=SERPENT RESCUE_DISK=1 SINGLE_PRF=SHA2

del /q /s Rescue_Twofish >NUL:
md Rescue_Twofish 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=TWOFISH RESCUE_DISK=1

del /q /s Rescue_Twofish_SHA2 >NUL:
md Rescue_Twofish_SHA2 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=TWOFISH RESCUE_DISK=1 SINGLE_PRF=SHA2"
|
||||
CleanCommandLine="del /q /s Release Release_AES Release_Serpent Release_Twofish Rescue Rescue_AES Rescue_Serpent Rescue_Twofish >NUL:
del /q /s Release_SHA2 Release_AES_SHA2 Release_Serpent_SHA2 Release_Twofish_SHA2 Rescue_SHA2 Rescue_AES_SHA2 Rescue_Serpent_SHA2 Rescue_Twofish_SHA2 >NUL:
"
|
||||
Output="Release\BootLoader.com"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG"
|
||||
IncludeSearchPath=""$(SolutionDir)";"$(SolutionDir)\Common";"$(SolutionDir)\Crypto";"$(MSVC16_ROOT)\Include""
|
||||
@@ -164,6 +164,10 @@
|
||||
RelativePath="..\..\Crypto\Serpent.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\Crypto\Sha2Small.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\Crypto\Twofish.c"
|
||||
>
|
||||
|
||||
@@ -1,9 +1,13 @@
|
||||
/*
|
||||
Copyright (c) 2008 TrueCrypt Developers Association. All rights reserved.
|
||||
Derived from source code of TrueCrypt 7.1a, which is
|
||||
Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
|
||||
by the TrueCrypt License 3.0.
|
||||
|
||||
Governed by the TrueCrypt License 3.0 the full text of which is contained in
|
||||
the file License.txt included in TrueCrypt binary and source code distribution
|
||||
packages.
|
||||
Modifications and additions to the original source code (contained in this file)
|
||||
and all other portions of this file are Copyright (c) 2013-2015 IDRIX
|
||||
and are governed by the Apache License 2.0 the full text of which is
|
||||
contained in the file License.txt included in VeraCrypt binary and source
|
||||
code distribution packages.
|
||||
*/
|
||||
|
||||
#ifndef TC_HEADER_Boot_BootCommon
|
||||
@@ -13,7 +17,7 @@
|
||||
#include "BootDefs.h"
|
||||
|
||||
// The user will be advised to upgrade the rescue disk if upgrading from the following or any previous version
|
||||
#define TC_RESCUE_DISK_UPGRADE_NOTICE_MAX_VERSION 0x060a
|
||||
#define TC_RESCUE_DISK_UPGRADE_NOTICE_MAX_VERSION 0x0111
|
||||
|
||||
#define TC_BOOT_LOADER_AREA_SIZE (TC_BOOT_LOADER_AREA_SECTOR_COUNT * TC_SECTOR_SIZE_BIOS)
|
||||
|
||||
|
||||
@@ -1,9 +1,13 @@
|
||||
/*
|
||||
Copyright (c) 2008-2012 TrueCrypt Developers Association. All rights reserved.
|
||||
Derived from source code of TrueCrypt 7.1a, which is
|
||||
Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
|
||||
by the TrueCrypt License 3.0.
|
||||
|
||||
Governed by the TrueCrypt License 3.0 the full text of which is contained in
|
||||
the file License.txt included in TrueCrypt binary and source code distribution
|
||||
packages.
|
||||
Modifications and additions to the original source code (contained in this file)
|
||||
and all other portions of this file are Copyright (c) 2013-2015 IDRIX
|
||||
and are governed by the Apache License 2.0 the full text of which is
|
||||
contained in the file License.txt included in VeraCrypt binary and source
|
||||
code distribution packages.
|
||||
*/
|
||||
|
||||
#include "BootConfig.h"
|
||||
|
||||
@@ -1,9 +1,13 @@
|
||||
/*
|
||||
Copyright (c) 2008-2009 TrueCrypt Developers Association. All rights reserved.
|
||||
Derived from source code of TrueCrypt 7.1a, which is
|
||||
Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
|
||||
by the TrueCrypt License 3.0.
|
||||
|
||||
Governed by the TrueCrypt License 3.0 the full text of which is contained in
|
||||
the file License.txt included in TrueCrypt binary and source code distribution
|
||||
packages.
|
||||
Modifications and additions to the original source code (contained in this file)
|
||||
and all other portions of this file are Copyright (c) 2013-2015 IDRIX
|
||||
and are governed by the Apache License 2.0 the full text of which is
|
||||
contained in the file License.txt included in VeraCrypt binary and source
|
||||
code distribution packages.
|
||||
*/
|
||||
|
||||
#ifndef TC_HEADER_Boot_BootConfig
|
||||
|
||||
@@ -1,9 +1,13 @@
|
||||
/*
|
||||
Copyright (c) 2008-2009 TrueCrypt Developers Association. All rights reserved.
|
||||
Derived from source code of TrueCrypt 7.1a, which is
|
||||
Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
|
||||
by the TrueCrypt License 3.0.
|
||||
|
||||
Governed by the TrueCrypt License 3.0 the full text of which is contained in
|
||||
the file License.txt included in TrueCrypt binary and source code distribution
|
||||
packages.
|
||||
Modifications and additions to the original source code (contained in this file)
|
||||
and all other portions of this file are Copyright (c) 2013-2015 IDRIX
|
||||
and are governed by the Apache License 2.0 the full text of which is
|
||||
contained in the file License.txt included in VeraCrypt binary and source
|
||||
code distribution packages.
|
||||
*/
|
||||
|
||||
#include "Platform.h"
|
||||
@@ -305,6 +309,11 @@ bool IsPrintable (char c)
|
||||
return c >= ' ' && c <= '~';
|
||||
}
|
||||
|
||||
bool IsDigit (char c)
|
||||
{
|
||||
return c >= '0' && c <= '9';
|
||||
}
|
||||
|
||||
|
||||
int GetString (char *buffer, size_t bufferSize)
|
||||
{
|
||||
|
||||
@@ -1,9 +1,13 @@
|
||||
/*
|
||||
Copyright (c) 2008 TrueCrypt Developers Association. All rights reserved.
|
||||
Derived from source code of TrueCrypt 7.1a, which is
|
||||
Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
|
||||
by the TrueCrypt License 3.0.
|
||||
|
||||
Governed by the TrueCrypt License 3.0 the full text of which is contained in
|
||||
the file License.txt included in TrueCrypt binary and source code distribution
|
||||
packages.
|
||||
Modifications and additions to the original source code (contained in this file)
|
||||
and all other portions of this file are Copyright (c) 2013-2015 IDRIX
|
||||
and are governed by the Apache License 2.0 the full text of which is
|
||||
contained in the file License.txt included in VeraCrypt binary and source
|
||||
code distribution packages.
|
||||
*/
|
||||
|
||||
#ifndef TC_HEADER_Boot_BootConsoleIo
|
||||
@@ -48,6 +52,7 @@ int GetString (char *buffer, size_t bufferSize);
|
||||
void InitVideoMode ();
|
||||
bool IsKeyboardCharAvailable ();
|
||||
bool IsPrintable (char c);
|
||||
bool IsDigit (char c);
|
||||
void Print (const char *str);
|
||||
void Print (uint32 number);
|
||||
void Print (const uint64 &number);
|
||||
|
||||
@@ -1,9 +1,13 @@
|
||||
;
|
||||
; Copyright (c) 2008 TrueCrypt Developers Association. All rights reserved.
|
||||
; Derived from source code of TrueCrypt 7.1a, which is
|
||||
; Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
|
||||
; by the TrueCrypt License 3.0.
|
||||
;
|
||||
; Governed by the TrueCrypt License 3.0 the full text of which is contained in
|
||||
; the file License.txt included in TrueCrypt binary and source code distribution
|
||||
; packages.
|
||||
; Modifications and additions to the original source code (contained in this file)
|
||||
; and all other portions of this file are Copyright (c) 2013-2015 IDRIX
|
||||
; and are governed by the Apache License 2.0 the full text of which is
|
||||
; contained in the file License.txt included in VeraCrypt binary and source
|
||||
; code distribution packages.
|
||||
;
|
||||
|
||||
.MODEL tiny, C
|
||||
|
||||
@@ -1,9 +1,13 @@
|
||||
/*
|
||||
Copyright (c) 2008 TrueCrypt Developers Association. All rights reserved.
|
||||
Derived from source code of TrueCrypt 7.1a, which is
|
||||
Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
|
||||
by the TrueCrypt License 3.0.
|
||||
|
||||
Governed by the TrueCrypt License 3.0 the full text of which is contained in
|
||||
the file License.txt included in TrueCrypt binary and source code distribution
|
||||
packages.
|
||||
Modifications and additions to the original source code (contained in this file)
|
||||
and all other portions of this file are Copyright (c) 2013-2015 IDRIX
|
||||
and are governed by the Apache License 2.0 the full text of which is
|
||||
contained in the file License.txt included in VeraCrypt binary and source
|
||||
code distribution packages.
|
||||
*/
|
||||
|
||||
#include "Platform.h"
|
||||
|
||||
@@ -1,9 +1,13 @@
|
||||
/*
|
||||
Copyright (c) 2008 TrueCrypt Developers Association. All rights reserved.
|
||||
Derived from source code of TrueCrypt 7.1a, which is
|
||||
Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
|
||||
by the TrueCrypt License 3.0.
|
||||
|
||||
Governed by the TrueCrypt License 3.0 the full text of which is contained in
|
||||
the file License.txt included in TrueCrypt binary and source code distribution
|
||||
packages.
|
||||
Modifications and additions to the original source code (contained in this file)
|
||||
and all other portions of this file are Copyright (c) 2013-2015 IDRIX
|
||||
and are governed by the Apache License 2.0 the full text of which is
|
||||
contained in the file License.txt included in VeraCrypt binary and source
|
||||
code distribution packages.
|
||||
*/
|
||||
|
||||
#ifndef TC_HEADER_Boot_BootDebug
|
||||
|
||||
@@ -1,9 +1,13 @@
|
||||
/*
|
||||
Copyright (c) 2008-2009 TrueCrypt Developers Association. All rights reserved.
|
||||
Derived from source code of TrueCrypt 7.1a, which is
|
||||
Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
|
||||
by the TrueCrypt License 3.0.
|
||||
|
||||
Governed by the TrueCrypt License 3.0 the full text of which is contained in
|
||||
the file License.txt included in TrueCrypt binary and source code distribution
|
||||
packages.
|
||||
Modifications and additions to the original source code (contained in this file)
|
||||
and all other portions of this file are Copyright (c) 2013-2015 IDRIX
|
||||
and are governed by the Apache License 2.0 the full text of which is
|
||||
contained in the file License.txt included in VeraCrypt binary and source
|
||||
code distribution packages.
|
||||
*/
|
||||
|
||||
#ifndef TC_HEADER_Boot_BootDefs
|
||||
|
||||
@@ -1,9 +1,13 @@
|
||||
/*
|
||||
Copyright (c) 2008-2011 TrueCrypt Developers Association. All rights reserved.
|
||||
Derived from source code of TrueCrypt 7.1a, which is
|
||||
Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
|
||||
by the TrueCrypt License 3.0.
|
||||
|
||||
Governed by the TrueCrypt License 3.0 the full text of which is contained in
|
||||
the file License.txt included in TrueCrypt binary and source code distribution
|
||||
packages.
|
||||
Modifications and additions to the original source code (contained in this file)
|
||||
and all other portions of this file are Copyright (c) 2013-2015 IDRIX
|
||||
and are governed by the Apache License 2.0 the full text of which is
|
||||
contained in the file License.txt included in VeraCrypt binary and source
|
||||
code distribution packages.
|
||||
*/
|
||||
|
||||
#include "Bios.h"
|
||||
|
||||
@@ -1,9 +1,13 @@
|
||||
/*
|
||||
Copyright (c) 2008-2011 TrueCrypt Developers Association. All rights reserved.
|
||||
Derived from source code of TrueCrypt 7.1a, which is
|
||||
Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
|
||||
by the TrueCrypt License 3.0.
|
||||
|
||||
Governed by the TrueCrypt License 3.0 the full text of which is contained in
|
||||
the file License.txt included in TrueCrypt binary and source code distribution
|
||||
packages.
|
||||
Modifications and additions to the original source code (contained in this file)
|
||||
and all other portions of this file are Copyright (c) 2013-2015 IDRIX
|
||||
and are governed by the Apache License 2.0 the full text of which is
|
||||
contained in the file License.txt included in VeraCrypt binary and source
|
||||
code distribution packages.
|
||||
*/
|
||||
|
||||
#ifndef TC_HEADER_Boot_BootDiskIo
|
||||
|
||||
@@ -1,9 +1,13 @@
|
||||
/*
|
||||
Copyright (c) 2008 TrueCrypt Developers Association. All rights reserved.
|
||||
Derived from source code of TrueCrypt 7.1a, which is
|
||||
Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
|
||||
by the TrueCrypt License 3.0.
|
||||
|
||||
Governed by the TrueCrypt License 3.0 the full text of which is contained in
|
||||
the file License.txt included in TrueCrypt binary and source code distribution
|
||||
packages.
|
||||
Modifications and additions to the original source code (contained in this file)
|
||||
and all other portions of this file are Copyright (c) 2013-2015 IDRIX
|
||||
and are governed by the Apache License 2.0 the full text of which is
|
||||
contained in the file License.txt included in VeraCrypt binary and source
|
||||
code distribution packages.
|
||||
*/
|
||||
|
||||
#include "Crypto.h"
|
||||
@@ -74,7 +78,7 @@ BiosResult ReadEncryptedSectors (uint16 destSegment, uint16 destOffset, byte dri
|
||||
|
||||
BiosResult WriteEncryptedSectors (uint16 sourceSegment, uint16 sourceOffset, byte drive, uint64 sector, uint16 sectorCount)
|
||||
{
|
||||
BiosResult result;
|
||||
BiosResult result = BiosResultSuccess;
|
||||
AcquireSectorBuffer();
|
||||
uint64 dataUnitNo;
|
||||
uint64 writeOffset;
|
||||
|
||||
@@ -1,9 +1,13 @@
|
||||
/*
|
||||
Copyright (c) 2008 TrueCrypt Developers Association. All rights reserved.
|
||||
Derived from source code of TrueCrypt 7.1a, which is
|
||||
Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
|
||||
by the TrueCrypt License 3.0.
|
||||
|
||||
Governed by the TrueCrypt License 3.0 the full text of which is contained in
|
||||
the file License.txt included in TrueCrypt binary and source code distribution
|
||||
packages.
|
||||
Modifications and additions to the original source code (contained in this file)
|
||||
and all other portions of this file are Copyright (c) 2013-2015 IDRIX
|
||||
and are governed by the Apache License 2.0 the full text of which is
|
||||
contained in the file License.txt included in VeraCrypt binary and source
|
||||
code distribution packages.
|
||||
*/
|
||||
|
||||
#ifndef TC_HEADER_Boot_BootEncryptionIo
|
||||
|
||||
+100
-24
@@ -1,9 +1,13 @@
|
||||
/*
|
||||
Copyright (c) 2008-2011 TrueCrypt Developers Association. All rights reserved.
|
||||
Derived from source code of TrueCrypt 7.1a, which is
|
||||
Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
|
||||
by the TrueCrypt License 3.0.
|
||||
|
||||
Governed by the TrueCrypt License 3.0 the full text of which is contained in
|
||||
the file License.txt included in TrueCrypt binary and source code distribution
|
||||
packages.
|
||||
Modifications and additions to the original source code (contained in this file)
|
||||
and all other portions of this file are Copyright (c) 2013-2015 IDRIX
|
||||
and are governed by the Apache License 2.0 the full text of which is
|
||||
contained in the file License.txt included in VeraCrypt binary and source
|
||||
code distribution packages.
|
||||
*/
|
||||
|
||||
#include "Crc.h"
|
||||
@@ -60,6 +64,7 @@ static void PrintMainMenu ()
|
||||
return;
|
||||
|
||||
Print (" Keyboard Controls:\r\n");
|
||||
Print (" [F5] Hide/Show Password\r\n");
|
||||
Print (" [Esc] ");
|
||||
|
||||
#ifndef TC_WINDOWS_BOOT_RESCUE_DISK_MODE
|
||||
@@ -144,11 +149,14 @@ static int AskSelection (const char *options[], size_t optionCount)
|
||||
}
|
||||
|
||||
|
||||
static byte AskPassword (Password &password)
|
||||
static byte AskPassword (Password &password, int& pim)
|
||||
{
|
||||
size_t pos = 0;
|
||||
byte scanCode;
|
||||
byte asciiCode;
|
||||
byte hidePassword = 1;
|
||||
|
||||
pim = 0;
|
||||
|
||||
Print ("Enter password");
|
||||
Print (PreventNormalSystemBoot ? " for hidden system:\r\n" : ": ");
|
||||
@@ -164,7 +172,7 @@ static byte AskPassword (Password &password)
|
||||
PrintEndl();
|
||||
|
||||
password.Length = pos;
|
||||
return scanCode;
|
||||
break;
|
||||
|
||||
case TC_BIOS_KEY_BACKSPACE:
|
||||
if (pos > 0)
|
||||
@@ -178,6 +186,66 @@ static byte AskPassword (Password &password)
|
||||
}
|
||||
continue;
|
||||
|
||||
case TC_BIOS_KEY_F5:
|
||||
hidePassword ^= 0x01;
|
||||
continue;
|
||||
|
||||
default:
|
||||
if (scanCode == TC_BIOS_KEY_ESC || IsMenuKey (scanCode))
|
||||
{
|
||||
burn (password.Text, sizeof (password.Text));
|
||||
ClearBiosKeystrokeBuffer();
|
||||
|
||||
PrintEndl();
|
||||
return scanCode;
|
||||
}
|
||||
}
|
||||
|
||||
if (TC_BIOS_KEY_ENTER == scanCode)
|
||||
break;
|
||||
|
||||
if (!IsPrintable (asciiCode) || pos == MAX_PASSWORD)
|
||||
{
|
||||
Beep();
|
||||
continue;
|
||||
}
|
||||
|
||||
password.Text[pos++] = asciiCode;
|
||||
if (hidePassword) asciiCode = '*';
|
||||
if (pos < MAX_PASSWORD)
|
||||
PrintChar (asciiCode);
|
||||
else
|
||||
PrintCharAtCursor (asciiCode);
|
||||
}
|
||||
|
||||
pos = 0;
|
||||
Print ("PIM: ");
|
||||
|
||||
while (true)
|
||||
{
|
||||
asciiCode = GetKeyboardChar (&scanCode);
|
||||
|
||||
switch (scanCode)
|
||||
{
|
||||
case TC_BIOS_KEY_ENTER:
|
||||
ClearBiosKeystrokeBuffer();
|
||||
PrintEndl();
|
||||
|
||||
return TC_BIOS_KEY_ENTER;
|
||||
|
||||
case TC_BIOS_KEY_BACKSPACE:
|
||||
if (pos > 0)
|
||||
{
|
||||
if (pos < MAX_PIM)
|
||||
PrintBackspace();
|
||||
else
|
||||
PrintCharAtCursor (' ');
|
||||
|
||||
--pos;
|
||||
pim /= 10;
|
||||
}
|
||||
continue;
|
||||
|
||||
default:
|
||||
if (scanCode == TC_BIOS_KEY_ESC || IsMenuKey (scanCode))
|
||||
{
|
||||
@@ -189,17 +257,19 @@ static byte AskPassword (Password &password)
|
||||
}
|
||||
}
|
||||
|
||||
if (!IsPrintable (asciiCode) || pos == MAX_PASSWORD)
|
||||
if (!IsDigit (asciiCode) || pos == MAX_PIM)
|
||||
{
|
||||
Beep();
|
||||
continue;
|
||||
}
|
||||
|
||||
password.Text[pos++] = asciiCode;
|
||||
if (pos < MAX_PASSWORD)
|
||||
PrintChar ('*');
|
||||
pim = 10*pim + (asciiCode - '0');
|
||||
pos++;
|
||||
|
||||
if (pos < MAX_PIM)
|
||||
PrintChar (asciiCode);
|
||||
else
|
||||
PrintCharAtCursor ('*');
|
||||
PrintCharAtCursor (asciiCode);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -230,7 +300,7 @@ static void ExecuteBootSector (byte drive, byte *sectorBuffer)
|
||||
}
|
||||
|
||||
|
||||
static bool OpenVolume (byte drive, Password &password, CRYPTO_INFO **cryptoInfo, uint32 *headerSaltCrc32, bool skipNormal, bool skipHidden)
|
||||
static bool OpenVolume (byte drive, Password &password, int pim, CRYPTO_INFO **cryptoInfo, uint32 *headerSaltCrc32, bool skipNormal, bool skipHidden)
|
||||
{
|
||||
int volumeType;
|
||||
bool hiddenVolume;
|
||||
@@ -261,7 +331,7 @@ static bool OpenVolume (byte drive, Password &password, CRYPTO_INFO **cryptoInfo
|
||||
if (ReadSectors (SectorBuffer, drive, headerSec, 1) != BiosResultSuccess)
|
||||
continue;
|
||||
|
||||
if (ReadVolumeHeader (!hiddenVolume, (char *) SectorBuffer, &password, cryptoInfo, nullptr) == ERR_SUCCESS)
|
||||
if (ReadVolumeHeader (!hiddenVolume, (char *) SectorBuffer, &password, pim, cryptoInfo, nullptr) == ERR_SUCCESS)
|
||||
{
|
||||
// Prevent opening a non-system hidden volume
|
||||
if (hiddenVolume && !((*cryptoInfo)->HeaderFlags & TC_HEADER_FLAG_ENCRYPTED_SYSTEM))
|
||||
@@ -315,21 +385,25 @@ static bool CheckMemoryRequirements ()
|
||||
static bool MountVolume (byte drive, byte &exitKey, bool skipNormal, bool skipHidden)
|
||||
{
|
||||
BootArguments *bootArguments = (BootArguments *) TC_BOOT_LOADER_ARGS_OFFSET;
|
||||
int incorrectPasswordCount = 0;
|
||||
int incorrectPasswordCount = 0, pim = 0;
|
||||
|
||||
EraseMemory (bootArguments, sizeof (*bootArguments));
|
||||
|
||||
// Open volume header
|
||||
while (true)
|
||||
{
|
||||
exitKey = AskPassword (bootArguments->BootPassword);
|
||||
exitKey = AskPassword (bootArguments->BootPassword, pim);
|
||||
|
||||
if (exitKey != TC_BIOS_KEY_ENTER)
|
||||
return false;
|
||||
|
||||
if (OpenVolume (BootDrive, bootArguments->BootPassword, &BootCryptoInfo, &bootArguments->HeaderSaltCrc32, skipNormal, skipHidden))
|
||||
break;
|
||||
Print ("Verifying password...");
|
||||
|
||||
if (OpenVolume (BootDrive, bootArguments->BootPassword, pim, &BootCryptoInfo, &bootArguments->HeaderSaltCrc32, skipNormal, skipHidden))
|
||||
{
|
||||
Print ("OK\r\n");
|
||||
break;
|
||||
}
|
||||
if (GetShiftFlags() & TC_BIOS_SHIFTMASK_CAPSLOCK)
|
||||
Print ("Warning: Caps Lock is on.\r\n");
|
||||
|
||||
@@ -351,6 +425,7 @@ static bool MountVolume (byte drive, byte &exitKey, bool skipNormal, bool skipHi
|
||||
bootArguments->BootLoaderVersion = VERSION_NUM;
|
||||
bootArguments->CryptoInfoOffset = (uint16) BootCryptoInfo;
|
||||
bootArguments->CryptoInfoLength = sizeof (*BootCryptoInfo);
|
||||
bootArguments->Flags = (((uint32)pim) << 16);
|
||||
|
||||
if (BootCryptoInfo->hiddenVolume)
|
||||
bootArguments->HiddenSystemPartitionStart = PartitionFollowingActive.StartSector << TC_LB_SIZE_BIT_SHIFT_DIVISOR;
|
||||
@@ -584,7 +659,7 @@ static bool CopySystemPartitionToHiddenVolume (byte drive, byte &exitKey)
|
||||
sectorOffset.HighPart = 0;
|
||||
|
||||
int fragmentSectorCount = 0x7f; // Maximum safe value supported by BIOS
|
||||
int statCount;
|
||||
int statCount = 0;
|
||||
|
||||
if (!CheckMemoryRequirements ())
|
||||
goto err;
|
||||
@@ -709,7 +784,7 @@ static void DecryptDrive (byte drive)
|
||||
uint64 sector = EncryptedVirtualPartition.EndSector + 1;
|
||||
|
||||
int fragmentSectorCount = 0x7f; // Maximum safe value supported by BIOS
|
||||
int statCount;
|
||||
int statCount = 0;
|
||||
|
||||
bool skipBadSectors = false;
|
||||
|
||||
@@ -799,7 +874,7 @@ askBadSectorSkip:
|
||||
CRYPTO_INFO *headerCryptoInfo = crypto_open();
|
||||
while (ReadSectors (SectorBuffer, drive, headerSector, 1) != BiosResultSuccess);
|
||||
|
||||
if (ReadVolumeHeader (TRUE, (char *) SectorBuffer, &bootArguments->BootPassword, NULL, headerCryptoInfo) == 0)
|
||||
if (ReadVolumeHeader (TRUE, (char *) SectorBuffer, &bootArguments->BootPassword, (int) (bootArguments->Flags >> 16), NULL, headerCryptoInfo) == 0)
|
||||
{
|
||||
DecryptBuffer (SectorBuffer + HEADER_ENCRYPTED_DATA_OFFSET, HEADER_ENCRYPTED_DATA_SIZE, headerCryptoInfo);
|
||||
|
||||
@@ -952,7 +1027,8 @@ static void RepairMenu ()
|
||||
uint32 masterKeyScheduleCrc;
|
||||
|
||||
Password password;
|
||||
byte exitKey = AskPassword (password);
|
||||
int pim;
|
||||
byte exitKey = AskPassword (password, pim);
|
||||
|
||||
if (exitKey != TC_BIOS_KEY_ENTER)
|
||||
goto abort;
|
||||
@@ -963,7 +1039,7 @@ static void RepairMenu ()
|
||||
ReleaseSectorBuffer();
|
||||
|
||||
// Restore volume header only if the current one cannot be used
|
||||
if (OpenVolume (TC_FIRST_BIOS_DRIVE, password, &cryptoInfo, nullptr, false, true))
|
||||
if (OpenVolume (TC_FIRST_BIOS_DRIVE, password, pim, &cryptoInfo, nullptr, false, true))
|
||||
{
|
||||
validHeaderPresent = true;
|
||||
masterKeyScheduleCrc = GetCrc32 (cryptoInfo->ks, sizeof (cryptoInfo->ks));
|
||||
@@ -973,7 +1049,7 @@ static void RepairMenu ()
|
||||
AcquireSectorBuffer();
|
||||
CopyMemory (TC_BOOT_LOADER_BUFFER_SEGMENT, 0, SectorBuffer, TC_LB_SIZE);
|
||||
|
||||
if (ReadVolumeHeader (TRUE, (char *) SectorBuffer, &password, &cryptoInfo, nullptr) == 0)
|
||||
if (ReadVolumeHeader (TRUE, (char *) SectorBuffer, &password, pim, &cryptoInfo, nullptr) == 0)
|
||||
{
|
||||
if (validHeaderPresent)
|
||||
{
|
||||
@@ -1081,7 +1157,7 @@ void main ()
|
||||
// Check whether the user is not using the Rescue Disk to create a hidden system
|
||||
|
||||
if (ReadWriteMBR (false, BootDrive, true) == BiosResultSuccess
|
||||
&& *(uint32 *) (SectorBuffer + 6) == 0x65757254
|
||||
&& *(uint32 *) (SectorBuffer + 6) == 0x61726556
|
||||
&& *(uint32 *) (SectorBuffer + 10) == 0x70797243
|
||||
&& (SectorBuffer[TC_BOOT_SECTOR_CONFIG_OFFSET] & TC_BOOT_CFG_MASK_HIDDEN_OS_CREATION_PHASE) != TC_HIDDEN_OS_CREATION_PHASE_NONE)
|
||||
{
|
||||
|
||||
@@ -1,9 +1,13 @@
|
||||
/*
|
||||
Copyright (c) 2008 TrueCrypt Developers Association. All rights reserved.
|
||||
Derived from source code of TrueCrypt 7.1a, which is
|
||||
Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
|
||||
by the TrueCrypt License 3.0.
|
||||
|
||||
Governed by the TrueCrypt License 3.0 the full text of which is contained in
|
||||
the file License.txt included in TrueCrypt binary and source code distribution
|
||||
packages.
|
||||
Modifications and additions to the original source code (contained in this file)
|
||||
and all other portions of this file are Copyright (c) 2013-2015 IDRIX
|
||||
and are governed by the Apache License 2.0 the full text of which is
|
||||
contained in the file License.txt included in VeraCrypt binary and source
|
||||
code distribution packages.
|
||||
*/
|
||||
|
||||
#ifndef TC_HEADER_Boot_BootMain
|
||||
@@ -12,7 +16,7 @@
|
||||
#include "TCdefs.h"
|
||||
#include "Platform.h"
|
||||
|
||||
static byte AskPassword (Password &password);
|
||||
static byte AskPassword (Password &password, int& pim);
|
||||
static int AskSelection (const char *options[], size_t optionCount);
|
||||
static bool AskYesNo (const char *message);
|
||||
static byte BootEncryptedDrive ();
|
||||
|
||||
@@ -1,9 +1,13 @@
|
||||
/*
|
||||
Copyright (c) 2008 TrueCrypt Developers Association. All rights reserved.
|
||||
Derived from source code of TrueCrypt 7.1a, which is
|
||||
Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
|
||||
by the TrueCrypt License 3.0.
|
||||
|
||||
Governed by the TrueCrypt License 3.0 the full text of which is contained in
|
||||
the file License.txt included in TrueCrypt binary and source code distribution
|
||||
packages.
|
||||
Modifications and additions to the original source code (contained in this file)
|
||||
and all other portions of this file are Copyright (c) 2013-2015 IDRIX
|
||||
and are governed by the Apache License 2.0 the full text of which is
|
||||
contained in the file License.txt included in VeraCrypt binary and source
|
||||
code distribution packages.
|
||||
*/
|
||||
|
||||
#include "BootDefs.h"
|
||||
|
||||
@@ -1,9 +1,13 @@
|
||||
/*
|
||||
Copyright (c) 2008 TrueCrypt Developers Association. All rights reserved.
|
||||
Derived from source code of TrueCrypt 7.1a, which is
|
||||
Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
|
||||
by the TrueCrypt License 3.0.
|
||||
|
||||
Governed by the TrueCrypt License 3.0 the full text of which is contained in
|
||||
the file License.txt included in TrueCrypt binary and source code distribution
|
||||
packages.
|
||||
Modifications and additions to the original source code (contained in this file)
|
||||
and all other portions of this file are Copyright (c) 2013-2015 IDRIX
|
||||
and are governed by the Apache License 2.0 the full text of which is
|
||||
contained in the file License.txt included in VeraCrypt binary and source
|
||||
code distribution packages.
|
||||
*/
|
||||
|
||||
#include "Platform.h"
|
||||
|
||||
@@ -1,9 +1,13 @@
|
||||
;
|
||||
; Copyright (c) 2008-2009 TrueCrypt Developers Association. All rights reserved.
|
||||
; Derived from source code of TrueCrypt 7.1a, which is
|
||||
; Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
|
||||
; by the TrueCrypt License 3.0.
|
||||
;
|
||||
; Governed by the TrueCrypt License 3.0 the full text of which is contained in
|
||||
; the file License.txt included in TrueCrypt binary and source code distribution
|
||||
; packages.
|
||||
; Modifications and additions to the original source code (contained in this file)
|
||||
; and all other portions of this file are Copyright (c) 2013-2015 IDRIX
|
||||
; and are governed by the Apache License 2.0 the full text of which is
|
||||
; contained in the file License.txt included in VeraCrypt binary and source
|
||||
; code distribution packages.
|
||||
;
|
||||
|
||||
.MODEL tiny
|
||||
@@ -134,6 +138,8 @@ checksum_ok:
|
||||
push dx
|
||||
|
||||
; Decompress boot loader
|
||||
mov cx, word ptr [start + TC_BOOT_SECTOR_LOADER_LENGTH_OFFSET]
|
||||
push cx ; Compressed data size
|
||||
push TC_BOOT_LOADER_COMPRESSED_BUFFER_OFFSET + TC_GZIP_HEADER_SIZE ; Compressed data
|
||||
push TC_MAX_BOOT_LOADER_DECOMPRESSED_SIZE ; Output buffer size
|
||||
push TC_BOOT_LOADER_DECOMPRESSOR_MEMORY_SIZE + TC_COM_EXECUTABLE_OFFSET ; Output buffer
|
||||
@@ -145,7 +151,7 @@ checksum_ok:
|
||||
retf
|
||||
decompressor_ret:
|
||||
|
||||
add sp, 6
|
||||
add sp, 8
|
||||
pop dx
|
||||
|
||||
; Restore boot sector segment
|
||||
|
||||
@@ -1,9 +1,13 @@
|
||||
/*
|
||||
Copyright (c) 2008 TrueCrypt Developers Association. All rights reserved.
|
||||
Derived from source code of TrueCrypt 7.1a, which is
|
||||
Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
|
||||
by the TrueCrypt License 3.0.
|
||||
|
||||
Governed by the TrueCrypt License 3.0 the full text of which is contained in
|
||||
the file License.txt included in TrueCrypt binary and source code distribution
|
||||
packages.
|
||||
Modifications and additions to the original source code (contained in this file)
|
||||
and all other portions of this file are Copyright (c) 2013-2015 IDRIX
|
||||
and are governed by the Apache License 2.0 the full text of which is
|
||||
contained in the file License.txt included in VeraCrypt binary and source
|
||||
code distribution packages.
|
||||
*/
|
||||
|
||||
#ifndef TC_HEADER_Boot_BootStrings
|
||||
|
||||
+445
-409
@@ -1,410 +1,433 @@
|
||||
/*
|
||||
puff.c
|
||||
Copyright (C) 2002-2004 Mark Adler, all rights reserved
|
||||
version 1.8, 9 Jan 2004
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the author be held liable for any damages
|
||||
arising from the use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute it
|
||||
freely, subject to the following restrictions:
|
||||
|
||||
1. The origin of this software must not be misrepresented; you must not
|
||||
claim that you wrote the original software. If you use this software
|
||||
in a product, an acknowledgment in the product documentation would be
|
||||
appreciated but is not required.
|
||||
2. Altered source versions must be plainly marked as such, and must not be
|
||||
misrepresented as being the original software.
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
|
||||
Mark Adler madler@alumni.caltech.edu
|
||||
*/
|
||||
|
||||
/* Adapted for TrueCrypt */
|
||||
|
||||
|
||||
#define local static /* for local function definitions */
|
||||
#define NIL ((unsigned char *)0) /* for no output option */
|
||||
|
||||
/*
|
||||
* Maximums for allocations and loops. It is not useful to change these --
|
||||
* they are fixed by the deflate format.
|
||||
*/
|
||||
#define MAXBITS 15 /* maximum bits in a code */
|
||||
#define MAXLCODES 286 /* maximum number of literal/length codes */
|
||||
#define MAXDCODES 30 /* maximum number of distance codes */
|
||||
#define MAXCODES (MAXLCODES+MAXDCODES) /* maximum codes lengths to read */
|
||||
#define FIXLCODES 288 /* number of fixed literal/length codes */
|
||||
|
||||
/* input and output state */
|
||||
struct state {
|
||||
/* output state */
|
||||
unsigned char *out; /* output buffer */
|
||||
unsigned int outlen; /* available space at out */
|
||||
unsigned int outcnt; /* bytes written to out so far */
|
||||
|
||||
/* input state */
|
||||
unsigned char *in; /* input buffer */
|
||||
unsigned int incnt; /* bytes read so far */
|
||||
int bitbuf; /* bit buffer */
|
||||
int bitcnt; /* number of bits in bit buffer */
|
||||
};
|
||||
|
||||
|
||||
local int bits(struct state *s, int need)
|
||||
{
|
||||
long val; /* bit accumulator (can use up to 20 bits) */
|
||||
|
||||
/* load at least need bits into val */
|
||||
val = s->bitbuf;
|
||||
while (s->bitcnt < need) {
|
||||
val |= (long)(s->in[s->incnt++]) << s->bitcnt; /* load eight bits */
|
||||
s->bitcnt += 8;
|
||||
}
|
||||
|
||||
/* drop need bits and update buffer, always zero to seven bits left */
|
||||
s->bitbuf = (int)(val >> need);
|
||||
s->bitcnt -= need;
|
||||
|
||||
/* return need bits, zeroing the bits above that */
|
||||
return (int)(val & ((1L << need) - 1));
|
||||
}
|
||||
|
||||
|
||||
local int stored(struct state *s)
|
||||
{
|
||||
unsigned len; /* length of stored block */
|
||||
|
||||
/* discard leftover bits from current byte (assumes s->bitcnt < 8) */
|
||||
s->bitbuf = 0;
|
||||
s->bitcnt = 0;
|
||||
|
||||
/* get length and check against its one's complement */
|
||||
len = s->in[s->incnt++];
|
||||
len |= s->in[s->incnt++] << 8;
|
||||
if (s->in[s->incnt++] != (~len & 0xff) ||
|
||||
s->in[s->incnt++] != ((~len >> 8) & 0xff))
|
||||
return -2; /* didn't match complement! */
|
||||
|
||||
/* copy len bytes from in to out */
|
||||
if (s->out != NIL) {
|
||||
if (s->outcnt + len > s->outlen)
|
||||
return 1; /* not enough output space */
|
||||
while (len--)
|
||||
s->out[s->outcnt++] = s->in[s->incnt++];
|
||||
}
|
||||
else { /* just scanning */
|
||||
s->outcnt += len;
|
||||
s->incnt += len;
|
||||
}
|
||||
|
||||
/* done with a valid stored block */
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
struct huffman {
|
||||
short *count; /* number of symbols of each length */
|
||||
short *symbol; /* canonically ordered symbols */
|
||||
};
|
||||
|
||||
|
||||
#ifdef SLOW
|
||||
local int decode(struct state *s, struct huffman *h)
|
||||
{
|
||||
int len; /* current number of bits in code */
|
||||
int code; /* len bits being decoded */
|
||||
int first; /* first code of length len */
|
||||
int count; /* number of codes of length len */
|
||||
int index; /* index of first code of length len in symbol table */
|
||||
|
||||
code = first = index = 0;
|
||||
for (len = 1; len <= MAXBITS; len++) {
|
||||
code |= bits(s, 1); /* get next bit */
|
||||
count = h->count[len];
|
||||
if (code < first + count) /* if length len, return symbol */
|
||||
return h->symbol[index + (code - first)];
|
||||
index += count; /* else update for next length */
|
||||
first += count;
|
||||
first <<= 1;
|
||||
code <<= 1;
|
||||
}
|
||||
return -9; /* ran out of codes */
|
||||
}
|
||||
|
||||
/*
|
||||
* A faster version of decode() for real applications of this code. It's not
|
||||
* as readable, but it makes puff() twice as fast. And it only makes the code
|
||||
* a few percent larger.
|
||||
*/
|
||||
#else /* !SLOW */
|
||||
local int decode(struct state *s, struct huffman *h)
|
||||
{
|
||||
int len; /* current number of bits in code */
|
||||
int code; /* len bits being decoded */
|
||||
int first; /* first code of length len */
|
||||
int count; /* number of codes of length len */
|
||||
int index; /* index of first code of length len in symbol table */
|
||||
int bitbuf; /* bits from stream */
|
||||
int left; /* bits left in next or left to process */
|
||||
short *next; /* next number of codes */
|
||||
|
||||
bitbuf = s->bitbuf;
|
||||
left = s->bitcnt;
|
||||
code = first = index = 0;
|
||||
len = 1;
|
||||
next = h->count + 1;
|
||||
while (1) {
|
||||
while (left--) {
|
||||
code |= bitbuf & 1;
|
||||
bitbuf >>= 1;
|
||||
count = *next++;
|
||||
if (code < first + count) { /* if length len, return symbol */
|
||||
s->bitbuf = bitbuf;
|
||||
s->bitcnt = (s->bitcnt - len) & 7;
|
||||
return h->symbol[index + (code - first)];
|
||||
}
|
||||
index += count; /* else update for next length */
|
||||
first += count;
|
||||
first <<= 1;
|
||||
code <<= 1;
|
||||
len++;
|
||||
}
|
||||
left = (MAXBITS+1) - len;
|
||||
if (left == 0) break;
|
||||
bitbuf = s->in[s->incnt++];
|
||||
if (left > 8) left = 8;
|
||||
}
|
||||
return -9; /* ran out of codes */
|
||||
}
|
||||
#endif /* SLOW */
|
||||
|
||||
|
||||
local int construct(struct huffman *h, short *length, int n)
|
||||
{
|
||||
int symbol; /* current symbol when stepping through length[] */
|
||||
int len; /* current length when stepping through h->count[] */
|
||||
int left; /* number of possible codes left of current length */
|
||||
short offs[MAXBITS+1]; /* offsets in symbol table for each length */
|
||||
|
||||
/* count number of codes of each length */
|
||||
for (len = 0; len <= MAXBITS; len++)
|
||||
h->count[len] = 0;
|
||||
for (symbol = 0; symbol < n; symbol++)
|
||||
(h->count[length[symbol]])++; /* assumes lengths are within bounds */
|
||||
if (h->count[0] == n) /* no codes! */
|
||||
return 0; /* complete, but decode() will fail */
|
||||
|
||||
/* check for an over-subscribed or incomplete set of lengths */
|
||||
left = 1; /* one possible code of zero length */
|
||||
for (len = 1; len <= MAXBITS; len++) {
|
||||
left <<= 1; /* one more bit, double codes left */
|
||||
left -= h->count[len]; /* deduct count from possible codes */
|
||||
if (left < 0) return left; /* over-subscribed--return negative */
|
||||
} /* left > 0 means incomplete */
|
||||
|
||||
/* generate offsets into symbol table for each length for sorting */
|
||||
offs[1] = 0;
|
||||
for (len = 1; len < MAXBITS; len++)
|
||||
offs[len + 1] = offs[len] + h->count[len];
|
||||
|
||||
/*
|
||||
* put symbols in table sorted by length, by symbol order within each
|
||||
* length
|
||||
*/
|
||||
for (symbol = 0; symbol < n; symbol++)
|
||||
if (length[symbol] != 0)
|
||||
h->symbol[offs[length[symbol]]++] = symbol;
|
||||
|
||||
/* return zero for complete set, positive for incomplete set */
|
||||
return left;
|
||||
}
|
||||
|
||||
|
||||
local int codes(struct state *s,
|
||||
struct huffman *lencode,
|
||||
struct huffman *distcode)
|
||||
{
|
||||
int symbol; /* decoded symbol */
|
||||
int len; /* length for copy */
|
||||
unsigned dist; /* distance for copy */
|
||||
static const short lens[29] = { /* Size base for length codes 257..285 */
|
||||
3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31,
|
||||
35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258};
|
||||
static const short lext[29] = { /* Extra bits for length codes 257..285 */
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2,
|
||||
3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0};
|
||||
static const short dists[30] = { /* Offset base for distance codes 0..29 */
|
||||
1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193,
|
||||
257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145,
|
||||
8193, 12289, 16385, 24577};
|
||||
static const short dext[30] = { /* Extra bits for distance codes 0..29 */
|
||||
0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6,
|
||||
7, 7, 8, 8, 9, 9, 10, 10, 11, 11,
|
||||
12, 12, 13, 13};
|
||||
|
||||
/* decode literals and length/distance pairs */
|
||||
do {
|
||||
symbol = decode(s, lencode);
|
||||
if (symbol < 0) return symbol; /* invalid symbol */
|
||||
if (symbol < 256) { /* literal: symbol is the byte */
|
||||
/* write out the literal */
|
||||
if (s->out != NIL) {
|
||||
if (s->outcnt == s->outlen) return 1;
|
||||
s->out[s->outcnt] = symbol;
|
||||
}
|
||||
s->outcnt++;
|
||||
}
|
||||
else if (symbol > 256) { /* length */
|
||||
/* get and compute length */
|
||||
symbol -= 257;
|
||||
if (symbol >= 29) return -9; /* invalid fixed code */
|
||||
len = lens[symbol] + bits(s, lext[symbol]);
|
||||
|
||||
/* get and check distance */
|
||||
symbol = decode(s, distcode);
|
||||
if (symbol < 0) return symbol; /* invalid symbol */
|
||||
dist = dists[symbol] + bits(s, dext[symbol]);
|
||||
if (dist > s->outcnt)
|
||||
return -10; /* distance too far back */
|
||||
|
||||
/* copy length bytes from distance bytes back */
|
||||
if (s->out != NIL) {
|
||||
if (s->outcnt + len > s->outlen) return 1;
|
||||
while (len--) {
|
||||
s->out[s->outcnt] = s->out[s->outcnt - dist];
|
||||
s->outcnt++;
|
||||
}
|
||||
}
|
||||
else
|
||||
s->outcnt += len;
|
||||
}
|
||||
} while (symbol != 256); /* end of block symbol */
|
||||
|
||||
/* done with a valid fixed or dynamic block */
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
local int fixed(struct state *s)
|
||||
{
|
||||
static int virgin = 1;
|
||||
static short lencnt[MAXBITS+1], lensym[FIXLCODES];
|
||||
static short distcnt[MAXBITS+1], distsym[MAXDCODES];
|
||||
static struct huffman lencode = {lencnt, lensym};
|
||||
static struct huffman distcode = {distcnt, distsym};
|
||||
|
||||
/* build fixed huffman tables if first call (may not be thread safe) */
|
||||
if (virgin) {
|
||||
int symbol;
|
||||
short lengths[FIXLCODES];
|
||||
|
||||
/* literal/length table */
|
||||
for (symbol = 0; symbol < 144; symbol++)
|
||||
lengths[symbol] = 8;
|
||||
for (; symbol < 256; symbol++)
|
||||
lengths[symbol] = 9;
|
||||
for (; symbol < 280; symbol++)
|
||||
lengths[symbol] = 7;
|
||||
for (; symbol < FIXLCODES; symbol++)
|
||||
lengths[symbol] = 8;
|
||||
construct(&lencode, lengths, FIXLCODES);
|
||||
|
||||
/* distance table */
|
||||
for (symbol = 0; symbol < MAXDCODES; symbol++)
|
||||
lengths[symbol] = 5;
|
||||
construct(&distcode, lengths, MAXDCODES);
|
||||
|
||||
/* do this just once */
|
||||
virgin = 0;
|
||||
}
|
||||
|
||||
/* decode data until end-of-block code */
|
||||
return codes(s, &lencode, &distcode);
|
||||
}
|
||||
|
||||
|
||||
local int dynamic(struct state *s)
|
||||
{
|
||||
int nlen, ndist, ncode; /* number of lengths in descriptor */
|
||||
int index; /* index of lengths[] */
|
||||
int err; /* construct() return value */
|
||||
short lengths[MAXCODES]; /* descriptor code lengths */
|
||||
short lencnt[MAXBITS+1], lensym[MAXLCODES]; /* lencode memory */
|
||||
short distcnt[MAXBITS+1], distsym[MAXDCODES]; /* distcode memory */
|
||||
struct huffman lencode = {lencnt, lensym}; /* length code */
|
||||
struct huffman distcode = {distcnt, distsym}; /* distance code */
|
||||
static const short order[19] = /* permutation of code length codes */
|
||||
{16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15};
|
||||
|
||||
/* get number of lengths in each table, check lengths */
|
||||
nlen = bits(s, 5) + 257;
|
||||
ndist = bits(s, 5) + 1;
|
||||
ncode = bits(s, 4) + 4;
|
||||
if (nlen > MAXLCODES || ndist > MAXDCODES)
|
||||
return -3; /* bad counts */
|
||||
|
||||
/* read code length code lengths (really), missing lengths are zero */
|
||||
for (index = 0; index < ncode; index++)
|
||||
lengths[order[index]] = bits(s, 3);
|
||||
for (; index < 19; index++)
|
||||
lengths[order[index]] = 0;
|
||||
|
||||
/* build huffman table for code lengths codes (use lencode temporarily) */
|
||||
err = construct(&lencode, lengths, 19);
|
||||
if (err != 0) return -4; /* require complete code set here */
|
||||
|
||||
/* read length/literal and distance code length tables */
|
||||
index = 0;
|
||||
while (index < nlen + ndist) {
|
||||
int symbol; /* decoded value */
|
||||
int len; /* last length to repeat */
|
||||
|
||||
symbol = decode(s, &lencode);
|
||||
if (symbol < 16) /* length in 0..15 */
|
||||
lengths[index++] = symbol;
|
||||
else { /* repeat instruction */
|
||||
len = 0; /* assume repeating zeros */
|
||||
if (symbol == 16) { /* repeat last length 3..6 times */
|
||||
if (index == 0) return -5; /* no last length! */
|
||||
len = lengths[index - 1]; /* last length */
|
||||
symbol = 3 + bits(s, 2);
|
||||
}
|
||||
else if (symbol == 17) /* repeat zero 3..10 times */
|
||||
symbol = 3 + bits(s, 3);
|
||||
else /* == 18, repeat zero 11..138 times */
|
||||
symbol = 11 + bits(s, 7);
|
||||
if (index + symbol > nlen + ndist)
|
||||
return -6; /* too many lengths! */
|
||||
while (symbol--) /* repeat last or zero symbol times */
|
||||
lengths[index++] = len;
|
||||
}
|
||||
}
|
||||
|
||||
/* build huffman table for literal/length codes */
|
||||
err = construct(&lencode, lengths, nlen);
|
||||
if (err < 0 || (err > 0 && nlen - lencode.count[0] != 1))
|
||||
return -7; /* only allow incomplete codes if just one code */
|
||||
|
||||
/* build huffman table for distance codes */
|
||||
err = construct(&distcode, lengths + nlen, ndist);
|
||||
if (err < 0 || (err > 0 && ndist - distcode.count[0] != 1))
|
||||
return -8; /* only allow incomplete codes if just one code */
|
||||
|
||||
/* decode data until end-of-block code */
|
||||
return codes(s, &lencode, &distcode);
|
||||
}
|
||||
|
||||
|
||||
void _acrtused () { }
|
||||
|
||||
// Decompress deflated data
|
||||
/*
|
||||
puff.c
|
||||
Copyright (C) 2002-2004 Mark Adler, all rights reserved
|
||||
version 1.8, 9 Jan 2004
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the author be held liable for any damages
|
||||
arising from the use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute it
|
||||
freely, subject to the following restrictions:
|
||||
|
||||
1. The origin of this software must not be misrepresented; you must not
|
||||
claim that you wrote the original software. If you use this software
|
||||
in a product, an acknowledgment in the product documentation would be
|
||||
appreciated but is not required.
|
||||
2. Altered source versions must be plainly marked as such, and must not be
|
||||
misrepresented as being the original software.
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
|
||||
Mark Adler madler@alumni.caltech.edu
|
||||
*/
|
||||
|
||||
/* Adapted for TrueCrypt */
|
||||
/* Adapted for VeraCrypt */
|
||||
|
||||
|
||||
#define local static /* for local function definitions */
|
||||
#define NIL ((unsigned char *)0) /* for no output option */
|
||||
|
||||
/*
|
||||
* Maximums for allocations and loops. It is not useful to change these --
|
||||
* they are fixed by the deflate format.
|
||||
*/
|
||||
#define MAXBITS 15 /* maximum bits in a code */
|
||||
#define MAXLCODES 286 /* maximum number of literal/length codes */
|
||||
#define MAXDCODES 30 /* maximum number of distance codes */
|
||||
#define MAXCODES (MAXLCODES+MAXDCODES) /* maximum codes lengths to read */
|
||||
#define FIXLCODES 288 /* number of fixed literal/length codes */
|
||||
|
||||
/* input and output state */
|
||||
struct state {
|
||||
/* output state */
|
||||
unsigned char *out; /* output buffer */
|
||||
unsigned int outlen; /* available space at out */
|
||||
unsigned int outcnt; /* bytes written to out so far */
|
||||
|
||||
/* input state */
|
||||
unsigned char *in; /* input buffer */
|
||||
unsigned int inlen; /* available input at in */
|
||||
unsigned int incnt; /* bytes read so far */
|
||||
int bitbuf; /* bit buffer */
|
||||
int bitcnt; /* number of bits in bit buffer */
|
||||
};
|
||||
|
||||
|
||||
local int bits(struct state *s, int need)
|
||||
{
|
||||
long val; /* bit accumulator (can use up to 20 bits) */
|
||||
|
||||
/* load at least need bits into val */
|
||||
val = s->bitbuf;
|
||||
while (s->bitcnt < need) {
|
||||
val |= (long)(s->in[s->incnt++]) << s->bitcnt; /* load eight bits */
|
||||
s->bitcnt += 8;
|
||||
}
|
||||
|
||||
/* drop need bits and update buffer, always zero to seven bits left */
|
||||
s->bitbuf = (int)(val >> need);
|
||||
s->bitcnt -= need;
|
||||
|
||||
/* return need bits, zeroing the bits above that */
|
||||
return (int)(val & ((1L << need) - 1));
|
||||
}
|
||||
|
||||
|
||||
local int stored(struct state *s)
|
||||
{
|
||||
unsigned len; /* length of stored block */
|
||||
|
||||
/* discard leftover bits from current byte (assumes s->bitcnt < 8) */
|
||||
s->bitbuf = 0;
|
||||
s->bitcnt = 0;
|
||||
|
||||
if (s->incnt + 4 > s->inlen)
|
||||
return 2; /* not enough input */
|
||||
|
||||
/* get length and check against its one's complement */
|
||||
len = s->in[s->incnt++];
|
||||
len |= s->in[s->incnt++] << 8;
|
||||
if (s->in[s->incnt++] != (~len & 0xff) ||
|
||||
s->in[s->incnt++] != ((~len >> 8) & 0xff))
|
||||
return -2; /* didn't match complement! */
|
||||
|
||||
if (s->incnt + len > s->inlen)
|
||||
return 2; /* not enough input */
|
||||
|
||||
/* copy len bytes from in to out */
|
||||
if (s->out != NIL) {
|
||||
if (s->outcnt + len > s->outlen)
|
||||
return 1; /* not enough output space */
|
||||
while (len--)
|
||||
s->out[s->outcnt++] = s->in[s->incnt++];
|
||||
}
|
||||
else { /* just scanning */
|
||||
s->outcnt += len;
|
||||
s->incnt += len;
|
||||
}
|
||||
|
||||
/* done with a valid stored block */
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
struct huffman {
|
||||
short *count; /* number of symbols of each length */
|
||||
short *symbol; /* canonically ordered symbols */
|
||||
};
|
||||
|
||||
/* reduce code size by using slow version of the decompressor */
|
||||
#define SLOW
|
||||
|
||||
#ifdef SLOW
|
||||
local int decode(struct state *s, struct huffman *h)
|
||||
{
|
||||
int len; /* current number of bits in code */
|
||||
int code; /* len bits being decoded */
|
||||
int first; /* first code of length len */
|
||||
int count; /* number of codes of length len */
|
||||
int index; /* index of first code of length len in symbol table */
|
||||
|
||||
code = first = index = 0;
|
||||
for (len = 1; len <= MAXBITS; len++) {
|
||||
code |= bits(s, 1); /* get next bit */
|
||||
count = h->count[len];
|
||||
if (code < first + count) /* if length len, return symbol */
|
||||
return h->symbol[index + (code - first)];
|
||||
index += count; /* else update for next length */
|
||||
first += count;
|
||||
first <<= 1;
|
||||
code <<= 1;
|
||||
}
|
||||
return -9; /* ran out of codes */
|
||||
}
|
||||
|
||||
/*
|
||||
* A faster version of decode() for real applications of this code. It's not
|
||||
* as readable, but it makes puff() twice as fast. And it only makes the code
|
||||
* a few percent larger.
|
||||
*/
|
||||
#else /* !SLOW */
|
||||
local int decode(struct state *s, struct huffman *h)
|
||||
{
|
||||
int len; /* current number of bits in code */
|
||||
int code; /* len bits being decoded */
|
||||
int first; /* first code of length len */
|
||||
int count; /* number of codes of length len */
|
||||
int index; /* index of first code of length len in symbol table */
|
||||
int bitbuf; /* bits from stream */
|
||||
int left; /* bits left in next or left to process */
|
||||
short *next; /* next number of codes */
|
||||
|
||||
bitbuf = s->bitbuf;
|
||||
left = s->bitcnt;
|
||||
code = first = index = 0;
|
||||
len = 1;
|
||||
next = h->count + 1;
|
||||
while (1) {
|
||||
while (left--) {
|
||||
code |= bitbuf & 1;
|
||||
bitbuf >>= 1;
|
||||
count = *next++;
|
||||
if (code < first + count) { /* if length len, return symbol */
|
||||
s->bitbuf = bitbuf;
|
||||
s->bitcnt = (s->bitcnt - len) & 7;
|
||||
return h->symbol[index + (code - first)];
|
||||
}
|
||||
index += count; /* else update for next length */
|
||||
first += count;
|
||||
first <<= 1;
|
||||
code <<= 1;
|
||||
len++;
|
||||
}
|
||||
left = (MAXBITS+1) - len;
|
||||
if (left == 0) break;
|
||||
bitbuf = s->in[s->incnt++];
|
||||
if (left > 8) left = 8;
|
||||
}
|
||||
return -9; /* ran out of codes */
|
||||
}
|
||||
#endif /* SLOW */
|
||||
|
||||
|
||||
local int construct(struct huffman *h, short *length, int n)
|
||||
{
|
||||
int symbol; /* current symbol when stepping through length[] */
|
||||
int len; /* current length when stepping through h->count[] */
|
||||
int left; /* number of possible codes left of current length */
|
||||
short offs[MAXBITS+1]; /* offsets in symbol table for each length */
|
||||
|
||||
/* count number of codes of each length */
|
||||
for (len = 0; len <= MAXBITS; len++)
|
||||
h->count[len] = 0;
|
||||
for (symbol = 0; symbol < n; symbol++)
|
||||
(h->count[length[symbol]])++; /* assumes lengths are within bounds */
|
||||
if (h->count[0] == n) /* no codes! */
|
||||
return 0; /* complete, but decode() will fail */
|
||||
|
||||
/* check for an over-subscribed or incomplete set of lengths */
|
||||
left = 1; /* one possible code of zero length */
|
||||
for (len = 1; len <= MAXBITS; len++) {
|
||||
left <<= 1; /* one more bit, double codes left */
|
||||
left -= h->count[len]; /* deduct count from possible codes */
|
||||
if (left < 0) return left; /* over-subscribed--return negative */
|
||||
} /* left > 0 means incomplete */
|
||||
|
||||
/* generate offsets into symbol table for each length for sorting */
|
||||
offs[1] = 0;
|
||||
for (len = 1; len < MAXBITS; len++)
|
||||
offs[len + 1] = offs[len] + h->count[len];
|
||||
|
||||
/*
|
||||
* put symbols in table sorted by length, by symbol order within each
|
||||
* length
|
||||
*/
|
||||
for (symbol = 0; symbol < n; symbol++)
|
||||
if (length[symbol] != 0)
|
||||
h->symbol[offs[length[symbol]]++] = symbol;
|
||||
|
||||
/* return zero for complete set, positive for incomplete set */
|
||||
return left;
|
||||
}
|
||||
|
||||
|
||||
local int codes(struct state *s,
|
||||
struct huffman *lencode,
|
||||
struct huffman *distcode)
|
||||
{
|
||||
int symbol; /* decoded symbol */
|
||||
int len; /* length for copy */
|
||||
unsigned dist; /* distance for copy */
|
||||
static const short lens[29] = { /* Size base for length codes 257..285 */
|
||||
3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31,
|
||||
35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258};
|
||||
static const short lext[29] = { /* Extra bits for length codes 257..285 */
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2,
|
||||
3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0};
|
||||
static const short dists[30] = { /* Offset base for distance codes 0..29 */
|
||||
1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193,
|
||||
257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145,
|
||||
8193, 12289, 16385, 24577};
|
||||
static const short dext[30] = { /* Extra bits for distance codes 0..29 */
|
||||
0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6,
|
||||
7, 7, 8, 8, 9, 9, 10, 10, 11, 11,
|
||||
12, 12, 13, 13};
|
||||
|
||||
/* decode literals and length/distance pairs */
|
||||
do {
|
||||
symbol = decode(s, lencode);
|
||||
if (symbol < 0) return symbol; /* invalid symbol */
|
||||
if (symbol < 256) { /* literal: symbol is the byte */
|
||||
/* write out the literal */
|
||||
if (s->out != NIL) {
|
||||
if (s->outcnt == s->outlen) return 1;
|
||||
s->out[s->outcnt] = symbol;
|
||||
}
|
||||
s->outcnt++;
|
||||
}
|
||||
else if (symbol > 256) { /* length */
|
||||
/* get and compute length */
|
||||
symbol -= 257;
|
||||
if (symbol >= 29) return -9; /* invalid fixed code */
|
||||
len = lens[symbol] + bits(s, lext[symbol]);
|
||||
|
||||
/* get and check distance */
|
||||
symbol = decode(s, distcode);
|
||||
if (symbol < 0) return symbol; /* invalid symbol */
|
||||
dist = dists[symbol] + bits(s, dext[symbol]);
|
||||
if (dist > s->outcnt)
|
||||
return -10; /* distance too far back */
|
||||
|
||||
/* copy length bytes from distance bytes back */
|
||||
if (s->out != NIL) {
|
||||
if (s->outcnt + len > s->outlen) return 1;
|
||||
while (len--) {
|
||||
s->out[s->outcnt] = s->out[s->outcnt - dist];
|
||||
s->outcnt++;
|
||||
}
|
||||
}
|
||||
else
|
||||
s->outcnt += len;
|
||||
}
|
||||
} while (symbol != 256); /* end of block symbol */
|
||||
|
||||
/* done with a valid fixed or dynamic block */
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
local int fixed(struct state *s)
|
||||
{
|
||||
static int virgin = 1;
|
||||
static short lencnt[MAXBITS+1], lensym[FIXLCODES];
|
||||
static short distcnt[MAXBITS+1], distsym[MAXDCODES];
|
||||
static struct huffman lencode = {lencnt, lensym};
|
||||
static struct huffman distcode = {distcnt, distsym};
|
||||
|
||||
/* build fixed huffman tables if first call (may not be thread safe) */
|
||||
if (virgin) {
|
||||
int symbol;
|
||||
short lengths[FIXLCODES];
|
||||
|
||||
/* literal/length table */
|
||||
for (symbol = 0; symbol < 144; symbol++)
|
||||
lengths[symbol] = 8;
|
||||
for (; symbol < 256; symbol++)
|
||||
lengths[symbol] = 9;
|
||||
for (; symbol < 280; symbol++)
|
||||
lengths[symbol] = 7;
|
||||
for (; symbol < FIXLCODES; symbol++)
|
||||
lengths[symbol] = 8;
|
||||
construct(&lencode, lengths, FIXLCODES);
|
||||
|
||||
/* distance table */
|
||||
for (symbol = 0; symbol < MAXDCODES; symbol++)
|
||||
lengths[symbol] = 5;
|
||||
construct(&distcode, lengths, MAXDCODES);
|
||||
|
||||
/* do this just once */
|
||||
virgin = 0;
|
||||
}
|
||||
|
||||
/* decode data until end-of-block code */
|
||||
return codes(s, &lencode, &distcode);
|
||||
}
|
||||
|
||||
|
||||
local int dynamic(struct state *s)
|
||||
{
|
||||
int nlen, ndist, ncode; /* number of lengths in descriptor */
|
||||
int index; /* index of lengths[] */
|
||||
int err; /* construct() return value */
|
||||
short lengths[MAXCODES]; /* descriptor code lengths */
|
||||
short lencnt[MAXBITS+1], lensym[MAXLCODES]; /* lencode memory */
|
||||
short distcnt[MAXBITS+1], distsym[MAXDCODES]; /* distcode memory */
|
||||
struct huffman lencode = {lencnt, lensym}; /* length code */
|
||||
struct huffman distcode = {distcnt, distsym}; /* distance code */
|
||||
static const short order[19] = /* permutation of code length codes */
|
||||
{16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15};
|
||||
|
||||
/* get number of lengths in each table, check lengths */
|
||||
nlen = bits(s, 5) + 257;
|
||||
ndist = bits(s, 5) + 1;
|
||||
ncode = bits(s, 4) + 4;
|
||||
if (nlen > MAXLCODES || ndist > MAXDCODES)
|
||||
return -3; /* bad counts */
|
||||
|
||||
/* read code length code lengths (really), missing lengths are zero */
|
||||
for (index = 0; index < ncode; index++)
|
||||
lengths[order[index]] = bits(s, 3);
|
||||
for (; index < 19; index++)
|
||||
lengths[order[index]] = 0;
|
||||
|
||||
/* build huffman table for code lengths codes (use lencode temporarily) */
|
||||
err = construct(&lencode, lengths, 19);
|
||||
if (err != 0) return -4; /* require complete code set here */
|
||||
|
||||
/* read length/literal and distance code length tables */
|
||||
index = 0;
|
||||
while (index < nlen + ndist) {
|
||||
int symbol; /* decoded value */
|
||||
int len; /* last length to repeat */
|
||||
|
||||
symbol = decode(s, &lencode);
|
||||
if (symbol < 0)
|
||||
return symbol; /* invalid symbol */
|
||||
if (symbol < 16) /* length in 0..15 */
|
||||
lengths[index++] = symbol;
|
||||
else { /* repeat instruction */
|
||||
len = 0; /* assume repeating zeros */
|
||||
switch(symbol)
|
||||
{
|
||||
case 16: { /* repeat last length 3..6 times */
|
||||
if (index == 0) return -5; /* no last length! */
|
||||
len = lengths[index - 1]; /* last length */
|
||||
symbol = 3 + bits(s, 2);
|
||||
break;
|
||||
}
|
||||
case 17: /* repeat zero 3..10 times */
|
||||
symbol = 3 + bits(s, 3);
|
||||
break;
|
||||
default: /* == 18, repeat zero 11..138 times */
|
||||
symbol = 11 + bits(s, 7);
|
||||
break;
|
||||
}
|
||||
if ((index + symbol > nlen + ndist))
|
||||
return -6; /* too many lengths! */
|
||||
while (symbol--) /* repeat last or zero symbol times */
|
||||
lengths[index++] = len;
|
||||
}
|
||||
}
|
||||
|
||||
/* check for end-of-block code -- there better be one! */
|
||||
if (lengths[256] == 0)
|
||||
return -9;
|
||||
|
||||
/* build huffman table for literal/length codes */
|
||||
err = construct(&lencode, lengths, nlen);
|
||||
if (err < 0 || (err > 0 && nlen - lencode.count[0] != 1))
|
||||
return -7; /* only allow incomplete codes if just one code */
|
||||
|
||||
/* build huffman table for distance codes */
|
||||
err = construct(&distcode, lengths + nlen, ndist);
|
||||
if (err < 0 || (err > 0 && ndist - distcode.count[0] != 1))
|
||||
return -8; /* only allow incomplete codes if just one code */
|
||||
|
||||
/* decode data until end-of-block code */
|
||||
return codes(s, &lencode, &distcode);
|
||||
}
|
||||
|
||||
|
||||
void _acrtused () { }
|
||||
|
||||
// Decompress deflated data
|
||||
int far main (
|
||||
unsigned char *dest, /* pointer to destination pointer */
|
||||
unsigned int destlen, /* amount of output space */
|
||||
unsigned char *source) /* pointer to source data pointer */
|
||||
unsigned char *source, /* pointer to source data pointer */
|
||||
unsigned int sourcelen)
|
||||
{
|
||||
struct state s; /* input/output state */
|
||||
int last, type; /* block information */
|
||||
@@ -417,6 +440,7 @@ int far main (
|
||||
|
||||
/* initialize input state */
|
||||
s.in = source;
|
||||
s.inlen = sourcelen;
|
||||
s.incnt = 0;
|
||||
s.bitbuf = 0;
|
||||
s.bitcnt = 0;
|
||||
@@ -425,12 +449,24 @@ int far main (
|
||||
do {
|
||||
last = bits(&s, 1); /* one if last block */
|
||||
type = bits(&s, 2); /* block type 0..3 */
|
||||
err = type == 0 ? stored(&s) :
|
||||
(type == 1 ? fixed(&s) :
|
||||
(type == 2 ? dynamic(&s) :
|
||||
-1)); /* type == 3, invalid */
|
||||
switch(type)
|
||||
{
|
||||
case 0:
|
||||
err = stored(&s);
|
||||
break;
|
||||
case 1:
|
||||
err = fixed(&s);
|
||||
break;
|
||||
case 2:
|
||||
err = dynamic(&s);
|
||||
break;
|
||||
default:
|
||||
err = -1; /* type == 3, invalid */
|
||||
break;
|
||||
}
|
||||
|
||||
if (err != 0) break; /* return with error */
|
||||
} while (!last);
|
||||
|
||||
return err;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,13 @@
|
||||
/*
|
||||
Copyright (c) 2008 TrueCrypt Developers Association. All rights reserved.
|
||||
Derived from source code of TrueCrypt 7.1a, which is
|
||||
Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
|
||||
by the TrueCrypt License 3.0.
|
||||
|
||||
Governed by the TrueCrypt License 3.0 the full text of which is contained in
|
||||
the file License.txt included in TrueCrypt binary and source code distribution
|
||||
packages.
|
||||
Modifications and additions to the original source code (contained in this file)
|
||||
and all other portions of this file are Copyright (c) 2013-2015 IDRIX
|
||||
and are governed by the Apache License 2.0 the full text of which is
|
||||
contained in the file License.txt included in VeraCrypt binary and source
|
||||
code distribution packages.
|
||||
*/
|
||||
|
||||
#include "Platform.h"
|
||||
|
||||
@@ -1,9 +1,13 @@
|
||||
/*
|
||||
Copyright (c) 2008 TrueCrypt Developers Association. All rights reserved.
|
||||
Derived from source code of TrueCrypt 7.1a, which is
|
||||
Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
|
||||
by the TrueCrypt License 3.0.
|
||||
|
||||
Governed by the TrueCrypt License 3.0 the full text of which is contained in
|
||||
the file License.txt included in TrueCrypt binary and source code distribution
|
||||
packages.
|
||||
Modifications and additions to the original source code (contained in this file)
|
||||
and all other portions of this file are Copyright (c) 2013-2015 IDRIX
|
||||
and are governed by the Apache License 2.0 the full text of which is
|
||||
contained in the file License.txt included in VeraCrypt binary and source
|
||||
code distribution packages.
|
||||
*/
|
||||
|
||||
#ifndef TC_HEADER_Boot_IntFilter
|
||||
|
||||
@@ -1,10 +1,13 @@
|
||||
#
|
||||
# Copyright (c) 2008-2010 TrueCrypt Developers Association. All rights reserved.
|
||||
#
|
||||
# Governed by the TrueCrypt License 3.0 the full text of which is contained in
|
||||
# the file License.txt included in TrueCrypt binary and source code distribution
|
||||
# packages.
|
||||
# Derived from source code of TrueCrypt 7.1a, which is
|
||||
# Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
|
||||
# by the TrueCrypt License 3.0.
|
||||
#
|
||||
# Modifications and additions to the original source code (contained in this file)
|
||||
# and all other portions of this file are Copyright (c) 2013-2015 IDRIX
|
||||
# and are governed by the Apache License 2.0 the full text of which is
|
||||
# contained in the file License.txt included in VeraCrypt binary and source
|
||||
# code distribution packages.
|
||||
|
||||
PROJ = BootLoader
|
||||
.SILENT:
|
||||
@@ -39,6 +42,13 @@ OBJDIR = $(OBJDIR)_$(SINGLE_CIPHER)
|
||||
CFLAGS = $(CFLAGS) /D TC_WINDOWS_BOOT_SINGLE_CIPHER_MODE /D TC_WINDOWS_BOOT_$(SINGLE_CIPHER)
|
||||
!endif
|
||||
|
||||
!ifdef SINGLE_PRF
|
||||
OBJDIR = $(OBJDIR)_$(SINGLE_PRF)
|
||||
CFLAGS = $(CFLAGS) /D TC_WINDOWS_BOOT_$(SINGLE_PRF)
|
||||
!else
|
||||
CFLAGS = $(CFLAGS) /D TC_WINDOWS_BOOT_RIPEMD160
|
||||
!endif
|
||||
|
||||
OUTDIR = $(OBJDIR)
|
||||
TARGETEXT = com
|
||||
TARGETS = $(OUTDIR)\BootDefs.i $(OUTDIR)\BootSector.bin $(OUTDIR)\Decompressor.com
|
||||
@@ -72,7 +82,11 @@ OBJS = $(OBJS) $(OUTDIR)\Pkcs5.obj
|
||||
OBJS = $(OBJS) $(OUTDIR)\Volumes.obj
|
||||
OBJS = $(OBJS) $(OUTDIR)\Xts.obj
|
||||
|
||||
!if "$(SINGLE_PRF)" == "SHA2"
|
||||
OBJS = $(OBJS) $(OUTDIR)\Sha2Small.obj
|
||||
!else
|
||||
OBJS = $(OBJS) $(OUTDIR)\Rmd160.obj
|
||||
!endif
|
||||
|
||||
!if !DEFINED (SINGLE_CIPHER)
|
||||
OBJS = $(OBJS) $(OUTDIR)\AesSmall.obj
|
||||
|
||||
@@ -1,9 +1,13 @@
|
||||
/*
|
||||
Copyright (c) 2008 TrueCrypt Developers Association. All rights reserved.
|
||||
Derived from source code of TrueCrypt 7.1a, which is
|
||||
Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
|
||||
by the TrueCrypt License 3.0.
|
||||
|
||||
Governed by the TrueCrypt License 3.0 the full text of which is contained in
|
||||
the file License.txt included in TrueCrypt binary and source code distribution
|
||||
packages.
|
||||
Modifications and additions to the original source code (contained in this file)
|
||||
and all other portions of this file are Copyright (c) 2013-2015 IDRIX
|
||||
and are governed by the Apache License 2.0 the full text of which is
|
||||
contained in the file License.txt included in VeraCrypt binary and source
|
||||
code distribution packages.
|
||||
*/
|
||||
|
||||
#include "Platform.h"
|
||||
|
||||
@@ -1,9 +1,13 @@
|
||||
/*
|
||||
Copyright (c) 2008-2009 TrueCrypt Developers Association. All rights reserved.
|
||||
Derived from source code of TrueCrypt 7.1a, which is
|
||||
Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
|
||||
by the TrueCrypt License 3.0.
|
||||
|
||||
Governed by the TrueCrypt License 3.0 the full text of which is contained in
|
||||
the file License.txt included in TrueCrypt binary and source code distribution
|
||||
packages.
|
||||
Modifications and additions to the original source code (contained in this file)
|
||||
and all other portions of this file are Copyright (c) 2013-2015 IDRIX
|
||||
and are governed by the Apache License 2.0 the full text of which is
|
||||
contained in the file License.txt included in VeraCrypt binary and source
|
||||
code distribution packages.
|
||||
*/
|
||||
|
||||
#ifndef TC_HEADER_Boot_Platform
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
#
|
||||
# Derived from source code of TrueCrypt 7.1a, which is
|
||||
# Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
|
||||
# by the TrueCrypt License 3.0.
|
||||
#
|
||||
# Modifications and additions to the original source code (contained in this file)
|
||||
# and all other portions of this file are Copyright (c) 2013-2015 IDRIX
|
||||
# and are governed by the Apache License 2.0 the full text of which is
|
||||
# contained in the file License.txt included in VeraCrypt binary and source
|
||||
# code distribution packages.
|
||||
#
|
||||
|
||||
$(NAME): $(NAME).a
|
||||
|
||||
clean:
|
||||
@echo Cleaning $(NAME)
|
||||
rm -f $(APPNAME) $(NAME).a $(OBJS) $(OBJSEX) $(OBJS:.o=.d) *.gch
|
||||
|
||||
%.o: %.c
|
||||
@echo Compiling $(<F)
|
||||
$(CC) $(CFLAGS) -c $< -o $@
|
||||
|
||||
%.o: %.cpp
|
||||
@echo Compiling $(<F)
|
||||
$(CXX) $(CXXFLAGS) -c $< -o $@
|
||||
|
||||
ifeq "$(PLATFORM)" "MacOSX"
|
||||
%.o: %.asm
|
||||
@echo Assembling $(<F)
|
||||
$(AS) $(ASFLAGS) -f macho32 -o $@.32 $<
|
||||
$(AS) $(ASFLAGS) -f macho64 -o $@.64 $<
|
||||
lipo -create $@.32 $@.64 -output $@
|
||||
else
|
||||
%.o: %.asm
|
||||
@echo Assembling $(<F)
|
||||
$(AS) $(ASFLAGS) -o $@ $<
|
||||
endif
|
||||
|
||||
# Precompiled headers
|
||||
%.h.gch: %.h
|
||||
@echo Precompiling $(<F)
|
||||
$(CXX) $(CXXFLAGS) -g0 -c $< || (rm -f $(<F).gch && exit 1)
|
||||
|
||||
|
||||
# Embedded files
|
||||
OD_BIN := od -v -t u1 -A n
|
||||
TR_SED_BIN := tr '\n' ' ' | tr -s ' ' ',' | sed -e 's/^,//g' -e 's/,$$/n/' | tr 'n' '\n'
|
||||
|
||||
%.xml.h: %.xml
|
||||
@echo Converting $(<F)
|
||||
$(OD_BIN) $< | $(TR_SED_BIN) >$@
|
||||
|
||||
%.txt.h: %.txt
|
||||
@echo Converting $(<F)
|
||||
$(OD_BIN) $< | $(TR_SED_BIN) >$@
|
||||
|
||||
%.bmp.h: %.bmp
|
||||
@echo Converting $(<F)
|
||||
$(OD_BIN) $< | $(TR_SED_BIN) >$@
|
||||
|
||||
|
||||
# Dependencies
|
||||
-include $(OBJS:.o=.d) $(OBJSEX:.oo=.d)
|
||||
|
||||
|
||||
$(NAME).a: $(OBJS) $(OBJSEX)
|
||||
@echo Updating library $@
|
||||
$(AR) $(AFLAGS) -rcu $@ $(OBJS) $(OBJSEX)
|
||||
$(RANLIB) $@
|
||||
@@ -0,0 +1,44 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist SYSTEM "file://localhost/System/Library/DTDs/PropertyList.dtd">
|
||||
<plist version="0.9">
|
||||
<dict>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>org.idrix.VeraCrypt</string>
|
||||
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>English</string>
|
||||
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>VeraCrypt</string>
|
||||
|
||||
<key>CFBundleIconFile</key>
|
||||
<string>VeraCrypt.icns</string>
|
||||
|
||||
<key>CFBundleName</key>
|
||||
<string>VeraCrypt</string>
|
||||
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
|
||||
<key>CFBundleSignature</key>
|
||||
<string>TRUE</string>
|
||||
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1.13.1</string>
|
||||
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>_VERSION_</string>
|
||||
|
||||
<key>CFBundleLongVersionString</key>
|
||||
<string>VeraCrypt _VERSION_</string>
|
||||
|
||||
<key>LSRequiresCarbon</key>
|
||||
<false/>
|
||||
|
||||
<key>CSResourcesFileMapped</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
||||
Executable
BIN
Binary file not shown.
Executable
+47
@@ -0,0 +1,47 @@
|
||||
#
|
||||
# Copyright (c) 2013-2015 IDRIX
|
||||
# Governed by the Apache License 2.0 the full text of which is contained
|
||||
# in the file License.txt included in VeraCrypt binary and source
|
||||
# code distribution packages.
|
||||
#
|
||||
|
||||
# Absolute path to this script
|
||||
SCRIPT=$(readlink -f "$0")
|
||||
# Absolute path this script is in
|
||||
SCRIPTPATH=$(dirname "$SCRIPT")
|
||||
# source directory which contains the Makefile
|
||||
SOURCEPATH=$(readlink -f "$SCRIPTPATH/..")
|
||||
# directory where the VeraCrypt has been checked out
|
||||
PARENTDIR=$(readlink -f "$SCRIPTPATH/../../..")
|
||||
|
||||
# Make sure only root can run our script
|
||||
if [ "$(id -u)" != "0" ]; then
|
||||
echo "VeraCrypt must be built by root" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# the sources of wxWidgets 3.0.2 must be extracted to the parent directory
|
||||
export WX_ROOT=$PARENTDIR/wxWidgets-3.0.2
|
||||
echo "Using wxWidgets sources in $WX_ROOT"
|
||||
|
||||
cd $SOURCEPATH
|
||||
|
||||
echo "Building GUI version of VeraCrypt"
|
||||
|
||||
# this will be the temporary wxWidgets directory
|
||||
export WX_BUILD_DIR=$PARENTDIR/wxBuildGui
|
||||
|
||||
make WXSTATIC=1 wxbuild && make WXSTATIC=1 clean && make WXSTATIC=1
|
||||
|
||||
# Uncomment below and comment line above to reuse existing wxWidgets build
|
||||
# make WXSTATIC=1 clean && make WXSTATIC=1
|
||||
|
||||
echo "Building console version of VeraCrypt"
|
||||
|
||||
# this will be the temporary wxWidgets directory
|
||||
export WX_BUILD_DIR=$PARENTDIR/wxBuildConsole
|
||||
|
||||
make WXSTATIC=1 NOGUI=1 wxbuild && make WXSTATIC=1 NOGUI=1 clean && make WXSTATIC=1 NOGUI=1
|
||||
|
||||
# Uncomment below and comment line above to reuse existing wxWidgets build
|
||||
# make WXSTATIC=1 NOGUI=1 clean && make WXSTATIC=1 NOGUI=1
|
||||
Executable
+31
@@ -0,0 +1,31 @@
|
||||
#
|
||||
# Copyright (c) 2013-2015 IDRIX
|
||||
# Governed by the Apache License 2.0 the full text of which is contained
|
||||
# in the file License.txt included in VeraCrypt binary and source
|
||||
# code distribution packages.
|
||||
#
|
||||
|
||||
# Absolute path this script is in
|
||||
SCRIPTPATH=$(cd "$(dirname "$0")"; pwd)
|
||||
# source directory which contains the Makefile
|
||||
SOURCEPATH=$(cd "$(dirname "$SCRIPTPATH/../.")"; pwd)
|
||||
# directory where the VeraCrypt project has been checked out
|
||||
PARENTDIR=$(cd "$(dirname "$SCRIPTPATH/../../../.")"; pwd)
|
||||
|
||||
# the sources of wxWidgets 3.0.2 must be extracted to the parent directory
|
||||
export WX_ROOT=$PARENTDIR/wxWidgets-3.0.2
|
||||
echo "Using wxWidgets sources in $WX_ROOT"
|
||||
|
||||
# this will be the temporary wxWidgets directory
|
||||
export WX_BUILD_DIR=$PARENTDIR/wxBuild
|
||||
|
||||
# define the SDK version to use. We use 10.6 by default
|
||||
export VC_OSX_TARGET=10.6
|
||||
echo "Using MacOSX SDK $VC_OSX_TARGET"
|
||||
|
||||
|
||||
cd $SOURCEPATH
|
||||
|
||||
echo "Building VeraCrypt"
|
||||
make WXSTATIC=1 wxbuild && make WXSTATIC=1 clean && make WXSTATIC=1
|
||||
|
||||
+26
-11
@@ -1,12 +1,14 @@
|
||||
/*
|
||||
Legal Notice: Some portions of the source code contained in this file were
|
||||
derived from the source code of Encryption for the Masses 2.02a, which is
|
||||
Copyright (c) 1998-2000 Paul Le Roux and which is governed by the 'License
|
||||
Agreement for Encryption for the Masses'. Modifications and additions to
|
||||
the original source code (contained in this file) and all other portions
|
||||
of this file are Copyright (c) 2003-2010 TrueCrypt Developers Association
|
||||
and are governed by the TrueCrypt License 3.0 the full text of which is
|
||||
contained in the file License.txt included in TrueCrypt binary and source
|
||||
derived from the source code of TrueCrypt 7.1a, which is
|
||||
Copyright (c) 2003-2012 TrueCrypt Developers Association and which is
|
||||
governed by the TrueCrypt License 3.0, also from the source code of
|
||||
Encryption for the Masses 2.02a, which is Copyright (c) 1998-2000 Paul Le Roux
|
||||
and which is governed by the 'License Agreement for Encryption for the Masses'
|
||||
Modifications and additions to the original source code (contained in this file)
|
||||
and all other portions of this file are Copyright (c) 2013-2015 IDRIX
|
||||
and are governed by the Apache License 2.0 the full text of which is
|
||||
contained in the file License.txt included in VeraCrypt binary and source
|
||||
code distribution packages. */
|
||||
|
||||
#pragma once
|
||||
@@ -62,6 +64,7 @@
|
||||
#define TC_IOCTL_SET_SYSTEM_FAVORITE_VOLUME_DIRTY TC_IOCTL (36)
|
||||
#define TC_IOCTL_REREAD_DRIVER_CONFIG TC_IOCTL (37)
|
||||
#define TC_IOCTL_GET_SYSTEM_DRIVE_DUMP_CONFIG TC_IOCTL (38)
|
||||
#define VC_IOCTL_GET_BOOT_LOADER_FINGERPRINT TC_IOCTL (39)
|
||||
|
||||
// Legacy IOCTLs used before version 5.0
|
||||
#define TC_IOCTL_LEGACY_GET_DRIVER_VERSION 466968
|
||||
@@ -100,6 +103,12 @@ typedef struct
|
||||
Password ProtectedHidVolPassword; /* Password to the hidden volume to be protected against overwriting */
|
||||
BOOL UseBackupHeader;
|
||||
BOOL RecoveryMode;
|
||||
int pkcs5_prf;
|
||||
int ProtectedHidVolPkcs5Prf;
|
||||
BOOL bTrueCryptMode;
|
||||
uint32 BytesPerPhysicalSector;
|
||||
int VolumePim;
|
||||
int ProtectedHidVolPim;
|
||||
} MOUNT_STRUCT;
|
||||
|
||||
typedef struct
|
||||
@@ -117,6 +126,7 @@ typedef struct
|
||||
unsigned __int64 diskLength[26];
|
||||
int ea[26];
|
||||
int volumeType[26]; /* Volume type (e.g. PROP_VOL_TYPE_OUTER, PROP_VOL_TYPE_OUTER_VOL_WRITE_PREVENTED, etc.) */
|
||||
BOOL truecryptMode[26];
|
||||
} MOUNT_LIST_STRUCT;
|
||||
|
||||
typedef struct
|
||||
@@ -133,15 +143,12 @@ typedef struct
|
||||
BOOL readOnly;
|
||||
BOOL removable;
|
||||
BOOL partitionInInactiveSysEncScope;
|
||||
#if 0
|
||||
unsigned __int64 volumeCreationTime; // Deprecated in v6.0
|
||||
unsigned __int64 headerCreationTime; // Deprecated in v6.0
|
||||
#endif
|
||||
uint32 volumeHeaderFlags;
|
||||
unsigned __int64 totalBytesRead;
|
||||
unsigned __int64 totalBytesWritten;
|
||||
int hiddenVolProtection; /* Hidden volume protection status (e.g. HIDVOL_PROT_STATUS_NONE, HIDVOL_PROT_STATUS_ACTIVE, etc.) */
|
||||
int volFormatVersion;
|
||||
int volumePim;
|
||||
} VOLUME_PROPERTIES_STRUCT;
|
||||
|
||||
typedef struct
|
||||
@@ -239,14 +246,22 @@ typedef struct
|
||||
typedef struct
|
||||
{
|
||||
Password VolumePassword;
|
||||
int pkcs5_prf;
|
||||
int pim;
|
||||
} ReopenBootVolumeHeaderRequest;
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
char BootEncryptionAlgorithmName[256];
|
||||
char BootPrfAlgorithmName[256];
|
||||
} GetBootEncryptionAlgorithmNameRequest;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
byte Fingerprint[WHIRLPOOL_DIGESTSIZE + SHA512_DIGESTSIZE];
|
||||
} BootLoaderFingerprintRequest;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
wchar_t DevicePath[TC_MAX_PATH];
|
||||
|
||||
+38
-16
@@ -1,9 +1,13 @@
|
||||
/*
|
||||
Copyright (c) 2007-2010 TrueCrypt Developers Association. All rights reserved.
|
||||
Derived from source code of TrueCrypt 7.1a, which is
|
||||
Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
|
||||
by the TrueCrypt License 3.0.
|
||||
|
||||
Governed by the TrueCrypt License 3.0 the full text of which is contained in
|
||||
the file License.txt included in TrueCrypt binary and source code distribution
|
||||
packages.
|
||||
Modifications and additions to the original source code (contained in this file)
|
||||
and all other portions of this file are Copyright (c) 2013-2015 IDRIX
|
||||
and are governed by the Apache License 2.0 the full text of which is
|
||||
contained in the file License.txt included in VeraCrypt binary and source
|
||||
code distribution packages.
|
||||
*/
|
||||
|
||||
#include <atlcomcli.h>
|
||||
@@ -15,7 +19,7 @@
|
||||
#include "Dlgcode.h"
|
||||
#include "Registry.h"
|
||||
|
||||
using namespace TrueCrypt;
|
||||
using namespace VeraCrypt;
|
||||
|
||||
HRESULT CreateElevatedComObject (HWND hwnd, REFGUID guid, REFIID iid, void **ppv)
|
||||
{
|
||||
@@ -43,12 +47,27 @@ BOOL ComGetInstanceBase (HWND hWnd, REFCLSID clsid, REFIID iid, void **tcServer)
|
||||
BOOL r;
|
||||
|
||||
if (IsUacSupported ())
|
||||
r = CreateElevatedComObject (hWnd, clsid, iid, tcServer) == S_OK;
|
||||
{
|
||||
while (true)
|
||||
{
|
||||
r = CreateElevatedComObject (hWnd, clsid, iid, tcServer) == S_OK;
|
||||
if (r)
|
||||
break;
|
||||
else
|
||||
{
|
||||
if (IDRETRY == ErrorRetryCancel ("UAC_INIT_ERROR", hWnd))
|
||||
continue;
|
||||
else
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
r = CoCreateInstance (clsid, NULL, CLSCTX_LOCAL_SERVER, iid, tcServer) == S_OK;
|
||||
|
||||
if (!r)
|
||||
Error ("UAC_INIT_ERROR");
|
||||
if (!r)
|
||||
Error ("UAC_INIT_ERROR", hWnd);
|
||||
}
|
||||
|
||||
return r;
|
||||
}
|
||||
@@ -83,9 +102,8 @@ DWORD BaseCom::CallDriver (DWORD ioctl, BSTR input, BSTR *output)
|
||||
|
||||
DWORD BaseCom::CopyFile (BSTR sourceFile, BSTR destinationFile)
|
||||
{
|
||||
USES_CONVERSION;
|
||||
|
||||
if (!::CopyFile (CW2A (sourceFile), CW2A (destinationFile), FALSE))
|
||||
if (!::CopyFileW (sourceFile, destinationFile, FALSE))
|
||||
return GetLastError();
|
||||
|
||||
return ERROR_SUCCESS;
|
||||
@@ -94,9 +112,8 @@ DWORD BaseCom::CopyFile (BSTR sourceFile, BSTR destinationFile)
|
||||
|
||||
DWORD BaseCom::DeleteFile (BSTR file)
|
||||
{
|
||||
USES_CONVERSION;
|
||||
|
||||
if (!::DeleteFile (CW2A (file)))
|
||||
if (!::DeleteFileW (file))
|
||||
return GetLastError();
|
||||
|
||||
return ERROR_SUCCESS;
|
||||
@@ -112,10 +129,16 @@ BOOL BaseCom::IsPagingFileActive (BOOL checkNonWindowsPartitionsOnly)
|
||||
DWORD BaseCom::ReadWriteFile (BOOL write, BOOL device, BSTR filePath, BSTR *bufferBstr, unsigned __int64 offset, unsigned __int32 size, DWORD *sizeDone)
|
||||
{
|
||||
USES_CONVERSION;
|
||||
CW2A szFilePathA(filePath);
|
||||
if (!szFilePathA.m_psz)
|
||||
{
|
||||
return ERROR_NOT_ENOUGH_MEMORY;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
auto_ptr <File> file (device ? new Device (string (CW2A (filePath)), !write) : new File (string (CW2A (filePath)), !write));
|
||||
auto_ptr <File> file (device ? new Device (string (szFilePathA.m_psz), !write) : new File (string (szFilePathA.m_psz), !write));
|
||||
file->CheckOpened (SRC_POS);
|
||||
file->SeekAt (offset);
|
||||
|
||||
if (write)
|
||||
@@ -223,8 +246,7 @@ DWORD BaseCom::SetDriverServiceStartType (DWORD startType)
|
||||
|
||||
DWORD BaseCom::WriteLocalMachineRegistryDwordValue (BSTR keyPath, BSTR valueName, DWORD value)
|
||||
{
|
||||
USES_CONVERSION;
|
||||
if (!::WriteLocalMachineRegistryDword (CW2A (keyPath), CW2A (valueName), value))
|
||||
if (!::WriteLocalMachineRegistryDwordW (keyPath, valueName, value))
|
||||
return GetLastError();
|
||||
|
||||
return ERROR_SUCCESS;
|
||||
|
||||
@@ -1,9 +1,13 @@
|
||||
/*
|
||||
Copyright (c) 2007-2010 TrueCrypt Developers Association. All rights reserved.
|
||||
Derived from source code of TrueCrypt 7.1a, which is
|
||||
Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
|
||||
by the TrueCrypt License 3.0.
|
||||
|
||||
Governed by the TrueCrypt License 3.0 the full text of which is contained in
|
||||
the file License.txt included in TrueCrypt binary and source code distribution
|
||||
packages.
|
||||
Modifications and additions to the original source code (contained in this file)
|
||||
and all other portions of this file are Copyright (c) 2013-2015 IDRIX
|
||||
and are governed by the Apache License 2.0 the full text of which is
|
||||
contained in the file License.txt included in VeraCrypt binary and source
|
||||
code distribution packages.
|
||||
*/
|
||||
|
||||
#ifndef TC_HEADER_BASE_COM
|
||||
|
||||
+469
-187
File diff suppressed because it is too large
Load Diff
+25
-12
@@ -1,9 +1,13 @@
|
||||
/*
|
||||
Copyright (c) 2008-2010 TrueCrypt Developers Association. All rights reserved.
|
||||
Derived from source code of TrueCrypt 7.1a, which is
|
||||
Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
|
||||
by the TrueCrypt License 3.0.
|
||||
|
||||
Governed by the TrueCrypt License 3.0 the full text of which is contained in
|
||||
the file License.txt included in TrueCrypt binary and source code distribution
|
||||
packages.
|
||||
Modifications and additions to the original source code (contained in this file)
|
||||
and all other portions of this file are Copyright (c) 2013-2015 IDRIX
|
||||
and are governed by the Apache License 2.0 the full text of which is
|
||||
contained in the file License.txt included in VeraCrypt binary and source
|
||||
code distribution packages.
|
||||
*/
|
||||
|
||||
#ifndef TC_HEADER_Common_BootEncryption
|
||||
@@ -17,15 +21,16 @@
|
||||
|
||||
using namespace std;
|
||||
|
||||
namespace TrueCrypt
|
||||
namespace VeraCrypt
|
||||
{
|
||||
class File
|
||||
{
|
||||
public:
|
||||
File () : FileOpen (false) { }
|
||||
File (string path, bool readOnly = false, bool create = false);
|
||||
~File () { Close(); }
|
||||
File () : Elevated (false), FileOpen (false), FilePointerPosition(0), Handle(INVALID_HANDLE_VALUE), IsDevice(false), LastError(0) { }
|
||||
File (string path,bool readOnly = false, bool create = false);
|
||||
virtual ~File () { Close(); }
|
||||
|
||||
void CheckOpened (const char* srcPos) { if (!FileOpen) { SetLastError (LastError); throw SystemException (srcPos);} }
|
||||
void Close ();
|
||||
DWORD Read (byte *buffer, DWORD size);
|
||||
void Write (byte *buffer, DWORD size);
|
||||
@@ -38,13 +43,15 @@ namespace TrueCrypt
|
||||
HANDLE Handle;
|
||||
bool IsDevice;
|
||||
string Path;
|
||||
DWORD LastError;
|
||||
};
|
||||
|
||||
|
||||
class Device : public File
|
||||
{
|
||||
public:
|
||||
Device (string path, bool readOnly = false);
|
||||
Device (string path,bool readOnly = false);
|
||||
virtual ~Device () {}
|
||||
};
|
||||
|
||||
|
||||
@@ -137,11 +144,12 @@ namespace TrueCrypt
|
||||
DumpFilter
|
||||
};
|
||||
|
||||
void SetParentWindow (HWND parent) { ParentWindow = parent; }
|
||||
void AbortDecoyOSWipe ();
|
||||
void AbortSetup ();
|
||||
void AbortSetupWait ();
|
||||
void CallDriver (DWORD ioctl, void *input = nullptr, DWORD inputSize = 0, void *output = nullptr, DWORD outputSize = 0);
|
||||
int ChangePassword (Password *oldPassword, Password *newPassword, int pkcs5);
|
||||
int ChangePassword (Password *oldPassword, int old_pkcs5, int old_pim, Password *newPassword, int pkcs5, int pim, int wipePassCount, HWND hwndDlg);
|
||||
void CheckDecoyOSWipeResult ();
|
||||
void CheckEncryptionSetupResult ();
|
||||
void CheckRequirements ();
|
||||
@@ -154,6 +162,7 @@ namespace TrueCrypt
|
||||
DWORD GetDriverServiceStartType ();
|
||||
unsigned int GetHiddenOSCreationPhase ();
|
||||
uint16 GetInstalledBootLoaderVersion ();
|
||||
void GetInstalledBootLoaderFingerprint (byte fingerprint[WHIRLPOOL_DIGESTSIZE + SHA512_DIGESTSIZE]);
|
||||
Partition GetPartitionForHiddenOS ();
|
||||
bool IsBootLoaderOnDrive (char *devicePath);
|
||||
BootEncryptionStatus GetStatus ();
|
||||
@@ -161,19 +170,22 @@ namespace TrueCrypt
|
||||
void GetVolumeProperties (VOLUME_PROPERTIES_STRUCT *properties);
|
||||
SystemDriveConfiguration GetSystemDriveConfiguration ();
|
||||
void Install (bool hiddenSystem);
|
||||
void InstallBootLoader (Device& device, bool preserveUserConfig = false, bool hiddenOSCreation = false);
|
||||
void InstallBootLoader (bool preserveUserConfig = false, bool hiddenOSCreation = false);
|
||||
bool CheckBootloaderFingerprint (bool bSilent = false);
|
||||
void InvalidateCachedSysDriveProperties ();
|
||||
bool IsCDDrivePresent ();
|
||||
bool IsHiddenSystemRunning ();
|
||||
bool IsPagingFileActive (BOOL checkNonWindowsPartitionsOnly);
|
||||
void PrepareHiddenOSCreation (int ea, int mode, int pkcs5);
|
||||
void PrepareInstallation (bool systemPartitionOnly, Password &password, int ea, int mode, int pkcs5, const string &rescueIsoImagePath);
|
||||
void PrepareInstallation (bool systemPartitionOnly, Password &password, int ea, int mode, int pkcs5, int pim, const string &rescueIsoImagePath);
|
||||
void ProbeRealSystemDriveSize ();
|
||||
void ReadBootSectorConfig (byte *config, size_t bufLength, byte *userConfig = nullptr, string *customUserMessage = nullptr, uint16 *bootLoaderVersion = nullptr);
|
||||
uint32 ReadDriverConfigurationFlags ();
|
||||
void RegisterBootDriver (bool hiddenSystem);
|
||||
void RegisterFilterDriver (bool registerDriver, FilterType filterType);
|
||||
void RegisterSystemFavoritesService (BOOL registerService);
|
||||
void RegisterSystemFavoritesService (BOOL registerService, BOOL noFileHandling);
|
||||
void RenameDeprecatedSystemLoaderBackup ();
|
||||
bool RestartComputer (void);
|
||||
void InitialSecurityChecksForHiddenOS ();
|
||||
@@ -201,7 +213,7 @@ namespace TrueCrypt
|
||||
|
||||
void BackupSystemLoader ();
|
||||
void CreateBootLoaderInMemory (byte *buffer, size_t bufferSize, bool rescueDisk, bool hiddenOSCreation = false);
|
||||
void CreateVolumeHeader (uint64 volumeSize, uint64 encryptedAreaStart, Password *password, int ea, int mode, int pkcs5);
|
||||
void CreateVolumeHeader (uint64 volumeSize, uint64 encryptedAreaStart, Password *password, int ea, int mode, int pkcs5, int pim);
|
||||
string GetSystemLoaderBackupPath ();
|
||||
uint32 GetChecksum (byte *data, size_t size);
|
||||
DISK_GEOMETRY GetDriveGeometry (int driveNumber);
|
||||
@@ -215,6 +227,7 @@ namespace TrueCrypt
|
||||
HWND ParentWindow;
|
||||
SystemDriveConfiguration DriveConfig;
|
||||
int SelectedEncryptionAlgorithmId;
|
||||
int SelectedPrfAlgorithmId;
|
||||
Partition HiddenOSCandidatePartition;
|
||||
byte *RescueIsoImage;
|
||||
byte RescueVolumeHeader[TC_BOOT_ENCRYPTION_VOLUME_HEADER_SIZE];
|
||||
|
||||
+12
-10
@@ -1,12 +1,14 @@
|
||||
/*
|
||||
Legal Notice: Some portions of the source code contained in this file were
|
||||
derived from the source code of Encryption for the Masses 2.02a, which is
|
||||
Copyright (c) 1998-2000 Paul Le Roux and which is governed by the 'License
|
||||
Agreement for Encryption for the Masses'. Modifications and additions to
|
||||
the original source code (contained in this file) and all other portions
|
||||
of this file are Copyright (c) 2003-2008 TrueCrypt Developers Association
|
||||
and are governed by the TrueCrypt License 3.0 the full text of which is
|
||||
contained in the file License.txt included in TrueCrypt binary and source
|
||||
derived from the source code of TrueCrypt 7.1a, which is
|
||||
Copyright (c) 2003-2012 TrueCrypt Developers Association and which is
|
||||
governed by the TrueCrypt License 3.0, also from the source code of
|
||||
Encryption for the Masses 2.02a, which is Copyright (c) 1998-2000 Paul Le Roux
|
||||
and which is governed by the 'License Agreement for Encryption for the Masses'
|
||||
Modifications and additions to the original source code (contained in this file)
|
||||
and all other portions of this file are Copyright (c) 2013-2015 IDRIX
|
||||
and are governed by the Apache License 2.0 the full text of which is
|
||||
contained in the file License.txt included in VeraCrypt binary and source
|
||||
code distribution packages. */
|
||||
|
||||
#include "Tcdefs.h"
|
||||
@@ -21,7 +23,7 @@ Password CachedPasswords[CACHE_SIZE];
|
||||
int cacheEmpty = 1;
|
||||
static int nPasswordIdx = 0;
|
||||
|
||||
int ReadVolumeHeaderWCache (BOOL bBoot, BOOL bCache, char *header, Password *password, PCRYPTO_INFO *retInfo)
|
||||
int ReadVolumeHeaderWCache (BOOL bBoot, BOOL bCache, char *header, Password *password, int pkcs5_prf, int pim, BOOL truecryptMode, PCRYPTO_INFO *retInfo)
|
||||
{
|
||||
int nReturnCode = ERR_PASSWORD_WRONG;
|
||||
int i;
|
||||
@@ -29,7 +31,7 @@ int ReadVolumeHeaderWCache (BOOL bBoot, BOOL bCache, char *header, Password *pas
|
||||
/* Attempt to recognize volume using mount password */
|
||||
if (password->Length > 0)
|
||||
{
|
||||
nReturnCode = ReadVolumeHeader (bBoot, header, password, retInfo, NULL);
|
||||
nReturnCode = ReadVolumeHeader (bBoot, header, password, pkcs5_prf, pim, truecryptMode, retInfo, NULL);
|
||||
|
||||
/* Save mount passwords back into cache if asked to do so */
|
||||
if (bCache && (nReturnCode == 0 || nReturnCode == ERR_CIPHER_INIT_WEAK_KEY))
|
||||
@@ -59,7 +61,7 @@ int ReadVolumeHeaderWCache (BOOL bBoot, BOOL bCache, char *header, Password *pas
|
||||
{
|
||||
if (CachedPasswords[i].Length > 0)
|
||||
{
|
||||
nReturnCode = ReadVolumeHeader (bBoot, header, &CachedPasswords[i], retInfo, NULL);
|
||||
nReturnCode = ReadVolumeHeader (bBoot, header, &CachedPasswords[i], pkcs5_prf, pim, truecryptMode, retInfo, NULL);
|
||||
|
||||
if (nReturnCode != ERR_PASSWORD_WRONG)
|
||||
break;
|
||||
|
||||
+10
-8
@@ -1,12 +1,14 @@
|
||||
/*
|
||||
Legal Notice: Some portions of the source code contained in this file were
|
||||
derived from the source code of Encryption for the Masses 2.02a, which is
|
||||
Copyright (c) 1998-2000 Paul Le Roux and which is governed by the 'License
|
||||
Agreement for Encryption for the Masses'. Modifications and additions to
|
||||
the original source code (contained in this file) and all other portions
|
||||
of this file are Copyright (c) 2003-2008 TrueCrypt Developers Association
|
||||
and are governed by the TrueCrypt License 3.0 the full text of which is
|
||||
contained in the file License.txt included in TrueCrypt binary and source
|
||||
derived from the source code of TrueCrypt 7.1a, which is
|
||||
Copyright (c) 2003-2012 TrueCrypt Developers Association and which is
|
||||
governed by the TrueCrypt License 3.0, also from the source code of
|
||||
Encryption for the Masses 2.02a, which is Copyright (c) 1998-2000 Paul Le Roux
|
||||
and which is governed by the 'License Agreement for Encryption for the Masses'
|
||||
Modifications and additions to the original source code (contained in this file)
|
||||
and all other portions of this file are Copyright (c) 2013-2015 IDRIX
|
||||
and are governed by the Apache License 2.0 the full text of which is
|
||||
contained in the file License.txt included in VeraCrypt binary and source
|
||||
code distribution packages. */
|
||||
|
||||
#include "Common.h"
|
||||
@@ -19,5 +21,5 @@
|
||||
extern int cacheEmpty;
|
||||
|
||||
void AddPasswordToCache (Password *password);
|
||||
int ReadVolumeHeaderWCache (BOOL bBoot, BOOL bCache, char *header, Password *password, PCRYPTO_INFO *retInfo);
|
||||
int ReadVolumeHeaderWCache (BOOL bBoot, BOOL bCache, char *header, Password *password, int pkcs5_prf, int pim, BOOL truecryptMode, PCRYPTO_INFO *retInfo);
|
||||
void WipeCache (void);
|
||||
|
||||
+44
-86
@@ -1,12 +1,14 @@
|
||||
/*
|
||||
Legal Notice: Some portions of the source code contained in this file were
|
||||
derived from the source code of Encryption for the Masses 2.02a, which is
|
||||
Copyright (c) 1998-2000 Paul Le Roux and which is governed by the 'License
|
||||
Agreement for Encryption for the Masses'. Modifications and additions to
|
||||
the original source code (contained in this file) and all other portions
|
||||
of this file are Copyright (c) 2003-2009 TrueCrypt Developers Association
|
||||
and are governed by the TrueCrypt License 3.0 the full text of which is
|
||||
contained in the file License.txt included in TrueCrypt binary and source
|
||||
derived from the source code of TrueCrypt 7.1a, which is
|
||||
Copyright (c) 2003-2012 TrueCrypt Developers Association and which is
|
||||
governed by the TrueCrypt License 3.0, also from the source code of
|
||||
Encryption for the Masses 2.02a, which is Copyright (c) 1998-2000 Paul Le Roux
|
||||
and which is governed by the 'License Agreement for Encryption for the Masses'
|
||||
Modifications and additions to the original source code (contained in this file)
|
||||
and all other portions of this file are Copyright (c) 2013-2015 IDRIX
|
||||
and are governed by the Apache License 2.0 the full text of which is
|
||||
contained in the file License.txt included in VeraCrypt binary and source
|
||||
code distribution packages. */
|
||||
|
||||
#include "Tcdefs.h"
|
||||
@@ -20,14 +22,19 @@
|
||||
#include "Apidrvr.h"
|
||||
#include "Dlgcode.h"
|
||||
#include "Language.h"
|
||||
#include <Strsafe.h>
|
||||
|
||||
#ifndef SRC_POS
|
||||
#define SRC_POS (__FUNCTION__ ":" TC_TO_STRING(__LINE__))
|
||||
#endif
|
||||
|
||||
/* Except in response to the WM_INITDIALOG message, the dialog box procedure
|
||||
should return nonzero if it processes the message, and zero if it does
|
||||
not. - see DialogProc */
|
||||
BOOL CALLBACK CommandHelpDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
if (lParam); /* remove warning */
|
||||
if (wParam); /* remove warning */
|
||||
UNREFERENCED_PARAMETER (lParam); /* remove warning */
|
||||
UNREFERENCED_PARAMETER (wParam); /* remove warning */
|
||||
|
||||
switch (msg)
|
||||
{
|
||||
@@ -44,17 +51,31 @@ BOOL CALLBACK CommandHelpDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
|
||||
|
||||
*tmp = 0;
|
||||
|
||||
strcpy (tmp, "Command line options:\n\n");
|
||||
StringCbCopyA (tmp, 8192, "VeraCrypt " VERSION_STRING);
|
||||
#ifdef _WIN64
|
||||
StringCbCatA (tmp, 8192, " (64-bit)");
|
||||
#else
|
||||
StringCbCatA (tmp, 8192, " (32-bit)");
|
||||
#endif
|
||||
#if (defined(_DEBUG) || defined(DEBUG))
|
||||
StringCbCatA (tmp, 8192, " (debug)");
|
||||
#endif
|
||||
|
||||
StringCbCatA (tmp, 8192, "\n\nCommand line options:\n\n");
|
||||
for (i = 0; i < as->arg_cnt; i ++)
|
||||
{
|
||||
if (!as->args[i].Internal)
|
||||
{
|
||||
sprintf(tmp2, "%s\t%s\n", as->args[i].short_name, as->args[i].long_name);
|
||||
strcat(tmp,tmp2);
|
||||
StringCchPrintf(tmp2, MAX_PATH * 2, "%s\t%s\n", as->args[i].short_name, as->args[i].long_name);
|
||||
StringCchCat(tmp, 8192, tmp2);
|
||||
}
|
||||
}
|
||||
|
||||
StringCbCatA (tmp, 8192, "\nExamples:\n\nMount a volume as X:\tveracrypt.exe /q /v volume.hc /l X\nDismount a volume X:\tveracrypt.exe /q /d X");
|
||||
|
||||
SetWindowText (GetDlgItem (hwndDlg, IDC_COMMANDHELP_TEXT), (char*) tmp);
|
||||
|
||||
TCfree(tmp);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -77,7 +98,7 @@ int Win32CommandLine (char *lpszCommandLine, char ***lpszArgs)
|
||||
LPWSTR *arguments = CommandLineToArgvW (GetCommandLineW(), &argumentCount);
|
||||
if (!arguments)
|
||||
{
|
||||
handleWin32Error (NULL);
|
||||
handleWin32Error (NULL, SRC_POS);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -102,10 +123,10 @@ int Win32CommandLine (char *lpszCommandLine, char ***lpszArgs)
|
||||
|
||||
if (argLen > 0)
|
||||
{
|
||||
int len = WideCharToMultiByte (CP_ACP, 0, arguments[i + 1], -1, arg, argLen + 1, NULL, NULL);
|
||||
int len = WideCharToMultiByte (CP_ACP, 0, arguments[i + 1], -1, arg, (int) argLen + 1, NULL, NULL);
|
||||
if (len == 0)
|
||||
{
|
||||
handleWin32Error (NULL);
|
||||
handleWin32Error (NULL, SRC_POS);
|
||||
AbortProcessSilent();
|
||||
}
|
||||
}
|
||||
@@ -127,81 +148,26 @@ int GetArgSepPosOffset (char *lpszArgument)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int GetArgumentID (argumentspec *as, char *lpszArgument, int *nArgPos)
|
||||
int GetArgumentID (argumentspec *as, char *lpszArgument)
|
||||
{
|
||||
char szTmp[MAX_PATH * 2];
|
||||
int i;
|
||||
|
||||
i = strlen (lpszArgument);
|
||||
szTmp[i] = 0;
|
||||
while (--i >= 0)
|
||||
{
|
||||
szTmp[i] = (char) tolower (lpszArgument[i]);
|
||||
}
|
||||
|
||||
for (i = 0; i < as->arg_cnt; i++)
|
||||
{
|
||||
size_t k;
|
||||
|
||||
k = strlen (as->args[i].long_name);
|
||||
if (memcmp (as->args[i].long_name, szTmp, k * sizeof (char)) == 0)
|
||||
if (_stricmp (as->args[i].long_name, lpszArgument) == 0)
|
||||
{
|
||||
int x;
|
||||
for (x = i + 1; x < as->arg_cnt; x++)
|
||||
{
|
||||
size_t m;
|
||||
|
||||
m = strlen (as->args[x].long_name);
|
||||
if (memcmp (as->args[x].long_name, szTmp, m * sizeof (char)) == 0)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (x == as->arg_cnt)
|
||||
{
|
||||
if (strlen (lpszArgument) != k)
|
||||
*nArgPos = k;
|
||||
else
|
||||
*nArgPos = 0;
|
||||
return as->args[i].Id;
|
||||
}
|
||||
return as->args[i].Id;
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < as->arg_cnt; i++)
|
||||
{
|
||||
size_t k;
|
||||
|
||||
if (as->args[i].short_name[0] == 0)
|
||||
continue;
|
||||
|
||||
k = strlen (as->args[i].short_name);
|
||||
if (memcmp (as->args[i].short_name, szTmp, k * sizeof (char)) == 0)
|
||||
if (_stricmp (as->args[i].short_name, lpszArgument) == 0)
|
||||
{
|
||||
int x;
|
||||
for (x = i + 1; x < as->arg_cnt; x++)
|
||||
{
|
||||
size_t m;
|
||||
|
||||
if (as->args[x].short_name[0] == 0)
|
||||
continue;
|
||||
|
||||
m = strlen (as->args[x].short_name);
|
||||
if (memcmp (as->args[x].short_name, szTmp, m * sizeof (char)) == 0)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (x == as->arg_cnt)
|
||||
{
|
||||
if (strlen (lpszArgument) != k)
|
||||
*nArgPos = k;
|
||||
else
|
||||
*nArgPos = 0;
|
||||
return as->args[i].Id;
|
||||
}
|
||||
return as->args[i].Id;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -209,27 +175,19 @@ int GetArgumentID (argumentspec *as, char *lpszArgument, int *nArgPos)
|
||||
return -1;
|
||||
}
|
||||
|
||||
int GetArgumentValue (char **lpszCommandLineArgs, int nArgPos, int *nArgIdx,
|
||||
int GetArgumentValue (char **lpszCommandLineArgs, int *nArgIdx,
|
||||
int nNoCommandLineArgs, char *lpszValue, int nValueSize)
|
||||
{
|
||||
*lpszValue = 0;
|
||||
|
||||
if (nArgPos)
|
||||
{
|
||||
/* Handles the case of no space between parameter code and
|
||||
value */
|
||||
strncpy (lpszValue, &lpszCommandLineArgs[*nArgIdx][nArgPos], nValueSize);
|
||||
lpszValue[nValueSize - 1] = 0;
|
||||
return HAS_ARGUMENT;
|
||||
}
|
||||
else if (*nArgIdx + 1 < nNoCommandLineArgs)
|
||||
if (*nArgIdx + 1 < nNoCommandLineArgs)
|
||||
{
|
||||
int x = GetArgSepPosOffset (lpszCommandLineArgs[*nArgIdx + 1]);
|
||||
if (x == 0)
|
||||
{
|
||||
/* Handles the case of space between parameter code
|
||||
and value */
|
||||
strncpy (lpszValue, &lpszCommandLineArgs[*nArgIdx + 1][x], nValueSize);
|
||||
StringCbCopyA (lpszValue, nValueSize, lpszCommandLineArgs[*nArgIdx + 1]);
|
||||
lpszValue[nValueSize - 1] = 0;
|
||||
(*nArgIdx)++;
|
||||
return HAS_ARGUMENT;
|
||||
|
||||
+11
-9
@@ -1,12 +1,14 @@
|
||||
/*
|
||||
Legal Notice: Some portions of the source code contained in this file were
|
||||
derived from the source code of Encryption for the Masses 2.02a, which is
|
||||
Copyright (c) 1998-2000 Paul Le Roux and which is governed by the 'License
|
||||
Agreement for Encryption for the Masses'. Modifications and additions to
|
||||
the original source code (contained in this file) and all other portions
|
||||
of this file are Copyright (c) 2003-2008 TrueCrypt Developers Association
|
||||
and are governed by the TrueCrypt License 3.0 the full text of which is
|
||||
contained in the file License.txt included in TrueCrypt binary and source
|
||||
derived from the source code of TrueCrypt 7.1a, which is
|
||||
Copyright (c) 2003-2012 TrueCrypt Developers Association and which is
|
||||
governed by the TrueCrypt License 3.0, also from the source code of
|
||||
Encryption for the Masses 2.02a, which is Copyright (c) 1998-2000 Paul Le Roux
|
||||
and which is governed by the 'License Agreement for Encryption for the Masses'
|
||||
Modifications and additions to the original source code (contained in this file)
|
||||
and all other portions of this file are Copyright (c) 2013-2015 IDRIX
|
||||
and are governed by the Apache License 2.0 the full text of which is
|
||||
contained in the file License.txt included in VeraCrypt binary and source
|
||||
code distribution packages. */
|
||||
|
||||
#ifdef __cplusplus
|
||||
@@ -33,8 +35,8 @@ typedef struct argumentspec_t
|
||||
BOOL CALLBACK CommandHelpDlgProc ( HWND hwndDlg , UINT msg , WPARAM wParam , LPARAM lParam );
|
||||
int Win32CommandLine ( char *lpszCommandLine , char ***lpszArgs );
|
||||
int GetArgSepPosOffset ( char *lpszArgument );
|
||||
int GetArgumentID ( argumentspec *as , char *lpszArgument , int *nArgPos );
|
||||
int GetArgumentValue ( char **lpszCommandLineArgs , int nArgPos , int *nArgIdx , int nNoCommandLineArgs , char *lpszValue , int nValueSize );
|
||||
int GetArgumentID ( argumentspec *as , char *lpszArgument );
|
||||
int GetArgumentValue ( char **lpszCommandLineArgs , int *nArgIdx , int nNoCommandLineArgs , char *lpszValue , int nValueSize );
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
+59
-16
@@ -1,12 +1,14 @@
|
||||
/*
|
||||
Legal Notice: Some portions of the source code contained in this file were
|
||||
derived from the source code of Encryption for the Masses 2.02a, which is
|
||||
Copyright (c) 1998-2000 Paul Le Roux and which is governed by the 'License
|
||||
Agreement for Encryption for the Masses'. Modifications and additions to
|
||||
the original source code (contained in this file) and all other portions
|
||||
of this file are Copyright (c) 2003-2008 TrueCrypt Developers Association
|
||||
and are governed by the TrueCrypt License 3.0 the full text of which is
|
||||
contained in the file License.txt included in TrueCrypt binary and source
|
||||
derived from the source code of TrueCrypt 7.1a, which is
|
||||
Copyright (c) 2003-2012 TrueCrypt Developers Association and which is
|
||||
governed by the TrueCrypt License 3.0, also from the source code of
|
||||
Encryption for the Masses 2.02a, which is Copyright (c) 1998-2000 Paul Le Roux
|
||||
and which is governed by the 'License Agreement for Encryption for the Masses'
|
||||
Modifications and additions to the original source code (contained in this file)
|
||||
and all other portions of this file are Copyright (c) 2013-2015 IDRIX
|
||||
and are governed by the Apache License 2.0 the full text of which is
|
||||
contained in the file License.txt included in VeraCrypt binary and source
|
||||
code distribution packages. */
|
||||
|
||||
#include "Tcdefs.h"
|
||||
@@ -133,23 +135,64 @@ LPARAM UpdateComboOrder (HWND hComboBox)
|
||||
return nIndex;
|
||||
}
|
||||
|
||||
void LoadCombo (HWND hComboBox)
|
||||
void LoadCombo (HWND hComboBox, BOOL bEnabled, BOOL bOnlyCheckModified, BOOL *pbModified)
|
||||
{
|
||||
DWORD size;
|
||||
char *history = LoadFile (GetConfigPath (TC_APPD_FILENAME_HISTORY), &size);
|
||||
char *xml = history;
|
||||
char volume[MAX_PATH];
|
||||
int i, nComboIdx[SIZEOF_MRU_LIST] = {0};
|
||||
int count = SendMessage (hComboBox, CB_GETCOUNT, 0, 0);
|
||||
|
||||
if (xml == NULL) return;
|
||||
|
||||
while (xml = XmlFindElement (xml, "volume"))
|
||||
if (xml == NULL)
|
||||
{
|
||||
XmlGetNodeText (xml, volume, sizeof (volume));
|
||||
AddComboItem (hComboBox, volume, TRUE);
|
||||
xml++;
|
||||
// No history XML file but history is enabled
|
||||
if (bEnabled && pbModified)
|
||||
*pbModified = TRUE;
|
||||
return;
|
||||
}
|
||||
|
||||
SendMessage (hComboBox, CB_SETCURSEL, 0, 0);
|
||||
if (!bEnabled && bOnlyCheckModified)
|
||||
{
|
||||
// History is disable but there is a history XML file
|
||||
if (pbModified)
|
||||
*pbModified = TRUE;
|
||||
free (history);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/* combo list part:- get mru items */
|
||||
for (i = 0; i < SIZEOF_MRU_LIST; i++)
|
||||
nComboIdx[i] = GetOrderComboIdx (hComboBox, &nComboIdx[0], i);
|
||||
|
||||
i = 0;
|
||||
while (xml = XmlFindElement (xml, "volume"))
|
||||
{
|
||||
char szTmp[MAX_PATH] = { 0 };
|
||||
|
||||
if (i < count)
|
||||
{
|
||||
if (SendMessage (hComboBox, CB_GETLBTEXTLEN, nComboIdx[i], 0) < sizeof (szTmp))
|
||||
SendMessage (hComboBox, CB_GETLBTEXT, nComboIdx[i], (LPARAM) & szTmp[0]);
|
||||
}
|
||||
|
||||
XmlGetNodeText (xml, volume, sizeof (volume));
|
||||
if (!bOnlyCheckModified)
|
||||
AddComboItem (hComboBox, volume, TRUE);
|
||||
|
||||
if (pbModified && strcmp (volume, szTmp))
|
||||
*pbModified = TRUE;
|
||||
|
||||
xml++;
|
||||
i++;
|
||||
}
|
||||
|
||||
if (pbModified && (i != count))
|
||||
*pbModified = TRUE;
|
||||
|
||||
if (!bOnlyCheckModified)
|
||||
SendMessage (hComboBox, CB_SETCURSEL, 0, 0);
|
||||
|
||||
free (history);
|
||||
}
|
||||
@@ -157,7 +200,7 @@ void LoadCombo (HWND hComboBox)
|
||||
void DumpCombo (HWND hComboBox, int bClear)
|
||||
{
|
||||
FILE *f;
|
||||
int i, nComboIdx[SIZEOF_MRU_LIST];
|
||||
int i, nComboIdx[SIZEOF_MRU_LIST] = {0};
|
||||
|
||||
if (bClear)
|
||||
{
|
||||
|
||||
+10
-8
@@ -1,12 +1,14 @@
|
||||
/*
|
||||
Legal Notice: Some portions of the source code contained in this file were
|
||||
derived from the source code of Encryption for the Masses 2.02a, which is
|
||||
Copyright (c) 1998-2000 Paul Le Roux and which is governed by the 'License
|
||||
Agreement for Encryption for the Masses'. Modifications and additions to
|
||||
the original source code (contained in this file) and all other portions
|
||||
of this file are Copyright (c) 2003-2008 TrueCrypt Developers Association
|
||||
and are governed by the TrueCrypt License 3.0 the full text of which is
|
||||
contained in the file License.txt included in TrueCrypt binary and source
|
||||
derived from the source code of TrueCrypt 7.1a, which is
|
||||
Copyright (c) 2003-2012 TrueCrypt Developers Association and which is
|
||||
governed by the TrueCrypt License 3.0, also from the source code of
|
||||
Encryption for the Masses 2.02a, which is Copyright (c) 1998-2000 Paul Le Roux
|
||||
and which is governed by the 'License Agreement for Encryption for the Masses'
|
||||
Modifications and additions to the original source code (contained in this file)
|
||||
and all other portions of this file are Copyright (c) 2013-2015 IDRIX
|
||||
and are governed by the Apache License 2.0 the full text of which is
|
||||
contained in the file License.txt included in VeraCrypt binary and source
|
||||
code distribution packages. */
|
||||
|
||||
#ifdef __cplusplus
|
||||
@@ -17,7 +19,7 @@ void AddComboItem (HWND hComboBox, char *lpszFileName, BOOL saveHistory);
|
||||
LPARAM MoveEditToCombo (HWND hComboBox, BOOL saveHistory);
|
||||
int GetOrderComboIdx ( HWND hComboBox , int *nIdxList , int nElems );
|
||||
LPARAM UpdateComboOrder ( HWND hComboBox );
|
||||
void LoadCombo ( HWND hComboBox );
|
||||
void LoadCombo (HWND hComboBox, BOOL bEnabled, BOOL bOnlyCheckModified, BOOL *pbModified);
|
||||
void DumpCombo ( HWND hComboBox , int bClear );
|
||||
void ClearCombo (HWND hComboBox);
|
||||
int IsComboEmpty (HWND hComboBox);
|
||||
|
||||
+10
-5
@@ -1,9 +1,13 @@
|
||||
/*
|
||||
Copyright (c) 2005-2009 TrueCrypt Developers Association. All rights reserved.
|
||||
Derived from source code of TrueCrypt 7.1a, which is
|
||||
Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
|
||||
by the TrueCrypt License 3.0.
|
||||
|
||||
Governed by the TrueCrypt License 3.0 the full text of which is contained in
|
||||
the file License.txt included in TrueCrypt binary and source code distribution
|
||||
packages.
|
||||
Modifications and additions to the original source code (contained in this file)
|
||||
and all other portions of this file are Copyright (c) 2013-2015 IDRIX
|
||||
and are governed by the Apache License 2.0 the full text of which is
|
||||
contained in the file License.txt included in VeraCrypt binary and source
|
||||
code distribution packages.
|
||||
*/
|
||||
|
||||
#ifndef COMMON_H
|
||||
@@ -43,7 +47,6 @@ enum
|
||||
{
|
||||
TC_VOLUME_TYPE_NORMAL = 0,
|
||||
TC_VOLUME_TYPE_HIDDEN,
|
||||
TC_VOLUME_TYPE_HIDDEN_LEGACY,
|
||||
TC_VOLUME_TYPE_COUNT
|
||||
};
|
||||
|
||||
@@ -76,6 +79,8 @@ typedef struct
|
||||
Password ProtectedHidVolPassword; /* Password of hidden volume to protect against overwriting */
|
||||
BOOL UseBackupHeader;
|
||||
BOOL RecoveryMode;
|
||||
int ProtectedHidVolPkcs5Prf;
|
||||
int ProtectedHidVolPim;
|
||||
} MountOptions;
|
||||
|
||||
#endif
|
||||
|
||||
+77
-22
@@ -29,30 +29,30 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
||||
IDD_ABOUT_DLG DIALOGEX 31, 51, 292, 199
|
||||
STYLE DS_SETFONT | DS_MODALFRAME | DS_3DLOOK | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "About VeraCrypt"
|
||||
CLASS "SplashDlg"
|
||||
CLASS "VeraCryptSplashDlg"
|
||||
FONT 8, "MS Shell Dlg", 0, 0, 0x0
|
||||
BEGIN
|
||||
EDITTEXT IDC_ABOUT_CREDITS,7,111,277,45,ES_MULTILINE | WS_VSCROLL | NOT WS_TABSTOP
|
||||
DEFPUSHBUTTON "OK",IDOK,230,178,52,14
|
||||
LTEXT "",IDC_HOMEPAGE,18,87,117,9,SS_NOTIFY
|
||||
LTEXT "",IDT_ABOUT_RELEASE,18,71,235,8
|
||||
CONTROL 517,IDC_ABOUT_BKG,"Static",SS_BITMAP,0,0,12,11,WS_EX_STATICEDGE
|
||||
CONTROL IDB_TEXTUAL_LOGO_BKG,IDC_ABOUT_BKG,"Static",SS_BITMAP,0,0,12,11,WS_EX_STATICEDGE
|
||||
LTEXT "",IDT_ABOUT_VERSION,18,61,161,8
|
||||
CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,1,167,291,1,WS_EX_STATICEDGE
|
||||
CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,1,169,291,1,WS_EX_STATICEDGE
|
||||
CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,1,107,291,1,WS_EX_STATICEDGE
|
||||
CONTROL "",IDC_ABOUT_LOGO_AREA,"Static",SS_GRAYRECT | NOT WS_VISIBLE,0,0,293,50,WS_EX_TRANSPARENT | WS_EX_STATICEDGE
|
||||
CONTROL 518,IDC_TEXTUAL_LOGO_IMG,"Static",SS_BITMAP,12,26,157,16
|
||||
CONTROL IDB_TEXTUAL_LOGO_96DPI,IDC_TEXTUAL_LOGO_IMG,"Static",SS_BITMAP,12,26,157,16
|
||||
END
|
||||
|
||||
IDD_COMMANDHELP_DLG DIALOGEX 0, 0, 249, 213
|
||||
IDD_COMMANDHELP_DLG DIALOGEX 0, 0, 249, 274
|
||||
STYLE DS_SETFONT | DS_MODALFRAME | DS_3DLOOK | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Command Line Help"
|
||||
CLASS "CustomDlg"
|
||||
CLASS "VeraCryptCustomDlg"
|
||||
FONT 8, "MS Shell Dlg", 0, 0, 0x0
|
||||
BEGIN
|
||||
DEFPUSHBUTTON "OK",IDOK,93,191,59,14
|
||||
LTEXT "",IDC_COMMANDHELP_TEXT,20,11,208,174
|
||||
DEFPUSHBUTTON "OK",IDOK,93,252,59,14
|
||||
LTEXT "",IDC_COMMANDHELP_TEXT,20,10,208,241
|
||||
END
|
||||
|
||||
IDD_RAWDEVICES_DLG DIALOGEX 0, 0, 305, 209
|
||||
@@ -65,7 +65,7 @@ BEGIN
|
||||
PUSHBUTTON "Cancel",IDCANCEL,248,190,50,14
|
||||
END
|
||||
|
||||
IDD_MOUNT_OPTIONS DIALOGEX 0, 0, 277, 172
|
||||
IDD_MOUNT_OPTIONS DIALOGEX 0, 0, 277, 224
|
||||
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "VeraCrypt - Mount Options"
|
||||
FONT 8, "MS Shell Dlg", 400, 0, 0x1
|
||||
@@ -73,21 +73,27 @@ BEGIN
|
||||
CONTROL "Mount volume as read-&only",IDC_MOUNT_READONLY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,11,194,10
|
||||
CONTROL "Mount volume as removable &medium",IDC_MOUNT_REMOVABLE,
|
||||
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,25,195,10
|
||||
CONTROL "Use backup header embedded in &volume if available",IDC_USE_EMBEDDED_HEADER_BAK,
|
||||
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,39,257,11
|
||||
CONTROL "Mount partition &using system encryption without pre-boot authentication",IDC_MOUNT_SYSENC_PART_WITHOUT_PBA,
|
||||
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,53,259,11
|
||||
CONTROL "&Protect hidden volume against damage caused by writing to outer volume",IDC_PROTECT_HIDDEN_VOL,
|
||||
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,86,252,10
|
||||
EDITTEXT IDC_PASSWORD_PROT_HIDVOL,112,104,151,14,ES_PASSWORD | ES_AUTOHSCROLL
|
||||
CONTROL "&Display password",IDC_SHOW_PASSWORD_MO,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,112,123,90,10
|
||||
CONTROL "U&se keyfiles",IDC_KEYFILES_ENABLE_HIDVOL_PROT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,112,136,90,10
|
||||
PUSHBUTTON "&Keyfiles...",IDC_KEYFILES_HIDVOL_PROT,203,125,60,14
|
||||
LTEXT "What is hidden volume protection?",IDC_LINK_HIDVOL_PROTECTION_INFO,16,151,247,10,SS_NOTIFY
|
||||
COMBOBOX IDC_PKCS5_PRF_ID,112,125,91,90,CBS_DROPDOWNLIST | WS_TABSTOP
|
||||
EDITTEXT IDC_PIM,112,145,42,14,ES_RIGHT | ES_AUTOHSCROLL | ES_NUMBER | NOT WS_VISIBLE
|
||||
LTEXT "(Empty or 0 for default iterations)",IDC_PIM_HELP,158,148,112,8,NOT WS_VISIBLE
|
||||
CONTROL "&Display password",IDC_SHOW_PASSWORD_MO,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,112,165,90,10
|
||||
CONTROL "U&se keyfiles",IDC_KEYFILES_ENABLE_HIDVOL_PROT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,112,178,90,10
|
||||
PUSHBUTTON "&Keyfiles...",IDC_KEYFILES_HIDVOL_PROT,204,174,60,14
|
||||
DEFPUSHBUTTON "OK",IDOK,211,7,60,14
|
||||
PUSHBUTTON "Cancel",IDCANCEL,211,24,60,14
|
||||
LTEXT "What is hidden volume protection?",IDC_LINK_HIDVOL_PROTECTION_INFO,16,193,247,10,SS_NOTIFY
|
||||
RTEXT "P&assword to hidden volume:\n(if empty, cache is used)",IDT_HIDDEN_PROT_PASSWD,15,103,91,17,0,WS_EX_RIGHT
|
||||
GROUPBOX "Hidden Volume Protection",IDT_HIDDEN_VOL_PROTECTION,6,72,265,95
|
||||
CONTROL "Use backup header embedded in &volume if available",IDC_USE_EMBEDDED_HEADER_BAK,
|
||||
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,39,257,11
|
||||
GROUPBOX "Hidden Volume Protection",IDT_HIDDEN_VOL_PROTECTION,6,72,265,139
|
||||
RTEXT "PKCS-5 PRF:",IDT_PKCS5_PRF,15,126,91,17
|
||||
RTEXT "Volume PIM:",IDT_PIM,15,148,91,17,NOT WS_VISIBLE
|
||||
CONTROL "Use PIM",IDC_PIM_ENABLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,112,152,97,10
|
||||
END
|
||||
|
||||
IDD_KEYFILES DIALOGEX 0, 0, 345, 237
|
||||
@@ -172,7 +178,7 @@ BEGIN
|
||||
GROUPBOX "Plaintext (hexadecimal)",IDT_TEST_PLAINTEXT,1,140,323,33
|
||||
GROUPBOX "Ciphertext (hexadecimal)",IDT_TEST_CIPHERTEXT,1,174,323,33
|
||||
RTEXT "",IDC_TESTS_MESSAGE,50,213,178,10
|
||||
CONTROL "",IDC_REDTICK,"REDTICK",0x0,234,214,10,8
|
||||
CONTROL "",IDC_REDTICK,"VCREDTICK",0x0,234,214,10,8
|
||||
RTEXT "Key size:",IDT_KEY,8,57,56,8
|
||||
RTEXT "Plaintext size:",IDT_PLAINTEXT,190,153,63,8
|
||||
LTEXT "bits",IDT_KEY_UNIT,114,57,45,8
|
||||
@@ -194,24 +200,32 @@ BEGIN
|
||||
CONTROL "",IDC_INFO_BOX_TEXT,"RichEdit20A",ES_MULTILINE | ES_READONLY | ES_NUMBER | WS_BORDER | WS_VSCROLL | WS_TABSTOP,5,6,361,188
|
||||
END
|
||||
|
||||
IDD_KEYFILE_GENERATOR DIALOGEX 0, 0, 308, 270
|
||||
IDD_KEYFILE_GENERATOR DIALOGEX 0, 0, 308, 325
|
||||
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "VeraCrypt - Keyfile Generator"
|
||||
FONT 8, "MS Shell Dlg", 400, 0, 0x1
|
||||
BEGIN
|
||||
DEFPUSHBUTTON "Close",IDCLOSE,237,10,59,14
|
||||
COMBOBOX IDC_PRF_ID,79,49,91,90,CBS_DROPDOWNLIST | WS_TABSTOP
|
||||
PUSHBUTTON "Generate and Save Keyfile...",IDC_GENERATE_AND_SAVE_KEYFILE,89,248,131,14
|
||||
PUSHBUTTON "Generate and Save Keyfile...",IDC_GENERATE_AND_SAVE_KEYFILE,92,302,141,14
|
||||
LTEXT "IMPORTANT: Move your mouse as randomly as possible within this window. The longer you move it, the better. This significantly increases the cryptographic strength of the keyfile.",IDT_KEYFILE_GENERATOR_NOTE,11,5,213,33
|
||||
CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,1,40,307,1,WS_EX_STATICEDGE
|
||||
RTEXT "Mixing PRF:",IDT_PRF,6,51,67,10,SS_CENTERIMAGE
|
||||
GROUPBOX "Current Pool Content",IDT_POOL_CONTENTS,6,70,296,170
|
||||
CONTROL "",IDC_POOL_CONTENTS,"Static",SS_LEFTNOWORDWRAP | WS_GROUP,16,83,282,148,WS_EX_TRANSPARENT
|
||||
CONTROL "Display pool content",IDC_DISPLAY_POOL_CONTENTS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,191,51,111,10
|
||||
LTEXT "Number of keyfiles:",IDT_NUMBER_KEYFILES,9,247,75,8
|
||||
EDITTEXT IDC_NUMBER_KEYFILES,92,244,51,14,ES_RIGHT | ES_AUTOHSCROLL | ES_NUMBER
|
||||
LTEXT "Keyfiles base name:",IDT_KEYFILES_BASE_NAME,9,287,75,8
|
||||
EDITTEXT IDC_KEYFILES_BASE_NAME,92,284,141,14,ES_AUTOHSCROLL
|
||||
LTEXT "Keyfiles size (in Bytes):",IDT_KEYFILES_SIZE,9,266,75,8
|
||||
EDITTEXT IDC_KEYFILES_SIZE,92,264,51,14,ES_RIGHT | ES_AUTOHSCROLL | ES_NUMBER
|
||||
CONTROL "Random size ( 64 <-> 1048576 )",IDC_KEYFILES_RANDOM_SIZE,
|
||||
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,149,266,140,10
|
||||
END
|
||||
|
||||
IDD_MULTI_CHOICE_DLG DIALOGEX 0, 0, 167, 322
|
||||
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION
|
||||
FONT 8, "MS Shell Dlg", 0, 0, 0x0
|
||||
BEGIN
|
||||
PUSHBUTTON "",IDC_CHOICE10,7,292,153,24,BS_CENTER | BS_MULTILINE,WS_EX_STATICEDGE
|
||||
@@ -299,6 +313,15 @@ BEGIN
|
||||
LTEXT "Please wait. This process may take a long time...",IDT_STATIC_MODELESS_WAIT_DLG_INFO,9,8,274,9
|
||||
END
|
||||
|
||||
IDD_STATIC_MODAL_WAIT_DLG DIALOGEX 0, 0, 292, 74
|
||||
STYLE DS_SETFONT | DS_MODALFRAME | DS_SETFOREGROUND | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION
|
||||
CAPTION "VeraCrypt"
|
||||
FONT 8, "MS Shell Dlg", 0, 0, 0x0
|
||||
BEGIN
|
||||
CTEXT "Please wait...\nThis process may take a long time and VeraCrypt may seem unresponsive.",IDT_STATIC_MODAL_WAIT_DLG_INFO,9,11,274,33
|
||||
CONTROL "",IDC_WAIT_PROGRESS_BAR,"msctls_progress32",WS_BORDER,7,49,278,14
|
||||
END
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
@@ -308,9 +331,13 @@ END
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
GUIDELINES DESIGNINFO
|
||||
BEGIN
|
||||
IDD_ABOUT_DLG, DIALOG
|
||||
BEGIN
|
||||
END
|
||||
|
||||
IDD_COMMANDHELP_DLG, DIALOG
|
||||
BEGIN
|
||||
BOTTOMMARGIN, 205
|
||||
BOTTOMMARGIN, 266
|
||||
END
|
||||
|
||||
IDD_RAWDEVICES_DLG, DIALOG
|
||||
@@ -325,7 +352,7 @@ BEGIN
|
||||
BEGIN
|
||||
LEFTMARGIN, 7
|
||||
TOPMARGIN, 7
|
||||
BOTTOMMARGIN, 166
|
||||
BOTTOMMARGIN, 218
|
||||
END
|
||||
|
||||
IDD_KEYFILES, DIALOG
|
||||
@@ -373,7 +400,7 @@ BEGIN
|
||||
LEFTMARGIN, 7
|
||||
RIGHTMARGIN, 299
|
||||
TOPMARGIN, 7
|
||||
BOTTOMMARGIN, 266
|
||||
BOTTOMMARGIN, 321
|
||||
END
|
||||
|
||||
IDD_MULTI_CHOICE_DLG, DIALOG
|
||||
@@ -431,6 +458,14 @@ BEGIN
|
||||
TOPMARGIN, 7
|
||||
BOTTOMMARGIN, 35
|
||||
END
|
||||
|
||||
IDD_STATIC_MODAL_WAIT_DLG, DIALOG
|
||||
BEGIN
|
||||
LEFTMARGIN, 7
|
||||
RIGHTMARGIN, 285
|
||||
TOPMARGIN, 7
|
||||
BOTTOMMARGIN, 67
|
||||
END
|
||||
END
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
@@ -449,6 +484,17 @@ IDR_BOOT_LOADER BIN "..\\Boot\\Windows\\Release\\Boo
|
||||
IDR_BOOT_LOADER_AES BIN "..\\Boot\\Windows\\Release_AES\\BootLoader.com.gz"
|
||||
IDR_BOOT_LOADER_SERPENT BIN "..\\Boot\\Windows\\Release_Serpent\\BootLoader.com.gz"
|
||||
IDR_BOOT_LOADER_TWOFISH BIN "..\\Boot\\Windows\\Release_Twofish\\BootLoader.com.gz"
|
||||
|
||||
IDR_BOOT_SECTOR_SHA2 BIN "..\\Boot\\Windows\\Release_SHA2\\BootSector.bin"
|
||||
IDR_BOOT_SECTOR_AES_SHA2 BIN "..\\Boot\\Windows\\Release_AES_SHA2\\BootSector.bin"
|
||||
IDR_BOOT_SECTOR_SERPENT_SHA2 BIN "..\\Boot\\Windows\\Release_Serpent_SHA2\\BootSector.bin"
|
||||
IDR_BOOT_SECTOR_TWOFISH_SHA2 BIN "..\\Boot\\Windows\\Release_Twofish_SHA2\\BootSector.bin"
|
||||
IDR_BOOT_LOADER_SHA2 BIN "..\\Boot\\Windows\\Release_SHA2\\BootLoader.com.gz"
|
||||
IDR_BOOT_LOADER_AES_SHA2 BIN "..\\Boot\\Windows\\Release_AES_SHA2\\BootLoader.com.gz"
|
||||
IDR_BOOT_LOADER_SERPENT_SHA2 BIN "..\\Boot\\Windows\\Release_Serpent_SHA2\\BootLoader.com.gz"
|
||||
IDR_BOOT_LOADER_TWOFISH_SHA2 BIN "..\\Boot\\Windows\\Release_Twofish_SHA2\\BootLoader.com.gz"
|
||||
|
||||
|
||||
IDR_RESCUE_BOOT_SECTOR BIN "..\\Boot\\Windows\\Rescue\\BootSector.bin"
|
||||
IDR_RESCUE_BOOT_SECTOR_AES BIN "..\\Boot\\Windows\\Rescue_AES\\BootSector.bin"
|
||||
IDR_RESCUE_BOOT_SECTOR_SERPENT BIN "..\\Boot\\Windows\\Rescue_Serpent\\BootSector.bin"
|
||||
@@ -458,6 +504,15 @@ IDR_RESCUE_LOADER_AES BIN "..\\Boot\\Windows\\Rescue_AES\\
|
||||
IDR_RESCUE_LOADER_SERPENT BIN "..\\Boot\\Windows\\Rescue_Serpent\\BootLoader.com.gz"
|
||||
IDR_RESCUE_LOADER_TWOFISH BIN "..\\Boot\\Windows\\Rescue_Twofish\\BootLoader.com.gz"
|
||||
|
||||
IDR_RESCUE_BOOT_SECTOR_SHA2 BIN "..\\Boot\\Windows\\Rescue_SHA2\\BootSector.bin"
|
||||
IDR_RESCUE_BOOT_SECTOR_AES_SHA2 BIN "..\\Boot\\Windows\\Rescue_AES_SHA2\\BootSector.bin"
|
||||
IDR_RESCUE_BOOT_SECTOR_SERPENT_SHA2 BIN "..\\Boot\\Windows\\Rescue_Serpent_SHA2\\BootSector.bin"
|
||||
IDR_RESCUE_BOOT_SECTOR_TWOFISH_SHA2 BIN "..\\Boot\\Windows\\Rescue_Twofish_SHA2\\BootSector.bin"
|
||||
IDR_RESCUE_LOADER_SHA2 BIN "..\\Boot\\Windows\\Rescue_SHA2\\BootLoader.com.gz"
|
||||
IDR_RESCUE_LOADER_AES_SHA2 BIN "..\\Boot\\Windows\\Rescue_AES_SHA2\\BootLoader.com.gz"
|
||||
IDR_RESCUE_LOADER_SERPENT_SHA2 BIN "..\\Boot\\Windows\\Rescue_Serpent_SHA2\\BootLoader.com.gz"
|
||||
IDR_RESCUE_LOADER_TWOFISH_SHA2 BIN "..\\Boot\\Windows\\Rescue_Twofish_SHA2\\BootLoader.com.gz"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// XML
|
||||
|
||||
+9
-7
@@ -1,12 +1,14 @@
|
||||
/*
|
||||
Legal Notice: Some portions of the source code contained in this file were
|
||||
derived from the source code of Encryption for the Masses 2.02a, which is
|
||||
Copyright (c) 1998-2000 Paul Le Roux and which is governed by the 'License
|
||||
Agreement for Encryption for the Masses'. Modifications and additions to
|
||||
the original source code (contained in this file) and all other portions
|
||||
of this file are Copyright (c) 2003-2008 TrueCrypt Developers Association
|
||||
and are governed by the TrueCrypt License 3.0 the full text of which is
|
||||
contained in the file License.txt included in TrueCrypt binary and source
|
||||
derived from the source code of TrueCrypt 7.1a, which is
|
||||
Copyright (c) 2003-2012 TrueCrypt Developers Association and which is
|
||||
governed by the TrueCrypt License 3.0, also from the source code of
|
||||
Encryption for the Masses 2.02a, which is Copyright (c) 1998-2000 Paul Le Roux
|
||||
and which is governed by the 'License Agreement for Encryption for the Masses'
|
||||
Modifications and additions to the original source code (contained in this file)
|
||||
and all other portions of this file are Copyright (c) 2013-2015 IDRIX
|
||||
and are governed by the Apache License 2.0 the full text of which is
|
||||
contained in the file License.txt included in VeraCrypt binary and source
|
||||
code distribution packages. */
|
||||
|
||||
#include "Tcdefs.h"
|
||||
|
||||
+9
-7
@@ -1,12 +1,14 @@
|
||||
/*
|
||||
Legal Notice: Some portions of the source code contained in this file were
|
||||
derived from the source code of Encryption for the Masses 2.02a, which is
|
||||
Copyright (c) 1998-2000 Paul Le Roux and which is governed by the 'License
|
||||
Agreement for Encryption for the Masses'. Modifications and additions to
|
||||
the original source code (contained in this file) and all other portions
|
||||
of this file are Copyright (c) 2003-2008 TrueCrypt Developers Association
|
||||
and are governed by the TrueCrypt License 3.0 the full text of which is
|
||||
contained in the file License.txt included in TrueCrypt binary and source
|
||||
derived from the source code of TrueCrypt 7.1a, which is
|
||||
Copyright (c) 2003-2012 TrueCrypt Developers Association and which is
|
||||
governed by the TrueCrypt License 3.0, also from the source code of
|
||||
Encryption for the Masses 2.02a, which is Copyright (c) 1998-2000 Paul Le Roux
|
||||
and which is governed by the 'License Agreement for Encryption for the Masses'
|
||||
Modifications and additions to the original source code (contained in this file)
|
||||
and all other portions of this file are Copyright (c) 2013-2015 IDRIX
|
||||
and are governed by the Apache License 2.0 the full text of which is
|
||||
contained in the file License.txt included in VeraCrypt binary and source
|
||||
code distribution packages. */
|
||||
|
||||
#ifndef TC_HEADER_CRC
|
||||
|
||||
+113
-920
File diff suppressed because it is too large
Load Diff
+62
-46
@@ -1,12 +1,14 @@
|
||||
/*
|
||||
Legal Notice: Some portions of the source code contained in this file were
|
||||
derived from the source code of Encryption for the Masses 2.02a, which is
|
||||
Copyright (c) 1998-2000 Paul Le Roux and which is governed by the 'License
|
||||
Agreement for Encryption for the Masses'. Modifications and additions to
|
||||
the original source code (contained in this file) and all other portions
|
||||
of this file are Copyright (c) 2003-2010 TrueCrypt Developers Association
|
||||
and are governed by the TrueCrypt License 3.0 the full text of which is
|
||||
contained in the file License.txt included in TrueCrypt binary and source
|
||||
derived from the source code of TrueCrypt 7.1a, which is
|
||||
Copyright (c) 2003-2012 TrueCrypt Developers Association and which is
|
||||
governed by the TrueCrypt License 3.0, also from the source code of
|
||||
Encryption for the Masses 2.02a, which is Copyright (c) 1998-2000 Paul Le Roux
|
||||
and which is governed by the 'License Agreement for Encryption for the Masses'
|
||||
Modifications and additions to the original source code (contained in this file)
|
||||
and all other portions of this file are Copyright (c) 2013-2015 IDRIX
|
||||
and are governed by the Apache License 2.0 the full text of which is
|
||||
contained in the file License.txt included in VeraCrypt binary and source
|
||||
code distribution packages. */
|
||||
|
||||
/* Update the following when adding a new cipher or EA:
|
||||
@@ -42,21 +44,16 @@ extern "C" {
|
||||
// Size of the volume header area containing concatenated master key(s) and secondary key(s) (XTS mode)
|
||||
#define MASTER_KEYDATA_SIZE 256
|
||||
|
||||
// Size of the deprecated volume header item containing either an IV seed (CBC mode) or tweak key (LRW mode)
|
||||
#define LEGACY_VOL_IV_SIZE 32
|
||||
|
||||
// The first PRF to try when mounting
|
||||
#define FIRST_PRF_ID 1
|
||||
|
||||
// Hash algorithms (pseudorandom functions).
|
||||
enum
|
||||
{
|
||||
RIPEMD160 = FIRST_PRF_ID,
|
||||
#ifndef TC_WINDOWS_BOOT
|
||||
SHA512,
|
||||
SHA512 = FIRST_PRF_ID,
|
||||
WHIRLPOOL,
|
||||
SHA1, // Deprecated/legacy
|
||||
#endif
|
||||
SHA256,
|
||||
RIPEMD160,
|
||||
HASH_ENUM_END_ID
|
||||
};
|
||||
|
||||
@@ -66,8 +63,8 @@ enum
|
||||
#define RIPEMD160_BLOCKSIZE 64
|
||||
#define RIPEMD160_DIGESTSIZE 20
|
||||
|
||||
#define SHA1_BLOCKSIZE 64
|
||||
#define SHA1_DIGESTSIZE 20
|
||||
#define SHA256_BLOCKSIZE 64
|
||||
#define SHA256_DIGESTSIZE 32
|
||||
|
||||
#define SHA512_BLOCKSIZE 128
|
||||
#define SHA512_DIGESTSIZE 64
|
||||
@@ -78,7 +75,7 @@ enum
|
||||
#define MAX_DIGESTSIZE WHIRLPOOL_DIGESTSIZE
|
||||
|
||||
#define DEFAULT_HASH_ALGORITHM FIRST_PRF_ID
|
||||
#define DEFAULT_HASH_ALGORITHM_BOOT RIPEMD160
|
||||
#define DEFAULT_HASH_ALGORITHM_BOOT SHA256
|
||||
|
||||
// The mode of operation used for newly created volumes and first to try when mounting
|
||||
#define FIRST_MODE_OF_OPERATION_ID 1
|
||||
@@ -89,12 +86,6 @@ enum
|
||||
/* If you add/remove a mode, update the following: GetMaxPkcs5OutSize(), EAInitMode() */
|
||||
|
||||
XTS = FIRST_MODE_OF_OPERATION_ID,
|
||||
#ifndef TC_WINDOWS_BOOT
|
||||
LRW, // Deprecated/legacy
|
||||
CBC, // Deprecated/legacy
|
||||
OUTER_CBC, // Deprecated/legacy
|
||||
INNER_CBC, // Deprecated/legacy
|
||||
#endif
|
||||
MODE_ENUM_END_ID
|
||||
};
|
||||
|
||||
@@ -115,12 +106,7 @@ enum
|
||||
NONE = 0,
|
||||
AES,
|
||||
SERPENT,
|
||||
TWOFISH,
|
||||
#ifndef TC_WINDOWS_BOOT
|
||||
BLOWFISH, // Deprecated/legacy
|
||||
CAST, // Deprecated/legacy
|
||||
TRIPLEDES // Deprecated/legacy
|
||||
#endif
|
||||
TWOFISH
|
||||
};
|
||||
|
||||
typedef struct
|
||||
@@ -177,6 +163,9 @@ typedef struct
|
||||
# define PRAND_DISK_WIPE_PASSES 256
|
||||
#endif
|
||||
|
||||
/* specific value for volume header wipe used only when drive is fully wiped. */
|
||||
#define PRAND_HEADER_WIPE_PASSES 3
|
||||
|
||||
#if !defined (TC_WINDOWS_BOOT) || defined (TC_WINDOWS_BOOT_AES)
|
||||
# include "Aes.h"
|
||||
#else
|
||||
@@ -184,15 +173,11 @@ typedef struct
|
||||
#endif
|
||||
|
||||
#include "Aes_hw_cpu.h"
|
||||
#include "Blowfish.h"
|
||||
#include "Cast.h"
|
||||
#include "Des.h"
|
||||
#include "Serpent.h"
|
||||
#include "Twofish.h"
|
||||
|
||||
#include "Rmd160.h"
|
||||
#ifndef TC_WINDOWS_BOOT
|
||||
# include "Sha1.h"
|
||||
# include "Sha2.h"
|
||||
# include "Whirlpool.h"
|
||||
#endif
|
||||
@@ -213,6 +198,8 @@ typedef struct CRYPTO_INFO_t
|
||||
{
|
||||
int ea; /* Encryption algorithm ID */
|
||||
int mode; /* Mode of operation (e.g., XTS) */
|
||||
int pkcs5; /* PRF algorithm */
|
||||
|
||||
unsigned __int8 ks[MAX_EXPANDED_KEY]; /* Primary key schedule (if it is a cascade, it conatins multiple concatenated keys) */
|
||||
unsigned __int8 ks2[MAX_EXPANDED_KEY]; /* Secondary key schedule (if cascade, multiple concatenated) for XTS mode. */
|
||||
|
||||
@@ -226,8 +213,9 @@ typedef struct CRYPTO_INFO_t
|
||||
unsigned __int8 master_keydata[MASTER_KEYDATA_SIZE]; /* This holds the volume header area containing concatenated master key(s) and secondary key(s) (XTS mode). For LRW (deprecated/legacy), it contains the tweak key before the master key(s). For CBC (deprecated/legacy), it contains the IV seed before the master key(s). */
|
||||
unsigned __int8 k2[MASTER_KEYDATA_SIZE]; /* For XTS, this contains the secondary key (if cascade, multiple concatenated). For LRW (deprecated/legacy), it contains the tweak key. For CBC (deprecated/legacy), it contains the IV seed. */
|
||||
unsigned __int8 salt[PKCS5_SALT_SIZE];
|
||||
int noIterations;
|
||||
int pkcs5;
|
||||
int noIterations;
|
||||
BOOL bTrueCryptMode;
|
||||
int volumePim;
|
||||
|
||||
uint64 volume_creation_time; // Legacy
|
||||
uint64 header_creation_time; // Legacy
|
||||
@@ -261,6 +249,23 @@ typedef struct CRYPTO_INFO_t
|
||||
|
||||
} CRYPTO_INFO, *PCRYPTO_INFO;
|
||||
|
||||
#ifdef _WIN32
|
||||
|
||||
#pragma pack (push)
|
||||
#pragma pack(1)
|
||||
|
||||
typedef struct BOOT_CRYPTO_HEADER_t
|
||||
{
|
||||
__int16 ea; /* Encryption algorithm ID */
|
||||
__int16 mode; /* Mode of operation (e.g., XTS) */
|
||||
__int16 pkcs5; /* PRF algorithm */
|
||||
|
||||
} BOOT_CRYPTO_HEADER, *PBOOT_CRYPTO_HEADER;
|
||||
|
||||
#pragma pack (pop)
|
||||
|
||||
#endif
|
||||
|
||||
PCRYPTO_INFO crypto_open (void);
|
||||
void crypto_loadkey (PKEY_INFO keyInfo, char *lpszUserKey, int nUserKeyLen);
|
||||
void crypto_close (PCRYPTO_INFO cryptoInfo);
|
||||
@@ -269,10 +274,18 @@ int CipherGetBlockSize (int cipher);
|
||||
int CipherGetKeySize (int cipher);
|
||||
int CipherGetKeyScheduleSize (int cipher);
|
||||
BOOL CipherSupportsIntraDataUnitParallelization (int cipher);
|
||||
|
||||
#ifndef TC_WINDOWS_BOOT
|
||||
const
|
||||
#endif
|
||||
char * CipherGetName (int cipher);
|
||||
|
||||
int CipherInit (int cipher, unsigned char *key, unsigned char *ks);
|
||||
#ifndef TC_WINDOWS_BOOT_SINGLE_CIPHER_MODE
|
||||
int EAInit (int ea, unsigned char *key, unsigned char *ks);
|
||||
#else
|
||||
int EAInit (unsigned char *key, unsigned char *ks);
|
||||
#endif
|
||||
BOOL EAInitMode (PCRYPTO_INFO ci);
|
||||
void EncipherBlock(int cipher, void *data, void *ks);
|
||||
void DecipherBlock(int cipher, void *data, void *ks);
|
||||
@@ -284,7 +297,7 @@ void DecipherBlocks (int cipher, void *dataPtr, void *ks, size_t blockCount);
|
||||
int EAGetFirst ();
|
||||
int EAGetCount (void);
|
||||
int EAGetNext (int previousEA);
|
||||
char * EAGetName (char *buf, int ea);
|
||||
char * EAGetName (char *buf, int ea, int guiDisplay);
|
||||
int EAGetByName (char *name);
|
||||
int EAGetKeySize (int ea);
|
||||
int EAGetFirstMode (int ea);
|
||||
@@ -302,10 +315,20 @@ int EAGetPreviousCipher (int ea, int previousCipherId);
|
||||
int EAIsFormatEnabled (int ea);
|
||||
BOOL EAIsModeSupported (int ea, int testedMode);
|
||||
|
||||
char *HashGetName (int hash_algo_id);
|
||||
BOOL HashIsDeprecated (int hashId);
|
||||
|
||||
#ifndef TC_WINDOWS_BOOT
|
||||
const
|
||||
#endif
|
||||
char *HashGetName (int hash_algo_id);
|
||||
|
||||
#ifndef TC_WINDOWS_BOOT
|
||||
Hash *HashGet (int id);
|
||||
void HashGetName2 (char *buf, int hashId);
|
||||
BOOL HashIsDeprecated (int hashId);
|
||||
BOOL HashForSystemEncryption (int hashId);
|
||||
int GetMaxPkcs5OutSize (void);
|
||||
#endif
|
||||
|
||||
|
||||
void EncryptDataUnits (unsigned __int8 *buf, const UINT64_STRUCT *structUnitNo, uint32 nbrUnits, PCRYPTO_INFO ci);
|
||||
void EncryptDataUnitsCurrentThread (unsigned __int8 *buf, const UINT64_STRUCT *structUnitNo, TC_LARGEST_COMPILER_UINT nbrUnits, PCRYPTO_INFO ci);
|
||||
@@ -313,13 +336,6 @@ void DecryptDataUnits (unsigned __int8 *buf, const UINT64_STRUCT *structUnitNo,
|
||||
void DecryptDataUnitsCurrentThread (unsigned __int8 *buf, const UINT64_STRUCT *structUnitNo, TC_LARGEST_COMPILER_UINT nbrUnits, PCRYPTO_INFO ci);
|
||||
void EncryptBuffer (unsigned __int8 *buf, TC_LARGEST_COMPILER_UINT len, PCRYPTO_INFO cryptoInfo);
|
||||
void DecryptBuffer (unsigned __int8 *buf, TC_LARGEST_COMPILER_UINT len, PCRYPTO_INFO cryptoInfo);
|
||||
#ifndef TC_NO_COMPILER_INT64
|
||||
void EncryptBufferLRW128 (byte *buffer, uint64 length, uint64 blockIndex, PCRYPTO_INFO cryptoInfo);
|
||||
void DecryptBufferLRW128 (byte *buffer, uint64 length, uint64 blockIndex, PCRYPTO_INFO cryptoInfo);
|
||||
void EncryptBufferLRW64 (byte *buffer, uint64 length, uint64 blockIndex, PCRYPTO_INFO cryptoInfo);
|
||||
void DecryptBufferLRW64 (byte *buffer, uint64 length, uint64 blockIndex, PCRYPTO_INFO cryptoInfo);
|
||||
uint64 DataUnit2LRWIndex (uint64 dataUnit, int blockSize, PCRYPTO_INFO ci);
|
||||
#endif // #ifndef TC_NO_COMPILER_INT64
|
||||
|
||||
BOOL IsAesHwCpuSupported ();
|
||||
void EnableHwEncryption (BOOL enable);
|
||||
|
||||
+16
-8
@@ -1,9 +1,13 @@
|
||||
/*
|
||||
Copyright (c) 2005-2009 TrueCrypt Developers Association. All rights reserved.
|
||||
Derived from source code of TrueCrypt 7.1a, which is
|
||||
Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
|
||||
by the TrueCrypt License 3.0.
|
||||
|
||||
Governed by the TrueCrypt License 3.0 the full text of which is contained in
|
||||
the file License.txt included in TrueCrypt binary and source code distribution
|
||||
packages.
|
||||
Modifications and additions to the original source code (contained in this file)
|
||||
and all other portions of this file are Copyright (c) 2013-2015 IDRIX
|
||||
and are governed by the Apache License 2.0 the full text of which is
|
||||
contained in the file License.txt included in VeraCrypt binary and source
|
||||
code distribution packages.
|
||||
*/
|
||||
|
||||
#include "../Common/Dictionary.h"
|
||||
@@ -22,11 +26,15 @@ static size_t DataPoolSize = 0;
|
||||
|
||||
void AddDictionaryEntry (char *key, int intKey, void *value)
|
||||
{
|
||||
if (key)
|
||||
StringKeyMap[key] = value;
|
||||
try
|
||||
{
|
||||
if (key)
|
||||
StringKeyMap[key] = value;
|
||||
|
||||
if (intKey != 0)
|
||||
IntKeyMap[intKey] = value;
|
||||
if (intKey != 0)
|
||||
IntKeyMap[intKey] = value;
|
||||
}
|
||||
catch (exception&) {}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,9 +1,13 @@
|
||||
/*
|
||||
Copyright (c) 2005-2009 TrueCrypt Developers Association. All rights reserved.
|
||||
Derived from source code of TrueCrypt 7.1a, which is
|
||||
Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
|
||||
by the TrueCrypt License 3.0.
|
||||
|
||||
Governed by the TrueCrypt License 3.0 the full text of which is contained in
|
||||
the file License.txt included in TrueCrypt binary and source code distribution
|
||||
packages.
|
||||
Modifications and additions to the original source code (contained in this file)
|
||||
and all other portions of this file are Copyright (c) 2013-2015 IDRIX
|
||||
and are governed by the Apache License 2.0 the full text of which is
|
||||
contained in the file License.txt included in VeraCrypt binary and source
|
||||
code distribution packages.
|
||||
*/
|
||||
|
||||
#ifndef DICTIONARY_H
|
||||
|
||||
+1766
-807
File diff suppressed because it is too large
Load Diff
+107
-70
@@ -1,12 +1,14 @@
|
||||
/*
|
||||
Legal Notice: Some portions of the source code contained in this file were
|
||||
derived from the source code of Encryption for the Masses 2.02a, which is
|
||||
Copyright (c) 1998-2000 Paul Le Roux and which is governed by the 'License
|
||||
Agreement for Encryption for the Masses'. Modifications and additions to
|
||||
the original source code (contained in this file) and all other portions
|
||||
of this file are Copyright (c) 2003-2010 TrueCrypt Developers Association
|
||||
and are governed by the TrueCrypt License 3.0 the full text of which is
|
||||
contained in the file License.txt included in TrueCrypt binary and source
|
||||
derived from the source code of TrueCrypt 7.1a, which is
|
||||
Copyright (c) 2003-2012 TrueCrypt Developers Association and which is
|
||||
governed by the TrueCrypt License 3.0, also from the source code of
|
||||
Encryption for the Masses 2.02a, which is Copyright (c) 1998-2000 Paul Le Roux
|
||||
and which is governed by the 'License Agreement for Encryption for the Masses'
|
||||
Modifications and additions to the original source code (contained in this file)
|
||||
and all other portions of this file are Copyright (c) 2013-2015 IDRIX
|
||||
and are governed by the Apache License 2.0 the full text of which is
|
||||
contained in the file License.txt included in VeraCrypt binary and source
|
||||
code distribution packages. */
|
||||
|
||||
#ifndef TC_HEADER_DLGCODE
|
||||
@@ -77,6 +79,8 @@ enum
|
||||
#define TC_APPD_FILENAME_POST_INSTALL_TASK_TUTORIAL "Post-Install Task - Tutorial"
|
||||
#define TC_APPD_FILENAME_POST_INSTALL_TASK_RELEASE_NOTES "Post-Install Task - Release Notes"
|
||||
|
||||
#define VC_FILENAME_RENAMED_SUFFIX "_old"
|
||||
|
||||
#ifndef USER_DEFAULT_SCREEN_DPI
|
||||
#define USER_DEFAULT_SCREEN_DPI 96
|
||||
#endif
|
||||
@@ -128,9 +132,14 @@ extern WipeAlgorithmId nWipeMode;
|
||||
extern BOOL bSysPartitionSelected;
|
||||
extern BOOL bSysDriveSelected;
|
||||
|
||||
extern char SysPartitionDevicePath [TC_MAX_PATH];
|
||||
extern char SysDriveDevicePath [TC_MAX_PATH];
|
||||
extern char bCachedSysDevicePathsValid;
|
||||
|
||||
extern BOOL bHyperLinkBeingTracked;
|
||||
extern BOOL bInPlaceEncNonSysPending;
|
||||
|
||||
extern BOOL PimEnable;
|
||||
extern BOOL KeyFilesEnable;
|
||||
extern KeyFile *FirstKeyFile;
|
||||
extern KeyFilesDlgParam defaultKeyFilesParam;
|
||||
@@ -218,19 +227,20 @@ typedef struct
|
||||
#define YES_NO MB_YESNO
|
||||
|
||||
#define ISO_BURNER_TOOL "isoburn.exe"
|
||||
#define PRINT_TOOL "notepad"
|
||||
#define PRINT_TOOL "notepad.exe"
|
||||
|
||||
void cleanup ( void );
|
||||
void LowerCaseCopy ( char *lpszDest , const char *lpszSource );
|
||||
void UpperCaseCopy ( char *lpszDest , const char *lpszSource );
|
||||
void CreateFullVolumePath ( char *lpszDiskFile , const char *lpszFileName , BOOL *bDevice );
|
||||
int FakeDosNameForDevice ( const char *lpszDiskFile , char *lpszDosDevice , char *lpszCFDevice , BOOL bNameOnly );
|
||||
void UpperCaseCopy ( char *lpszDest , size_t cbDest, const char *lpszSource );
|
||||
void CreateFullVolumePath ( char *lpszDiskFile , size_t cbDiskFile, const char *lpszFileName , BOOL *bDevice );
|
||||
int FakeDosNameForDevice ( const char *lpszDiskFile , char *lpszDosDevice , size_t cbDosDevice, char *lpszCFDevice , size_t cbCFDevice, BOOL bNameOnly );
|
||||
int RemoveFakeDosName ( char *lpszDiskFile , char *lpszDosDevice );
|
||||
void AbortProcessDirect ( wchar_t *abortMsg );
|
||||
void AbortProcess ( char *stringId );
|
||||
void AbortProcessSilent ( void );
|
||||
void *err_malloc ( size_t size );
|
||||
char *err_strdup ( char *lpszText );
|
||||
DWORD handleWin32Error ( HWND hwndDlg );
|
||||
DWORD handleWin32Error ( HWND hwndDlg, const char* srcPos );
|
||||
BOOL IsDiskReadError (DWORD error);
|
||||
BOOL IsDiskWriteError (DWORD error);
|
||||
BOOL IsDiskError (DWORD error);
|
||||
@@ -242,8 +252,8 @@ void CloseStaticModelessWaitDlg (void);
|
||||
BOOL IsButtonChecked ( HWND hButton );
|
||||
void CheckButton ( HWND hButton );
|
||||
void LeftPadString (char *szTmp, int len, int targetLen, char filler);
|
||||
void ToSBCS ( LPWSTR lpszText );
|
||||
void ToUNICODE ( char *lpszText );
|
||||
void ToSBCS ( LPWSTR lpszText, size_t cbSize );
|
||||
void ToUNICODE ( char *lpszText , size_t cbSize);
|
||||
void InitDialog ( HWND hwndDlg );
|
||||
void ProcessPaintMessages (HWND hwnd, int maxMessagesToProcess);
|
||||
HDC CreateMemBitmap ( HINSTANCE hInstance , HWND hwnd , char *resource );
|
||||
@@ -259,7 +269,7 @@ void HandCursor ();
|
||||
void AddComboPair (HWND hComboBox, const char *lpszItem, int value);
|
||||
void AddComboPairW (HWND hComboBox, const wchar_t *lpszItem, int value);
|
||||
void SelectAlgo ( HWND hComboBox , int *nCipher );
|
||||
void PopulateWipeModeCombo (HWND hComboBox, BOOL bNA, BOOL bInPlaceEncryption);
|
||||
void PopulateWipeModeCombo (HWND hComboBox, BOOL bNA, BOOL bInPlaceEncryption, BOOL bHeaderWipe);
|
||||
wchar_t *GetWipeModeName (WipeAlgorithmId modeId);
|
||||
wchar_t *GetPathType (const char *path, BOOL bUpperCase, BOOL *bIsPartition);
|
||||
LRESULT CALLBACK CustomDlgProc ( HWND hwnd , UINT uMsg , WPARAM wParam , LPARAM lParam );
|
||||
@@ -285,17 +295,19 @@ BOOL LoadSysEncSettings (HWND hwndDlg);
|
||||
int LoadNonSysInPlaceEncSettings (WipeAlgorithmId *wipeAlgorithm);
|
||||
void RemoveNonSysInPlaceEncNotifications (void);
|
||||
void SavePostInstallTasksSettings (int command);
|
||||
void DoPostInstallTasks (void);
|
||||
void DoPostInstallTasks (HWND hwndDlg);
|
||||
void InitOSVersionInfo ();
|
||||
void InitApp ( HINSTANCE hInstance, char *lpszCommandLine );
|
||||
void FinalizeApp (void);
|
||||
void InitHelpFileName (void);
|
||||
BOOL OpenDevice (const char *lpszPath, OPEN_TEST_STRUCT *driver, BOOL detectFilesystem);
|
||||
void NotifyDriverOfPortableMode (void);
|
||||
int GetAvailableFixedDisks ( HWND hComboBox , char *lpszRootPath );
|
||||
int GetAvailableRemovables ( HWND hComboBox , char *lpszRootPath );
|
||||
int IsSystemDevicePath (char *path, HWND hwndDlg, BOOL bReliableRequired);
|
||||
int IsSystemDevicePath (const char *path, HWND hwndDlg, BOOL bReliableRequired);
|
||||
int IsNonSysPartitionOnSysDrive (const char *path);
|
||||
BOOL CALLBACK RawDevicesDlgProc ( HWND hwndDlg , UINT msg , WPARAM wParam , LPARAM lParam );
|
||||
BOOL TextInfoDialogBox (int nID);
|
||||
INT_PTR TextInfoDialogBox (int nID);
|
||||
BOOL CALLBACK TextInfoDialogBoxDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
|
||||
char * GetLegalNotices ();
|
||||
BOOL CALLBACK BenchmarkDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
|
||||
@@ -308,8 +320,8 @@ void ResetCipherTest ( HWND hwndDlg , int idTestCipher );
|
||||
void ResetCurrentDirectory ();
|
||||
BOOL BrowseFiles (HWND hwndDlg, char *stringId, char *lpszFileName, BOOL keepHistory, BOOL saveMode, wchar_t *browseFilter);
|
||||
BOOL BrowseDirectories (HWND hWnd, char *lpszTitle, char *dirName);
|
||||
void handleError ( HWND hwndDlg , int code );
|
||||
BOOL CheckFileStreamWriteErrors (FILE *file, const char *fileName);
|
||||
void handleError ( HWND hwndDlg , int code, const char* srcPos );
|
||||
BOOL CheckFileStreamWriteErrors (HWND hwndDlg, FILE *file, const char *fileName);
|
||||
void LocalizeDialog ( HWND hwnd, char *stringId );
|
||||
void OpenVolumeExplorerWindow (int driveNo);
|
||||
static BOOL CALLBACK CloseVolumeExplorerWindowsEnum( HWND hwnd, LPARAM driveNo);
|
||||
@@ -325,28 +337,29 @@ BOOL IsDriveAvailable (int driveNo);
|
||||
BOOL IsDeviceMounted (char *deviceName);
|
||||
int DriverUnmountVolume (HWND hwndDlg, int nDosDriveNo, BOOL forced);
|
||||
void BroadcastDeviceChange (WPARAM message, int nDosDriveNo, DWORD driveMap);
|
||||
int MountVolume (HWND hwndDlg, int driveNo, char *volumePath, Password *password, BOOL cachePassword, BOOL sharedAccess, const MountOptions* const mountOptions, BOOL quiet, BOOL bReportWrongPassword);
|
||||
int MountVolume (HWND hwndDlg, int driveNo, char *volumePath, Password *password, int pkcs5, int pim, BOOL truecryptMode, BOOL cachePassword, BOOL sharedAccess, const MountOptions* const mountOptions, BOOL quiet, BOOL bReportWrongPassword);
|
||||
BOOL UnmountVolume (HWND hwndDlg , int nDosDriveNo, BOOL forceUnmount);
|
||||
BOOL UnmountVolumeAfterFormatExCall (HWND hwndDlg, int nDosDriveNo);
|
||||
BOOL IsPasswordCacheEmpty (void);
|
||||
BOOL IsMountedVolume (const char *volname);
|
||||
int GetMountedVolumeDriveNo (char *volname);
|
||||
BOOL IsAdmin (void);
|
||||
BOOL IsBuiltInAdmin ();
|
||||
BOOL IsUacSupported ();
|
||||
BOOL ResolveSymbolicLink (const wchar_t *symLinkName, PWSTR targetName);
|
||||
BOOL ResolveSymbolicLink (const wchar_t *symLinkName, PWSTR targetName, size_t cbTargetName);
|
||||
int GetDiskDeviceDriveLetter (PWSTR deviceName);
|
||||
int FileSystemAppearsEmpty (const char *devicePath);
|
||||
__int64 GetStatsFreeSpaceOnPartition (const char *devicePath, float *percent, __int64 *occupiedBytes, BOOL silent);
|
||||
__int64 GetDeviceSize (const char *devicePath);
|
||||
HANDLE DismountDrive (char *devName, char *devicePath);
|
||||
int64 FindString (const char *buf, const char *str, int64 bufLen, size_t strLen, int64 startOffset);
|
||||
int64 FindString (const char *buf, const char *str, int64 bufLen, int64 strLen, int64 startOffset);
|
||||
BOOL FileExists (const char *filePathPtr);
|
||||
__int64 FindStringInFile (const char *filePath, const char *str, int strLen);
|
||||
BOOL TCCopyFile (char *sourceFileName, char *destinationFile);
|
||||
BOOL SaveBufferToFile (const char *inputBuffer, const char *destinationFile, DWORD inputLength, BOOL bAppend);
|
||||
BOOL SaveBufferToFile (const char *inputBuffer, const char *destinationFile, DWORD inputLength, BOOL bAppend, BOOL bRenameIfFailed);
|
||||
BOOL TCFlushFile (FILE *f);
|
||||
BOOL PrintHardCopyTextUTF16 (wchar_t *text, char *title, int byteLen);
|
||||
void GetSpeedString (unsigned __int64 speed, wchar_t *str);
|
||||
BOOL PrintHardCopyTextUTF16 (wchar_t *text, char *title, size_t byteLen);
|
||||
void GetSpeedString (unsigned __int64 speed, wchar_t *str, size_t cbStr);
|
||||
BOOL IsNonInstallMode ();
|
||||
BOOL DriverUnload ();
|
||||
LRESULT SetCheckBox (HWND hwndDlg, int dlgItem, BOOL state);
|
||||
@@ -362,50 +375,52 @@ LRESULT ListSubItemSet (HWND list, int index, int subIndex, char *string);
|
||||
LRESULT ListSubItemSetW (HWND list, int index, int subIndex, wchar_t *string);
|
||||
BOOL GetMountList (MOUNT_LIST_STRUCT *list);
|
||||
int GetDriverRefCount ();
|
||||
void GetSizeString (unsigned __int64 size, wchar_t *str);
|
||||
void GetSizeString (unsigned __int64 size, wchar_t *str, size_t cbStr);
|
||||
__int64 GetFileSize64 (const char *path);
|
||||
BOOL LoadInt16 (char *filePath, int *result, __int64 fileOffset);
|
||||
BOOL LoadInt32 (char *filePath, unsigned __int32 *result, __int64 fileOffset);
|
||||
char *LoadFile (const char *fileName, DWORD *size);
|
||||
char *LoadFileBlock (char *fileName, __int64 fileOffset, size_t count);
|
||||
char *LoadFileBlock (char *fileName, __int64 fileOffset, DWORD count);
|
||||
char *GetModPath (char *path, int maxSize);
|
||||
char *GetConfigPath (char *fileName);
|
||||
char *GetProgramConfigPath (char *fileName);
|
||||
char GetSystemDriveLetter (void);
|
||||
void OpenPageHelp (HWND hwndDlg, int nPage);
|
||||
void TaskBarIconDisplayBalloonTooltip (HWND hwnd, wchar_t *headline, wchar_t *text, BOOL warning);
|
||||
void InfoBalloon (char *headingStringId, char *textStringId);
|
||||
void InfoBalloonDirect (wchar_t *headingString, wchar_t *textString);
|
||||
void WarningBalloon (char *headingStringId, char *textStringId);
|
||||
void WarningBalloonDirect (wchar_t *headingString, wchar_t *textString);
|
||||
int Info (char *stringId);
|
||||
int InfoTopMost (char *stringId);
|
||||
int InfoDirect (const wchar_t *msg);
|
||||
int Warning (char *stringId);
|
||||
int WarningTopMost (char *stringId);
|
||||
int WarningDirect (const wchar_t *warnMsg);
|
||||
int Error (char *stringId);
|
||||
int ErrorDirect (const wchar_t *errMsg);
|
||||
int ErrorTopMost (char *stringId);
|
||||
int AskYesNo (char *stringId);
|
||||
int AskYesNoString (const wchar_t *str);
|
||||
int AskYesNoTopmost (char *stringId);
|
||||
int AskNoYes (char *stringId);
|
||||
int AskOkCancel (char *stringId);
|
||||
int AskWarnYesNo (char *stringId);
|
||||
int AskWarnYesNoString (const wchar_t *string);
|
||||
int AskWarnYesNoTopmost (char *stringId);
|
||||
int AskWarnYesNoStringTopmost (const wchar_t *string);
|
||||
int AskWarnNoYes (char *stringId);
|
||||
int AskWarnNoYesString (const wchar_t *string);
|
||||
int AskWarnNoYesTopmost (char *stringId);
|
||||
int AskWarnOkCancel (char *stringId);
|
||||
int AskWarnCancelOk (char *stringId);
|
||||
int AskErrYesNo (char *stringId);
|
||||
int AskErrNoYes (char *stringId);
|
||||
int AskMultiChoice (void *strings[], BOOL bBold);
|
||||
void InfoBalloon (char *headingStringId, char *textStringId, HWND hwnd);
|
||||
void InfoBalloonDirect (wchar_t *headingString, wchar_t *textString, HWND hwnd);
|
||||
void WarningBalloon (char *headingStringId, char *textStringId, HWND hwnd);
|
||||
void WarningBalloonDirect (wchar_t *headingString, wchar_t *textString, HWND hwnd);
|
||||
int Info (char *stringId, HWND hwnd);
|
||||
int InfoTopMost (char *stringId, HWND hwnd);
|
||||
int InfoDirect (const wchar_t *msg, HWND hwnd);
|
||||
int Warning (char *stringId, HWND hwnd);
|
||||
int WarningTopMost (char *stringId, HWND hwnd);
|
||||
int WarningDirect (const wchar_t *warnMsg, HWND hwnd);
|
||||
int Error (char *stringId, HWND hwnd);
|
||||
int ErrorRetryCancel (char *stringId, HWND hwnd);
|
||||
int ErrorDirect (const wchar_t *errMsg, HWND hwnd);
|
||||
int ErrorTopMost (char *stringId, HWND hwnd);
|
||||
int AskYesNo (char *stringId, HWND hwnd);
|
||||
int AskYesNoString (const wchar_t *str, HWND hwnd);
|
||||
int AskYesNoTopmost (char *stringId, HWND hwnd);
|
||||
int AskNoYes (char *stringId, HWND hwnd);
|
||||
int AskNoYesString (const wchar_t *string, HWND hwnd);
|
||||
int AskOkCancel (char *stringId, HWND hwnd);
|
||||
int AskWarnYesNo (char *stringId, HWND hwnd);
|
||||
int AskWarnYesNoString (const wchar_t *string, HWND hwnd);
|
||||
int AskWarnYesNoTopmost (char *stringId, HWND hwnd);
|
||||
int AskWarnYesNoStringTopmost (const wchar_t *string, HWND hwnd);
|
||||
int AskWarnNoYes (char *stringId, HWND hwnd);
|
||||
int AskWarnNoYesString (const wchar_t *string, HWND hwnd);
|
||||
int AskWarnNoYesTopmost (char *stringId, HWND hwnd);
|
||||
int AskWarnOkCancel (char *stringId, HWND hwnd);
|
||||
int AskWarnCancelOk (char *stringId, HWND hwnd);
|
||||
int AskErrYesNo (char *stringId, HWND hwnd);
|
||||
int AskErrNoYes (char *stringId, HWND hwnd);
|
||||
int AskMultiChoice (void *strings[], BOOL bBold, HWND hwnd);
|
||||
BOOL ConfigWriteBegin ();
|
||||
BOOL ConfigWriteEnd ();
|
||||
BOOL ConfigWriteEnd (HWND hwnd);
|
||||
BOOL ConfigWriteString (char *configKey, char *configValue);
|
||||
BOOL ConfigWriteInt (char *configKey, int configValue);
|
||||
int ConfigReadInt (char *configKey, int defaultValue);
|
||||
@@ -423,14 +438,14 @@ BOOL EnableWow64FsRedirection (BOOL enable);
|
||||
BOOL RestartComputer (void);
|
||||
void Applink (char *dest, BOOL bSendOS, char *extraOutput);
|
||||
char *RelativePath2Absolute (char *szFileName);
|
||||
void HandleDriveNotReadyError ();
|
||||
void HandleDriveNotReadyError (HWND hwnd);
|
||||
BOOL CALLBACK CloseTCWindowsEnum( HWND hwnd, LPARAM lParam);
|
||||
BOOL CALLBACK FindTCWindowEnum (HWND hwnd, LPARAM lParam);
|
||||
BYTE *MapResource (char *resourceType, int resourceId, PDWORD size);
|
||||
void InconsistencyResolved (char *msg);
|
||||
void ReportUnexpectedState (char *techInfo);
|
||||
BOOL SelectMultipleFiles (HWND hwndDlg, char *stringId, char *lpszFileName, BOOL keepHistory);
|
||||
BOOL SelectMultipleFilesNext (char *lpszFileName);
|
||||
BOOL SelectMultipleFiles (HWND hwndDlg, const char *stringId, char *lpszFileName, size_t cbFileName, BOOL keepHistory);
|
||||
BOOL SelectMultipleFilesNext (char *lpszFileName, size_t cbFileName);
|
||||
void OpenOnlineHelp ();
|
||||
BOOL GetPartitionInfo (const char *deviceName, PPARTITION_INFORMATION rpartInfo);
|
||||
BOOL GetDeviceInfo (const char *deviceName, DISK_PARTITION_INFO_STRUCT *info);
|
||||
@@ -443,31 +458,36 @@ int GetTextGfxWidth (HWND hwndDlgItem, const wchar_t *text, HFONT hFont);
|
||||
int GetTextGfxHeight (HWND hwndDlgItem, const wchar_t *text, HFONT hFont);
|
||||
BOOL ToHyperlink (HWND hwndDlg, UINT ctrlId);
|
||||
BOOL ToCustHyperlink (HWND hwndDlg, UINT ctrlId, HFONT hFont);
|
||||
void DisableCloseButton (HWND hwndDlg);
|
||||
void EnableCloseButton (HWND hwndDlg);
|
||||
void ToBootPwdField (HWND hwndDlg, UINT ctrlId);
|
||||
void AccommodateTextField (HWND hwndDlg, UINT ctrlId, BOOL bFirstUpdate, HFONT hFont);
|
||||
BOOL GetDriveLabel (int driveNo, wchar_t *label, int labelSize);
|
||||
BOOL GetSysDevicePaths (HWND hwndDlg);
|
||||
BOOL DoDriverInstall (HWND hwndDlg);
|
||||
int OpenVolume (OpenVolumeContext *context, const char *volumePath, Password *password, BOOL write, BOOL preserveTimestamps, BOOL useBackupHeader);
|
||||
int OpenVolume (OpenVolumeContext *context, const char *volumePath, Password *password, int pkcs5_prf, int pim, BOOL truecryptMode, BOOL write, BOOL preserveTimestamps, BOOL useBackupHeader);
|
||||
void CloseVolume (OpenVolumeContext *context);
|
||||
int ReEncryptVolumeHeader (char *buffer, BOOL bBoot, CRYPTO_INFO *cryptoInfo, Password *password, BOOL wipeMode);
|
||||
int ReEncryptVolumeHeader (HWND hwndDlg, char *buffer, BOOL bBoot, CRYPTO_INFO *cryptoInfo, Password *password, int pim, BOOL wipeMode);
|
||||
BOOL IsPagingFileActive (BOOL checkNonWindowsPartitionsOnly);
|
||||
BOOL IsPagingFileWildcardActive ();
|
||||
BOOL DisablePagingFile ();
|
||||
BOOL CALLBACK SecurityTokenPasswordDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
|
||||
BOOL CALLBACK SecurityTokenKeyfileDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
|
||||
BOOL InitSecurityTokenLibrary ();
|
||||
BOOL InitSecurityTokenLibrary (HWND hwndDlg);
|
||||
BOOL FileHasReadOnlyAttribute (const char *path);
|
||||
BOOL IsFileOnReadOnlyFilesystem (const char *path);
|
||||
void CheckFilesystem (int driveNo, BOOL fixErrors);
|
||||
void CheckFilesystem (HWND hwndDlg, int driveNo, BOOL fixErrors);
|
||||
BOOL BufferContainsString (const byte *buffer, size_t bufferSize, const char *str);
|
||||
int AskNonSysInPlaceEncryptionResume ();
|
||||
int AskNonSysInPlaceEncryptionResume (HWND hwndDlg, BOOL* pbDecrypt);
|
||||
BOOL RemoveDeviceWriteProtection (HWND hwndDlg, char *devicePath);
|
||||
void EnableElevatedCursorChange (HWND parent);
|
||||
BOOL DisableFileCompression (HANDLE file);
|
||||
BOOL VolumePathExists (char *volumePath);
|
||||
BOOL VolumePathExists (const char *volumePath);
|
||||
BOOL IsWindowsIsoBurnerAvailable ();
|
||||
BOOL LaunchWindowsIsoBurner (HWND hwnd, const char *isoPath);
|
||||
BOOL IsApplicationInstalled (const char *appName);
|
||||
int GetPim (HWND hwndDlg, UINT ctrlId);
|
||||
void SetPim (HWND hwndDlg, UINT ctrlId, int pim);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
@@ -487,7 +507,8 @@ struct HostDevice
|
||||
IsVirtualPartition (false),
|
||||
HasUnencryptedFilesystem (false),
|
||||
Removable (false),
|
||||
Size (0)
|
||||
Size (0),
|
||||
SystemNumber((uint32) -1)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -510,6 +531,12 @@ struct HostDevice
|
||||
std::vector <HostDevice> Partitions;
|
||||
};
|
||||
|
||||
struct RawDevicesDlgParam
|
||||
{
|
||||
std::vector <HostDevice> devices;
|
||||
char *pszFileName;
|
||||
};
|
||||
|
||||
BOOL BrowseFilesInDir (HWND hwndDlg, char *stringId, char *initialDir, char *lpszFileName, BOOL keepHistory, BOOL saveMode, wchar_t *browseFilter, const wchar_t *initialFileName = NULL, const wchar_t *defaultExtension = NULL);
|
||||
std::wstring SingleStringToWide (const std::string &singleString);
|
||||
std::wstring Utf8StringToWide (const std::string &utf8String);
|
||||
@@ -521,11 +548,21 @@ std::string ToUpperCase (const std::string &str);
|
||||
std::wstring GetWrongPasswordErrorMessage (HWND hwndDlg);
|
||||
std::string GetWindowsEdition ();
|
||||
std::string FitPathInGfxWidth (HWND hwnd, HFONT hFont, LONG width, const std::string &path);
|
||||
std::string GetServiceConfigPath (const char *fileName);
|
||||
std::string GetServiceConfigPath (const char *fileName, bool useLegacy);
|
||||
std::string VolumeGuidPathToDevicePath (std::string volumeGuidPath);
|
||||
std::string HarddiskVolumePathToPartitionPath (const std::string &harddiskVolumePath);
|
||||
std::string FindLatestFileOrDirectory (const std::string &directory, const char *namePattern, bool findDirectory, bool findFile);
|
||||
std::string GetUserFriendlyVersionString (int version);
|
||||
std::string IntToString (int val);
|
||||
std::wstring IntToWideString (int val);
|
||||
inline std::wstring AppendSrcPos (const wchar_t* msg, const char* srcPos)
|
||||
{
|
||||
return std::wstring (msg) + L"\n\nSource: " + SingleStringToWide (srcPos);
|
||||
}
|
||||
|
||||
// Display a wait dialog while calling the provided callback with the given parameter
|
||||
typedef void (CALLBACK* WaitThreadProc)(void* pArg, HWND hWaitDlg);
|
||||
void ShowWaitDialog(HWND hwnd, BOOL bUseHwndAsParent, WaitThreadProc callback, void* pArg);
|
||||
|
||||
#endif // __cplusplus
|
||||
|
||||
|
||||
@@ -1,9 +1,13 @@
|
||||
/*
|
||||
Copyright (c) 2008-2010 TrueCrypt Developers Association. All rights reserved.
|
||||
Derived from source code of TrueCrypt 7.1a, which is
|
||||
Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
|
||||
by the TrueCrypt License 3.0.
|
||||
|
||||
Governed by the TrueCrypt License 3.0 the full text of which is contained in
|
||||
the file License.txt included in TrueCrypt binary and source code distribution
|
||||
packages.
|
||||
Modifications and additions to the original source code (contained in this file)
|
||||
and all other portions of this file are Copyright (c) 2013-2015 IDRIX
|
||||
and are governed by the Apache License 2.0 the full text of which is
|
||||
contained in the file License.txt included in VeraCrypt binary and source
|
||||
code distribution packages.
|
||||
*/
|
||||
|
||||
#include "EncryptionThreadPool.h"
|
||||
@@ -159,7 +163,7 @@ static TC_THREAD_PROC EncryptionThreadProc (void *threadArg)
|
||||
switch (workItem->KeyDerivation.Pkcs5Prf)
|
||||
{
|
||||
case RIPEMD160:
|
||||
derive_key_ripemd160 (TRUE, workItem->KeyDerivation.Password, workItem->KeyDerivation.PasswordLength, workItem->KeyDerivation.Salt, PKCS5_SALT_SIZE,
|
||||
derive_key_ripemd160 (workItem->KeyDerivation.Password, workItem->KeyDerivation.PasswordLength, workItem->KeyDerivation.Salt, PKCS5_SALT_SIZE,
|
||||
workItem->KeyDerivation.IterationCount, workItem->KeyDerivation.DerivedKey, GetMaxPkcs5OutSize());
|
||||
break;
|
||||
|
||||
@@ -173,8 +177,8 @@ static TC_THREAD_PROC EncryptionThreadProc (void *threadArg)
|
||||
workItem->KeyDerivation.IterationCount, workItem->KeyDerivation.DerivedKey, GetMaxPkcs5OutSize());
|
||||
break;
|
||||
|
||||
case SHA1:
|
||||
derive_key_sha1 (workItem->KeyDerivation.Password, workItem->KeyDerivation.PasswordLength, workItem->KeyDerivation.Salt, PKCS5_SALT_SIZE,
|
||||
case SHA256:
|
||||
derive_key_sha256 (workItem->KeyDerivation.Password, workItem->KeyDerivation.PasswordLength, workItem->KeyDerivation.Salt, PKCS5_SALT_SIZE,
|
||||
workItem->KeyDerivation.IterationCount, workItem->KeyDerivation.DerivedKey, GetMaxPkcs5OutSize());
|
||||
break;
|
||||
|
||||
|
||||
@@ -1,9 +1,13 @@
|
||||
/*
|
||||
Copyright (c) 2008-2010 TrueCrypt Developers Association. All rights reserved.
|
||||
Derived from source code of TrueCrypt 7.1a, which is
|
||||
Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
|
||||
by the TrueCrypt License 3.0.
|
||||
|
||||
Governed by the TrueCrypt License 3.0 the full text of which is contained in
|
||||
the file License.txt included in TrueCrypt binary and source code distribution
|
||||
packages.
|
||||
Modifications and additions to the original source code (contained in this file)
|
||||
and all other portions of this file are Copyright (c) 2013-2015 IDRIX
|
||||
and are governed by the Apache License 2.0 the full text of which is
|
||||
contained in the file License.txt included in VeraCrypt binary and source
|
||||
code distribution packages.
|
||||
*/
|
||||
|
||||
#ifndef TC_HEADER_ENCRYPTION_THREAD_POOL
|
||||
|
||||
+9
-7
@@ -1,12 +1,14 @@
|
||||
/*
|
||||
Legal Notice: Some portions of the source code contained in this file were
|
||||
derived from the source code of Encryption for the Masses 2.02a, which is
|
||||
Copyright (c) 1998-2000 Paul Le Roux and which is governed by the 'License
|
||||
Agreement for Encryption for the Masses'. Modifications and additions to
|
||||
the original source code (contained in this file) and all other portions
|
||||
of this file are Copyright (c) 2003-2009 TrueCrypt Developers Association
|
||||
and are governed by the TrueCrypt License 3.0 the full text of which is
|
||||
contained in the file License.txt included in TrueCrypt binary and source
|
||||
derived from the source code of TrueCrypt 7.1a, which is
|
||||
Copyright (c) 2003-2012 TrueCrypt Developers Association and which is
|
||||
governed by the TrueCrypt License 3.0, also from the source code of
|
||||
Encryption for the Masses 2.02a, which is Copyright (c) 1998-2000 Paul Le Roux
|
||||
and which is governed by the 'License Agreement for Encryption for the Masses'
|
||||
Modifications and additions to the original source code (contained in this file)
|
||||
and all other portions of this file are Copyright (c) 2013-2015 IDRIX
|
||||
and are governed by the Apache License 2.0 the full text of which is
|
||||
contained in the file License.txt included in VeraCrypt binary and source
|
||||
code distribution packages. */
|
||||
|
||||
#include "Tcdefs.h"
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user