Projects
Extra
GostCrypt
Sign Up
Log In
Username
Password
We truncated the diff of some files because they were too big. If you want to see the full diff for every file,
click here
.
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 7
View file
gostcrypt.changes
Changed
@@ -1,4 +1,15 @@ ------------------------------------------------------------------- +Sat Jan 23 09:55:41 UTC 2016 - antoine.belvire@laposte.net + +- Update to 1.3: + * Add Grasshopper algorithm + * Fix some bugs + * Attention: containers from 1.0 are not compatible with 1.3, you + have to create new containers and transfer your data to them. +- Remove gostcrypt-1.0-long-long-32bit.patch (upstreamed) +- Add gostcrypt-1.3-fix-inline-warnings.patch + +------------------------------------------------------------------- Thu Dec 10 10:04:17 UTC 2015 - antoine.belvire@laposte.net - Add gostcrypt-1.0-fix-abi-gcc5.patch:
View file
gostcrypt.spec
Changed
@@ -16,7 +16,7 @@ # Name: gostcrypt -Version: 1.0 +Version: 1.3 %if 0%{?fedora} Release: 0%{?dist} %else @@ -30,10 +30,10 @@ Source1: %{name}.desktop # PATCH-FIX-UPSTREAM gostcrypt-1.0-tc_token_err.patch Patch0: gostcrypt-1.0-tc_token_err.patch -# PATCH-FIX-UPSTREAM gostcrypt-1.0-long-long-32bit.patch -Patch1: gostcrypt-1.0-long-long-32bit.patch # PATCH-FIX-UPSTREAM gostcrypt-1.0-fix-abi-gcc5.patch -Patch2: gostcrypt-1.0-fix-abi-gcc5.patch +Patch1: gostcrypt-1.0-fix-abi-gcc5.patch +# PATCH-FIX-UPSTREAM gostcrypt-1.3-fix-inline-warnings.patch +Patch2: gostcrypt-1.3-fix-inline-warnings.patch BuildRequires: gcc-c++ BuildRequires: fuse-devel %if 0%{?suse_version} @@ -67,7 +67,7 @@ %prep %setup -q -n GostCrypt_Linux_%{version} %patch0 -%patch1 +%patch1 -p1 %patch2 -p1 %build
View file
gostcrypt-1.0-long-long-32bit.patch
Deleted
@@ -1,19 +0,0 @@ -diff -up Crypto/Stribog.c.diff Crypto/Stribog.c ---- Crypto/Stribog.c.diff 2015-01-16 00:10:36.177397080 +0100 -+++ Crypto/Stribog.c 2015-01-16 00:10:47.439595137 +0100 -@@ -11,7 +11,7 @@ - - #include "Stribog.h" - --const unsigned long T[8][256] = { -+const unsigned long long T[8][256] = { - { - 0xE6F87E5C5B711FD0,0x258377800924FA16,0xC849E07E852EA4A8,0x5B4686A18F06C16A, - 0x0B32E9A2D77B416E,0xABDA37A467815C66,0xF61796A81A686676,0xF5DC0B706391954B, -@@ -788,4 +788,4 @@ void STRIBOG_finalize(STRIBOG_CTX *ctx, - g_N(ctx->v0, ctx->hash, ctx->EPSILON); - - copy_blocks(out, ctx->hash, 64); --} -\ No newline at end of file -+}
View file
gostcrypt-1.3-fix-inline-warnings.patch
Added
@@ -0,0 +1,78 @@ +From: Antoine Belvire <antoine.belvire@laposte.net> +Date: Sat, 23 Jan 2016 11:44:20 +0100 +Subject: Fix warnings about inline functions +Upstream: not submitted + +===================================================== +diff --git a/Crypto/GrasshopperCipher.c b/Crypto/GrasshopperCipher.c +--- a/Crypto/GrasshopperCipher.c 2015-07-24 10:03:04.000000000 +0200 ++++ b/Crypto/GrasshopperCipher.c 2016-01-23 12:13:20.592557196 +0100 +@@ -121,7 +121,9 @@ unsigned char mult_mod_poly[8][256] = { + 8, 243, 61, 198, 98, 153, 87, 172, 220, 39, 233, 18, 182, 77, 131, 120, 99, 152, 86, 173, 9, 242, 60, 199, 183, 76, 130, 121, 221, 38, 232, 19, + 177, 74, 132, 127, 219, 32, 238, 21, 101, 158, 80, 171, 15, 244, 58, 193, 218, 33, 239, 20, 176, 75, 133, 126, 14, 245, 59, 192, 100, 159, 81, 170, + 103, 156, 82, 169, 13, 246, 56, 195, 179, 72, 134, 125, 217, 34, 236, 23, 12, 247, 57, 194, 102, 157, 83, 168, 216, 35, 237, 22, 178, 73, 135, 124}}; +-void S(unsigned long long * block) ++ ++/* S conversion function */ ++inline void S(unsigned long long * block) + { + unsigned long long valtmp; + +@@ -149,7 +151,7 @@ void S(unsigned long long * block) + } + + /* Inverse of S conversion function */ +-void S_inv(unsigned long long * block) ++inline void S_inv(unsigned long long * block) + { + unsigned long long valtmp; + +@@ -176,6 +178,7 @@ void S_inv(unsigned long long * block) + block[1] = valtmp; + } + ++/* Linear transformation */ + inline unsigned char ll(unsigned long long *block) + { + +diff --git a/Crypto/GrasshopperCipher.h b/Crypto/GrasshopperCipher.h +--- a/Crypto/GrasshopperCipher.h 2015-07-24 10:03:04.000000000 +0200 ++++ b/Crypto/GrasshopperCipher.h 2016-01-23 12:13:20.592557196 +0100 +@@ -66,28 +66,28 @@ typedef struct grasshopper_kds + /****************************************************/ + + /* S conversion function */ +-inline void S(unsigned long long * block); ++//inline void S(unsigned long long * block); + + /* Inverse of S conversion function */ +-inline void S_inv(unsigned long long * block); +-/* Linear transformation */ ++//inline void S_inv(unsigned long long * block); + +-inline unsigned char ll(unsigned long long block[2]); ++/* Linear transformation */ ++//inline unsigned char ll(unsigned long long block[2]); + + /* R conversion function */ +- inline void R(unsigned long long * block); ++//inline void R(unsigned long long * block); + + /* Inverse of R conversion function */ +-inline void R_inv(unsigned long long * block); ++//inline void R_inv(unsigned long long * block); + + /* L conversion function (16 iteration of R) */ +-inline void L(unsigned long long * block); ++//inline void L(unsigned long long * block); + + /* Inverse of L conversion function (16 iteration of R_inv) */ +-inline void L_inv(unsigned long long * block); ++//inline void L_inv(unsigned long long * block); + + /* F conversion function (used in key setup) */ +- inline void F(unsigned long long * k, unsigned long long * block1, unsigned long long * block0); ++//inline void F(unsigned long long * k, unsigned long long * block1, unsigned long long * block0); + + /****************************************************/ + /****************************************************/
View file
GostCrypt_Linux_1.0.tar.gz/Release/Setup Files/License.txt
Deleted
@@ -1,674 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/> - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU General Public License is a free, copyleft license for -software and other kinds of works. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - To protect your rights, we need to prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. You must make sure that they, too, receive -or can get the source code. And you must show them these terms so they -know their rights. - - Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. - - For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. - - Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. - - Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice;
View file
GostCrypt_Linux_1.0.tar.gz/Resources/Texts
Deleted
-(directory)
View file
GostCrypt_Linux_1.0.tar.gz/Resources/Texts/License.rtf
Deleted
@@ -1,666 +0,0 @@ -{\rtf1\ansi\deff3\adeflang1025 -{\fonttbl{\f0\froman\fprq2\fcharset0 Times New Roman;}{\f1\froman\fprq2\fcharset2 Symbol;}{\f2\fswiss\fprq2\fcharset0 Arial;}{\f3\fnil\fprq0\fcharset0 Times{\*\falt Times New Roman};}{\f4\fnil\fprq0\fcharset0 Helvetica{\*\falt Arial};}{\f5\fmodern\fprq1\fcharset0 Nimbus Mono L{\*\falt Courier New};}{\f6\froman\fprq2\fcharset0 Nimbus Roman No9 L{\*\falt Times New Roman};}{\f7\fnil\fprq2\fcharset0 HG Mincho Light J{\*\falt msmincho};}{\f8\fnil\fprq2\fcharset0 Tahoma;}{\f9\fnil\fprq0\fcharset0 Tahoma;}} -{\colortbl;\red0\green0\blue0;\red128\green128\blue128;} -{\stylesheet{\s0\snext0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\ltrpar\cf0\dbch\af10\langfe255\dbch\af8\afs24\alang255\loch\f3\fs24\lang9226 Default Style;} -{\s15\sbasedon0\snext16\sb240\sa120\keepn\dbch\af7\dbch\af8\afs28\loch\f4\fs28 Heading;} -{\s16\sbasedon0\snext16\sb0\sa120 Text Body;} -{\s17\sbasedon16\snext17\sb0\sa120\dbch\af9\loch\f3 List;} -{\s18\sbasedon0\snext18\sb120\sa120\noline\i\dbch\af9\afs24\ai\loch\f3\fs24 Caption;} -{\s19\sbasedon0\snext19\noline\dbch\af9\loch\f3 Index;} -{\s20\sbasedon0\snext20\sb0\sa0\dbch\af5\dbch\af5\afs20\loch\f5\fs20 Preformatted Text;} -}{\info{\creatim\yr0\mo0\dy0\hr0\min0}{\author carlos luna}{\revtim\yr2007\mo11\dy5\hr17\min33}{\printim\yr0\mo0\dy0\hr0\min0}{\comment LibreOffice}{\vern4000}}\deftab709 -\viewscale75 -{\*\pgdsctbl -{\pgdsc0\pgdscuse451\pgwsxn11906\pghsxn16838\marglsxn1134\margrsxn1134\margtsxn1134\margbsxn1134\pgdscnxt0 Default Style;}} -\formshade\paperh16838\paperw11906\margl1134\margr1134\margt1134\margb1134\sectd\sbknone\sectunlocked1\pgndec\pgwsxn11906\pghsxn16838\marglsxn1134\margrsxn1134\margtsxn1134\margbsxn1134\ftnbj\ftnstart1\ftnrstcont\ftnnar\aenddoc\aftnrstcont\aftnstart1\aftnnrlc -\pgndec\pard\plain \s20\sb0\sa0\dbch\af5\dbch\af5\afs20\loch\f5\fs20\qc{\b\afs52\ab\rtlch \ltrch\loch\fs52 -GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007} -\par \pard\plain \s20\sb0\sa0\dbch\af5\dbch\af5\afs20\loch\f5\fs20\qc\b\afs36\ab\rtlch \ltrch\loch\fs36 - -\par \pard\plain \s20\sb0\sa0\dbch\af5\dbch\af5\afs20\loch\f5\fs20\qc\rtlch \ltrch\loch - -\par \pard\plain \s20\sb0\sa0\dbch\af5\dbch\af5\afs20\loch\f5\fs20\qj{\afs28\rtlch \ltrch\loch\fs28\loch\f6 -Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>} -\par \pard\plain \s20\sb0\sa0\dbch\af5\dbch\af5\afs20\loch\f5\fs20\qj{\afs28\rtlch \ltrch\loch\fs28\loch\f6 -Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.} -\par \pard\plain \s20\sb0\sa0\dbch\af5\dbch\af5\afs20\loch\f5\fs20\qj\afs28\rtlch \ltrch\loch\fs28\loch\f6 - -\par \pard\plain \s20\sb0\sa0\dbch\af5\dbch\af5\afs20\loch\f5\fs20\qj{\afs28\rtlch \ltrch\loch\fs28\loch\f6 -Preamble} -\par \pard\plain \s20\sb0\sa0\dbch\af5\dbch\af5\afs20\loch\f5\fs20\qj\afs28\rtlch \ltrch\loch\fs28\loch\f6 - -\par \pard\plain \s20\sb0\sa0\dbch\af5\dbch\af5\afs20\loch\f5\fs20\qj{\afs28\rtlch \ltrch\loch\fs28\loch\f6 -The GNU General Public License is a free, copyleft license for software and other kinds of works.} -\par \pard\plain \s20\sb0\sa0\dbch\af5\dbch\af5\afs20\loch\f5\fs20\qj\afs28\rtlch \ltrch\loch\fs28\loch\f6 - -\par \pard\plain \s20\sb0\sa0\dbch\af5\dbch\af5\afs20\loch\f5\fs20\qj{\afs28\rtlch \ltrch\loch\fs28\loch\f6 -The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to} -\par \pard\plain \s20\sb0\sa0\dbch\af5\dbch\af5\afs20\loch\f5\fs20\qj{\afs28\rtlch \ltrch\loch\fs28\loch\f6 -your programs, too.} -\par \pard\plain \s20\sb0\sa0\dbch\af5\dbch\af5\afs20\loch\f5\fs20\qj\afs28\rtlch \ltrch\loch\fs28\loch\f6 - -\par \pard\plain \s20\sb0\sa0\dbch\af5\dbch\af5\afs20\loch\f5\fs20\qj{\afs28\rtlch \ltrch\loch\fs28\loch\f6 -When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things.} -\par \pard\plain \s20\sb0\sa0\dbch\af5\dbch\af5\afs20\loch\f5\fs20\afs28\rtlch \ltrch\loch\fs28\loch\f6 - -\par \pard\plain \s20\sb0\sa0\dbch\af5\dbch\af5\afs20\loch\f5\fs20\qj{\afs28\rtlch \ltrch\loch\fs28\loch\f6 -To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others.} -\par \pard\plain \s20\sb0\sa0\dbch\af5\dbch\af5\afs20\loch\f5\fs20\afs28\rtlch \ltrch\loch\fs28\loch\f6 - -\par \pard\plain \s20\sb0\sa0\dbch\af5\dbch\af5\afs20\loch\f5\fs20\qj{\afs28\rtlch \ltrch\loch\fs28\loch\f6 -For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights.} -\par \pard\plain \s20\sb0\sa0\dbch\af5\dbch\af5\afs20\loch\f5\fs20\afs28\rtlch \ltrch\loch\fs28\loch\f6 - -\par \pard\plain \s20\sb0\sa0\dbch\af5\dbch\af5\afs20\loch\f5\fs20\qj{\afs28\rtlch \ltrch\loch\fs28\loch\f6 -Developers that use the GNU GPL protect your rights with two steps:} -\par \pard\plain \s20\sb0\sa0\dbch\af5\dbch\af5\afs20\loch\f5\fs20\qj{\afs28\rtlch \ltrch\loch\fs28\loch\f6 -(1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it.} -\par \pard\plain \s20\sb0\sa0\dbch\af5\dbch\af5\afs20\loch\f5\fs20\afs28\rtlch \ltrch\loch\fs28\loch\f6 - -\par \pard\plain \s20\sb0\sa0\dbch\af5\dbch\af5\afs20\loch\f5\fs20\qj{\afs28\rtlch \ltrch\loch\fs28\loch\f6 -For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions.} -\par \pard\plain \s20\sb0\sa0\dbch\af5\dbch\af5\afs20\loch\f5\fs20\afs28\rtlch \ltrch\loch\fs28\loch\f6 - -\par \pard\plain \s20\sb0\sa0\dbch\af5\dbch\af5\afs20\loch\f5\fs20\qj{\afs28\rtlch \ltrch\loch\fs28\loch\f6 -Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users.} -\par \pard\plain \s20\sb0\sa0\dbch\af5\dbch\af5\afs20\loch\f5\fs20\qj\afs28\rtlch \ltrch\loch\fs28\loch\f6 - -\par \pard\plain \s20\sb0\sa0\dbch\af5\dbch\af5\afs20\loch\f5\fs20\qj{\afs28\rtlch \ltrch\loch\fs28\loch\f6 -Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free.} -\par \pard\plain \s20\sb0\sa0\dbch\af5\dbch\af5\afs20\loch\f5\fs20\afs28\rtlch \ltrch\loch\fs28\loch\f6 - -\par \pard\plain \s20\sb0\sa0\dbch\af5\dbch\af5\afs20\loch\f5\fs20\qj{\afs28\rtlch \ltrch\loch\fs28\loch\f6 -The precise terms and conditions for copying, distribution and modification follow.} -\par \pard\plain \s20\sb0\sa0\dbch\af5\dbch\af5\afs20\loch\f5\fs20\afs28\rtlch \ltrch\loch\fs28\loch\f6 - -\par \pard\plain \s20\sb0\sa0\dbch\af5\dbch\af5\afs20\loch\f5\fs20\qc{\afs28\rtlch \ltrch\loch\fs28\loch\f6 -TERMS AND CONDITIONS} -\par \pard\plain \s20\sb0\sa0\dbch\af5\dbch\af5\afs20\loch\f5\fs20\afs28\rtlch \ltrch\loch\fs28\loch\f6 - -\par \pard\plain \s20\sb0\sa0\dbch\af5\dbch\af5\afs20\loch\f5\fs20\qj{\afs28\rtlch \ltrch\loch\fs28\loch\f6 -0. Definitions.} -\par \pard\plain \s20\sb0\sa0\dbch\af5\dbch\af5\afs20\loch\f5\fs20\qj\afs28\rtlch \ltrch\loch\fs28\loch\f6 - -\par \pard\plain \s20\sb0\sa0\dbch\af5\dbch\af5\afs20\loch\f5\fs20\qj{\afs28\rtlch \ltrch\loch\fs28\loch\f6 -"This License" refers to version 3 of the GNU General Public License.} -\par \pard\plain \s20\sb0\sa0\dbch\af5\dbch\af5\afs20\loch\f5\fs20\qj\afs28\rtlch \ltrch\loch\fs28\loch\f6 - -\par \pard\plain \s20\sb0\sa0\dbch\af5\dbch\af5\afs20\loch\f5\fs20\qj{\afs28\rtlch \ltrch\loch\fs28\loch\f6 -"Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks.} -\par \pard\plain \s20\sb0\sa0\dbch\af5\dbch\af5\afs20\loch\f5\fs20\qj\afs28\rtlch \ltrch\loch\fs28\loch\f6 - -\par \pard\plain \s20\sb0\sa0\dbch\af5\dbch\af5\afs20\loch\f5\fs20\qj{\afs28\rtlch \ltrch\loch\fs28\loch\f6 -"The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations.} -\par \pard\plain \s20\sb0\sa0\dbch\af5\dbch\af5\afs20\loch\f5\fs20\qj\afs28\rtlch \ltrch\loch\fs28\loch\f6 - -\par \pard\plain \s20\sb0\sa0\dbch\af5\dbch\af5\afs20\loch\f5\fs20\qj{\afs28\rtlch \ltrch\loch\fs28\loch\f6 -To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work.} -\par \pard\plain \s20\sb0\sa0\dbch\af5\dbch\af5\afs20\loch\f5\fs20\afs28\rtlch \ltrch\loch\fs28\loch\f6 - -\par \pard\plain \s20\sb0\sa0\dbch\af5\dbch\af5\afs20\loch\f5\fs20\qj{\afs28\rtlch \ltrch\loch\fs28\loch\f6 -A "covered work" means either the unmodified Program or a work based on the Program.} -\par \pard\plain \s20\sb0\sa0\dbch\af5\dbch\af5\afs20\loch\f5\fs20\afs28\rtlch \ltrch\loch\fs28\loch\f6 - -\par \pard\plain \s20\sb0\sa0\dbch\af5\dbch\af5\afs20\loch\f5\fs20{\afs28\rtlch \ltrch\loch\fs28\loch\f6 -To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the} -\par \pard\plain \s20\sb0\sa0\dbch\af5\dbch\af5\afs20\loch\f5\fs20{\afs28\rtlch \ltrch\loch\fs28\loch\f6 -public, and in some countries other activities as well.} -\par \pard\plain \s20\sb0\sa0\dbch\af5\dbch\af5\afs20\loch\f5\fs20\afs28\rtlch \ltrch\loch\fs28\loch\f6 - -\par \pard\plain \s20\sb0\sa0\dbch\af5\dbch\af5\afs20\loch\f5\fs20{\afs28\rtlch \ltrch\loch\fs28\loch\f6 -To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying.} -\par \pard\plain \s20\sb0\sa0\dbch\af5\dbch\af5\afs20\loch\f5\fs20\afs28\rtlch \ltrch\loch\fs28\loch\f6 - -\par \pard\plain \s20\sb0\sa0\dbch\af5\dbch\af5\afs20\loch\f5\fs20\qj{\afs28\rtlch \ltrch\loch\fs28\loch\f6 -An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion.} -\par \pard\plain \s20\sb0\sa0\dbch\af5\dbch\af5\afs20\loch\f5\fs20\qj\afs28\rtlch \ltrch\loch\fs28\loch\f6 - -\par \pard\plain \s20\sb0\sa0\dbch\af5\dbch\af5\afs20\loch\f5\fs20\qj{\afs28\rtlch \ltrch\fs28\loch\f6 - }{\afs28\rtlch \ltrch\loch\fs28\loch\f6 -1. Source Code.} -\par \pard\plain \s20\sb0\sa0\dbch\af5\dbch\af5\afs20\loch\f5\fs20\qj\afs28\rtlch \ltrch\loch\fs28\loch\f6 - -\par \pard\plain \s20\sb0\sa0\dbch\af5\dbch\af5\afs20\loch\f5\fs20\qj{\afs28\rtlch \ltrch\fs28\loch\f6 - }{\afs28\rtlch \ltrch\loch\fs28\loch\f6 -The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work.} -\par \pard\plain \s20\sb0\sa0\dbch\af5\dbch\af5\afs20\loch\f5\fs20\qj\afs28\rtlch \ltrch\loch\fs28\loch\f6 - -\par \pard\plain \s20\sb0\sa0\dbch\af5\dbch\af5\afs20\loch\f5\fs20\qj{\afs28\rtlch \ltrch\fs28\loch\f6 - }{\afs28\rtlch \ltrch\loch\fs28\loch\f6 -A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language.} -\par \pard\plain \s20\sb0\sa0\dbch\af5\dbch\af5\afs20\loch\f5\fs20\qj\afs28\rtlch \ltrch\loch\fs28\loch\f6 - -\par \pard\plain \s20\sb0\sa0\dbch\af5\dbch\af5\afs20\loch\f5\fs20\qj{\afs28\rtlch \ltrch\fs28\loch\f6 - }{\afs28\rtlch \ltrch\loch\fs28\loch\f6 -The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it.} -\par \pard\plain \s20\sb0\sa0\dbch\af5\dbch\af5\afs20\loch\f5\fs20\qj\afs28\rtlch \ltrch\loch\fs28\loch\f6 - -\par \pard\plain \s20\sb0\sa0\dbch\af5\dbch\af5\afs20\loch\f5\fs20\qj{\afs28\rtlch \ltrch\fs28\loch\f6 - }{\afs28\rtlch \ltrch\loch\fs28\loch\f6 -The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free} -\par \pard\plain \s20\sb0\sa0\dbch\af5\dbch\af5\afs20\loch\f5\fs20\qj{\afs28\rtlch \ltrch\loch\fs28\loch\f6 -programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require,} -\par \pard\plain \s20\sb0\sa0\dbch\af5\dbch\af5\afs20\loch\f5\fs20\qj{\afs28\rtlch \ltrch\loch\fs28\loch\f6 -such as by intimate data communication or control flow between those subprograms and other parts of the work.} -\par \pard\plain \s20\sb0\sa0\dbch\af5\dbch\af5\afs20\loch\f5\fs20\qj\afs28\rtlch \ltrch\loch\fs28\loch\f6 - -\par \pard\plain \s20\sb0\sa0\dbch\af5\dbch\af5\afs20\loch\f5\fs20\qj{\afs28\rtlch \ltrch\fs28\loch\f6 - }{\afs28\rtlch \ltrch\loch\fs28\loch\f6 -The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source.} -\par \pard\plain \s20\sb0\sa0\dbch\af5\dbch\af5\afs20\loch\f5\fs20\qj\afs28\rtlch \ltrch\loch\fs28\loch\f6 - -\par \pard\plain \s20\sb0\sa0\dbch\af5\dbch\af5\afs20\loch\f5\fs20\qj{\afs28\rtlch \ltrch\fs28\loch\f6 - }{\afs28\rtlch \ltrch\loch\fs28\loch\f6 -The Corresponding Source for a work in source code form is that same work.} -\par \pard\plain \s20\sb0\sa0\dbch\af5\dbch\af5\afs20\loch\f5\fs20\qj\afs28\rtlch \ltrch\loch\fs28\loch\f6 - -\par \pard\plain \s20\sb0\sa0\dbch\af5\dbch\af5\afs20\loch\f5\fs20\qj{\afs28\rtlch \ltrch\fs28\loch\f6 - }{\afs28\rtlch \ltrch\loch\fs28\loch\f6 -2. Basic Permissions.} -\par \pard\plain \s20\sb0\sa0\dbch\af5\dbch\af5\afs20\loch\f5\fs20\qj\afs28\rtlch \ltrch\loch\fs28\loch\f6 - -\par \pard\plain \s20\sb0\sa0\dbch\af5\dbch\af5\afs20\loch\f5\fs20\qj{\afs28\rtlch \ltrch\fs28\loch\f6 - }{\afs28\rtlch \ltrch\loch\fs28\loch\f6 -All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your} -\par \pard\plain \s20\sb0\sa0\dbch\af5\dbch\af5\afs20\loch\f5\fs20\qj{\afs28\rtlch \ltrch\loch\fs28\loch\f6 -rights of fair use or other equivalent, as provided by copyright law.} -\par \pard\plain \s20\sb0\sa0\dbch\af5\dbch\af5\afs20\loch\f5\fs20\qj\afs28\rtlch \ltrch\loch\fs28\loch\f6 - -\par \pard\plain \s20\sb0\sa0\dbch\af5\dbch\af5\afs20\loch\f5\fs20\qj{\afs28\rtlch \ltrch\fs28\loch\f6 - }{\afs28\rtlch \ltrch\loch\fs28\loch\f6 -You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works} -\par \pard\plain \s20\sb0\sa0\dbch\af5\dbch\af5\afs20\loch\f5\fs20\qj{\afs28\rtlch \ltrch\loch\fs28\loch\f6 -for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you.} -\par \pard\plain \s20\sb0\sa0\dbch\af5\dbch\af5\afs20\loch\f5\fs20\afs28\rtlch \ltrch\loch\fs28\loch\f6 - -\par \pard\plain \s20\sb0\sa0\dbch\af5\dbch\af5\afs20\loch\f5\fs20\qj{\afs28\rtlch \ltrch\fs28\loch\f6 - }{\afs28\rtlch \ltrch\loch\fs28\loch\f6 -Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary.} -\par \pard\plain \s20\sb0\sa0\dbch\af5\dbch\af5\afs20\loch\f5\fs20\qj\afs28\rtlch \ltrch\loch\fs28\loch\f6 - -\par \pard\plain \s20\sb0\sa0\dbch\af5\dbch\af5\afs20\loch\f5\fs20\qj{\afs28\rtlch \ltrch\fs28\loch\f6 - }{\afs28\rtlch \ltrch\loch\fs28\loch\f6 -3. Protecting Users' Legal Rights From Anti-Circumvention Law.} -\par \pard\plain \s20\sb0\sa0\dbch\af5\dbch\af5\afs20\loch\f5\fs20\qj\afs28\rtlch \ltrch\loch\fs28\loch\f6 - -\par \pard\plain \s20\sb0\sa0\dbch\af5\dbch\af5\afs20\loch\f5\fs20\qj{\afs28\rtlch \ltrch\fs28\loch\f6 - }{\afs28\rtlch \ltrch\loch\fs28\loch\f6 -No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures.} -\par \pard\plain \s20\sb0\sa0\dbch\af5\dbch\af5\afs20\loch\f5\fs20\qj\afs28\rtlch \ltrch\loch\fs28\loch\f6 - -\par \pard\plain \s20\sb0\sa0\dbch\af5\dbch\af5\afs20\loch\f5\fs20\qj{\afs28\rtlch \ltrch\fs28\loch\f6 - }{\afs28\rtlch \ltrch\loch\fs28\loch\f6 -When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures.} -\par \pard\plain \s20\sb0\sa0\dbch\af5\dbch\af5\afs20\loch\f5\fs20\afs28\rtlch \ltrch\loch\fs28\loch\f6 - -\par \pard\plain \s20\sb0\sa0\dbch\af5\dbch\af5\afs20\loch\f5\fs20{\afs28\rtlch \ltrch\fs28\loch\f6 - }{\afs28\rtlch \ltrch\loch\fs28\loch\f6 -4. Conveying Verbatim Copies.} -\par \pard\plain \s20\sb0\sa0\dbch\af5\dbch\af5\afs20\loch\f5\fs20\afs28\rtlch \ltrch\loch\fs28\loch\f6
View file
GostCrypt_Linux_1.0.tar.gz/Common/Crypto.h -> GostCrypt_Linux_1.3.tar.gz/Common/Crypto.h
Changed
@@ -49,9 +49,6 @@ // 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 @@ -90,12 +87,6 @@ /* If you add/remove a mode, update the following: GetMaxPkcs5OutSize(), EAInitMode() */ XTS = FIRST_MODE_OF_OPERATION_ID, -#ifndef GST_WINDOWS_BOOT - LRW, // Deprecated/legacy - CBC, // Deprecated/legacy - OUTER_CBC, // Deprecated/legacy - INNER_CBC, // Deprecated/legacy -#endif MODE_ENUM_END_ID }; @@ -116,7 +107,8 @@ enum { NONE = 0, - GOST + GOST, + GRASSHOPPER }; typedef struct @@ -143,11 +135,6 @@ BOOL SystemEncryption; // Available for system encryption } Hash; -#define GOST_KS (sizeof(gost_kds)) - -#define MAX_EXPANDED_KEY (GOST_KS) - - #ifdef DEBUG # define PRAND_DISK_WIPE_PASSES 3 #else @@ -155,6 +142,7 @@ #endif #include "GostCipher.h" +#include "GrasshopperCipher.h" #include "Whirlpool.h" #include "Stribog.h" @@ -163,13 +151,22 @@ #include "GfMul.h" #include "Password.h" + +#define GOST_KS (sizeof(gost_kds)) +#define GRASSHOPPER_KS (sizeof(grasshopper_kds)) + + +#define MAX_EXPANDED_KEY (GOST_KS) + + + typedef struct keyInfo_t { int noIterations; /* Number of times to iterate (PKCS-5) */ int keyLength; /* Length of the key */ __int8 userKey[MAX_PASSWORD]; /* Password (to which keyfiles may have been applied). WITHOUT +1 for the null terminator. */ __int8 salt[PKCS5_SALT_SIZE]; /* PKCS-5 salt */ - __int8 master_keydata[MASTER_KEYDATA_SIZE]; /* Concatenated master primary 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). */ + __int8 master_keydata[MASTER_KEYDATA_SIZE]; /* Concatenated master primary and secondary key(s) (XTS mode). */ } KEY_INFO, *PKEY_INFO; typedef struct CRYPTO_INFO_t @@ -181,13 +178,12 @@ BOOL hiddenVolume; // Indicates whether the volume is mounted/mountable as hidden volume -#ifndef GST_WINDOWS_BOOT uint16 HeaderVersion; GfCtx gf_ctx; - 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 master_keydata[MASTER_KEYDATA_SIZE]; /* This holds the volume header area containing concatenated master key(s) and secondary key(s) (XTS mode). */ + unsigned __int8 k2[MASTER_KEYDATA_SIZE]; /* For XTS, this contains the secondary key (if cascade, multiple concatenated). */ unsigned __int8 salt[PKCS5_SALT_SIZE]; int noIterations; int pkcs5; @@ -213,7 +209,6 @@ uint32 SectorSize; -#endif // !GST_WINDOWS_BOOT UINT64_STRUCT VolumeSize; @@ -239,10 +234,8 @@ BOOL EAInitMode (PCRYPTO_INFO ci); void EncipherBlock(int cipher, void *data, void *ks); void DecipherBlock(int cipher, void *data, void *ks); -#ifndef GST_WINDOWS_BOOT void EncipherBlocks (int cipher, void *dataPtr, void *ks, size_t blockCount); void DecipherBlocks (int cipher, void *dataPtr, void *ks, size_t blockCount); -#endif int EAGetFirst (); int EAGetCount (void); @@ -276,13 +269,6 @@ void DecryptDataUnitsCurrentThread (unsigned __int8 *buf, const UINT64_STRUCT *structUnitNo, GST_LARGEST_COMPILER_UINT nbrUnits, PCRYPTO_INFO ci); void EncryptBuffer (unsigned __int8 *buf, GST_LARGEST_COMPILER_UINT len, PCRYPTO_INFO cryptoInfo); void DecryptBuffer (unsigned __int8 *buf, GST_LARGEST_COMPILER_UINT len, PCRYPTO_INFO cryptoInfo); -#ifndef GST_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 GST_NO_COMPILER_INT64 void EnableHwEncryption (BOOL enable); BOOL IsHwEncryptionEnabled ();
View file
GostCrypt_Linux_1.0.tar.gz/Common/Gstdefs.h -> GostCrypt_Linux_1.3.tar.gz/Common/Gstdefs.h
Changed
@@ -21,15 +21,15 @@ #define GST_APP_NAME "GostCrypt" // Version displayed to user -#define VERSION_STRING "1.0" +#define VERSION_STRING "1.3" // Version number to compare against driver -#define VERSION_NUM 0x071a +#define VERSION_NUM 0x1100 // Release date -#define GST_STR_RELEASE_DATE "June 23, 2014" -#define GST_RELEASE_DATE_YEAR 2014 -#define GST_RELEASE_DATE_MONTH 6 +#define GST_STR_RELEASE_DATE "September 1, 2015" +#define GST_RELEASE_DATE_YEAR 2015 +#define GST_RELEASE_DATE_MONTH 9 #define BYTES_PER_KB 1024LL #define BYTES_PER_MB 1048576LL @@ -41,25 +41,6 @@ #define WIDE(x) (LPWSTR)L##x -#ifdef _MSC_VER - -typedef __int8 int8; -typedef __int16 int16; -typedef __int32 int32; -typedef unsigned __int8 byte; -typedef unsigned __int16 uint16; -typedef unsigned __int32 uint32; - -#ifdef GST_NO_COMPILER_INT64 -typedef unsigned __int32 GST_LARGEST_COMPILER_UINT; -#else -typedef unsigned __int64 GST_LARGEST_COMPILER_UINT; -typedef __int64 int64; -typedef unsigned __int64 uint64; -#endif - -#else // !_MSC_VER - #include <inttypes.h> #include <limits.h> @@ -95,7 +76,6 @@ #define TRUE 1 #endif -#endif // !_MSC_VER #define GST_INT_TYPES_DEFINED @@ -120,111 +100,18 @@ } UINT64_STRUCT; -#ifdef GST_WINDOWS_BOOT - -# ifdef __cplusplus -extern "C" -# endif -void ThrowFatalException (int line); - -# define GST_THROW_FATAL_EXCEPTION ThrowFatalException (__LINE__) -#elif defined (GST_WINDOWS_DRIVER) -# define GST_THROW_FATAL_EXCEPTION KeBugCheckEx (SECURITY_SYSTEM, __LINE__, 0, 0, 'GST') -#else -# define GST_THROW_FATAL_EXCEPTION *(char *) 0 = 0 -#endif - -#ifdef GST_WINDOWS_DRIVER - -#include <ntifs.h> -#include <ntddk.h> /* Standard header file for nt drivers */ -#include <ntdddisk.h> /* Standard I/O control codes */ - -#define GSTalloc(size) ((void *) ExAllocatePoolWithTag( NonPagedPool, size, 'MMCT' )) -#define GSTfree(memblock) ExFreePoolWithTag( memblock, 'MMCT' ) - -#define DEVICE_DRIVER - -#ifndef BOOL -typedef int BOOL; -#endif - -#ifndef TRUE -#define TRUE 1 -#endif - -#ifndef FALSE -#define FALSE !TRUE -#endif - -#else /* !GST_WINDOWS_DRIVER */ +#define GST_THROW_FATAL_EXCEPTION *(char *) 0 = 0 #define GSTalloc malloc #define GSTfree free -#ifdef _WIN32 - -#ifndef GST_LOCAL_WIN32_WINNT_OVERRIDE -# undef _WIN32_WINNT -# define _WIN32_WINNT 0x0501 /* Does not apply to the driver */ -#endif - -#include <windows.h> /* Windows header */ -#include <commctrl.h> /* The common controls */ -#include <process.h> /* Process control */ -#include <winioctl.h> -#include <stdio.h> /* For sprintf */ - -#endif /* _WIN32 */ - -#endif /* !GST_WINDOWS_DRIVER */ #ifndef GST_TO_STRING # define GST_TO_STRING2(n) #n # define GST_TO_STRING(n) GST_TO_STRING2(n) #endif -#ifdef DEVICE_DRIVER -# if defined (DEBUG) || 0 -# if 1 // DbgPrintEx is not available on Windows 2000 -# define Dump DbgPrint -# else -# define Dump(...) DbgPrintEx (DPFLTR_IHVDRIVER_ID, DPFLTR_ERROR_LEVEL, __VA_ARGS__) -# endif -# define DumpMem(...) DumpMemory (__VA_ARGS__) -# else -# define Dump(...) -# define DumpMem(...) -# endif -#endif - -#if !defined (trace_msg) && !defined (GST_WINDOWS_BOOT) -# ifdef DEBUG -# ifdef DEVICE_DRIVER -# define trace_msg Dump -# elif defined (_WIN32) -# define trace_msg(...) do { char msg[2048]; _snprintf (msg, sizeof (msg), __VA_ARGS__); OutputDebugString (msg); } while (0) -# endif -# define trace_point trace_msg (__FUNCTION__ ":" GST_TO_STRING(__LINE__) "\n") -# else -# define trace_msg(...) -# define trace_point -# endif -#endif - -#ifdef DEVICE_DRIVER -# define GST_EVENT KEVENT -# define GST_WAIT_EVENT(EVENT) KeWaitForSingleObject (&EVENT, Executive, KernelMode, FALSE, NULL) -#elif defined (_WIN32) -# define GST_EVENT HANDLE -# define GST_WAIT_EVENT(EVENT) WaitForSingleObject (EVENT, INFINITE) -#endif - -#ifdef _WIN32 -#define burn(mem,size) do { volatile char *burnm = (volatile char *)(mem); int burnc = size; RtlSecureZeroMemory (mem, size); while (burnc--) *burnm++ = 0; } while (0) -#else #define burn(mem,size) do { volatile char *burnm = (volatile char *)(mem); int burnc = size; while (burnc--) *burnm++ = 0; } while (0) -#endif // The size of the memory area to wipe is in bytes amd it must be a multiple of 8. #ifndef GST_NO_COMPILER_INT64 @@ -233,20 +120,6 @@ # define FAST_ERASE64(mem,size) do { volatile unsigned __int32 *burnm = (volatile unsigned __int32 *)(mem); int burnc = size >> 2; while (burnc--) *burnm++ = 0; } while (0) #endif -#ifdef GST_WINDOWS_BOOT -# ifndef max -# define max(a,b) (((a) > (b)) ? (a) : (b)) -# endif - -# ifdef __cplusplus -extern "C" -# endif -void EraseMemory (void *memory, int size); - -# undef burn -# define burn EraseMemory -#endif - #ifdef MAX_PATH #define GST_MAX_PATH MAX_PATH #else @@ -258,8 +131,8 @@ #define MAX_URL_LENGTH 2084 /* Internet Explorer limit. Includes the terminating null character. */ #define GST_HOMEPAGE "http://www.gostcrypt.org/" -#define GST_APPLINK "http://www.gostcrypt.org/applink.php?version=" VERSION_STRING -#define GST_APPLINK_SECURE "https://www.gostcrypt.org/applink.php?version=" VERSION_STRING +#define GST_APPLINK "http://www.gostcrypt.org/" +#define GST_APPLINK_SECURE "https://www.gostcrypt.org/" enum {
View file
GostCrypt_Linux_1.0.tar.gz/Common/Password.h -> GostCrypt_Linux_1.3.tar.gz/Common/Password.h
Changed
@@ -37,15 +37,6 @@ char Pad[3]; // keep 64-bit alignment } Password; -#if defined(_WIN32) && !defined(GST_WINDOWS_DRIVER) - -void VerifyPasswordAndUpdate ( HWND hwndDlg , HWND hButton , HWND hPassword , HWND hVerify , unsigned char *szPassword , char *szVerify, BOOL keyFilesEnabled ); -BOOL CheckPasswordLength (HWND hwndDlg, HWND hwndItem); -BOOL CheckPasswordCharEncoding (HWND hPassword, Password *ptrPw); -int ChangePwd (char *lpszVolume, Password *oldPassword, Password *newPassword, int pkcs5, HWND hwndDlg); - -#endif // defined(_WIN32) && !defined(GST_WINDOWS_DRIVER) - #ifdef __cplusplus } #endif
View file
GostCrypt_Linux_1.0.tar.gz/Common/SecurityToken.cpp -> GostCrypt_Linux_1.3.tar.gz/Common/SecurityToken.cpp
Changed
@@ -10,14 +10,9 @@ #include "Platform/Finally.h" #include "Platform/ForEach.h" -#if !defined (GST_WINDOWS) || defined (GST_PROTOTYPE) -# include "Platform/SerializerFactory.h" -# include "Platform/StringConverter.h" -# include "Platform/SystemException.h" -#else -# include "Dictionary.h" -# include "Language.h" -#endif +#include "Platform/SerializerFactory.h" +#include "Platform/StringConverter.h" +#include "Platform/SystemException.h" #ifdef GST_UNIX # include <dlfcn.h> @@ -77,11 +72,8 @@ CloseAllSessions(); Pkcs11Functions->C_Finalize (NULL_PTR); -#ifdef GST_WINDOWS - FreeLibrary (Pkcs11LibraryHandle); -#else dlclose (Pkcs11LibraryHandle); -#endif + Initialized = false; } } @@ -228,11 +220,8 @@ keyfile.IdUtf8 = (char *) &label.front(); -#if defined (GST_WINDOWS) && !defined (GST_PROTOTYPE) - keyfile.Id = Utf8StringToWide ((const char *) &label.front()); -#else keyfile.Id = StringConverter::ToWide ((const char *) &label.front()); -#endif + if (keyfile.Id.empty() || (!keyfileIdFilter.empty() && keyfileIdFilter != keyfile.Id)) continue; @@ -301,11 +290,8 @@ else token.LabelUtf8 = token.LabelUtf8.substr (0, lastSpace + 1); -#if defined (GST_WINDOWS) && !defined (GST_PROTOTYPE) - token.Label = Utf8StringToWide (token.LabelUtf8); -#else token.Label = StringConverter::ToWide (token.LabelUtf8); -#endif + return token; } @@ -512,19 +498,13 @@ if (Initialized) CloseLibrary(); -#ifdef GST_WINDOWS - Pkcs11LibraryHandle = LoadLibraryA (pkcs11LibraryPath.c_str()); -#else Pkcs11LibraryHandle = dlopen (pkcs11LibraryPath.c_str(), RTLD_NOW | RTLD_LOCAL); -#endif + throw_sys_if (!Pkcs11LibraryHandle); typedef CK_RV (*C_GetFunctionList_t) (CK_FUNCTION_LIST_PTR_PTR ppFunctionList); -#ifdef GST_WINDOWS - C_GetFunctionList_t C_GetFunctionList = (C_GetFunctionList_t) GetProcAddress (Pkcs11LibraryHandle, "C_GetFunctionList"); -#else + C_GetFunctionList_t C_GetFunctionList = (C_GetFunctionList_t) dlsym (Pkcs11LibraryHandle, "C_GetFunctionList"); -#endif if (!C_GetFunctionList) throw SecurityTokenLibraryNotInitialized(); @@ -724,11 +704,7 @@ CK_FUNCTION_LIST_PTR SecurityToken::Pkcs11Functions; map <CK_SLOT_ID, Pkcs11Session> SecurityToken::Sessions; -#ifdef GST_WINDOWS - HMODULE SecurityToken::Pkcs11LibraryHandle; -#else void *SecurityToken::Pkcs11LibraryHandle; -#endif #ifdef GST_HEADER_Platform_Exception
View file
GostCrypt_Linux_1.0.tar.gz/Common/SecurityToken.h -> GostCrypt_Linux_1.3.tar.gz/Common/SecurityToken.h
Changed
@@ -11,11 +11,7 @@ #define GST_HEADER_Common_SecurityToken #include "Platform/PlatformBase.h" -#if defined (GST_WINDOWS) && !defined (GST_PROTOTYPE) -# include "Exception.h" -#else -# include "Platform/Exception.h" -#endif +#include "Platform/Exception.h" #ifndef NULL_PTR # define NULL_PTR 0 @@ -23,27 +19,13 @@ #define CK_PTR * #define CK_CALLBACK_FUNCTION(RET_TYPE, NAME) RET_TYPE (* NAME) -#ifdef GST_WINDOWS - -# include <windows.h> - -# define CK_DEFINE_FUNCTION(RET_TYPE, NAME) RET_TYPE __declspec(dllexport) NAME -# define CK_DECLARE_FUNCTION(RET_TYPE, NAME) RET_TYPE __declspec(dllimport) NAME -# define CK_DECLARE_FUNCTION_POINTER(RET_TYPE, NAME) RET_TYPE __declspec(dllimport) (* NAME) -# pragma pack(push, cryptoki, 1) -# include <Pkcs11/pkcs11.h> -# pragma pack(pop, cryptoki) +#define CK_DEFINE_FUNCTION(RET_TYPE, NAME) RET_TYPE NAME +#define CK_DECLARE_FUNCTION(RET_TYPE, NAME) RET_TYPE NAME +#define CK_DECLARE_FUNCTION_POINTER(RET_TYPE, NAME) RET_TYPE (* NAME) -#else // !GST_WINDOWS +#include <Pkcs11/pkcs11.h> -# define CK_DEFINE_FUNCTION(RET_TYPE, NAME) RET_TYPE NAME -# define CK_DECLARE_FUNCTION(RET_TYPE, NAME) RET_TYPE NAME -# define CK_DECLARE_FUNCTION_POINTER(RET_TYPE, NAME) RET_TYPE (* NAME) - -# include <Pkcs11/pkcs11.h> - -#endif // !GST_WINDOWS #define GST_SECURITY_TOKEN_KEYFILE_URL_PREFIX L"token://" @@ -204,11 +186,7 @@ static bool Initialized; static auto_ptr <GetPinFunctor> PinCallback; static CK_FUNCTION_LIST_PTR Pkcs11Functions; -#ifdef GST_WINDOWS - static HMODULE Pkcs11LibraryHandle; -#else static void *Pkcs11LibraryHandle; -#endif static map <CK_SLOT_ID, Pkcs11Session> Sessions; static auto_ptr <SendExceptionFunctor> WarningCallback; };
View file
GostCrypt_Linux_1.0.tar.gz/Common/Volumes.h -> GostCrypt_Linux_1.3.tar.gz/Common/Volumes.h
Changed
@@ -24,21 +24,18 @@ #endif // Volume header version -#define VOLUME_HEADER_VERSION 0x0005 +#define VOLUME_HEADER_VERSION 0x1100 // Version number written to volume header during format; // specifies the minimum program version required to mount the volume -#define GST_VOLUME_MIN_REQUIRED_PROGRAM_VERSION 0x0700 +#define GST_VOLUME_MIN_REQUIRED_PROGRAM_VERSION 0x1100 // Version number written (encrypted) to the key data area of an encrypted system partition/drive; // specifies the minimum program version required to decrypt the system partition/drive -#define GST_SYSENC_KEYSCOPE_MIN_REQ_PROG_VERSION 0x0700 +#define GST_SYSENC_KEYSCOPE_MIN_REQ_PROG_VERSION 0x1100 -// Current volume format version (created by GostCrypt 6.0+) -#define GST_VOLUME_FORMAT_VERSION 2 - -// Version number of volume format created by GostCrypt 1.0-5.1a -#define GST_VOLUME_FORMAT_VERSION_PRE_6_0 1 +// Current volume format version (created by GostCrypt 1.1+) +#define GST_VOLUME_FORMAT_VERSION 11 // Volume header sizes #define GST_VOLUME_HEADER_SIZE (64 * 1024L) @@ -135,12 +132,11 @@ UINT64_STRUCT GetHeaderField64 (byte *header, int offset); int ReadVolumeHeader (BOOL bBoot, char *encryptedHeader, Password *password, PCRYPTO_INFO *retInfo, CRYPTO_INFO *retHeaderCryptoInfo); -#if !defined (DEVICE_DRIVER) && !defined (GST_WINDOWS_BOOT) int CreateVolumeHeaderInMemory (BOOL bBoot, char *encryptedHeader, int ea, int mode, Password *password, int pkcs5_prf, char *masterKeydata, PCRYPTO_INFO *retInfo, unsigned __int64 volumeSize, unsigned __int64 hiddenVolumeSize, unsigned __int64 encryptedAreaStart, unsigned __int64 encryptedAreaLength, uint16 requiredProgramVersion, uint32 headerFlags, uint32 sectorSize, BOOL bWipeMode); BOOL ReadEffectiveVolumeHeader (BOOL device, HANDLE fileHandle, byte *header, DWORD *bytesRead); BOOL WriteEffectiveVolumeHeader (BOOL device, HANDLE fileHandle, byte *header); int WriteRandomDataToReservedHeaderAreas (HANDLE dev, CRYPTO_INFO *cryptoInfo, uint64 dataAreaSize, BOOL bPrimaryOnly, BOOL bBackupOnly); -#endif + #endif // !GST_HEADER_Volume_VolumeHeader
View file
GostCrypt_Linux_1.3.tar.gz/Contributors.md
Added
@@ -0,0 +1,9 @@ +* AMICELLI Paul +* BERTIN Tristan +* DAVID Baptiste +* FILIOL Eric +* GROOT Sebastiaan +* SWAENEPOEL Guillaume +* THIEULEUX Jonathan + +* TrueCrypt Team
View file
GostCrypt_Linux_1.0.tar.gz/Core/CoreBase.cpp -> GostCrypt_Linux_1.3.tar.gz/Core/CoreBase.cpp
Changed
@@ -86,11 +86,8 @@ } if (!IsSlotNumberAvailable (options.SlotNumber)) -#ifdef GST_WINDOWS - throw DriveLetterUnavailable (SRC_POS); -#else throw VolumeSlotUnavailable (SRC_POS); -#endif + if (!options.NoFilesystem && (!options.MountPoint || options.MountPoint->IsEmpty())) options.MountPoint.reset (new DirectoryPath (SlotNumberToMountPoint (options.SlotNumber))); } @@ -121,11 +118,8 @@ && IsMountPointAvailable (SlotNumberToMountPoint (slotNumber))) return slotNumber; } -#ifdef GST_WINDOWS - throw DriveLetterUnavailable (SRC_POS); -#else throw VolumeSlotUnavailable (SRC_POS); -#endif + } uint64 CoreBase::GetMaxHiddenVolumeSize (shared_ptr <Volume> outerVolume) const
View file
GostCrypt_Linux_1.0.tar.gz/Core/RandomNumberGenerator.cpp -> GostCrypt_Linux_1.3.tar.gz/Core/RandomNumberGenerator.cpp
Changed
@@ -7,11 +7,9 @@ */ -#ifndef GST_WINDOWS #include <sys/types.h> #include <errno.h> #include <fcntl.h> -#endif #include "RandomNumberGenerator.h" #include "Volume/Crc32.h" @@ -22,11 +20,6 @@ { SecureBuffer buffer (PoolSize); -#ifdef GST_WINDOWS -#ifndef DEBUG - throw NotImplemented (SRC_POS); -#endif -#else int urandom = open ("/dev/urandom", O_RDONLY); throw_sys_sub_if (urandom == -1, L"/dev/urandom"); finally_do_arg (int, urandom, { close (finally_arg); }); @@ -44,7 +37,6 @@ throw_sys_sub_if (read (random, buffer, buffer.Size()) == -1 && errno != EAGAIN, L"/dev/random"); AddToPool (buffer); } -#endif } void RandomNumberGenerator::AddToPool (const ConstBufferPtr &data)
View file
GostCrypt_Linux_1.0.tar.gz/Core/Unix/CoreUnix.h -> GostCrypt_Linux_1.3.tar.gz/Core/Unix/CoreUnix.h
Changed
@@ -10,7 +10,6 @@ #ifndef GST_HEADER_Core_CoreUnix #define GST_HEADER_Core_CoreUnix -#include "System.h" #include "Platform/Unix/Process.h" #include "Core/CoreBase.h" #include "Core/Unix/MountedFilesystem.h"
View file
GostCrypt_Linux_1.0.tar.gz/Core/Unix/FreeBSD/CoreFreeBSD.h -> GostCrypt_Linux_1.3.tar.gz/Core/Unix/FreeBSD/CoreFreeBSD.h
Changed
@@ -1,3 +1,4 @@ + /* Copyright (c) 2008 TrueCrypt Developers Association. All rights reserved. @@ -10,7 +11,6 @@ #ifndef GST_HEADER_Core_CoreFreeBSD #define GST_HEADER_Core_CoreFreeBSD -#include "System.h" #include "Core/Unix/CoreUnix.h" namespace GostCrypt
View file
GostCrypt_Linux_1.0.tar.gz/Core/Unix/Linux/CoreLinux.cpp -> GostCrypt_Linux_1.3.tar.gz/Core/Unix/Linux/CoreLinux.cpp
Changed
@@ -18,7 +18,6 @@ #include "CoreLinux.h" #include "Platform/SystemInfo.h" #include "Platform/TextReader.h" -#include "Volume/EncryptionModeLRW.h" #include "Volume/EncryptionModeXTS.h" #include "Driver/Fuse/FuseService.h" #include "Core/Unix/CoreServiceProxy.h" @@ -153,7 +152,7 @@ HostDeviceList CoreLinux::GetHostDevices (bool pathListOnly) const { HostDeviceList devices; - TextReader tr ("/proc/partitions"); + TextReader tr (L"/proc/partitions"); string line; while (tr.ReadLine (line)) @@ -228,7 +227,7 @@ char *resolvedPath = realpath (string (devicePath).c_str(), NULL); if (resolvedPath) { - realDevicePath = resolvedPath; + realDevicePath = (DevicePath) resolvedPath; free (resolvedPath); } } @@ -291,10 +290,9 @@ void CoreLinux::MountVolumeNative (shared_ptr <Volume> volume, MountOptions &options, const DirectoryPath &auxMountPoint) const { bool xts = (typeid (*volume->GetEncryptionMode()) == typeid (EncryptionModeXTS)); - bool lrw = (typeid (*volume->GetEncryptionMode()) == typeid (EncryptionModeLRW)); if (options.NoKernelCrypto - || (!xts && (!lrw || volume->GetEncryptionAlgorithm()->GetCiphers().size() > 1 || volume->GetEncryptionAlgorithm()->GetMinBlockSize() != 16)) + || (!xts && (volume->GetEncryptionAlgorithm()->GetCiphers().size() > 1 || volume->GetEncryptionAlgorithm()->GetMinBlockSize() != 16)) || volume->GetProtectionType() == VolumeProtection::HiddenVolumeReadOnly) { throw NotApplicable (SRC_POS); @@ -373,9 +371,6 @@ sprintf ((char *) hexStr.Ptr(), "%02x", (int) cipherKey[i]); dmCreateArgsBuf.GetRange (keyArgOffset + i * 2, 2).CopyFrom (hexStr.GetRange (0, 2)); - if (lrw && i >= 16) - continue; - sprintf ((char *) hexStr.Ptr(), "%02x", (int) secondaryKey[i]); dmCreateArgsBuf.GetRange (keyArgOffset + cipherKey.Size() * 2 + i * 2, 2).CopyFrom (hexStr.GetRange (0, 2)); }
View file
GostCrypt_Linux_1.0.tar.gz/Core/Unix/Linux/CoreLinux.h -> GostCrypt_Linux_1.3.tar.gz/Core/Unix/Linux/CoreLinux.h
Changed
@@ -10,7 +10,6 @@ #ifndef GST_HEADER_Core_CoreLinux #define GST_HEADER_Core_CoreLinux -#include "System.h" #include "Core/Unix/CoreUnix.h" namespace GostCrypt
View file
GostCrypt_Linux_1.0.tar.gz/Core/Unix/MacOSX/CoreMacOSX.h -> GostCrypt_Linux_1.3.tar.gz/Core/Unix/MacOSX/CoreMacOSX.h
Changed
@@ -10,7 +10,6 @@ #ifndef GST_HEADER_Core_CoreMacOSX #define GST_HEADER_Core_CoreMacOSX -#include "System.h" #include "Core/Unix/FreeBSD/CoreFreeBSD.h" namespace GostCrypt
View file
GostCrypt_Linux_1.0.tar.gz/Core/Unix/Solaris/CoreSolaris.h -> GostCrypt_Linux_1.3.tar.gz/Core/Unix/Solaris/CoreSolaris.h
Changed
@@ -10,7 +10,6 @@ #ifndef GST_HEADER_Core_CoreSolaris #define GST_HEADER_Core_CoreSolaris -#include "System.h" #include "Core/Unix/CoreUnix.h" namespace GostCrypt
View file
GostCrypt_Linux_1.0.tar.gz/Core/VolumeCreator.h -> GostCrypt_Linux_1.3.tar.gz/Core/VolumeCreator.h
Changed
@@ -45,9 +45,8 @@ static Enum GetPlatformNative () { -#ifdef GST_WINDOWS - return VolumeCreationOptions::FilesystemType::NTFS; -#elif defined (GST_LINUX) + +#ifdef GST_LINUX return VolumeCreationOptions::FilesystemType::Ext3; #elif defined (GST_MACOSX) return VolumeCreationOptions::FilesystemType::MacOsExt;
View file
GostCrypt_Linux_1.0.tar.gz/Crypto/GostHash.h -> GostCrypt_Linux_1.3.tar.gz/Crypto/GostHash.h
Changed
@@ -23,17 +23,10 @@ #define GOSTHASH_GOST_KEYSIZE 32 typedef unsigned char byte; -#ifdef GST_WINDOWS_BOOT -typedef int gst_word; -typedef long gst_dword; -typedef unsigned int gst_uword; -typedef unsigned long gst_udword; -#else typedef short gst_word; typedef int gst_dword; typedef unsigned short gst_uword; typedef unsigned int gst_udword; -#endif typedef struct gosthash_s_box
View file
GostCrypt_Linux_1.3.tar.gz/Crypto/GrasshopperCipher.c
Added
@@ -0,0 +1,500 @@ + +/* Implementation of Gost Grasshopper Encryption Algorithm */ +/* This program implements the test vectors set provided in the reference document */ +/* provided by the Standartinform, Moscow, Russian Federation. */ +/* */ +/* Author: Eric Filiol */ +/* This program is protected by the GPLv3 */ +/***********************************************************************************/ + +#include "GrasshopperCipher.h" +#include <stdio.h> + +unsigned char pi[256] = {252, 238, 221, 17, 207, 110, 49, 22, 251, 196, 250, 218, 35, 197, 4, 77, + 233, 119, 240, 219, 147, 46, 153, 186, 23, 54, 241, 187, 20, 205, 95, 193, + 249, 24, 101, 90, 226, 92, 239, 33, 129, 28, 60, 66, 139, 1, 142, 79, + 5, 132, 2, 174, 227, 106, 143, 160, 6, 11, 237, 152, 127, 212, 211, 31, + 235, 52, 44, 81, 234, 200, 72, 171, 242, 42, 104, 162, 253, 58, 206, 204, + 181, 112, 14, 86, 8, 12, 118, 18, 191, 114, 19, 71, 156, 183, 93, 135, + 21, 161, 150, 41, 16, 123, 154, 199, 243, 145, 120, 111, 157, 158, 178, 177, + 50, 117, 25, 61, 255, 53, 138, 126, 109, 84, 198, 128, 195, 189, 13, 87, + 223, 245, 36, 169, 62, 168, 67, 201, 215, 121, 214, 246, 124, 34, 185, 3, + 224, 15, 236, 222, 122, 148, 176, 188, 220, 232, 40, 80, 78, 51, 10, 74, + 167, 151, 96, 115, 30, 0, 98, 68, 26, 184, 56, 130, 100, 159, 38, 65, + 173, 69, 70, 146, 39, 94, 85, 47, 140, 163, 165, 125, 105, 213, 149, 59, + 7, 88, 179, 64, 134, 172, 29, 247, 48, 55, 107, 228, 136, 217, 231, 137, + 225, 27, 131, 73, 76, 63, 248, 254, 141, 83, 170, 144, 202, 216, 133, 97, + 32, 113, 103, 164, 45, 43, 9, 91, 203, 155, 37, 208, 190, 229, 108, 82, + 89, 166, 116, 210, 230, 244, 180, 192, 209, 102, 175, 194, 57, 75, 99, 182}; + +unsigned char pi_inv[256] = {165, 45, 50, 143, 14, 48, 56, 192, 84, 230, 158, 57, 85, 126, 82, 145, + 100, 3, 87, 90, 28, 96, 7, 24, 33, 114, 168, 209, 41, 198, 164, 63, + 224, 39, 141, 12, 130, 234, 174, 180, 154, 99, 73, 229, 66, 228, 21, 183, + 200, 6, 112, 157, 65, 117, 25, 201, 170, 252, 77, 191, 42, 115, 132, 213, + 195, 175, 43, 134, 167, 177, 178, 91, 70, 211, 159, 253, 212, 15, 156, 47, + 155, 67, 239, 217, 121, 182, 83, 127, 193, 240, 35, 231, 37, 94, 181, 30, + 162, 223, 166, 254, 172, 34, 249, 226, 74, 188, 53, 202, 238, 120, 5, 107, + 81, 225, 89, 163, 242, 113, 86, 17, 106, 137, 148, 101, 140, 187, 119, 60, + 123, 40, 171, 210, 49, 222, 196, 95, 204, 207, 118, 44, 184, 216, 46, 54, + 219, 105, 179, 20, 149, 190, 98, 161, 59, 22, 102, 233, 92, 108, 109, 173, + 55, 97, 75, 185, 227, 186, 241, 160, 133, 131, 218, 71, 197, 176, 51, 250, + 150, 111, 110, 194, 246, 80, 255, 93, 169, 142, 23, 27, 151, 125, 236, 88, + 247, 31, 251, 124, 9, 13, 122, 103, 69, 135, 220, 232, 79, 29, 78, 4, + 235, 248, 243, 62, 61, 189, 138, 136, 221, 205, 11, 19, 152, 2, 147, 128, + 144, 208, 36, 52, 203, 237, 244, 206, 153, 16, 68, 64, 146, 58, 1, 38, + 18, 26, 72, 104, 245, 129, 139, 199, 214, 32, 10, 8, 0, 76, 215, 116}; + + +/* Precomputation of X.Y mod p(x) = x^8 + x^7 + x^6 + x + 1 where X and Y are elements in GF(2)[X]/p(x) */ +unsigned char mult_mod_poly[8][256] = { + + { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, + 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, + 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, + 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, + 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, + 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, + 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255}, + + + { 0, 16, 32, 48, 64, 80, 96, 112, 128, 144, 160, 176, 192, 208, 224, 240, 195, 211, 227, 243, 131, 147, 163, 179, 67, 83, 99, 115, 3, 19, 35, 51, + 69, 85, 101, 117, 5, 21, 37, 53, 197, 213, 229, 245, 133, 149, 165, 181, 134, 150, 166, 182, 198, 214, 230, 246, 6, 22, 38, 54, 70, 86, 102, 118, + 138, 154, 170, 186, 202, 218, 234, 250, 10, 26, 42, 58, 74, 90, 106, 122, 73, 89, 105, 121, 9, 25, 41, 57, 201, 217, 233, 249, 137, 153, 169, 185, + 207, 223, 239, 255, 143, 159, 175, 191, 79, 95, 111, 127, 15, 31, 47, 63, 12, 28, 44, 60, 76, 92, 108, 124, 140, 156, 172, 188, 204, 220, 236, 252, + 215, 199, 247, 231, 151, 135, 183, 167, 87, 71, 119, 103, 23, 7, 55, 39, 20, 4, 52, 36, 84, 68, 116, 100, 148, 132, 180, 164, 212, 196, 244, 228, + 146, 130, 178, 162, 210, 194, 242, 226, 18, 2, 50, 34, 82, 66, 114, 98, 81, 65, 113, 97, 17, 1, 49, 33, 209, 193, 241, 225, 145, 129, 177, 161, + 93, 77, 125, 109, 29, 13, 61, 45, 221, 205, 253, 237, 157, 141, 189, 173, 158, 142, 190, 174, 222, 206, 254, 238, 30, 14, 62, 46, 94, 78, 126, 110, + 24, 8, 56, 40, 88, 72, 120, 104, 152, 136, 184, 168, 216, 200, 248, 232, 219, 203, 251, 235, 155, 139, 187, 171, 91, 75, 123, 107, 27, 11, 59, 43}, + + { 0, 32, 64, 96, 128, 160, 192, 224, 195, 227, 131, 163, 67, 99, 3, 35, 69, 101, 5, 37, 197, 229, 133, 165, 134, 166, 198, 230, 6, 38, 70, 102, + 138, 170, 202, 234, 10, 42, 74, 106, 73, 105, 9, 41, 201, 233, 137, 169, 207, 239, 143, 175, 79, 111, 15, 47, 12, 44, 76, 108, 140, 172, 204, 236, + 215, 247, 151, 183, 87, 119, 23, 55, 20, 52, 84, 116, 148, 180, 212, 244, 146, 178, 210, 242, 18, 50, 82, 114, 81, 113, 17, 49, 209, 241, 145, 177, + 93, 125, 29, 61, 221, 253, 157, 189, 158, 190, 222, 254, 30, 62, 94, 126, 24, 56, 88, 120, 152, 184, 216, 248, 219, 251, 155, 187, 91, 123, 27, 59, + 109, 77, 45, 13, 237, 205, 173, 141, 174, 142, 238, 206, 46, 14, 110, 78, 40, 8, 104, 72, 168, 136, 232, 200, 235, 203, 171, 139, 107, 75, 43, 11, + 231, 199, 167, 135, 103, 71, 39, 7, 36, 4, 100, 68, 164, 132, 228, 196, 162, 130, 226, 194, 34, 2, 98, 66, 97, 65, 33, 1, 225, 193, 161, 129, + 186, 154, 250, 218, 58, 26, 122, 90, 121, 89, 57, 25, 249, 217, 185, 153, 255, 223, 191, 159, 127, 95, 63, 31, 60, 28, 124, 92, 188, 156, 252, 220, + 48, 16, 112, 80, 176, 144, 240, 208, 243, 211, 179, 147, 115, 83, 51, 19, 117, 85, 53, 21, 245, 213, 181, 149, 182, 150, 246, 214, 54, 22, 118, 86}, + + { 0, 133, 201, 76, 81, 212, 152, 29, 162, 39, 107, 238, 243, 118, 58, 191, 135, 2, 78, 203, 214, 83, 31, 154, 37, 160, 236, 105, 116, 241, 189, 56, + 205, 72, 4, 129, 156, 25, 85, 208, 111, 234, 166, 35, 62, 187, 247, 114, 74, 207, 131, 6, 27, 158, 210, 87, 232, 109, 33, 164, 185, 60, 112, 245, + 89, 220, 144, 21, 8, 141, 193, 68, 251, 126, 50, 183, 170, 47, 99, 230, 222, 91, 23, 146, 143, 10, 70, 195, 124, 249, 181, 48, 45, 168, 228, 97, + 148, 17, 93, 216, 197, 64, 12, 137, 54, 179, 255, 122, 103, 226, 174, 43, 19, 150, 218, 95, 66, 199, 139, 14, 177, 52, 120, 253, 224, 101, 41, 172, + 178, 55, 123, 254, 227, 102, 42, 175, 16, 149, 217, 92, 65, 196, 136, 13, 53, 176, 252, 121, 100, 225, 173, 40, 151, 18, 94, 219, 198, 67, 15, 138, + 127, 250, 182, 51, 46, 171, 231, 98, 221, 88, 20, 145, 140, 9, 69, 192, 248, 125, 49, 180, 169, 44, 96, 229, 90, 223, 147, 22, 11, 142, 194, 71, + 235, 110, 34, 167, 186, 63, 115, 246, 73, 204, 128, 5, 24, 157, 209, 84, 108, 233, 165, 32, 61, 184, 244, 113, 206, 75, 7, 130, 159, 26, 86, 211, + 38, 163, 239, 106, 119, 242, 190, 59, 132, 1, 77, 200, 213, 80, 28, 153, 161, 36, 104, 237, 240, 117, 57, 188, 3, 134, 202, 79, 82, 215, 155, 30}, + + { 0, 148, 235, 127, 21, 129, 254, 106, 42, 190, 193, 85, 63, 171, 212, 64, 84, 192, 191, 43, 65, 213, 170, 62, 126, 234, 149, 1, 107, 255, 128, 20, + 168, 60, 67, 215, 189, 41, 86, 194, 130, 22, 105, 253, 151, 3, 124, 232, 252, 104, 23, 131, 233, 125, 2, 150, 214, 66, 61, 169, 195, 87, 40, 188, + 147, 7, 120, 236, 134, 18, 109, 249, 185, 45, 82, 198, 172, 56, 71, 211, 199, 83, 44, 184, 210, 70, 57, 173, 237, 121, 6, 146, 248, 108, 19, 135, + 59, 175, 208, 68, 46, 186, 197, 81, 17, 133, 250, 110, 4, 144, 239, 123, 111, 251, 132, 16, 122, 238, 145, 5, 69, 209, 174, 58, 80, 196, 187, 47, + 229, 113, 14, 154, 240, 100, 27, 143, 207, 91, 36, 176, 218, 78, 49, 165, 177, 37, 90, 206, 164, 48, 79, 219, 155, 15, 112, 228, 142, 26, 101, 241, + 77, 217, 166, 50, 88, 204, 179, 39, 103, 243, 140, 24, 114, 230, 153, 13, 25, 141, 242, 102, 12, 152, 231, 115, 51, 167, 216, 76, 38, 178, 205, 89, + 118, 226, 157, 9, 99, 247, 136, 28, 92, 200, 183, 35, 73, 221, 162, 54, 34, 182, 201, 93, 55, 163, 220, 72, 8, 156, 227, 119, 29, 137, 246, 98, + 222, 74, 53, 161, 203, 95, 32, 180, 244, 96, 31, 139, 225, 117, 10, 158, 138, 30, 97, 245, 159, 11, 116, 224, 160, 52, 75, 223, 181, 33, 94, 202}, + + + { 0, 192, 67, 131, 134, 70, 197, 5, 207, 15, 140, 76, 73, 137, 10, 202, 93, 157, 30, 222, 219, 27, 152, 88, 146, 82, 209, 17, 20, 212, 87, 151, + 186, 122, 249, 57, 60, 252, 127, 191, 117, 181, 54, 246, 243, 51, 176, 112, 231, 39, 164, 100, 97, 161, 34, 226, 40, 232, 107, 171, 174, 110, 237, 45, + 183, 119, 244, 52, 49, 241, 114, 178, 120, 184, 59, 251, 254, 62, 189, 125, 234, 42, 169, 105, 108, 172, 47, 239, 37, 229, 102, 166, 163, 99, 224, 32, + 13, 205, 78, 142, 139, 75, 200, 8, 194, 2, 129, 65, 68, 132, 7, 199, 80, 144, 19, 211, 214, 22, 149, 85, 159, 95, 220, 28, 25, 217, 90, 154, + 173, 109, 238, 46, 43, 235, 104, 168, 98, 162, 33, 225, 228, 36, 167, 103, 240, 48, 179, 115, 118, 182, 53, 245, 63, 255, 124, 188, 185, 121, 250, 58, + 23, 215, 84, 148, 145, 81, 210, 18, 216, 24, 155, 91, 94, 158, 29, 221, 74, 138, 9, 201, 204, 12, 143, 79, 133, 69, 198, 6, 3, 195, 64, 128, + 26, 218, 89, 153, 156, 92, 223, 31, 213, 21, 150, 86, 83, 147, 16, 208, 71, 135, 4, 196, 193, 1, 130, 66, 136, 72, 203, 11, 14, 206, 77, 141, + 160, 96, 227, 35, 38, 230, 101, 165, 111, 175, 44, 236, 233, 41, 170, 106, 253, 61, 190, 126, 123, 187, 56, 248, 50, 242, 113, 177, 180, 116, 247, 55}, + + { 0, 194, 71, 133, 142, 76, 201, 11, 223, 29, 152, 90, 81, 147, 22, 212, 125, 191, 58, 248, 243, 49, 180, 118, 162, 96, 229, 39, 44, 238, 107, 169, + 250, 56, 189, 127, 116, 182, 51, 241, 37, 231, 98, 160, 171, 105, 236, 46, 135, 69, 192, 2, 9, 203, 78, 140, 88, 154, 31, 221, 214, 20, 145, 83, + 55, 245, 112, 178, 185, 123, 254, 60, 232, 42, 175, 109, 102, 164, 33, 227, 74, 136, 13, 207, 196, 6, 131, 65, 149, 87, 210, 16, 27, 217, 92, 158, + 205, 15, 138, 72, 67, 129, 4, 198, 18, 208, 85, 151, 156, 94, 219, 25, 176, 114, 247, 53, 62, 252, 121, 187, 111, 173, 40, 234, 225, 35, 166, 100, + 110, 172, 41, 235, 224, 34, 167, 101, 177, 115, 246, 52, 63, 253, 120, 186, 19, 209, 84, 150, 157, 95, 218, 24, 204, 14, 139, 73, 66, 128, 5, 199, + 148, 86, 211, 17, 26, 216, 93, 159, 75, 137, 12, 206, 197, 7, 130, 64, 233, 43, 174, 108, 103, 165, 32, 226, 54, 244, 113, 179, 184, 122, 255, 61, + 89, 155, 30, 220, 215, 21, 144, 82, 134, 68, 193, 3, 8, 202, 79, 141, 36, 230, 99, 161, 170, 104, 237, 47, 251, 57, 188, 126, 117, 183, 50, 240, + 163, 97, 228, 38, 45, 239, 106, 168, 124, 190, 59, 249, 242, 48, 181, 119, 222, 28, 153, 91, 80, 146, 23, 213, 1, 195, 70, 132, 143, 77, 200, 10}, + + { 0, 251, 53, 206, 106, 145, 95, 164, 212, 47, 225, 26, 190, 69, 139, 112, 107, 144, 94, 165, 1, 250, 52, 207, 191, 68, 138, 113, 213, 46, 224, 27, + 214, 45, 227, 24, 188, 71, 137, 114, 2, 249, 55, 204, 104, 147, 93, 166, 189, 70, 136, 115, 215, 44, 226, 25, 105, 146, 92, 167, 3, 248, 54, 205, + 111, 148, 90, 161, 5, 254, 48, 203, 187, 64, 142, 117, 209, 42, 228, 31, 4, 255, 49, 202, 110, 149, 91, 160, 208, 43, 229, 30, 186, 65, 143, 116, + 185, 66, 140, 119, 211, 40, 230, 29, 109, 150, 88, 163, 7, 252, 50, 201, 210, 41, 231, 28, 184, 67, 141, 118, 6, 253, 51, 200, 108, 151, 89, 162, + 222, 37, 235, 16, 180, 79, 129, 122, 10, 241, 63, 196, 96, 155, 85, 174, 181, 78, 128, 123, 223, 36, 234, 17, 97, 154, 84, 175, 11, 240, 62, 197, + 8, 243, 61, 198, 98, 153, 87, 172, 220, 39, 233, 18, 182, 77, 131, 120, 99, 152, 86, 173, 9, 242, 60, 199, 183, 76, 130, 121, 221, 38, 232, 19, + 177, 74, 132, 127, 219, 32, 238, 21, 101, 158, 80, 171, 15, 244, 58, 193, 218, 33, 239, 20, 176, 75, 133, 126, 14, 245, 59, 192, 100, 159, 81, 170, + 103, 156, 82, 169, 13, 246, 56, 195, 179, 72, 134, 125, 217, 34, 236, 23, 12, 247, 57, 194, 102, 157, 83, 168, 216, 35, 237, 22, 178, 73, 135, 124}}; +void S(unsigned long long * block) +{ + unsigned long long valtmp; + + valtmp = ((unsigned long long)(pi[(block[0] >> 56) & 0xFF]) << 56); + valtmp |= ((unsigned long long)(pi[(block[0] >> 48) & 0xFF]) << 48); + valtmp |= ((unsigned long long)(pi[(block[0] >> 40) & 0xFF]) << 40); + valtmp |= ((unsigned long long)(pi[(block[0] >> 32) & 0xFF]) << 32); + valtmp |= ((unsigned long long)(pi[(block[0] >> 24) & 0xFF]) << 24); + valtmp |= ((unsigned long long)(pi[(block[0] >> 16) & 0xFF]) << 16); + valtmp |= ((unsigned long long)(pi[(block[0] >> 8) & 0xFF]) << 8); + valtmp |= (unsigned long long)(pi[block[0] & 0xFF]); + + block[0] = valtmp; + + valtmp = ((unsigned long long)(pi[(block[1] >> 56) & 0xFF]) << 56); + valtmp |= ((unsigned long long)(pi[(block[1] >> 48) & 0xFF]) << 48); + valtmp |= ((unsigned long long)(pi[(block[1] >> 40) & 0xFF]) << 40); + valtmp |= ((unsigned long long)(pi[(block[1] >> 32) & 0xFF]) << 32); + valtmp |= ((unsigned long long)(pi[(block[1] >> 24) & 0xFF]) << 24); + valtmp |= ((unsigned long long)(pi[(block[1] >> 16) & 0xFF]) << 16); + valtmp |= ((unsigned long long)(pi[(block[1] >> 8) & 0xFF]) << 8); + valtmp |= (unsigned long long)(pi[block[1] & 0xFF]); + + block[1] = valtmp; +} + +/* Inverse of S conversion function */ +void S_inv(unsigned long long * block) +{ + unsigned long long valtmp; + + valtmp = ((unsigned long long)(pi_inv[(block[0] >> 56) & 0xFF]) << 56); + valtmp |= ((unsigned long long)(pi_inv[(block[0] >> 48) & 0xFF]) << 48); + valtmp |= ((unsigned long long)(pi_inv[(block[0] >> 40) & 0xFF]) << 40); + valtmp |= ((unsigned long long)(pi_inv[(block[0] >> 32) & 0xFF]) << 32); + valtmp |= ((unsigned long long)(pi_inv[(block[0] >> 24) & 0xFF]) << 24); + valtmp |= ((unsigned long long)(pi_inv[(block[0] >> 16) & 0xFF]) << 16); + valtmp |= ((unsigned long long)(pi_inv[(block[0] >> 8) & 0xFF]) << 8); + valtmp |= (unsigned long long)(pi_inv[block[0] & 0xFF]); + + block[0] = valtmp; + + valtmp = ((unsigned long long)(pi_inv[(block[1] >> 56) & 0xFF]) << 56); + valtmp |= ((unsigned long long)(pi_inv[(block[1] >> 48) & 0xFF]) << 48); + valtmp |= ((unsigned long long)(pi_inv[(block[1] >> 40) & 0xFF]) << 40); + valtmp |= ((unsigned long long)(pi_inv[(block[1] >> 32) & 0xFF]) << 32); + valtmp |= ((unsigned long long)(pi_inv[(block[1] >> 24) & 0xFF]) << 24); + valtmp |= ((unsigned long long)(pi_inv[(block[1] >> 16) & 0xFF]) << 16); + valtmp |= ((unsigned long long)(pi_inv[(block[1] >> 8) & 0xFF]) << 8); + valtmp |= (unsigned long long)(pi_inv[block[1] & 0xFF]); + + block[1] = valtmp; +} + +inline unsigned char ll(unsigned long long *block) +{ + + return (mult_mod_poly[4][(block[0] >> 56) & 0xFF] ^ + mult_mod_poly[2][(block[0] >> 48) & 0xFF] ^ + mult_mod_poly[3][(block[0] >> 40) & 0xFF] ^ + mult_mod_poly[1][(block[0] >> 32) & 0xFF] ^ + mult_mod_poly[6][(block[0] >> 24) & 0xFF] ^ + mult_mod_poly[5][(block[0] >> 16) & 0xFF] ^ + mult_mod_poly[0][(block[0] >> 8) & 0xFF] ^ + mult_mod_poly[7][(block[0] >> 0) & 0xFF] ^ + mult_mod_poly[0][(block[1] >> 56) & 0xFF] ^ + mult_mod_poly[5][(block[1] >> 48) & 0xFF] ^ + mult_mod_poly[6][(block[1] >> 40) & 0xFF] ^ + mult_mod_poly[1][(block[1] >> 32) & 0xFF] ^ + mult_mod_poly[3][(block[1] >> 24) & 0xFF] ^ + mult_mod_poly[2][(block[1] >> 16) & 0xFF] ^ + mult_mod_poly[4][(block[1] >> 8) & 0xFF] ^ + mult_mod_poly[0][(block[1] >> 0) & 0xFF] ); + +}
View file
GostCrypt_Linux_1.3.tar.gz/Crypto/GrasshopperCipher.h
Added
@@ -0,0 +1,121 @@ +/***********************************************************************************/ +/* Implementation of Gost Grasshopper Encryption Algorithm */ +/* This program implements the test vectors set provided in the reference document */ +/* provided by the Standartinform, Moscow, Russian Federation. */ +/* */ +/* Author: Eric Filiol */ +/* This program is protected by the GPLv3 */ +/***********************************************************************************/ + +/***********************************************************************************/ +/* Data structures for the gost_grasshopper algorithm. */ +/* Each block is an array of two 64-bit integers. */ +/* Key is an array of four 64-bit integers. */ +/* Index 0 contains the most significant 64-bit word while index 1 or 3 contains */ +/* the least significant 64-bit word. */ +/* All functions have the same name as in the reference document */ +/***********************************************************************************/ + +#ifndef GOST_GRASSHOPPER_H +#define GOST_GRASSHOPPER_H + +#if defined(__cplusplus) +extern "C" +{ +#endif //defined __cplusplus + +typedef unsigned char byte; +typedef short gst_word; +typedef int gst_dword; +typedef unsigned short gst_uword; +typedef unsigned int gst_udword; +typedef unsigned long long gst_ludword; + +//Structure of gost subkeys. 10 subkeys of 2 parts +typedef struct grasshopper_kds +{ + gst_ludword x00; //K[0][0] + gst_ludword x01; //K[0][1] + gst_ludword x10; //K[1][0] + gst_ludword x11; //K[1][1] + gst_ludword x20; //K[2][0] + gst_ludword x21; //K[2][1] + gst_ludword x30; //K[3][0] + gst_ludword x31; //K[3][1] + gst_ludword x40; //K[4][0] + gst_ludword x41; //K[4][1] + gst_ludword x50; //K[5][0] + gst_ludword x51; //K[5][1] + gst_ludword x60; //K[6][0] + gst_ludword x61; //K[6][1] + gst_ludword x70; //K[7][0] + gst_ludword x71; //K[7][1] + gst_ludword x80; //K[8][0] + gst_ludword x81; //K[8][1] + gst_ludword x90; //K[9][0] + gst_ludword x91; //K[9][1] + +} grasshopper_kds ; + + +/* The core nonlinear bijective permutation (S-Box) */ +/* The corresponding inverse permutation */ + +/****************************************************/ +/* Base and conversion functions */ +/****************************************************/ + +/* S conversion function */ +inline void S(unsigned long long * block); + +/* Inverse of S conversion function */ +inline void S_inv(unsigned long long * block); +/* Linear transformation */ + +inline unsigned char ll(unsigned long long block[2]); + +/* R conversion function */ + inline void R(unsigned long long * block); + +/* Inverse of R conversion function */ +inline void R_inv(unsigned long long * block); + +/* L conversion function (16 iteration of R) */ +inline void L(unsigned long long * block); + +/* Inverse of L conversion function (16 iteration of R_inv) */ +inline void L_inv(unsigned long long * block); + +/* F conversion function (used in key setup) */ + inline void F(unsigned long long * k, unsigned long long * block1, unsigned long long * block0); + +/****************************************************/ +/****************************************************/ +/* The three core functions */ +/****************************************************/ +/****************************************************/ + +/****************************************************/ +/* Key setup procedure */ +/****************************************************/ +void grasshopper_set_key(unsigned long long * master_key, grasshopper_kds *subkeys); + +/****************************************************/ +/* Encryption procedure */ +/****************************************************/ +void grasshopper_encrypt(grasshopper_kds* subkeys, unsigned long long * plaintext, unsigned long long * ciphertext); + +/****************************************************/ +/* Decryption procedure */ +/****************************************************/ +void grasshopper_decrypt(grasshopper_kds* subkeys, unsigned long long * ciphertext, unsigned long long * plaintext); + + +void grasshopper_xor_ks(grasshopper_kds *ks, grasshopper_kds *out_ks, unsigned long long *in, unsigned int len); + +void changeEndian(unsigned long long *ret); +#if defined(__cplusplus) +} +#endif //defined __cplusplus + +#endif //GOST_GRASSHOPPER_H
View file
GostCrypt_Linux_1.0.tar.gz/Crypto/Sources -> GostCrypt_Linux_1.3.tar.gz/Crypto/Sources
Changed
@@ -7,4 +7,5 @@ Whirlpool.c \ Stribog.c \ GostCipher.c \ - GostHash.c + GostHash.c \ + GrasshopperCipher.c
View file
GostCrypt_Linux_1.0.tar.gz/Crypto/Stribog.c -> GostCrypt_Linux_1.3.tar.gz/Crypto/Stribog.c
Changed
@@ -11,7 +11,7 @@ #include "Stribog.h" -const unsigned long T[8][256] = { +const unsigned long long T[8][256] = { { 0xE6F87E5C5B711FD0,0x258377800924FA16,0xC849E07E852EA4A8,0x5B4686A18F06C16A, 0x0B32E9A2D77B416E,0xABDA37A467815C66,0xF61796A81A686676,0xF5DC0B706391954B, @@ -788,4 +788,4 @@ g_N(ctx->v0, ctx->hash, ctx->EPSILON); copy_blocks(out, ctx->hash, 64); -} \ No newline at end of file +}
View file
GostCrypt_Linux_1.0.tar.gz/Driver/Fuse/FuseService.cpp -> GostCrypt_Linux_1.3.tar.gz/Driver/Fuse/FuseService.cpp
Changed
@@ -521,7 +521,7 @@ FuseService::UserId = getuid(); FuseService::GroupId = getgid(); - + if (getenv ("SUDO_UID")) { try @@ -537,7 +537,6 @@ } catch (...) { } } - static fuse_operations fuse_service_oper; fuse_service_oper.access = fuse_service_access;
View file
GostCrypt_Linux_1.0.tar.gz/Main/Application.cpp -> GostCrypt_Linux_1.3.tar.gz/Main/Application.cpp
Changed
@@ -7,7 +7,6 @@ */ -#include "System.h" #include <wx/stdpaths.h> #include "Main.h" #include "Application.h" @@ -37,7 +36,6 @@ FilePath Application::GetConfigFilePath (const wxString &configFileName, bool createConfigDir) { - wxStandardPaths stdPaths; DirectoryPath configDir; if (!Core->IsInPortableMode()) @@ -47,7 +45,7 @@ configPath.Normalize(); configDir = wstring (configPath.GetFullPath()); #else - configDir = wstring (stdPaths.GetUserDataDir()); + configDir = wstring (wxStandardPaths::Get().GetUserDataDir()); #endif } else @@ -56,18 +54,17 @@ if (createConfigDir && !configDir.IsDirectory()) Directory::Create (configDir); - FilePath filePath = wstring (wxFileName (wstring (configDir), configFileName).GetFullPath()); - return filePath; + FilePath filePath = wstring (wxFileName(wstring (configDir), configFileName).GetFullPath()); return filePath; } DirectoryPath Application::GetExecutableDirectory () { - return wstring (wxFileName (wxStandardPaths().GetExecutablePath()).GetPath()); + return wstring (wxFileName (wxStandardPaths::Get().GetExecutablePath()).GetPath()); } FilePath Application::GetExecutablePath () { - return wstring (wxStandardPaths().GetExecutablePath()); + return wstring (wxStandardPaths::Get().GetExecutablePath()); } void Application::Initialize (UserInterfaceType::Enum type)
View file
GostCrypt_Linux_1.0.tar.gz/Main/CommandLineInterface.cpp -> GostCrypt_Linux_1.3.tar.gz/Main/CommandLineInterface.cpp
Changed
@@ -7,7 +7,6 @@ */ -#include "System.h" #include <wx/cmdline.h> #include <wx/tokenzr.h> #include "Core/Core.h" @@ -31,9 +30,6 @@ parser.AddOption (L"", L"auto-mount", _("Auto mount device-hosted/favorite volumes")); parser.AddSwitch (L"", L"backup-headers", _("Backup volume headers")); parser.AddSwitch (L"", L"background-task", _("Start Background Task")); -#ifdef GST_WINDOWS - parser.AddSwitch (L"", L"cache", _("Cache passwords and keyfiles")); -#endif parser.AddSwitch (L"C", L"change", _("Change password or keyfiles")); parser.AddSwitch (L"c", L"create", _("Create new volume")); parser.AddSwitch (L"", L"create-keyfile", _("Create new keyfile")); @@ -45,7 +41,7 @@ parser.AddSwitch (L"", L"export-token-keyfile",_("Export keyfile from security token")); parser.AddOption (L"", L"filesystem", _("Filesystem type")); parser.AddSwitch (L"f", L"force", _("Force mount/dismount/overwrite")); -#if !defined(GST_WINDOWS) && !defined(GST_MACOSX) +#if !defined(GST_MACOSX) parser.AddOption (L"", L"fs-options", _("Filesystem mount options")); #endif parser.AddOption (L"", L"hash", _("Hash algorithm")); @@ -245,10 +241,6 @@ if (parser.Found (L"background-task")) StartBackgroundTask = true; -#ifdef GST_WINDOWS - if (parser.Found (L"cache")) - ArgMountOptions.CachePassword = true; -#endif ArgDisplayPassword = parser.Found (L"display-password"); if (parser.Found (L"encryption", &str)) @@ -288,7 +280,7 @@ ArgForce = parser.Found (L"force"); -#if !defined(GST_WINDOWS) && !defined(GST_MACOSX) +#ifndef GST_MACOSX if (parser.Found (L"fs-options", &str)) ArgMountOptions.FilesystemOptions = str; #endif @@ -327,10 +319,6 @@ ArgMountOptions.PartitionInSystemEncryptionScope = true; else if (token == L"timestamp" || token == L"ts") ArgMountOptions.PreserveTimestamps = false; -#ifdef GST_WINDOWS - else if (token == L"removable" || token == L"rm") - ArgMountOptions.Removable = true; -#endif else throw_err (LangString["UNKNOWN_OPTION"] + L": " + token); } @@ -381,7 +369,7 @@ ArgQuick = parser.Found (L"quick"); if (parser.Found (L"random-source", &str)) - ArgRandomSourcePath = FilesystemPath (str); + ArgRandomSourcePath = FilesystemPath (str.wc_str()); if (parser.Found (L"restore-headers")) { @@ -449,11 +437,7 @@ if (param1IsVolume) { wxFileName volPath (parser.GetParam (0)); - -#ifdef GST_WINDOWS - if (!parser.GetParam (0).StartsWith (L"\\Device\\")) -#endif - volPath.Normalize (wxPATH_NORM_ABSOLUTE | wxPATH_NORM_DOTS); + volPath.Normalize (wxPATH_NORM_ABSOLUTE | wxPATH_NORM_DOTS); ArgVolumePath.reset (new VolumePath (wstring (volPath.GetFullPath()))); } @@ -472,7 +456,7 @@ if (param1IsFile) { - ArgFilePath.reset (new FilePath (parser.GetParam (0))); + ArgFilePath.reset (new FilePath (parser.GetParam (0).wc_str())); } } @@ -525,7 +509,7 @@ arr.Add (L""); continue; } - arr.Last() += token.empty() ? L',' : token; + arr.Last() += token.empty() ? wxString(L',') : token; } else arr.Add (token); @@ -563,12 +547,12 @@ { filteredVolumes.push_back (volume); } - else if (wxString (volume->Path) == pathFilter.GetFullPath()) + else if (wxString (wstring (volume->Path)) == pathFilter.GetFullPath()) { filteredVolumes.push_back (volume); } - else if (wxString (volume->MountPoint) == pathFilter.GetFullPath() - || (wxString (volume->MountPoint) + wxFileName::GetPathSeparator()) == pathFilter.GetFullPath()) + else if (wxString (wstring(volume->MountPoint)) == pathFilter.GetFullPath() + || (wxString (wstring(volume->MountPoint)) + wxFileName::GetPathSeparator()) == pathFilter.GetFullPath()) { filteredVolumes.push_back (volume); }
View file
GostCrypt_Linux_1.0.tar.gz/Main/CommandLineInterface.h -> GostCrypt_Linux_1.3.tar.gz/Main/CommandLineInterface.h
Changed
@@ -10,7 +10,6 @@ #ifndef GST_HEADER_Main_CommandInterface #define GST_HEADER_Main_CommandInterface -#include "System.h" #include "Main.h" #include "Volume/VolumeInfo.h" #include "Core/MountOptions.h"
View file
GostCrypt_Linux_1.0.tar.gz/Main/FatalErrorHandler.cpp -> GostCrypt_Linux_1.3.tar.gz/Main/FatalErrorHandler.cpp
Changed
@@ -7,7 +7,7 @@ */ -#include "System.h" +#include <wx/string.h> #include <wx/stackwalk.h> #include "Main.h" @@ -110,9 +110,7 @@ signal (SIGSYS, SIG_DFL); #endif -#ifndef GST_WINDOWS std::set_terminate (DefaultTerminateHandler); -#endif } uint32 FatalErrorHandler::GetAppChecksum () @@ -254,10 +252,8 @@ void FatalErrorHandler::Register () { -#ifndef GST_WINDOWS // OnUnhandledException() seems to be called only on Windows DefaultTerminateHandler = std::set_terminate (OnTerminate); -#endif #ifdef GST_UNIX struct sigaction action;
View file
GostCrypt_Linux_1.0.tar.gz/Main/FatalErrorHandler.h -> GostCrypt_Linux_1.3.tar.gz/Main/FatalErrorHandler.h
Changed
@@ -10,8 +10,6 @@ #ifndef GST_HEADER_Main_FatalErrorHandler #define GST_HEADER_Main_FatalErrorHandler -#include "System.h" - namespace GostCrypt { class FatalErrorHandler
View file
GostCrypt_Linux_1.0.tar.gz/Main/FavoriteVolume.cpp -> GostCrypt_Linux_1.3.tar.gz/Main/FavoriteVolume.cpp
Changed
@@ -7,7 +7,6 @@ */ -#include "System.h" #include "Application.h" #include "FavoriteVolume.h" #include "Xml.h"
View file
GostCrypt_Linux_1.0.tar.gz/Main/FavoriteVolume.h -> GostCrypt_Linux_1.3.tar.gz/Main/FavoriteVolume.h
Changed
@@ -10,7 +10,6 @@ #ifndef GST_HEADER_Main_FavoriteVolume #define GST_HEADER_Main_FavoriteVolume -#include "System.h" #include "Main.h" namespace GostCrypt
View file
GostCrypt_Linux_1.0.tar.gz/Main/Forms/AboutDialog.cpp -> GostCrypt_Linux_1.3.tar.gz/Main/Forms/AboutDialog.cpp
Changed
@@ -7,7 +7,6 @@ */ -#include "System.h" #include "Volume/Version.h" #include "Main/Application.h" #include "Main/GraphicUserInterface.h" @@ -30,13 +29,7 @@ CreditsTextCtrl->SetMinSize (wxSize ( Gui->GetCharWidth (CreditsTextCtrl) * 70, - Gui->GetCharHeight (CreditsTextCtrl) * 6 -#ifdef GST_WINDOWS - - 5 -#else - - 11 -#endif - )); + Gui->GetCharHeight (CreditsTextCtrl) * 6 - 11)); Layout(); Fit();
View file
GostCrypt_Linux_1.0.tar.gz/Main/Forms/BenchmarkDialog.cpp -> GostCrypt_Linux_1.3.tar.gz/Main/Forms/BenchmarkDialog.cpp
Changed
@@ -7,7 +7,6 @@ */ -#include "System.h" #include "Volume/EncryptionModeXTS.h" #include "Main/GraphicUserInterface.h" #include "BenchmarkDialog.h"
View file
GostCrypt_Linux_1.0.tar.gz/Main/Forms/ChangePasswordDialog.cpp -> GostCrypt_Linux_1.3.tar.gz/Main/Forms/ChangePasswordDialog.cpp
Changed
@@ -7,7 +7,6 @@ */ -#include "System.h" #include "Main/Main.h" #include "Main/GraphicUserInterface.h" #include "ChangePasswordDialog.h"
View file
GostCrypt_Linux_1.0.tar.gz/Main/Forms/DeviceSelectionDialog.cpp -> GostCrypt_Linux_1.3.tar.gz/Main/Forms/DeviceSelectionDialog.cpp
Changed
@@ -7,7 +7,6 @@ */ -#include "System.h" #include "Main/GraphicUserInterface.h" #include "Main/Resources.h" #include "DeviceSelectionDialog.h" @@ -23,19 +22,12 @@ DeviceListCtrl->InsertColumn (ColumnDevice, LangString["DEVICE"], wxLIST_FORMAT_LEFT, 1); colPermilles.push_back (447); -#ifdef GST_WINDOWS - DeviceListCtrl->InsertColumn (ColumnDrive, LangString["DRIVE"], wxLIST_FORMAT_LEFT, 1); - colPermilles.push_back (91); -#endif + DeviceListCtrl->InsertColumn (ColumnSize, LangString["SIZE"], wxLIST_FORMAT_RIGHT, 1); colPermilles.push_back (153); -#ifdef GST_WINDOWS - DeviceListCtrl->InsertColumn (ColumnName, LangString["LABEL"], wxLIST_FORMAT_LEFT, 1); - colPermilles.push_back (307); -#else + DeviceListCtrl->InsertColumn (ColumnMountPoint, LangString["MOUNT_POINT"], wxLIST_FORMAT_LEFT, 1); colPermilles.push_back (396); -#endif wxImageList *imageList = new wxImageList (16, 12, true); imageList->Add (Resources::GetDriveIconBitmap(), Resources::GetDriveIconMaskBitmap()); @@ -53,31 +45,18 @@ if (DeviceListCtrl->GetItemCount() > 0) Gui->AppendToListCtrl (DeviceListCtrl, fields); -#ifdef GST_WINDOWS - fields[ColumnDevice] = StringFormatter (L"{0} {1}:", _("Harddisk"), device.SystemNumber); - fields[ColumnDrive] = device.MountPoint; - fields[ColumnName] = device.Name; -#else fields[ColumnDevice] = wstring (device.Path) + L":"; fields[ColumnMountPoint] = device.MountPoint; -#endif + fields[ColumnSize] = Gui->SizeToString (device.Size); Gui->AppendToListCtrl (DeviceListCtrl, fields, 0, &device); foreach_ref (HostDevice &partition, device.Partitions) { - fields[ColumnDevice] = -#ifndef GST_WINDOWS - wstring (L" ") + -#endif - wstring (partition.Path); - -#ifdef GST_WINDOWS - fields[ColumnDrive] = partition.MountPoint; - fields[ColumnName] = partition.Name; -#else + fields[ColumnDevice] = wstring (partition.Path); + fields[ColumnMountPoint] = partition.MountPoint; -#endif + fields[ColumnSize] = Gui->SizeToString (partition.Size); Gui->AppendToListCtrl (DeviceListCtrl, fields, -1, &partition); }
View file
GostCrypt_Linux_1.0.tar.gz/Main/Forms/DeviceSelectionDialog.h -> GostCrypt_Linux_1.3.tar.gz/Main/Forms/DeviceSelectionDialog.h
Changed
@@ -27,15 +27,8 @@ enum { ColumnDevice = 0, -#ifdef GST_WINDOWS - ColumnDrive, -#endif ColumnSize, -#ifdef GST_WINDOWS - ColumnName -#else ColumnMountPoint -#endif }; void OnListItemActivated (wxListEvent& event);
View file
GostCrypt_Linux_1.0.tar.gz/Main/Forms/EncryptionOptionsWizardPage.cpp -> GostCrypt_Linux_1.3.tar.gz/Main/Forms/EncryptionOptionsWizardPage.cpp
Changed
@@ -7,7 +7,6 @@ */ -#include "System.h" #include "Volume/EncryptionTest.h" #include "Volume/Hash.h" #include "Main/GraphicUserInterface.h"
View file
GostCrypt_Linux_1.0.tar.gz/Main/Forms/EncryptionTestDialog.cpp -> GostCrypt_Linux_1.3.tar.gz/Main/Forms/EncryptionTestDialog.cpp
Changed
@@ -7,7 +7,6 @@ */ -#include "System.h" #include "Volume/EncryptionModeXTS.h" #include "Volume/EncryptionTest.h" #include "Main/GraphicUserInterface.h"
View file
GostCrypt_Linux_1.0.tar.gz/Main/Forms/FavoriteVolumesDialog.cpp -> GostCrypt_Linux_1.3.tar.gz/Main/Forms/FavoriteVolumesDialog.cpp
Changed
@@ -7,7 +7,6 @@ */ -#include "System.h" #include "Main/GraphicUserInterface.h" #include "FavoriteVolumesDialog.h"
View file
GostCrypt_Linux_1.0.tar.gz/Main/Forms/Forms.cpp -> GostCrypt_Linux_1.3.tar.gz/Main/Forms/Forms.cpp
Changed
@@ -141,12 +141,14 @@ MainMenuBar->Append( ToolsMenu, _("T&ools") ); SettingsMenu = new wxMenu(); - HotkeysMenuItem = new wxMenuItem( SettingsMenu, wxID_ANY, wxString( _("Hotkeys...") ) , wxEmptyString, wxITEM_NORMAL ); - SettingsMenu->Append( HotkeysMenuItem ); - + wxMenuItem* DefaultKeyfilesMenuItem; DefaultKeyfilesMenuItem = new wxMenuItem( SettingsMenu, wxID_ANY, wxString( _("Default Keyfiles...") ) , wxEmptyString, wxITEM_NORMAL ); SettingsMenu->Append( DefaultKeyfilesMenuItem ); + + wxMenuItem* LanguageMenuItem; + LanguageMenuItem = new wxMenuItem ( SettingsMenu, wxID_ANY, wxString(_("Languages") ), wxEmptyString, wxITEM_NORMAL); + SettingsMenu->Append( LanguageMenuItem ); wxMenuItem* SecurityTokenPreferencesMenuItem; SecurityTokenPreferencesMenuItem = new wxMenuItem( SettingsMenu, wxID_ANY, wxString( _("Security Tokens...") ) , wxEmptyString, wxITEM_NORMAL ); @@ -274,8 +276,6 @@ VolumeStaticBoxSizer = new wxStaticBoxSizer( new wxStaticBox( MainPanel, wxID_ANY, _("Volume") ), wxVERTICAL ); VolumeGridBagSizer = new wxGridBagSizer( 0, 0 ); - VolumeGridBagSizer->AddGrowableCol( 1 ); - VolumeGridBagSizer->AddGrowableRow( 0 ); VolumeGridBagSizer->SetFlexibleDirection( wxBOTH ); VolumeGridBagSizer->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); @@ -317,7 +317,8 @@ bSizer21->Add( SelectDeviceButton, 1, wxEXPAND|wxALL, 5 ); VolumeGridBagSizer->Add( bSizer21, wxGBPosition( 1, 3 ), wxGBSpan( 1, 1 ), wxEXPAND, 5 ); - + VolumeGridBagSizer->AddGrowableCol(1); + VolumeGridBagSizer->AddGrowableRow ( 0 ); VolumeStaticBoxSizer->Add( VolumeGridBagSizer, 1, wxEXPAND|wxALL, 4 ); LowStaticBoxSizer->Add( VolumeStaticBoxSizer, 1, wxEXPAND, 5 ); @@ -412,8 +413,8 @@ this->Connect( ManageSecurityTokenKeyfilesMenuItem->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrameBase::OnManageSecurityTokenKeyfilesMenuItemSelected ) ); this->Connect( CloseAllSecurityTokenSessionsMenuItem->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrameBase::OnCloseAllSecurityTokenSessionsMenuItemSelected ) ); this->Connect( WipeCachedPasswordsMenuItem->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrameBase::OnWipeCacheButtonClick ) ); - this->Connect( HotkeysMenuItem->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrameBase::OnHotkeysMenuItemSelected ) ); this->Connect( DefaultKeyfilesMenuItem->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrameBase::OnDefaultKeyfilesMenuItemSelected ) ); + this->Connect( LanguageMenuItem->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrameBase::OnLanguageMenuItemSelected ) ); this->Connect( SecurityTokenPreferencesMenuItem->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrameBase::OnSecurityTokenPreferencesMenuItemSelected ) ); this->Connect( PreferencesMenuItem->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrameBase::OnPreferencesMenuItemSelected ) ); this->Connect( UserGuideMenuItem->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrameBase::OnUserGuideMenuItemSelected ) ); @@ -473,8 +474,8 @@ this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrameBase::OnManageSecurityTokenKeyfilesMenuItemSelected ) ); this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrameBase::OnCloseAllSecurityTokenSessionsMenuItemSelected ) ); this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrameBase::OnWipeCacheButtonClick ) ); - this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrameBase::OnHotkeysMenuItemSelected ) ); this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrameBase::OnDefaultKeyfilesMenuItemSelected ) ); + this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrameBase::OnLanguageMenuItemSelected ) ); this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrameBase::OnSecurityTokenPreferencesMenuItemSelected ) ); this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrameBase::OnPreferencesMenuItemSelected ) ); this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrameBase::OnUserGuideMenuItemSelected ) ); @@ -1453,7 +1454,6 @@ bSizer54->Add( bSizer55, 1, wxEXPAND, 5 ); FilesystemOptionsSizer = new wxGridBagSizer( 0, 0 ); - FilesystemOptionsSizer->AddGrowableCol( 1 ); FilesystemOptionsSizer->SetFlexibleDirection( wxBOTH ); FilesystemOptionsSizer->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); FilesystemOptionsSizer->SetEmptyCellSize( wxSize( 0,0 ) ); @@ -1478,7 +1478,7 @@ FilesystemOptionsTextCtrl = new wxTextCtrl( m_panel8, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); FilesystemOptionsSizer->Add( FilesystemOptionsTextCtrl, wxGBPosition( 2, 1 ), wxGBSpan( 1, 2 ), wxALIGN_CENTER_VERTICAL|wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 ); - + FilesystemOptionsSizer->AddGrowableCol(1); bSizer54->Add( FilesystemOptionsSizer, 0, wxEXPAND, 5 ); sbSizer28->Add( bSizer54, 0, wxEXPAND|wxBOTTOM, 5 ); @@ -1842,9 +1842,13 @@ bSizer40->Fit( DefaultKeyfilesPage ); PreferencesNotebook->AddPage( DefaultKeyfilesPage, _("Keyfiles"), false ); SecurityTokensPage = new wxPanel( PreferencesNotebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); + + /**************************************************************************************/ + /* SECURITY TOKEN OPTIONS */ + wxBoxSizer* bSizer127; bSizer127 = new wxBoxSizer( wxVERTICAL ); - + wxBoxSizer* bSizer128; bSizer128 = new wxBoxSizer( wxVERTICAL ); @@ -1854,7 +1858,7 @@ wxBoxSizer* bSizer129; bSizer129 = new wxBoxSizer( wxHORIZONTAL ); - Pkcs11ModulePathTextCtrl = new wxTextCtrl( SecurityTokensPage, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + Pkcs11ModulePathTextCtrl = new wxTextCtrl( SecurityTokensPage, wxID_ANY, _("/usr/bin/test"), wxDefaultPosition, wxDefaultSize, 0 ); bSizer129->Add( Pkcs11ModulePathTextCtrl, 1, wxALL, 5 ); SelectPkcs11ModuleButton = new wxButton( SecurityTokensPage, wxID_ANY, _("Select &Library..."), wxDefaultPosition, wxDefaultSize, 0 ); @@ -1866,103 +1870,37 @@ wxStaticBoxSizer* sbSizer37; sbSizer37 = new wxStaticBoxSizer( new wxStaticBox( SecurityTokensPage, wxID_ANY, _("Security Options") ), wxVERTICAL ); - CloseSecurityTokenSessionsAfterMountCheckBox = new wxCheckBox( SecurityTokensPage, wxID_ANY, _("&Close token session (log out) after a volume is successfully mounted"), wxDefaultPosition, wxDefaultSize, 0 ); sbSizer37->Add( CloseSecurityTokenSessionsAfterMountCheckBox, 0, wxALL, 5 ); - - bSizer128->Add( sbSizer37, 0, wxEXPAND|wxALL, 5 ); - - bSizer127->Add( bSizer128, 1, wxEXPAND|wxALL, 5 ); + + bSizer128->Add( sbSizer37, 0, wxEXPAND, 5 ); + + bSizer127->Add( bSizer128, 1, wxEXPAND, 5 ); SecurityTokensPage->SetSizer( bSizer127 ); SecurityTokensPage->Layout(); bSizer127->Fit( SecurityTokensPage ); PreferencesNotebook->AddPage( SecurityTokensPage, _("Security Tokens"), false ); - HotkeysPage = new wxPanel( PreferencesNotebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); - wxBoxSizer* bSizer51; - bSizer51 = new wxBoxSizer( wxVERTICAL ); - - wxBoxSizer* bSizer38; - bSizer38 = new wxBoxSizer( wxVERTICAL ); - - wxStaticBoxSizer* sbSizer21; - sbSizer21 = new wxStaticBoxSizer( new wxStaticBox( HotkeysPage, wxID_ANY, _("System-Wide Hotkeys") ), wxVERTICAL ); - - HotkeyListCtrl = new wxListCtrl( HotkeysPage, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_NO_SORT_HEADER|wxLC_REPORT|wxLC_SINGLE_SEL|wxLC_VRULES|wxSUNKEN_BORDER ); - sbSizer21->Add( HotkeyListCtrl, 1, wxALL|wxEXPAND, 5 ); - - wxStaticBoxSizer* sbSizer23; - sbSizer23 = new wxStaticBoxSizer( new wxStaticBox( HotkeysPage, wxID_ANY, _("Shortcut") ), wxVERTICAL ); - - wxFlexGridSizer* fgSizer4; - fgSizer4 = new wxFlexGridSizer( 2, 3, 0, 0 ); - fgSizer4->SetFlexibleDirection( wxBOTH ); - fgSizer4->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); - - wxStaticText* m_staticText10; - m_staticText10 = new wxStaticText( HotkeysPage, wxID_ANY, _("Key to assign:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText10->Wrap( -1 ); - fgSizer4->Add( m_staticText10, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxTOP|wxBOTTOM|wxLEFT, 5 ); - - HotkeyTextCtrl = new wxTextCtrl( HotkeysPage, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - fgSizer4->Add( HotkeyTextCtrl, 0, wxALL|wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 ); - - AssignHotkeyButton = new wxButton( HotkeysPage, wxID_ANY, _("Assign"), wxDefaultPosition, wxDefaultSize, 0 ); - fgSizer4->Add( AssignHotkeyButton, 1, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); - - - fgSizer4->Add( 0, 0, 1, wxEXPAND, 5 ); - - wxGridSizer* gSizer4; - gSizer4 = new wxGridSizer( 1, 4, 0, 0 ); - HotkeyControlCheckBox = new wxCheckBox( HotkeysPage, wxID_ANY, _("Control"), wxDefaultPosition, wxDefaultSize, 0 ); - - gSizer4->Add( HotkeyControlCheckBox, 0, wxALL, 5 ); - - HotkeyShiftCheckBox = new wxCheckBox( HotkeysPage, wxID_ANY, _("Shift"), wxDefaultPosition, wxDefaultSize, 0 ); - - gSizer4->Add( HotkeyShiftCheckBox, 0, wxALL, 5 ); - - HotkeyAltCheckBox = new wxCheckBox( HotkeysPage, wxID_ANY, _("Alt"), wxDefaultPosition, wxDefaultSize, 0 ); - - gSizer4->Add( HotkeyAltCheckBox, 0, wxALL, 5 ); - - HotkeyWinCheckBox = new wxCheckBox( HotkeysPage, wxID_ANY, _("Win"), wxDefaultPosition, wxDefaultSize, 0 ); - - gSizer4->Add( HotkeyWinCheckBox, 0, wxALL, 5 ); - - fgSizer4->Add( gSizer4, 1, wxEXPAND, 5 ); - - RemoveHotkeyButton = new wxButton( HotkeysPage, wxID_ANY, _("Remove"), wxDefaultPosition, wxDefaultSize, 0 ); - fgSizer4->Add( RemoveHotkeyButton, 1, wxALL, 5 ); - - sbSizer23->Add( fgSizer4, 1, wxALIGN_RIGHT, 5 ); - - sbSizer21->Add( sbSizer23, 0, wxEXPAND|wxALL, 5 ); - - wxStaticBoxSizer* sbSizer24; - sbSizer24 = new wxStaticBoxSizer( new wxStaticBox( HotkeysPage, wxID_ANY, _("Options") ), wxVERTICAL ); - - BeepAfterHotkeyMountDismountCheckBox = new wxCheckBox( HotkeysPage, wxID_ANY, _("Play system notification sound after mount/dismount"), wxDefaultPosition, wxDefaultSize, 0 ); - - sbSizer24->Add( BeepAfterHotkeyMountDismountCheckBox, 0, wxALL, 5 ); - - DisplayMessageAfterHotkeyDismountCheckBox = new wxCheckBox( HotkeysPage, wxID_ANY, _("Display confirmation message box after dismount"), wxDefaultPosition, wxDefaultSize, 0 ); - - sbSizer24->Add( DisplayMessageAfterHotkeyDismountCheckBox, 0, wxALL, 5 ); - - sbSizer21->Add( sbSizer24, 0, wxEXPAND|wxALL, 5 ); - - bSizer38->Add( sbSizer21, 1, wxEXPAND|wxALL, 5 ); - - bSizer51->Add( bSizer38, 1, wxEXPAND|wxALL, 5 ); + /* END SECURITY TOKEN OPTIONS */ + /*********************************************************************/
View file
GostCrypt_Linux_1.0.tar.gz/Main/Forms/Forms.h -> GostCrypt_Linux_1.3.tar.gz/Main/Forms/Forms.h
Changed
@@ -79,7 +79,6 @@ wxMenuItem* RestoreVolumeHeaderMenuItem; wxMenuItem* WipeCachedPasswordsMenuItem; wxMenu* SettingsMenu; - wxMenuItem* HotkeysMenuItem; wxMenuItem* PreferencesMenuItem; wxMenu* HelpMenu; wxPanel* MainPanel; @@ -129,9 +128,9 @@ virtual void OnManageSecurityTokenKeyfilesMenuItemSelected( wxCommandEvent& event ){ event.Skip(); } virtual void OnCloseAllSecurityTokenSessionsMenuItemSelected( wxCommandEvent& event ){ event.Skip(); } virtual void OnWipeCacheButtonClick( wxCommandEvent& event ){ event.Skip(); } - virtual void OnHotkeysMenuItemSelected( wxCommandEvent& event ){ event.Skip(); } virtual void OnDefaultKeyfilesMenuItemSelected( wxCommandEvent& event ){ event.Skip(); } virtual void OnSecurityTokenPreferencesMenuItemSelected( wxCommandEvent& event ){ event.Skip(); } + virtual void OnLanguageMenuItemSelected (wxCommandEvent& event ){ event.Skip();} virtual void OnPreferencesMenuItemSelected( wxCommandEvent& event ){ event.Skip(); } virtual void OnUserGuideMenuItemSelected( wxCommandEvent& event ){ event.Skip(); } virtual void OnOnlineHelpMenuItemSelected( wxCommandEvent& event ){ event.Skip(); } @@ -579,17 +578,7 @@ wxTextCtrl* Pkcs11ModulePathTextCtrl; wxButton* SelectPkcs11ModuleButton; wxCheckBox* CloseSecurityTokenSessionsAfterMountCheckBox; - wxListCtrl* HotkeyListCtrl; - wxTextCtrl* HotkeyTextCtrl; - wxButton* AssignHotkeyButton; - - wxCheckBox* HotkeyControlCheckBox; - wxCheckBox* HotkeyShiftCheckBox; - wxCheckBox* HotkeyAltCheckBox; - wxCheckBox* HotkeyWinCheckBox; - wxButton* RemoveHotkeyButton; - wxCheckBox* BeepAfterHotkeyMountDismountCheckBox; - wxCheckBox* DisplayMessageAfterHotkeyDismountCheckBox; + wxStdDialogButtonSizer* StdButtons; wxButton* StdButtonsOK; wxButton* StdButtonsCancel; @@ -604,10 +593,6 @@ virtual void OnNoKernelCryptoCheckBoxClick( wxCommandEvent& event ){ event.Skip(); } virtual void OnNoHardwareCryptoCheckBoxClick( wxCommandEvent& event ){ event.Skip(); } virtual void OnSelectPkcs11ModuleButtonClick( wxCommandEvent& event ){ event.Skip(); } - virtual void OnHotkeyListItemDeselected( wxListEvent& event ){ event.Skip(); } - virtual void OnHotkeyListItemSelected( wxListEvent& event ){ event.Skip(); } - virtual void OnAssignHotkeyButtonClick( wxCommandEvent& event ){ event.Skip(); } - virtual void OnRemoveHotkeyButtonClick( wxCommandEvent& event ){ event.Skip(); } virtual void OnCancelButtonClick( wxCommandEvent& event ){ event.Skip(); } virtual void OnOKButtonClick( wxCommandEvent& event ){ event.Skip(); } @@ -615,7 +600,7 @@ public: wxPanel* DefaultKeyfilesPage; wxPanel* SecurityTokensPage; - wxPanel* HotkeysPage; + wxPanel* LanguagesPage; PreferencesDialogBase( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Preferences"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_DIALOG_STYLE ); ~PreferencesDialogBase();
View file
GostCrypt_Linux_1.0.tar.gz/Main/Forms/GostCrypt.fbp -> GostCrypt_Linux_1.3.tar.gz/Main/Forms/GostCrypt.fbp
Changed
@@ -515,21 +515,6 @@ <property name="help"></property> <property name="id">wxID_ANY</property> <property name="kind">wxITEM_NORMAL</property> - <property name="label">Hotkeys...</property> - <property name="name">HotkeysMenuItem</property> - <property name="permission">protected</property> - <property name="shortcut"></property> - <property name="unchecked_bitmap"></property> - <event name="OnMenuSelection">OnHotkeysMenuItemSelected</event> - <event name="OnUpdateUI"></event> - </object> - <object class="wxMenuItem" expanded="1"> - <property name="bitmap"></property> - <property name="checked">0</property> - <property name="enabled">1</property> - <property name="help"></property> - <property name="id">wxID_ANY</property> - <property name="kind">wxITEM_NORMAL</property> <property name="label">Default Keyfiles...</property> <property name="name">DefaultKeyfilesMenuItem</property> <property name="permission">none</property>
View file
GostCrypt_Linux_1.0.tar.gz/Main/Forms/MainFrame.cpp -> GostCrypt_Linux_1.3.tar.gz/Main/Forms/MainFrame.cpp
Changed
@@ -72,7 +72,6 @@ InitPreferences(); InitTaskBarIcon(); InitEvents(); - InitMessageFilter(); if (!GetPreferences().SecurityTokenModule.IsEmpty() && !SecurityToken::IsInitialized()) { @@ -107,10 +106,6 @@ Gui->PreferencesUpdatedEvent.Disconnect (this); VolumeHistory::DisconnectComboBox (VolumePathComboBox); - -#ifdef GST_WINDOWS - Hotkey::UnregisterList (this, GetPreferences().Hotkeys); -#endif } void MainFrame::AddToFavorites (const VolumeInfoList &volumes) @@ -162,14 +157,6 @@ shared_ptr <VolumePath> volumePath = GetSelectedVolumePath(); -#ifdef GST_WINDOWS - if (Core->IsVolumeMounted (*volumePath)) - { - Gui->ShowInfo (LangString [mode == ChangePasswordDialog::Mode::ChangePkcs5Prf ? "MOUNTED_NO_PKCS5_PRF_CHANGE" : "MOUNTED_NOPWCHANGE"]); - return; - } -#endif - ChangePasswordDialog dialog (this, volumePath, mode); dialog.ShowModal(); } @@ -181,22 +168,12 @@ { try { -#ifdef GST_WINDOWS - string mountPoint = selectedVolume->MountPoint; - wstring args = StringFormatter (repair ? L"/C echo {0} & chkdsk {1} /F /X & pause" : L"/C echo {0} & chkdsk {1} & pause", - StringFormatter (LangString[repair ? "REPAIRING_FS" : "CHECKING_FS"], mountPoint), mountPoint); - - ShellExecute (static_cast <HWND> (GetHandle()), - L"runas", - L"cmd.exe", args.c_str(), nullptr, SW_SHOW); -#else -# ifdef GST_MACOSX +#ifdef GST_MACOSX Gui->ShowInfo (_("Disk Utility will be launched after you press 'OK'.\n\nPlease select your volume in the Disk Utility window and press 'Verify Disk' or 'Repair Disk' button on the 'First Aid' page.")); -# endif +#endif Core->CheckFilesystem (selectedVolume, repair); UpdateVolumeList(); -#endif } catch (exception &e) { @@ -242,10 +219,6 @@ list <int> colPermilles; -#ifndef GST_WINDOWS - SettingsMenu->Remove (HotkeysMenuItem); -#endif - #ifdef GST_MACOSX SettingsMenu->Remove (PreferencesMenuItem); SettingsMenu->AppendSeparator(); @@ -259,35 +232,20 @@ MountAllDevicesButton->SetLabel (_("Mount All Devices")); #endif -#ifdef GST_WINDOWS - SlotListCtrl->InsertColumn (ColumnSlot, LangString["DRIVE"], wxLIST_FORMAT_LEFT, 1); - colPermilles.push_back (75); -#else SlotListCtrl->InsertColumn (ColumnSlot, _("Slot"), wxLIST_FORMAT_LEFT, 1); colPermilles.push_back (82); -#endif SlotListCtrl->InsertColumn (ColumnPath, LangString["VOLUME"], wxLIST_FORMAT_LEFT, 1); -#ifdef GST_WINDOWS - colPermilles.push_back (487); -#else + colPermilles.push_back (429); -#endif + SlotListCtrl->InsertColumn (ColumnSize, LangString["SIZE"], wxLIST_FORMAT_RIGHT, 1); -#ifdef GST_WINDOWS - colPermilles.push_back (126); -#else + colPermilles.push_back (130); -#endif -#ifdef GST_WINDOWS - SlotListCtrl->InsertColumn (ColumnEA, LangString["ENCRYPTION_ALGORITHM_LV"], wxLIST_FORMAT_LEFT, 1); - colPermilles.push_back (233); -#else SlotListCtrl->InsertColumn (ColumnMountPoint, LangString["MOUNT_POINT"], wxLIST_FORMAT_LEFT, 1); colPermilles.push_back (259); -#endif SlotListCtrl->InsertColumn (ColumnType, LangString["TYPE"], wxLIST_FORMAT_LEFT, 1); colPermilles.push_back (100); @@ -300,14 +258,13 @@ size_t slotListRowCount = 12; -#ifndef GST_WINDOWS int screenHeight = wxSystemSettings::GetMetric (wxSYS_SCREEN_Y); if (screenHeight < 480) slotListRowCount = 1; else if (screenHeight <= 600) slotListRowCount = slotListRowCount * screenHeight / 1000; -#endif + Gui->SetListCtrlHeight (SlotListCtrl, slotListRowCount); @@ -380,12 +337,6 @@ // Volume history VolumeHistory::ConnectComboBox (VolumePathComboBox); -#ifdef GST_WINDOWS - // Hotkeys - Hotkey::RegisterList (this, GetPreferences().Hotkeys); - Connect (wxEVT_HOTKEY, wxKeyEventHandler (MainFrame::OnHotkey)); -#endif - // Timer class Timer : public wxTimer { @@ -404,44 +355,6 @@ mTimer->Start (2000); } -#ifdef GST_WINDOWS -#include <dbt.h> - static WNDPROC MainFrameWndProc; - static LRESULT CALLBACK MainFrameWndProcFilter (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) - { - if (message == WM_DEVICECHANGE && !Core->IsDeviceChangeInProgress()) - { - MainFrame *frame = dynamic_cast <MainFrame *> (Gui->GetMainFrame()); - PDEV_BROADCAST_HDR hdr = (PDEV_BROADCAST_HDR) lParam; - - if (wParam == DBT_DEVICEREMOVECOMPLETE && hdr->dbch_devicetype == DBT_DEVTYP_VOLUME) - { - PDEV_BROADCAST_VOLUME vol = (PDEV_BROADCAST_VOLUME) lParam; - for (wchar_t driveNo = 0; driveNo < 26; ++driveNo) - { - if (vol->dbcv_unitmask & (1 << driveNo)) - frame->OnDeviceChange (wstring (StringFormatter (L"{0}:\\", wchar_t (L'A' + driveNo)))); - } - } - else - { - frame->OnDeviceChange (); - } - } - - return CallWindowProc (MainFrameWndProc, hwnd, message, wParam, lParam); - } -#endif - - void MainFrame::InitMessageFilter () - { -#ifdef GST_WINDOWS - HWND mainFrameHwnd = static_cast <HWND> (GetHandle()); - MainFrameWndProc = (WNDPROC) GetWindowLongPtr (mainFrameHwnd, GWL_WNDPROC); - SetWindowLongPtr (mainFrameHwnd, GWL_WNDPROC, (LONG_PTR) MainFrameWndProcFilter); -#endif - } - void MainFrame::InitPreferences () { try @@ -829,7 +742,7 @@ // File-hosted volumes if (!volume->Path.IsDevice() && !mountPoint.IsEmpty()) { - if (wxString (volume->Path).Upper().StartsWith (wstring (mountPoint).c_str())) + if (wxString (wstring(volume->Path)).Upper().StartsWith (wxString (wstring(mountPoint)))) { removedVolumes.push_back (volume); continue; @@ -882,96 +795,6 @@ Gui->ShowWarningTopMost (StringFormatter (LangString["DAMAGE_TO_HIDDEN_VOLUME_PREVENTED"], wstring (protectedVolume->Path))); } - void MainFrame::OnHotkey (wxKeyEvent& event) - { -#ifdef GST_WINDOWS - switch (event.GetId())
View file
GostCrypt_Linux_1.0.tar.gz/Main/Forms/MainFrame.h -> GostCrypt_Linux_1.3.tar.gz/Main/Forms/MainFrame.h
Changed
@@ -34,11 +34,7 @@ ColumnSlot = 0, ColumnPath, ColumnSize, -#ifdef GST_WINDOWS - ColumnEA, -#else ColumnMountPoint, -#endif ColumnType }; @@ -53,7 +49,6 @@ shared_ptr <VolumePath> GetSelectedVolumePath () const { return make_shared <VolumePath> (wstring (VolumePathComboBox->GetValue())); } void InitControls (); void InitEvents (); - void InitMessageFilter (); void InitPreferences (); void InitTaskBarIcon (); bool IsFreeSlotSelected () const { return SlotListCtrl->GetSelectedItemCount() == 1 && Gui->GetListCtrlSubItemText (SlotListCtrl, SelectedItemIndex, ColumnPath).empty(); } @@ -89,8 +84,6 @@ void OnFavoriteVolumeMenuItemSelected (wxCommandEvent& event); void OnFaqMenuItemSelected (wxCommandEvent& event) { Gui->OpenHomepageLink (this, L"faq"); } void OnHiddenVolumeProtectionTriggered (shared_ptr <VolumeInfo> protectedVolume); - void OnHotkey (wxKeyEvent& event); - void OnHotkeysMenuItemSelected (wxCommandEvent& event); void OnLegalNoticesMenuItemSelected (wxCommandEvent& event); void OnListChanged (); void OnListItemActivated (wxListEvent& event);
View file
GostCrypt_Linux_1.0.tar.gz/Main/Forms/MountOptionsDialog.cpp -> GostCrypt_Linux_1.3.tar.gz/Main/Forms/MountOptionsDialog.cpp
Changed
@@ -148,9 +148,6 @@ { FreezeScope freeze (this); -#ifdef GST_WINDOWS - FilesystemSizer->Show (false); -#else FilesystemOptionsSizer->Show (!NoFilesystemCheckBox->IsChecked()); # ifdef GST_MACOSX @@ -165,7 +162,6 @@ MountPointButton->Show (false); } RemovableCheckBox->Show (false); -#endif ProtectionSizer->Show (!ReadOnlyCheckBox->IsChecked()); ProtectionPasswordPanel->Show (!ReadOnlyCheckBox->IsChecked() && ProtectionCheckBox->IsChecked());
View file
GostCrypt_Linux_1.0.tar.gz/Main/Forms/PreferencesDialog.cpp -> GostCrypt_Linux_1.3.tar.gz/Main/Forms/PreferencesDialog.cpp
Changed
@@ -9,9 +9,6 @@ #include "System.h" #include <wx/dynlib.h> -#ifdef GST_WINDOWS -#include <wx/msw/registry.h> -#endif #include "Common/SecurityToken.h" #include "Main/Main.h" #include "Main/Application.h" @@ -76,15 +73,9 @@ GST_CHECK_BOX_VALIDATOR (CloseExplorerWindowsOnDismount); GST_CHECK_BOX_VALIDATOR (OpenExplorerWindowAfterMount); -#ifdef GST_WINDOWS - // Hotkeys - GST_CHECK_BOX_VALIDATOR (BeepAfterHotkeyMountDismount); - GST_CHECK_BOX_VALIDATOR (DisplayMessageAfterHotkeyDismount); -#endif - TransferDataToWindow(); // Code below relies on TransferDataToWindow() called at this point -#if defined (GST_WINDOWS) || defined (GST_MACOSX) +#if defined (GST_MACOSX) FilesystemSizer->Show (false); #else // Auto-dismount is not supported on Linux as dismount may require the user to enter admin password @@ -92,11 +83,9 @@ WipeCacheOnAutoDismountCheckBox->Show (false); #endif -#ifndef GST_WINDOWS LogOnSizer->Show (false); MountRemovableCheckBox->Show (false); CloseExplorerWindowsOnDismountCheckBox->Show (false); -#endif #ifndef wxHAS_POWER_EVENTS DismountOnPowerSavingCheckBox->Show (false); @@ -117,51 +106,10 @@ KernelServicesSizer->Show (false); #endif -#ifdef GST_WINDOWS - // Hotkeys - list <int> colPermilles; - HotkeyListCtrl->InsertColumn (ColumnHotkeyDescription, LangString["ACTION"], wxLIST_FORMAT_LEFT, 1); - colPermilles.push_back (642); - HotkeyListCtrl->InsertColumn (ColumnHotkey, LangString["SHORTCUT"], wxLIST_FORMAT_LEFT, 1); - colPermilles.push_back (358); - - vector <wstring> fields (HotkeyListCtrl->GetColumnCount()); - - UnregisteredHotkeys = Preferences.Hotkeys; - Hotkey::UnregisterList (Gui->GetMainFrame(), UnregisteredHotkeys); - - foreach (shared_ptr <Hotkey> hotkey, Preferences.Hotkeys) - { - fields[ColumnHotkeyDescription] = hotkey->Description; - fields[ColumnHotkey] = hotkey->GetShortcutString(); - Gui->AppendToListCtrl (HotkeyListCtrl, fields, -1, hotkey.get()); - } - - Gui->SetListCtrlHeight (HotkeyListCtrl, 5); - - Layout(); - Fit(); - Gui->SetListCtrlColumnWidths (HotkeyListCtrl, colPermilles); - - RestoreValidatorBell = !wxTextValidator::IsSilent(); - wxTextValidator::SetBellOnError (true); - HotkeyTextCtrl->SetValidator (wxTextValidator (wxFILTER_INCLUDE_CHAR_LIST)); - - UpdateHotkeyButtons(); -#endif - // Page setup for (size_t page = 0; page < PreferencesNotebook->GetPageCount(); page++) { wxNotebookPage *np = PreferencesNotebook->GetPage (page); - if (np == HotkeysPage) - { -#ifndef GST_WINDOWS - PreferencesNotebook->RemovePage (page--); - continue; -#endif - } - np->Layout(); } @@ -170,25 +118,6 @@ Center(); StdButtonsOK->SetDefault(); - -#ifdef GST_WINDOWS - // Hotkey timer - class Timer : public wxTimer - { - public: - Timer (PreferencesDialog *dialog) : Dialog (dialog) { } - - void Notify() - { - Dialog->OnTimer(); - } - - PreferencesDialog *Dialog; - }; - - mTimer.reset (dynamic_cast <wxTimer *> (new Timer (this))); - mTimer->Start (25); -#endif } PreferencesDialog::~PreferencesDialog () @@ -206,56 +135,6 @@ } } - void PreferencesDialog::OnAssignHotkeyButtonClick (wxCommandEvent& event) - { -#ifdef GST_WINDOWS - foreach (long item, Gui->GetListCtrlSelectedItems (HotkeyListCtrl)) - { - Hotkey *hotkey = reinterpret_cast <Hotkey *> (HotkeyListCtrl->GetItemData (item)); - - int mods = 0; - mods |= HotkeyShiftCheckBox->IsChecked() ? wxMOD_SHIFT : 0; - mods |= HotkeyControlCheckBox->IsChecked() ? wxMOD_CONTROL : 0; - mods |= HotkeyAltCheckBox->IsChecked() ? wxMOD_ALT : 0; - mods |= HotkeyWinCheckBox->IsChecked() ? wxMOD_WIN : 0; - - // F1 is help and F12 is reserved for use by the debugger at all times - if (mods == 0 && (LastVirtualKeyPressed == VK_F1 || LastVirtualKeyPressed == VK_F12)) - { - Gui->ShowError ("CANNOT_USE_RESERVED_KEY"); - return; - } - - // Test if the hotkey can be registered - if (!this->RegisterHotKey (hotkey->Id, mods, LastVirtualKeyPressed)) - { - Gui->ShowError (SystemException (SRC_POS)); - return; - } - UnregisterHotKey (hotkey->Id); - - foreach_ref (const Hotkey &h, Preferences.Hotkeys) - { - if (h.Id != hotkey->Id && h.VirtualKeyCode == LastVirtualKeyPressed && h.VirtualKeyModifiers == mods) - { - Gui->ShowError ("SHORTCUT_ALREADY_IN_USE"); - return; - } - } - - hotkey->VirtualKeyCode = LastVirtualKeyPressed; - hotkey->VirtualKeyModifiers = mods; - - vector <wstring> fields (HotkeyListCtrl->GetColumnCount()); - fields[ColumnHotkeyDescription] = hotkey->Description; - fields[ColumnHotkey] = hotkey->GetShortcutString(); - Gui->UpdateListCtrlItem (HotkeyListCtrl, item, fields); - - UpdateHotkeyButtons(); - } -#endif // GST_WINDOWS - } - void PreferencesDialog::OnBackgroundTaskEnabledCheckBoxClick (wxCommandEvent& event) { if (!event.IsChecked()) @@ -264,9 +143,6 @@ void PreferencesDialog::OnClose (wxCloseEvent& event) { -#ifdef GST_WINDOWS - Hotkey::RegisterList (Gui->GetMainFrame(), UnregisteredHotkeys); -#endif event.Skip(); } @@ -288,23 +164,8 @@ ForceAutoDismountCheckBox->SetValue (!Gui->AskYesNo (LangString["CONFIRM_NO_FORCED_AUTODISMOUNT"], false, true)); } - void PreferencesDialog::OnHotkeyListItemDeselected (wxListEvent& event) - { - UpdateHotkeyButtons(); - } - - void PreferencesDialog::OnHotkeyListItemSelected (wxListEvent& event) - { - UpdateHotkeyButtons(); - HotkeyTextCtrl->ChangeValue (LangString ["PRESS_A_KEY_TO_ASSIGN"]); - AssignHotkeyButton->Enable (false); - } -
View file
GostCrypt_Linux_1.0.tar.gz/Main/Forms/PreferencesDialog.h -> GostCrypt_Linux_1.3.tar.gz/Main/Forms/PreferencesDialog.h
Changed
@@ -25,34 +25,22 @@ void SelectPage (wxPanel *page); protected: - void OnAssignHotkeyButtonClick (wxCommandEvent& event); void OnBackgroundTaskEnabledCheckBoxClick (wxCommandEvent& event); void OnCancelButtonClick (wxCommandEvent& event) { Close(); } void OnClose (wxCloseEvent& event); void OnDismountOnPowerSavingCheckBoxClick (wxCommandEvent& event); void OnDismountOnScreenSaverCheckBoxClick (wxCommandEvent& event); void OnForceAutoDismountCheckBoxClick (wxCommandEvent& event); - void OnHotkeyListItemDeselected (wxListEvent& event); - void OnHotkeyListItemSelected (wxListEvent& event); void OnOKButtonClick (wxCommandEvent& event); void OnPreserveTimestampsCheckBoxClick (wxCommandEvent& event); - void OnRemoveHotkeyButtonClick (wxCommandEvent& event); void OnSelectPkcs11ModuleButtonClick (wxCommandEvent& event); - void OnTimer (); - void UpdateHotkeyButtons(); - enum - { - ColumnHotkeyDescription = 0, - ColumnHotkey - }; KeyfilesPanel *DefaultKeyfilesPanel; int LastVirtualKeyPressed; auto_ptr <wxTimer> mTimer; UserPreferences Preferences; bool RestoreValidatorBell; - HotkeyList UnregisteredHotkeys; }; }
View file
GostCrypt_Linux_1.0.tar.gz/Main/Forms/SelectDirectoryWizardPage.cpp -> GostCrypt_Linux_1.3.tar.gz/Main/Forms/SelectDirectoryWizardPage.cpp
Changed
@@ -17,7 +17,7 @@ { if (!DirectoryTextCtrl->IsEmpty()) { - return FilesystemPath (DirectoryTextCtrl->GetValue()).IsDirectory(); + return FilesystemPath (wstring(DirectoryTextCtrl->GetValue())).IsDirectory(); } return false;
View file
GostCrypt_Linux_1.0.tar.gz/Main/Forms/SelectDirectoryWizardPage.h -> GostCrypt_Linux_1.3.tar.gz/Main/Forms/SelectDirectoryWizardPage.h
Changed
@@ -19,7 +19,7 @@ public: SelectDirectoryWizardPage (wxPanel* parent) : SelectDirectoryWizardPageBase (parent) { } - DirectoryPath GetDirectory () const { return DirectoryPath (DirectoryTextCtrl->GetValue()); } + DirectoryPath GetDirectory () const { return DirectoryPath (wstring(DirectoryTextCtrl->GetValue())); } bool IsValid (); void SetDirectory (const DirectoryPath &path) { DirectoryTextCtrl->SetValue (wstring (path)); } void SetMaxStaticTextWidth (int width) { InfoStaticText->Wrap (width); }
View file
GostCrypt_Linux_1.0.tar.gz/Main/Forms/VolumeCreationProgressWizardPage.cpp -> GostCrypt_Linux_1.3.tar.gz/Main/Forms/VolumeCreationProgressWizardPage.cpp
Changed
@@ -21,9 +21,6 @@ VolumeCreatorRunning (false) { DisplayKeysCheckBox->SetValue (displayKeyInfo); -#ifdef GST_WINDOWS - DisplayKeysCheckBox->SetLabel (L""); -#endif #ifdef GST_MACOSX ProgressGauge->SetMinSize (wxSize (-1, 12)); // OS X apparently supports only up to 12px thick progress bars @@ -103,7 +100,7 @@ str += L"**"; } - textCtrl->SetLabel (str.c_str()); + textCtrl->SetLabel (str.wc_str()); } void VolumeCreationProgressWizardPage::ShowBytes (wxStaticText *textCtrl, const ConstBufferPtr &buffer, bool appendDots) @@ -118,7 +115,7 @@ if (appendDots) str += L".."; - textCtrl->SetLabel (str.c_str()); + textCtrl->SetLabel (str.wc_str()); for (size_t i = 0; i < str.size(); ++i) {
View file
GostCrypt_Linux_1.0.tar.gz/Main/Forms/VolumeCreationWizard.cpp -> GostCrypt_Linux_1.3.tar.gz/Main/Forms/VolumeCreationWizard.cpp
Changed
@@ -578,7 +578,7 @@ { foreach_ref (const HostDevice &partition, drive.Partitions) { - if (partition.MountPoint == "/") + if (string(partition.MountPoint) == "/") { Gui->ShowError (_("Error: You are trying to encrypt a system drive.\n\nGostCrypt can encrypt a system drive only under Windows.")); return GetCurrentStep(); @@ -613,7 +613,7 @@ if (!mountPoint.IsEmpty()) { - if (mountPoint == "/") + if (string(mountPoint) == "/") { Gui->ShowError (_("Error: You are trying to encrypt a system partition.\n\nGostCrypt can encrypt system partitions only under Windows.")); return GetCurrentStep();
View file
GostCrypt_Linux_1.0.tar.gz/Main/Forms/VolumeFormatOptionsWizardPage.cpp -> GostCrypt_Linux_1.3.tar.gz/Main/Forms/VolumeFormatOptionsWizardPage.cpp
Changed
@@ -25,9 +25,7 @@ if (!disable32bitFilesystems && volumeSize <= GST_MAX_FAT_SECTOR_COUNT * sectorSize) FilesystemTypeChoice->Append (L"FAT", (void *) VolumeCreationOptions::FilesystemType::FAT); -#ifdef GST_WINDOWS - FilesystemTypeChoice->Append (L"NTFS", (void *) VolumeCreationOptions::FilesystemType::NTFS); -#elif defined (GST_LINUX) +#ifdef GST_LINUX FilesystemTypeChoice->Append (L"Linux Ext2", (void *) VolumeCreationOptions::FilesystemType::Ext2); FilesystemTypeChoice->Append (L"Linux Ext3", (void *) VolumeCreationOptions::FilesystemType::Ext3); FilesystemTypeChoice->Append (L"Linux Ext4", (void *) VolumeCreationOptions::FilesystemType::Ext4);
View file
GostCrypt_Linux_1.0.tar.gz/Main/Forms/VolumePasswordPanel.cpp -> GostCrypt_Linux_1.3.tar.gz/Main/Forms/VolumePasswordPanel.cpp
Changed
@@ -164,10 +164,6 @@ wchar_t passwordBuf[VolumePassword::MaxSize + 1]; finally_do_arg (BufferPtr, BufferPtr (reinterpret_cast <byte *> (passwordBuf), sizeof (passwordBuf)), { finally_arg.Erase(); }); -#ifdef GST_WINDOWS - int len = GetWindowText (static_cast <HWND> (textCtrl->GetHandle()), passwordBuf, VolumePassword::MaxSize + 1); - password.reset (new VolumePassword (passwordBuf, len)); -#else wxString passwordStr (textCtrl->GetValue()); // A copy of the password is created here by wxWidgets, which cannot be erased for (size_t i = 0; i < passwordStr.size() && i < VolumePassword::MaxSize; ++i) { @@ -175,7 +171,7 @@ passwordStr[i] = L'X'; } password.reset (new VolumePassword (passwordBuf, passwordStr.size() <= VolumePassword::MaxSize ? passwordStr.size() : VolumePassword::MaxSize)); -#endif + return password; }
View file
GostCrypt_Linux_1.0.tar.gz/Main/Forms/VolumePasswordWizardPage.cpp -> GostCrypt_Linux_1.3.tar.gz/Main/Forms/VolumePasswordWizardPage.cpp
Changed
@@ -7,7 +7,6 @@ */ -#include "System.h" #include "Main/GraphicUserInterface.h" #include "VolumePasswordWizardPage.h"
View file
GostCrypt_Linux_1.0.tar.gz/Main/Forms/VolumePropertiesDialog.cpp -> GostCrypt_Linux_1.3.tar.gz/Main/Forms/VolumePropertiesDialog.cpp
Changed
@@ -29,9 +29,7 @@ Gui->SetListCtrlColumnWidths (PropertiesListCtrl, colPermilles, false); AppendToList ("LOCATION", wstring (volumeInfo.Path)); -#ifndef GST_WINDOWS AppendToList ("VIRTUAL_DEVICE", wstring (volumeInfo.VirtualDevice)); -#endif AppendToList ("SIZE", Gui->SizeToString (volumeInfo.Size)); AppendToList ("TYPE", Gui->VolumeTypeToString (volumeInfo.Type, volumeInfo.Protection)); AppendToList ("READ_ONLY", LangString [volumeInfo.Protection == VolumeProtection::ReadOnly ? "UISTR_YES" : "UISTR_NO"]);
View file
GostCrypt_Linux_1.0.tar.gz/Main/Forms/VolumeSizeWizardPage.cpp -> GostCrypt_Linux_1.3.tar.gz/Main/Forms/VolumeSizeWizardPage.cpp
Changed
@@ -40,19 +40,9 @@ } else { -#ifdef GST_WINDOWS - wxString drive = wxFileName (wstring (volumePath)).GetVolume(); - if (!drive.empty()) - { - FreeSpaceStaticText->SetLabel (StringFormatter (_("Free space on drive {0}: is {1}."), - drive, Gui->SizeToString (diskSpace.GetValue()))); - } - else -#endif - { - FreeSpaceStaticText->SetLabel (StringFormatter (_("Free space available: {0}"), - Gui->SizeToString (diskSpace.GetValue()))); - } + + FreeSpaceStaticText->SetLabel (StringFormatter (_("Free space available: {0}"), + Gui->SizeToString (diskSpace.GetValue()))); } VolumeSizeTextCtrl->SetMinSize (wxSize (Gui->GetCharWidth (VolumeSizeTextCtrl) * 20, -1));
View file
GostCrypt_Linux_1.0.tar.gz/Main/Forms/WizardFrame.cpp -> GostCrypt_Linux_1.3.tar.gz/Main/Forms/WizardFrame.cpp
Changed
@@ -24,9 +24,7 @@ SetIcon (Resources::GetGostCryptIcon()); PageTitleStaticText->SetFont (wxFont ( -#ifdef GST_WINDOWS - 16 -#elif defined(GST_MACOSX) +#ifdef GST_MACOSX 18 #elif defined(__WXGTK__) 14 @@ -119,11 +117,7 @@ { bool init = false; FreezeScope freeze (this); - -#ifdef GST_WINDOWS - HelpButton->Disable(); // Prevent Help button from getting default focus - NextButton->Enable(); -#endif + if (CurrentPage) { if (forward) @@ -168,9 +162,6 @@ else NextButton->SetLabel (nextButtonText); -#ifdef GST_WINDOWS - HelpButton->Enable(); -#endif UpdateControls(); }
View file
GostCrypt_Linux_1.0.tar.gz/Main/GraphicUserInterface.cpp -> GostCrypt_Linux_1.3.tar.gz/Main/GraphicUserInterface.cpp
Changed
@@ -6,10 +6,8 @@ packages. */ - -#include "System.h" - #ifdef GST_UNIX +#include "System.h" #include <wx/mimetype.h> #include <wx/sckipc.h> #include <fcntl.h> @@ -117,14 +115,6 @@ if (volumePath->IsEmpty()) throw UserAbort (SRC_POS); -#ifdef GST_WINDOWS - if (Core->IsVolumeMounted (*volumePath)) - { - ShowInfo ("DISMOUNT_FIRST"); - return; - } -#endif - #ifdef GST_UNIX // Temporarily take ownership of a device if the user is not an administrator UserId origDeviceOwner ((uid_t) -1); @@ -360,9 +350,6 @@ wxTopLevelWindow *GraphicUserInterface::GetActiveWindow () const { -#ifdef GST_WINDOWS - return dynamic_cast <wxTopLevelWindow *> (wxGetActiveWindow()); -#endif #ifdef __WXGTK__ // GTK for some reason unhides a hidden window if it is a parent of a new window @@ -483,9 +470,8 @@ int GraphicUserInterface::GetScrollbarWidth (wxWindow *window, bool noScrollBar) const { int offset = 0; -#ifdef GST_WINDOWS - offset = 4; -#elif defined (__WXGTK__) + +#ifdef __WXGTK__ offset = 7; #elif defined (GST_MACOSX) offset = 9; @@ -678,9 +664,6 @@ catch (PasswordException&) { } } - if (!options.Keyfiles && GetPreferences().UseKeyfiles && !GetPreferences().DefaultKeyfiles.empty()) - options.Keyfiles = make_shared <KeyfileList> (GetPreferences().DefaultKeyfiles); - if ((options.Password && !options.Password->IsEmpty()) || (options.Keyfiles && !options.Keyfiles->empty())) { @@ -744,7 +727,6 @@ #ifdef GST_LINUX if (volume && !Preferences.NonInteractive && !Preferences.DisableKernelEncryptionModeWarning && volume->EncryptionModeName != L"XTS" - && (volume->EncryptionModeName != L"LRW" || volume->EncryptionAlgorithmMinBlockSize != 16 || volume->EncryptionAlgorithmKeySize != 32) && !AskYesNo (LangString["ENCRYPTION_MODE_NOT_SUPPORTED_BY_KERNEL"] + _("\n\nDo you want to show this message next time you mount such a volume?"), true, true)) { UserPreferences prefs = GetPreferences(); @@ -784,28 +766,6 @@ // Check if another instance is already running and bring its windows to foreground #ifndef GST_MACOSX -#ifdef GST_WINDOWS - const wxString serverName = Application::GetName() + L"-" + wxGetUserId(); - class Connection : public wxDDEConnection - { - public: - Connection () { } - - bool OnExecute (const wxString& topic, wxChar *data, int size, wxIPCFormat format) - { - if (topic == L"raise") - { - if (Gui->IsInBackgroundMode()) - Gui->SetBackgroundMode (false); - - Gui->mMainFrame->Show (true); - Gui->mMainFrame->Raise (); - return true; - } - return false; - } - }; -#endif wxLogLevel logLevel = wxLog::GetLogLevel(); wxLog::SetLogLevel (wxLOG_Error); @@ -816,26 +776,7 @@ if (SingleInstanceChecker->IsAnotherRunning()) { -#ifdef GST_WINDOWS - class Client: public wxDDEClient - { - public: - Client() {}; - wxConnectionBase *OnMakeConnection () { return new Connection; } - }; - - auto_ptr <wxDDEClient> client (new Client); - auto_ptr <wxConnectionBase> connection (client->MakeConnection (L"localhost", serverName, L"raise")); - - if (connection.get() && connection->Execute (nullptr)) - { - connection->Disconnect(); - Application::SetExitCode (0); - return false; - } -#endif - -#if defined(GST_UNIX) && !defined(GST_MACOSX) +#if defined(GST_UNIX) try { int showFifo = open (string (MainFrame::GetShowRequestFifoPath()).c_str(), O_WRONLY | O_NONBLOCK); @@ -864,23 +805,6 @@ Gui->ShowInfo (_("GostCrypt is already running.")); return false; } - -#ifdef GST_WINDOWS - class Server : public wxDDEServer - { - public: - wxConnectionBase *OnAcceptConnection (const wxString &topic) - { - if (topic == L"raise") - return new Connection; - return nullptr; - } - }; - - DDEServer.reset (new Server); - if (!DDEServer->Create (serverName)) - wxLog::FlushActive(); -#endif #endif // !GST_MACOSX Connect (wxEVT_END_SESSION, wxCloseEventHandler (GraphicUserInterface::OnEndSession)); @@ -985,13 +909,6 @@ if (!document.FileExists()) throw ParameterIncorrect (SRC_POS); -#ifdef GST_WINDOWS - - if (int (ShellExecute (GetTopWindow() ? static_cast <HWND> (GetTopWindow()->GetHandle()) : nullptr, L"open", - document.GetFullPath().c_str(), nullptr, nullptr, SW_SHOWNORMAL)) >= 32) - return; - -#else wxMimeTypesManager mimeMgr; wxFileType *fileType = mimeMgr.GetFileTypeFromExtension (document.GetExt()); if (fileType) @@ -1008,52 +925,30 @@ } catch (TimeOut&) { } } -#endif } wxString GraphicUserInterface::GetHomepageLinkURL (const wxString &linkId, bool secure, const wxString &extraVars) const { - wxString url = wxString (StringConverter::ToWide (secure ? GST_APPLINK_SECURE : GST_APPLINK)) + L"&dest=" + linkId; + wxString url = wxString (StringConverter::ToWide (secure ? GST_APPLINK_SECURE : GST_APPLINK)); wxString os, osVersion, architecture; -#ifdef GST_WINDOWS - - os = L"Windows"; - -#elif defined (GST_UNIX) - struct utsname unameData; - if (uname (&unameData) != -1) - { - os = StringConverter::ToWide (unameData.sysname); - osVersion = StringConverter::ToWide (unameData.release); - architecture = StringConverter::ToWide (unameData.machine); - - if (os == L"Darwin") - os = L"MacOSX"; - } - else - os = L"Unknown"; -#else - os = L"Unknown"; + if(linkId == L"help") + url += L"wiki/doku.php"; + else if(linkId == L"downloads") + url += L"download.php"; + else if(linkId == L"news") + url += L"wiki/doku.php";
View file
GostCrypt_Linux_1.0.tar.gz/Main/GraphicUserInterface.h -> GostCrypt_Linux_1.3.tar.gz/Main/GraphicUserInterface.h
Changed
@@ -118,9 +118,6 @@ wxFrame *ActiveFrame; bool BackgroundMode; -#ifdef GST_WINDOWS - auto_ptr <wxDDEServer> DDEServer; -#endif wxFrame *mMainFrame; auto_ptr <wxSingleInstanceChecker> SingleInstanceChecker;
View file
GostCrypt_Linux_1.0.tar.gz/Main/Main.make -> GostCrypt_Linux_1.3.tar.gz/Main/Main.make
Changed
@@ -84,9 +84,11 @@ ifeq "$(GST_BUILD_CONFIG)" "Release" -CXXFLAGS += $(shell $(WX_CONFIG) $(WX_CONFIG_ARGS) --cxxflags) +CXXFLAGS += $(shell $(WX_CONFIG) $(WX_CONFIG_ARGS) --cxxflags $(WX_CONFIG_LIBS)) WX_LIBS = $(shell $(WX_CONFIG) $(WX_CONFIG_ARGS) --libs $(WX_CONFIG_LIBS)) - +ifneq "$(origin WXSTATIC)" "command line" + LFLAGS += -ldl +endif else CXXFLAGS += $(shell $(WX_CONFIG) --debug $(WX_CONFIG_ARGS) --cxxflags) @@ -106,7 +108,7 @@ $(APPNAME): $(LIBS) $(OBJS) @echo Linking $@ - $(CXX) -o $(APPNAME) $(LFLAGS) $(OBJS) $(LIBS) $(FUSE_LIBS) $(WX_LIBS) + $(CXX) -o $(APPNAME) $(LFLAGS) $(OBJS) $(LIBS) $(FUSE_LIBS) $(WX_LIBS) -ldl ifeq "$(GST_BUILD_CONFIG)" "Release" ifndef NOSTRIP
View file
GostCrypt_Linux_1.0.tar.gz/Main/Resources.cpp -> GostCrypt_Linux_1.3.tar.gz/Main/Resources.cpp
Changed
@@ -11,41 +11,11 @@ #include "Platform/Platform.h" #include "Resources.h" -#ifdef GST_WINDOWS -#include "Main/resource.h" -#endif - namespace GostCrypt { -#ifdef GST_WINDOWS - static ConstBufferPtr GetWindowsResource (const wchar_t *resourceType, const wchar_t *resourceName) - { - HGLOBAL hResL; - HRSRC hRes; - - hRes = FindResource (NULL, resourceName, resourceType); - throw_sys_if (!hRes); - hResL = LoadResource (NULL, hRes); - throw_sys_if (!hResL); - - const byte *resPtr = (const byte *) LockResource (hResL); - throw_sys_if (!resPtr); - - return ConstBufferPtr (resPtr, SizeofResource (NULL, hRes)); - } -#endif // GST_WINDOWS - - string Resources::GetLanguageXml () { -#ifdef GST_WINDOWS - ConstBufferPtr res = GetWindowsResource (L"XML", L"IDR_LANGUAGE"); - Buffer strBuf (res.Size() + 1); - strBuf.Zero(); - strBuf.CopyFrom (res); - return string (reinterpret_cast <char *> (strBuf.Ptr())); -#else static const char LanguageXml[] = { # include "Common/Language.xml.h" @@ -53,18 +23,10 @@ }; return string (LanguageXml); -#endif } string Resources::GetLegalNotices () { -#ifdef GST_WINDOWS - ConstBufferPtr res = GetWindowsResource (L"TEXT", L"IDR_LICENSE"); - Buffer strBuf (res.Size() + 1); - strBuf.Zero(); - strBuf.CopyFrom (res); - return string (reinterpret_cast <char *> (strBuf.Ptr())); -#else static const char License[] = { # include "License.txt.h" @@ -72,7 +34,6 @@ }; return string (License); -#endif } @@ -80,9 +41,6 @@ wxBitmap Resources::GetDriveIconBitmap () { -#ifdef GST_WINDOWS - return wxBitmap (L"IDB_DRIVE_ICON", wxBITMAP_TYPE_BMP_RESOURCE).ConvertToImage().Resize (wxSize (16, 12), wxPoint (0, 0)); -#else static const byte DriveIcon[] = { # include "Mount/Drive_icon_96dpi.bmp.h" @@ -90,15 +48,10 @@ wxMemoryInputStream stream (DriveIcon, sizeof (DriveIcon)); return wxBitmap (wxImage (stream).Resize (wxSize (16, 12), wxPoint (0, 0))); -#endif } wxBitmap Resources::GetDriveIconMaskBitmap () { -#ifdef GST_WINDOWS - wxImage image = wxBitmap (L"IDB_DRIVE_ICON_MASK", wxBITMAP_TYPE_BMP_RESOURCE).ConvertToImage().Resize (wxSize (16, 12), wxPoint (0, 0)); - return wxBitmap (image.ConvertToMono (0, 0, 0), 1); -#else static const byte DriveIconMask[] = { # include "Mount/Drive_icon_mask_96dpi.bmp.h" @@ -108,20 +61,16 @@ wxImage image (stream); image.Resize (wxSize (16, 12), wxPoint (0, 0)); -# ifdef __WXGTK__ +#ifdef __WXGTK__ return wxBitmap (image.ConvertToMono (0, 0, 0), 1); -# else +#else return wxBitmap (image); -# endif #endif } wxBitmap Resources::GetLogoBitmap () { -#ifdef GST_WINDOWS - return wxBitmap (L"IDB_LOGO", wxBITMAP_TYPE_BMP_RESOURCE); -#else static const byte Logo[] = { # include "Mount/Logo_96dpi.bmp.h" @@ -129,14 +78,10 @@ wxMemoryInputStream stream (Logo, sizeof (Logo)); return wxBitmap (wxImage (stream)); -#endif } wxBitmap Resources::GetTextualLogoBitmap () { -#ifdef GST_WINDOWS - return wxBitmap (L"IDB_TEXTUAL_LOGO", wxBITMAP_TYPE_BMP_RESOURCE); -#else static const byte Logo[] = { # include "Common/Textual_logo_96dpi.bmp.h" @@ -144,24 +89,17 @@ wxMemoryInputStream stream (Logo, sizeof (Logo)); return wxBitmap (wxImage (stream)); -#endif } wxIcon Resources::GetGostCryptIcon () { -#ifdef GST_WINDOWS - return wxIcon (L"IDI_GOSTCRYPT_ICON", wxBITMAP_TYPE_ICO_RESOURCE, 16, 16); -#else + # include "Resources/Icons/GostCrypt-16x16.xpm" return wxIcon (GostCryptIcon16x16); -#endif } wxBitmap Resources::GetVolumeCreationWizardBitmap (int height) { -#ifdef GST_WINDOWS - return wxBitmap (L"IDB_VOLUME_WIZARD_BITMAP", wxBITMAP_TYPE_BMP_RESOURCE); -#else static const byte VolumeWizardIcon[] = { # include "Format/GostCrypt_Wizard.bmp.h" @@ -177,7 +115,6 @@ } return wxBitmap (image); -#endif } #endif // !GST_NO_GUI
View file
GostCrypt_Linux_1.0.tar.gz/Main/StringFormatter.h -> GostCrypt_Linux_1.3.tar.gz/Main/StringFormatter.h
Changed
@@ -11,6 +11,7 @@ #define GST_HEADER_Main_StringFormatter #include "System.h" + #include "Main.h" namespace GostCrypt
View file
GostCrypt_Linux_1.0.tar.gz/Main/System.h -> GostCrypt_Linux_1.3.tar.gz/Main/System.h
Changed
@@ -10,61 +10,6 @@ #ifndef GST_HEADER_Main_System #define GST_HEADER_Main_System -#ifndef GST_WINDOWS - #include "SystemPrecompiled.h" -#else - -#ifndef WINVER -#define WINVER 0x0501 -#endif - -#ifndef GST_LOCAL_WIN32_WINNT_OVERRIDE -# ifndef _WIN32_WINNT -# define _WIN32_WINNT 0x0501 -# endif -#endif - -#ifndef _WIN32_WINDOWS -#define _WIN32_WINDOWS 0x0410 -#endif - -#ifndef _WIN32_IE -#define _WIN32_IE 0x0600 -#endif - -#define WIN32_LEAN_AND_MEAN - -#ifndef UNICODE -#define UNICODE -#endif - -#ifndef _UNICODE -#define _UNICODE -#endif _UNICODE - -#include <wx/wxprec.h> -#include <wx/dde.h> -#include <wx/dnd.h> -#include <wx/filename.h> -#include <wx/hyperlink.h> -#include <wx/imaglist.h> -#include <wx/listctrl.h> -#include <wx/mstream.h> -#include <wx/power.h> -#include <wx/snglinst.h> -#include <wx/taskbar.h> -#include <wx/txtstrm.h> -#include <wx/valgen.h> -#include <wx/wfstream.h> -#include <shellapi.h> - -#include <iostream> -#include <memory.h> -#include <stdio.h> -#include <stdlib.h> - -#endif - #endif // GST_HEADER_Main_System
View file
GostCrypt_Linux_1.0.tar.gz/Main/TextUserInterface.cpp -> GostCrypt_Linux_1.3.tar.gz/Main/TextUserInterface.cpp
Changed
@@ -117,7 +117,7 @@ for (size_t i = 0; i < length && i < VolumePassword::MaxSize; ++i) { passwordBuf[i] = (wchar_t) passwordStr[i]; - const_cast <wchar_t *> (passwordStr.c_str())[i] = L'X'; + const_cast <wchar_t *> (passwordStr.wc_str())[i] = L'X'; } if (verify && verPhase) @@ -239,11 +239,6 @@ if (!volumePath) throw UserAbort (SRC_POS); -#ifdef GST_WINDOWS - if (Core->IsVolumeMounted (*volumePath)) - throw_err (LangString["DISMOUNT_FIRST"]); -#endif - ShowInfo ("EXTERNAL_VOL_HEADER_BAK_FIRST_INFO"); shared_ptr <Volume> normalVolume; @@ -1184,8 +1179,7 @@ #ifdef GST_LINUX if (!Preferences.NonInteractive && !Preferences.DisableKernelEncryptionModeWarning - && volume->EncryptionModeName != L"XTS" - && (volume->EncryptionModeName != L"LRW" || volume->EncryptionAlgorithmMinBlockSize != 16 || volume->EncryptionAlgorithmKeySize != 32)) + && volume->EncryptionModeName != L"XTS") { ShowWarning (LangString["ENCRYPTION_MODE_NOT_SUPPORTED_BY_KERNEL"]); } @@ -1269,11 +1263,6 @@ if (!volumePath) throw UserAbort (SRC_POS); -#ifdef GST_WINDOWS - if (Core->IsVolumeMounted (*volumePath)) - throw_err (LangString["DISMOUNT_FIRST"]); -#endif - // Ask whether to restore internal or external backup bool restoreInternalBackup;
View file
GostCrypt_Linux_1.0.tar.gz/Main/UserInterface.cpp -> GostCrypt_Linux_1.3.tar.gz/Main/UserInterface.cpp
Changed
@@ -56,64 +56,7 @@ void UserInterface::CloseExplorerWindows (shared_ptr <VolumeInfo> mountedVolume) const { -#ifdef GST_WINDOWS - struct Args - { - HWND ExplorerWindow; - string DriveRootPath; - }; - - struct Enumerator - { - static BOOL CALLBACK ChildWindows (HWND hwnd, LPARAM argsLP) - { - Args *args = reinterpret_cast <Args *> (argsLP); - - char s[4096]; - SendMessageA (hwnd, WM_GETTEXT, sizeof (s), (LPARAM) s); - - if (strstr (s, args->DriveRootPath.c_str()) != NULL) - { - PostMessage (args->ExplorerWindow, WM_CLOSE, 0, 0); - return FALSE; - } - - return TRUE; - } - - static BOOL CALLBACK TopLevelWindows (HWND hwnd, LPARAM argsLP) - { - Args *args = reinterpret_cast <Args *> (argsLP); - - char s[4096]; - GetClassNameA (hwnd, s, sizeof s); - if (strcmp (s, "CabinetWClass") == 0) - { - GetWindowTextA (hwnd, s, sizeof s); - if (strstr (s, args->DriveRootPath.c_str()) != NULL) - { - PostMessage (hwnd, WM_CLOSE, 0, 0); - return TRUE; - } - - args->ExplorerWindow = hwnd; - EnumChildWindows (hwnd, ChildWindows, argsLP); - } - - return TRUE; - } - }; - - Args args; - string mountPoint = mountedVolume->MountPoint; - if (mountPoint.size() < 2 || mountPoint[1] != ':') - return; - - args.DriveRootPath = string() + mountPoint[0] + string (":\\"); - - EnumWindows (Enumerator::TopLevelWindows, (LPARAM) &args); -#endif } void UserInterface::DismountAllVolumes (bool ignoreOpenFiles, bool interactive) const @@ -153,13 +96,6 @@ bool volumesInUse = false; bool firstPass = true; -#ifdef GST_WINDOWS - if (Preferences.CloseExplorerWindowsOnDismount) - { - foreach (shared_ptr <VolumeInfo> volume, volumes) - CloseExplorerWindows (volume); - } -#endif while (!volumes.empty()) { VolumeInfoList volumesLeft; @@ -244,9 +180,7 @@ { prop << _("Slot") << L": " << StringConverter::FromNumber (volume.SlotNumber) << L'\n'; prop << LangString["VOLUME"] << L": " << wstring (volume.Path) << L'\n'; -#ifndef GST_WINDOWS prop << LangString["VIRTUAL_DEVICE"] << L": " << wstring (volume.VirtualDevice) << L'\n'; -#endif prop << LangString["MOUNT_POINT"] << L": " << wstring (volume.MountPoint) << L'\n'; prop << LangString["SIZE"] << L": " << SizeToString (volume.Size) << L'\n'; prop << LangString["TYPE"] << L": " << VolumeTypeToString (volume.Type, volume.Protection) << L'\n'; @@ -470,6 +404,8 @@ EX2MSG (StringFormatterException, _("Error while parsing formatted string.")); EX2MSG (TemporaryDirectoryFailure, _("Failed to create a file or directory in a temporary directory.\n\nPlease make sure that the temporary directory exists, its security permissions allow you to access it, and there is sufficient disk space.")); EX2MSG (UnportablePassword, LangString["UNSUPPORTED_CHARS_IN_PWD"]); + EX2MSG (NextDeprecated, _("In the next version of GostCrypt, those archives won't be allowed. Please reencrypt your data with a newer container.")); + EX2MSG (OlderVersionRequired, _("The archive you are trying to open is no longer supported. Please open it in an previous version of GostCrypt and reencrypt the data in a new container.")); #if defined (GST_LINUX) EX2MSG (UnsupportedSectorSize, LangString["SECTOR_SIZE_UNSUPPORTED"]); @@ -802,14 +738,7 @@ list <string> args; -#ifdef GST_WINDOWS - - wstring p (Directory::AppendSeparator (path)); - SHFILEINFO fInfo; - SHGetFileInfo (p.c_str(), 0, &fInfo, sizeof (fInfo), 0); // Force explorer to discover the drive - ShellExecute (GetTopWindow() ? static_cast <HWND> (GetTopWindow()->GetHandle()) : nullptr, L"open", p.c_str(), nullptr, nullptr, SW_SHOWNORMAL); - -#elif defined (GST_MACOSX) +#if defined (GST_MACOSX) args.push_back (string (path)); try @@ -1452,22 +1381,6 @@ wxString UserInterface::VolumeTimeToString (VolumeTime volumeTime) const { wxString dateStr = VolumeTimeToDateTime (volumeTime).Format(); - -#ifdef GST_WINDOWS - - FILETIME ft; - *(unsigned __int64 *)(&ft) = volumeTime; - SYSTEMTIME st; - FileTimeToSystemTime (&ft, &st); - - wchar_t wstr[1024]; - if (GetDateFormat (LOCALE_USER_DEFAULT, 0, &st, 0, wstr, array_capacity (wstr)) != 0) - { - dateStr = wstr; - GetTimeFormat (LOCALE_USER_DEFAULT, 0, &st, 0, wstr, array_capacity (wstr)); - dateStr += wxString (L" ") + wstr; - } -#endif return dateStr; }
View file
GostCrypt_Linux_1.0.tar.gz/Main/UserPreferences.cpp -> GostCrypt_Linux_1.3.tar.gz/Main/UserPreferences.cpp
Changed
@@ -71,7 +71,7 @@ GST_CONFIG_SET (BackgroundTaskMenuDismountItemsEnabled); GST_CONFIG_SET (BackgroundTaskMenuMountItemsEnabled); GST_CONFIG_SET (BackgroundTaskMenuOpenItemsEnabled); - GST_CONFIG_SET (BeepAfterHotkeyMountDismount); + SetValue (configMap[L"CachePasswords"], DefaultMountOptions.CachePassword); GST_CONFIG_SET (CloseBackgroundTaskOnNoVolumes); GST_CONFIG_SET (CloseExplorerWindowsOnDismount); @@ -81,7 +81,7 @@ GST_CONFIG_SET (DismountOnLogOff); GST_CONFIG_SET (DismountOnPowerSaving); GST_CONFIG_SET (DismountOnScreenSaver); - GST_CONFIG_SET (DisplayMessageAfterHotkeyDismount); + GST_CONFIG_SET (BackgroundTaskEnabled); SetValue (configMap[L"FilesystemOptions"], DefaultMountOptions.FilesystemOptions); GST_CONFIG_SET (ForceAutoDismount); @@ -116,11 +116,6 @@ DefaultKeyfiles.push_back (make_shared <Keyfile> ((wstring) node.InnerText)); } } - -#ifdef GST_WINDOWS - // Hotkeys - Hotkeys = Hotkey::LoadList(); -#endif } void UserPreferences::Save() const @@ -171,7 +166,6 @@ GST_CONFIG_ADD (BackgroundTaskMenuDismountItemsEnabled); GST_CONFIG_ADD (BackgroundTaskMenuMountItemsEnabled); GST_CONFIG_ADD (BackgroundTaskMenuOpenItemsEnabled); - GST_CONFIG_ADD (BeepAfterHotkeyMountDismount); formatter.AddEntry (L"CachePasswords", DefaultMountOptions.CachePassword); GST_CONFIG_ADD (CloseBackgroundTaskOnNoVolumes); GST_CONFIG_ADD (CloseExplorerWindowsOnDismount); @@ -181,7 +175,6 @@ GST_CONFIG_ADD (DismountOnLogOff); GST_CONFIG_ADD (DismountOnPowerSaving); GST_CONFIG_ADD (DismountOnScreenSaver); - GST_CONFIG_ADD (DisplayMessageAfterHotkeyDismount); GST_CONFIG_ADD (BackgroundTaskEnabled); formatter.AddEntry (L"FilesystemOptions", DefaultMountOptions.FilesystemOptions); GST_CONFIG_ADD (ForceAutoDismount); @@ -220,17 +213,12 @@ foreach_ref (const Keyfile &keyfile, DefaultKeyfiles) { - keyfilesXml.InnerNodes.push_back (XmlNode (L"keyfile", wxString (FilesystemPath (keyfile)))); + keyfilesXml.InnerNodes.push_back (XmlNode (L"keyfile", wxString (wstring(FilesystemPath (keyfile))))); } XmlWriter keyfileWriter (keyfilesCfgPath); keyfileWriter.WriteNode (keyfilesXml); keyfileWriter.Close(); } - -#ifdef GST_WINDOWS - // Hotkeys - Hotkey::SaveList (Hotkeys); -#endif } }
View file
GostCrypt_Linux_1.0.tar.gz/Main/UserPreferences.h -> GostCrypt_Linux_1.3.tar.gz/Main/UserPreferences.h
Changed
@@ -12,7 +12,6 @@ #include "System.h" #include "Main.h" -#include "Hotkey.h" namespace GostCrypt { @@ -24,7 +23,6 @@ BackgroundTaskMenuDismountItemsEnabled (true), BackgroundTaskMenuMountItemsEnabled (true), BackgroundTaskMenuOpenItemsEnabled (true), - BeepAfterHotkeyMountDismount (false), CloseBackgroundTaskOnNoVolumes (true), CloseExplorerWindowsOnDismount (true), CloseSecurityTokenSessionsAfterMount (false), @@ -33,7 +31,6 @@ DismountOnLogOff (true), DismountOnPowerSaving (false), DismountOnScreenSaver (false), - DisplayMessageAfterHotkeyDismount (false), ForceAutoDismount (true), LastSelectedSlotNumber (0), MaxVolumeIdleTime (60), @@ -56,7 +53,6 @@ void Load(); void Save() const; - HotkeyList Hotkeys; KeyfileList DefaultKeyfiles; MountOptions DefaultMountOptions; @@ -64,7 +60,6 @@ bool BackgroundTaskMenuDismountItemsEnabled; bool BackgroundTaskMenuMountItemsEnabled; bool BackgroundTaskMenuOpenItemsEnabled; - bool BeepAfterHotkeyMountDismount; bool CloseBackgroundTaskOnNoVolumes; bool CloseExplorerWindowsOnDismount; bool CloseSecurityTokenSessionsAfterMount; @@ -73,7 +68,6 @@ bool DismountOnLogOff; bool DismountOnPowerSaving; bool DismountOnScreenSaver; - bool DisplayMessageAfterHotkeyDismount; bool ForceAutoDismount; uint64 LastSelectedSlotNumber; int32 MaxVolumeIdleTime;
View file
GostCrypt_Linux_1.0.tar.gz/Makefile -> GostCrypt_Linux_1.3.tar.gz/Makefile
Changed
@@ -34,13 +34,13 @@ export LFLAGS := export PKG_CONFIG_PATH = /usr/local/lib/pkgconfig -#export PKCS11_INC = Pkcs11 +export PKCS11_INC = Pkcs11 export WX_CONFIG ?= wx-config export WX_CONFIG_ARGS := --unicode WX_CONFIGURE_FLAGS := -export WXCONFIG_CFLAGS := -export WXCONFIG_CXXFLAGS := +export WXCONFIG_CFLAGS := `wx-config --cflags` +export WXCONFIG_CXXFLAGS := `wx-config --cxxflags` WX_ROOT ?= .. @@ -54,11 +54,12 @@ ifeq "$(origin NOGUI)" "command line" export GST_NO_GUI := 1 + export APPNAME := gostcrypt.cli C_CXX_FLAGS += -DGST_NO_GUI WX_CONFIGURE_FLAGS += --disable-gui endif -#C_CXX_FLAGS += -I$(PKCS11_INC) +C_CXX_FLAGS += -I$(PKCS11_INC) ifeq "$(origin RESOURCEDIR)" "command line" C_CXX_FLAGS += -DGST_RESOURCE_DIR="$(RESOURCEDIR)"
View file
GostCrypt_Linux_1.0.tar.gz/Platform/Buffer.h -> GostCrypt_Linux_1.3.tar.gz/Platform/Buffer.h
Changed
@@ -15,7 +15,6 @@ namespace GostCrypt { - class ConstBufferPtr { public:
View file
GostCrypt_Linux_1.0.tar.gz/Platform/Exception.cpp -> GostCrypt_Linux_1.3.tar.gz/Platform/Exception.cpp
Changed
@@ -49,5 +49,6 @@ #undef GST_EXCEPTION_NODECL #define GST_EXCEPTION_NODECL(TYPE) GST_SERIALIZER_FACTORY_ADD(TYPE) + GST_SERIALIZER_FACTORY_ADD_EXCEPTION_SET (Exception); }
View file
GostCrypt_Linux_1.0.tar.gz/Platform/Exception.h -> GostCrypt_Linux_1.3.tar.gz/Platform/Exception.h
Changed
@@ -96,6 +96,7 @@ GST_EXCEPTION_SET; #undef GST_EXCEPTION + } #ifdef assert
View file
GostCrypt_Linux_1.0.tar.gz/Platform/File.h -> GostCrypt_Linux_1.3.tar.gz/Platform/File.h
Changed
@@ -45,11 +45,7 @@ DisableWriteCaching = 1 << 1 }; -#ifdef GST_WINDOWS - typedef FILE* SystemFileHandleType; -#else typedef int SystemFileHandleType; -#endif File () : FileIsOpen (false), SharedHandle (false) { } virtual ~File (); @@ -96,11 +92,8 @@ FilePath Path; SystemFileHandleType FileHandle; -#ifdef GST_WINDOWS -#else time_t AccTime; time_t ModTime; -#endif private: File (const File &);
View file
GostCrypt_Linux_1.0.tar.gz/Platform/FileCommon.cpp -> GostCrypt_Linux_1.3.tar.gz/Platform/FileCommon.cpp
Changed
@@ -46,7 +46,6 @@ if (preserveTimestamps) { destination.Flush(); -#ifndef GST_WINDOWS struct stat statData; throw_sys_sub_if (stat (string (sourcePath).c_str(), &statData) == -1, wstring (sourcePath)); @@ -54,7 +53,6 @@ u.actime = statData.st_atime; u.modtime = statData.st_mtime; throw_sys_sub_if (utime (string (destinationPath).c_str(), &u) == -1, wstring (destinationPath)); -#endif } }
View file
GostCrypt_Linux_1.0.tar.gz/Platform/Memory.h -> GostCrypt_Linux_1.3.tar.gz/Platform/Memory.h
Changed
@@ -14,16 +14,8 @@ #include <memory.h> #include "PlatformBase.h" -#ifdef GST_WINDOWS -# ifndef LITTLE_ENDIAN -# define LITTLE_ENDIAN 1234 -# endif -# ifndef BYTE_ORDER -# define BYTE_ORDER LITTLE_ENDIAN -# endif - -#elif !defined(BYTE_ORDER) +#ifndef BYTE_ORDER # ifdef GST_MACOSX # include <machine/endian.h>
View file
GostCrypt_Linux_1.0.tar.gz/Platform/Mutex.h -> GostCrypt_Linux_1.3.tar.gz/Platform/Mutex.h
Changed
@@ -10,22 +10,14 @@ #ifndef GST_HEADER_Platform_Mutex #define GST_HEADER_Platform_Mutex -#ifdef GST_WINDOWS -# include "System.h" -#else -# include <pthread.h> -#endif +#include <pthread.h> #include "PlatformBase.h" namespace GostCrypt { class Mutex { -#ifdef GST_WINDOWS - typedef CRITICAL_SECTION SystemMutex_t; -#else typedef pthread_mutex_t SystemMutex_t; -#endif public: Mutex ();
View file
GostCrypt_Linux_1.0.tar.gz/Platform/PlatformBase.h -> GostCrypt_Linux_1.3.tar.gz/Platform/PlatformBase.h
Changed
@@ -57,10 +57,6 @@ #endif } -#if (defined(_WIN32) || defined(_WIN64)) && !defined(GST_WINDOWS) -# define GST_WINDOWS -#endif - #if defined(_DEBUG) && !defined(DEBUG) # define DEBUG #endif @@ -104,16 +100,10 @@ #ifdef DEBUG # define if_debug(...) __VA_ARGS__ -# ifdef GST_WINDOWS -# define trace_point OutputDebugStringA ((string (SRC_POS) + "\n").c_str()) -# define trace_msg(stream_args) do { stringstream s; s << (SRC_POS) << ": " << stream_args << endl; OutputDebugStringA (s.str().c_str()); } while (0) -# define trace_msgw(stream_args) do { wstringstream s; s << (SRC_POS) << L": " << stream_args << endl; OutputDebugStringW (s.str().c_str()); } while (0) -# else -# include <iostream> -# define trace_point cerr << (SRC_POS) << endl -# define trace_msg(stream_args) cerr << (SRC_POS) << ": " << stream_args << endl -# define trace_msgw(stream_args) cerr << (SRC_POS); wcerr << L": " << stream_args << endl -# endif +# include <iostream> +# define trace_point cerr << (SRC_POS) << endl +# define trace_msg(stream_args) cerr << (SRC_POS) << ": " << stream_args << endl +# define trace_msgw(stream_args) cerr << (SRC_POS); wcerr << L": " << stream_args << endl # include "Platform/SystemLog.h" # define trace_log_point SystemLog::WriteError (SRC_POS)
View file
GostCrypt_Linux_1.0.tar.gz/Platform/SerializerFactory.h -> GostCrypt_Linux_1.3.tar.gz/Platform/SerializerFactory.h
Changed
@@ -56,6 +56,22 @@ } +#define GST_SERIALIZER_FACTORY_ADD_ALERT_SET(TYPE) \ + struct TYPE##SerializerFactoryInitializer \ + { \ + TYPE##SerializerFactoryInitializer () \ + { \ + SerializerFactory::Initialize(); \ + GST_EXCEPTION_SET; \ + } \ + ~TYPE##SerializerFactoryInitializer () \ + { \ + SerializerFactory::Deinitialize(); \ + } \ + }; \ + static TYPE##SerializerFactoryInitializer TYPE##SerializerFactoryInitializer + + #define GST_SERIALIZER_FACTORY_ADD_EXCEPTION_SET(TYPE) \ struct TYPE##SerializerFactoryInitializer \ { \
View file
GostCrypt_Linux_1.0.tar.gz/Platform/SyncEvent.h -> GostCrypt_Linux_1.3.tar.gz/Platform/SyncEvent.h
Changed
@@ -10,11 +10,8 @@ #ifndef GST_HEADER_Platform_SyncEvent #define GST_HEADER_Platform_SyncEvent -#ifdef GST_WINDOWS -# include "System.h" -#else -# include <pthread.h> -#endif + +#include <pthread.h> #include "PlatformBase.h" #include "Mutex.h" @@ -31,13 +28,9 @@ protected: bool Initialized; -#ifdef GST_WINDOWS - HANDLE SystemSyncEvent; -#else volatile bool Signaled; pthread_cond_t SystemSyncEvent; Mutex EventMutex; -#endif private: SyncEvent (const SyncEvent &);
View file
GostCrypt_Linux_1.0.tar.gz/Platform/System.h -> GostCrypt_Linux_1.3.tar.gz/Platform/System.h
Changed
@@ -10,8 +10,4 @@ #ifndef GST_HEADER_Platform_System #define GST_HEADER_Platform_System -#ifdef GST_WINDOWS -#include "Windows/System.h" -#endif - #endif // GST_HEADER_Platform_System
View file
GostCrypt_Linux_1.0.tar.gz/Platform/Thread.h -> GostCrypt_Linux_1.3.tar.gz/Platform/Thread.h
Changed
@@ -10,13 +10,9 @@ #ifndef GST_HEADER_Platform_Thread #define GST_HEADER_Platform_Thread -#ifdef GST_WINDOWS -# include "System.h" -# define GST_THREAD_PROC DWORD WINAPI -#else -# include <pthread.h> -# define GST_THREAD_PROC void* -#endif +#include <pthread.h> +#define GST_THREAD_PROC void* + #include "PlatformBase.h" #include "Functor.h" #include "SharedPtr.h" @@ -27,13 +23,9 @@ class Thread { public: -#ifdef GST_WINDOWS - typedef HANDLE ThreadSystemHandle; - typedef LPTHREAD_START_ROUTINE ThreadProcPtr; -#else typedef pthread_t ThreadSystemHandle; typedef void* (*ThreadProcPtr) (void *); -#endif + Thread () { }; virtual ~Thread () { };
View file
GostCrypt_Linux_1.3.tar.gz/README.md
Added
@@ -0,0 +1,20 @@ +# GostCrypt Project + +GostCrypt project is a fork of TrueCrypt. For more information, see the +[GostCrypt](https://www.gostcrypt.org/) website. + +## Installation + +All the documentation about the installation process is available on our +[wiki](https://www.gostcrypt.org/wiki/doku.php). + + +## Pointers + +Website : [https://www.gostcrypt.org](https://www.gostcrypt.org) + +IRC : #gostcrypt + +Twitter : @GostCrypt + +PS: This project is developed by students, so be cool ;).
View file
GostCrypt_Linux_1.0.tar.gz/Readme.txt -> GostCrypt_Linux_1.3.tar.gz/Readme.txt
Changed
@@ -1,1 +1,1 @@ -This archive contains the source code of GostCrypt 1.0 \ No newline at end of file +This archive contains the source code of GostCrypt 1.3 \ No newline at end of file
View file
GostCrypt_Linux_1.0.tar.gz/Volume/Cipher.cpp -> GostCrypt_Linux_1.3.tar.gz/Volume/Cipher.cpp
Changed
@@ -10,6 +10,7 @@ #include "Platform/Platform.h" #include "Cipher.h" #include "Crypto/GostCipher.h" +#include "Crypto/GrasshopperCipher.h" namespace GostCrypt @@ -67,6 +68,7 @@ CipherList l; l.push_back (shared_ptr <Cipher> (new CipherGOST ())); + l.push_back (shared_ptr <Cipher> (new CipherGRASSHOPPER())); return l; } @@ -152,6 +154,51 @@ for (i = 0; i < size; i++) ks[i] = ptr[i]; } + + // GRASSHOPPER + void CipherGRASSHOPPER::Decrypt (byte *data) const + { + grasshopper_decrypt ((grasshopper_kds*) ScheduledKey.Ptr(), (gst_ludword *) data, (gst_ludword *) data); + } + + void CipherGRASSHOPPER::Encrypt (byte *data) const + { + grasshopper_encrypt ((grasshopper_kds*) ScheduledKey.Ptr(), (gst_ludword *) data, (gst_ludword *) data); + } + + void CipherGRASSHOPPER::DecryptWithKS (byte *data, byte *ks) const + { + grasshopper_decrypt ((grasshopper_kds*) ks, (gst_ludword *) data, (gst_ludword *) data); + } + + void CipherGRASSHOPPER::EncryptWithKS (byte *data, byte *ks) const + { + grasshopper_encrypt ((grasshopper_kds*) ks, (gst_ludword *) data, (gst_ludword *) data); + } + + size_t CipherGRASSHOPPER::GetScheduledKeySize () const + { + return sizeof(grasshopper_kds); + } + void CipherGRASSHOPPER::SetCipherKey (const byte *key) + { + grasshopper_set_key((gst_ludword*)key, (grasshopper_kds *) ScheduledKey.Ptr()); + } + + void CipherGRASSHOPPER::XorCipherKey (byte *ks, byte *data, int len) const + { + grasshopper_xor_ks((grasshopper_kds *) ScheduledKey.Ptr(), (grasshopper_kds *) ks, (gst_ludword *)data, len / sizeof(unsigned long long)); + } + + void CipherGRASSHOPPER::CopyCipherKey (byte *ks) const + { + size_t i; + size_t size = ScheduledKey.Size(); + byte *ptr = ScheduledKey.Ptr(); + for (i = 0; i < size; i++) + ks[i] = ptr[i]; + } bool Cipher::HwSupportEnabled = false; + }
View file
GostCrypt_Linux_1.0.tar.gz/Volume/Cipher.h -> GostCrypt_Linux_1.3.tar.gz/Volume/Cipher.h
Changed
@@ -47,13 +47,13 @@ virtual void CopyCipherKey (byte *ks) const = 0; static const int MaxBlockSize = 16; + virtual size_t GetScheduledKeySize () const = 0; protected: Cipher (); virtual void Decrypt (byte *data) const = 0; virtual void Encrypt (byte *data) const = 0; - virtual size_t GetScheduledKeySize () const = 0; virtual void SetCipherKey (const byte *key) = 0; static bool HwSupportEnabled; @@ -119,11 +119,11 @@ virtual void EncryptWithKS (byte *data, byte *ks) const; virtual void DecryptWithKS (byte *data, byte *ks) const; virtual void CopyCipherKey (byte *ks) const; + virtual size_t GetScheduledKeySize () const; protected: virtual void Decrypt (byte *data) const; virtual void Encrypt (byte *data) const; - virtual size_t GetScheduledKeySize () const; virtual void SetCipherKey (const byte *key); private: @@ -131,6 +131,35 @@ CipherGOST &operator= (const CipherGOST &); }; +class CipherGRASSHOPPER : public Cipher +{ +public: + CipherGRASSHOPPER () { } + virtual ~CipherGRASSHOPPER () { } + + virtual size_t GetBlockSize () const {return 16; }; + virtual size_t GetKeySize () const {return 32; }; + virtual wstring GetName() const {return L"Gost Grasshopper"; }; + virtual shared_ptr <Cipher> GetNew() const {return shared_ptr <Cipher> (new CipherGRASSHOPPER());}; + + virtual void XorCipherKey (byte *ks, byte *data, int len) const; + virtual void EncryptWithKS (byte *data, byte *ks) const; + virtual void DecryptWithKS (byte *data, byte *ks) const; + virtual void CopyCipherKey (byte *ks) const; + + virtual size_t GetScheduledKeySize () const; + +protected: + virtual void Decrypt (byte *data) const; + virtual void Encrypt (byte *data) const; + virtual void SetCipherKey (const byte *key); + +private: + CipherGRASSHOPPER (const CipherGRASSHOPPER &); + CipherGRASSHOPPER &operator= (const CipherGRASSHOPPER &); + +}; + #define GST_EXCEPTION(NAME) GST_EXCEPTION_DECL(NAME,CipherException) #undef GST_EXCEPTION_SET
View file
GostCrypt_Linux_1.3.tar.gz/Volume/Encrypt.cpp
Added
@@ -0,0 +1,4 @@ +void EncryptionTest::TestXTS8Byte () +{ + +} \ No newline at end of file
View file
GostCrypt_Linux_1.0.tar.gz/Volume/EncryptionAlgorithm.cpp -> GostCrypt_Linux_1.3.tar.gz/Volume/EncryptionAlgorithm.cpp
Changed
@@ -8,8 +8,6 @@ #include "EncryptionAlgorithm.h" -#include "EncryptionModeCBC.h" -#include "EncryptionModeLRW.h" #include "EncryptionModeXTS.h" namespace GostCrypt @@ -61,6 +59,7 @@ EncryptionAlgorithmList l; l.push_back (shared_ptr <EncryptionAlgorithm> (new GOST())); + l.push_back (shared_ptr <EncryptionAlgorithm> (new GRASSHOPPER())); return l; } @@ -199,4 +198,12 @@ SupportedModes.push_back (shared_ptr <EncryptionMode> (new EncryptionModeXTS ())); } + + //GRASSHOPPER + GRASSHOPPER::GRASSHOPPER() + { + Ciphers.push_back (shared_ptr <Cipher> (new CipherGRASSHOPPER ())); + SupportedModes.push_back (shared_ptr <EncryptionMode> (new EncryptionModeXTS ())); + + } }
View file
GostCrypt_Linux_1.0.tar.gz/Volume/EncryptionAlgorithm.h -> GostCrypt_Linux_1.3.tar.gz/Volume/EncryptionAlgorithm.h
Changed
@@ -75,6 +75,7 @@ } GST_ENCRYPTION_ALGORITHM (GOST); + GST_ENCRYPTION_ALGORITHM (GRASSHOPPER); #undef GST_ENCRYPTION_ALGORITHM }
View file
GostCrypt_Linux_1.0.tar.gz/Volume/EncryptionMode.cpp -> GostCrypt_Linux_1.3.tar.gz/Volume/EncryptionMode.cpp
Changed
@@ -8,8 +8,6 @@ #include "EncryptionMode.h" -#include "EncryptionModeCBC.h" -#include "EncryptionModeLRW.h" #include "EncryptionModeXTS.h" #include "EncryptionThreadPool.h" @@ -38,8 +36,6 @@ EncryptionModeList l; l.push_back (shared_ptr <EncryptionMode> (new EncryptionModeXTS ())); - l.push_back (shared_ptr <EncryptionMode> (new EncryptionModeLRW ())); - l.push_back (shared_ptr <EncryptionMode> (new EncryptionModeCBC ())); return l; }
View file
GostCrypt_Linux_1.0.tar.gz/Volume/EncryptionModeXTS.cpp -> GostCrypt_Linux_1.3.tar.gz/Volume/EncryptionModeXTS.cpp
Changed
@@ -9,6 +9,7 @@ #include "EncryptionModeXTS.h" #include "Common/Crypto.h" +#include "Volume/VolumeHeader.h" namespace GostCrypt { @@ -40,11 +41,13 @@ byte finalCarry; byte whiteningValue [BYTES_PER_XTS_BLOCK_SMALL]; byte byteBufUnitNo [BYTES_PER_XTS_BLOCK_SMALL]; + byte xor_ks [MAX_EXPANDED_KEY]; uint32 *whiteningValuePtr32 = (uint32 *)whiteningValue; uint32 *bufPtr = (uint32 *)buffer; uint32 startBlock = startCipherBlockNo, endBlock, block; uint64 blockCount, dataUnitNo; + uint32 modulus = 27; dataUnitNo = startDataUnitNo; *((uint64 *) byteBufUnitNo) = Endian::Little (dataUnitNo); @@ -97,7 +100,7 @@ #if BYTE_ORDER == LITTLE_ENDIAN //Little-endian platforms - finalCarry = (*whiteningValuePtr32 & 0x80000000) ? 135 : 0; + finalCarry = (*whiteningValuePtr32 & 0x80000000) ? modulus : 0; *whiteningValuePtr32-- <<= 1; @@ -107,7 +110,7 @@ *whiteningValuePtr32 <<= 1; #else //Big-endian platforms - finalCarry = (*whiteningValuePtr32 & 0x80) ? 135 : 0; + finalCarry = (*whiteningValuePtr32 & 0x80) ? modulus : 0; *whiteningValuePtr32 = Endian::Little (Endian::Little (*whiteningValuePtr32) << 1); @@ -120,6 +123,7 @@ #endif whiteningValue[0] ^= finalCarry; } + blockCount -= endBlock - startBlock; startBlock = 0; dataUnitNo++; @@ -315,7 +319,9 @@ uint32 *bufPtr = (uint32 *)buffer; uint32 startBlock = startCipherBlockNo, endBlock, block; uint64 blockCount, dataUnitNo; - + + uint32 modulus = 27; + dataUnitNo = startDataUnitNo; *((uint64 *) byteBufUnitNo) = Endian::Little (dataUnitNo); @@ -367,7 +373,7 @@ #if BYTE_ORDER == LITTLE_ENDIAN //Little-endian platforms - finalCarry = (*whiteningValuePtr32 & 0x80000000) ? 135 : 0; + finalCarry = (*whiteningValuePtr32 & 0x80000000) ? modulus : 0; *whiteningValuePtr32-- <<= 1; @@ -377,7 +383,7 @@ *whiteningValuePtr32 <<= 1; #else //Big-endian platforms - finalCarry = (*whiteningValuePtr32 & 0x80) ? 135 : 0; + finalCarry = (*whiteningValuePtr32 & 0x80) ? modulus : 0; *whiteningValuePtr32 = Endian::Little (Endian::Little (*whiteningValuePtr32) << 1); @@ -390,6 +396,7 @@ #endif whiteningValue[0] ^= finalCarry; } + blockCount -= endBlock - startBlock; startBlock = 0; dataUnitNo++;
View file
GostCrypt_Linux_1.0.tar.gz/Volume/EncryptionTest.cpp -> GostCrypt_Linux_1.3.tar.gz/Volume/EncryptionTest.cpp
Changed
@@ -12,8 +12,6 @@ #include "Crc32.h" #include "EncryptionAlgorithm.h" #include "EncryptionMode.h" -#include "EncryptionModeCBC.h" -#include "EncryptionModeLRW.h" #include "EncryptionModeXTS.h" #include "EncryptionTest.h" #include "Pkcs5Kdf.h" @@ -381,28 +379,53 @@ switch (testCase) { case 0: - if (crc != 0x50ae4605) + if (crc != 0x5eacf7d) throw TestFailed (SRC_POS); nTestsPerformed++; break; case 1: - if (crc != 0xaabf7dca) + if (crc != 0x5b5926d9) throw TestFailed (SRC_POS); nTestsPerformed++; break; case 2: - if (crc != 0x6cae5f6d) + if (crc != 0xcf0cfdd1) throw TestFailed (SRC_POS); nTestsPerformed++; break; case 3: - if (crc != 0xcb608e0b) + if (crc != 0xe82865a8) throw TestFailed (SRC_POS); nTestsPerformed++; break; } } - + else if(typeid(ea) == typeid(GRASSHOPPER)) + { + switch (testCase) + { + case 0: + if (crc != 0x6b86e72e) + throw TestFailed(SRC_POS); + nTestsPerformed++; + break; + case 1: + if (crc != 0xa4f8637d) + throw TestFailed(SRC_POS); + nTestsPerformed++; + break; + case 2: + if (crc != 0xfd83e76d) + throw TestFailed(SRC_POS); + nTestsPerformed++; + break; + case 3: + if (crc != 0xb24fc47b) + throw TestFailed(SRC_POS); + nTestsPerformed++; + break; + } + } if (crc == 0x9f5edd58) throw TestFailed (SRC_POS); @@ -452,7 +475,13 @@ if (typeid (ea) == typeid (GOST)) { - if (crc != 0xf0109bdf) + if (crc != 0x5d31eec2) + throw TestFailed (SRC_POS); + nTestsPerformed++; + } + else if (typeid(ea) == typeid(GRASSHOPPER)) + { + if(crc != 0xd6d39cdb) throw TestFailed (SRC_POS); nTestsPerformed++; } @@ -468,7 +497,7 @@ nTestsPerformed++; } - if (nTestsPerformed != 10) + if (nTestsPerformed != 20) // 2* number of algorithms throw TestFailed (SRC_POS); }
View file
GostCrypt_Linux_1.0.tar.gz/Volume/EncryptionThreadPool.cpp -> GostCrypt_Linux_1.3.tar.gz/Volume/EncryptionThreadPool.cpp
Changed
@@ -140,13 +140,7 @@ size_t cpuCount; -#ifdef GST_WINDOWS - - SYSTEM_INFO sysInfo; - GetSystemInfo (&sysInfo); - cpuCount = sysInfo.dwNumberOfProcessors; - -#elif defined (_SC_NPROCESSORS_ONLN) +#if defined (_SC_NPROCESSORS_ONLN) cpuCount = (size_t) sysconf (_SC_NPROCESSORS_ONLN); if (cpuCount == (size_t) -1)
View file
GostCrypt_Linux_1.0.tar.gz/Volume/Keyfile.h -> GostCrypt_Linux_1.3.tar.gz/Volume/Keyfile.h
Changed
@@ -22,7 +22,7 @@ class Keyfile { public: - Keyfile (const FilesystemPath &path) : Path (path) { } + Keyfile (const FilesystemPath &path){ } virtual ~Keyfile () { }; operator FilesystemPath () const { return Path; }
View file
GostCrypt_Linux_1.0.tar.gz/Volume/Version.h -> GostCrypt_Linux_1.3.tar.gz/Volume/Version.h
Changed
@@ -20,6 +20,7 @@ public: static const string String () { return VERSION_STRING; } static const uint16 Number () { return VERSION_NUM; } + }; }
View file
GostCrypt_Linux_1.0.tar.gz/Volume/Volume.cpp -> GostCrypt_Linux_1.3.tar.gz/Volume/Volume.cpp
Changed
@@ -7,10 +7,7 @@ */ -#ifndef GST_WINDOWS #include <errno.h> -#endif -#include "EncryptionModeLRW.h" #include "EncryptionModeXTS.h" #include "Volume.h" #include "VolumeHeader.h" @@ -79,12 +76,7 @@ } catch (SystemException &e) { - if (e.GetErrorCode() == -#ifdef GST_WINDOWS - ERROR_SHARING_VIOLATION) -#else - EAGAIN) -#endif + if (e.GetErrorCode() == EAGAIN) { if (!sharedAccessAllowed) throw VolumeHostInUse (SRC_POS); @@ -227,10 +219,6 @@ mode.SetSectorOffset (partitionStartOffset / ENCRYPTION_DATA_UNIT_SIZE); } - else if (typeid (mode) == typeid (EncryptionModeLRW)) - { - mode.SetSectorOffset (VolumeDataOffset / SectorSize); - } // Volume protection if (Protection == VolumeProtection::HiddenVolumeReadOnly)
View file
GostCrypt_Linux_1.0.tar.gz/Volume/Volume.make -> GostCrypt_Linux_1.3.tar.gz/Volume/Volume.make
Changed
@@ -11,8 +11,6 @@ OBJS += Cipher.o OBJS += EncryptionAlgorithm.o OBJS += EncryptionMode.o -OBJS += EncryptionModeCBC.o -OBJS += EncryptionModeLRW.o OBJS += EncryptionModeXTS.o OBJS += EncryptionTest.o OBJS += EncryptionThreadPool.o @@ -20,6 +18,7 @@ OBJS += Keyfile.o OBJS += Pkcs5Kdf.o OBJS += Volume.o +OBJS += VolumeAlert.o OBJS += VolumeException.o OBJS += VolumeHeader.o OBJS += VolumeInfo.o @@ -30,6 +29,7 @@ OBJS += ../Crypto/Whirlpool.o OBJS += ../Crypto/Stribog.o OBJS += ../Crypto/GostCipher.o +OBJS += ../Crypto/GrasshopperCipher.o OBJS += ../Crypto/GostHash.o OBJS += ../Common/Crc.o @@ -40,4 +40,8 @@ VolumeLibrary: Volume.a +WX_CONFIG_LIBS := adv,core,base +CXXFLAGS += $(shell $(WX_CONFIG) $(WX_CONFIG_ARGS) --cxxflags) +WX_LIBS = $(shell $(WX_CONFIG) $(WX_CONFIG_ARGS) --libs $(WX_CONFIG_LIBS)) + include $(BUILD_INC)/Makefile.inc
View file
GostCrypt_Linux_1.3.tar.gz/Volume/VolumeAlert.cpp
Added
@@ -0,0 +1,18 @@ + +#include "VolumeAlert.h" + +namespace GostCrypt +{ + VolumeAlert::VolumeAlert() + { + } + + void VolumeAlert::SetAlert(int message, wstring subject) + { + wxString foo; + foo.Printf(wxT("%d\n"), message); + wxMessageBox(foo); + + return; + } +} \ No newline at end of file
View file
GostCrypt_Linux_1.3.tar.gz/Volume/VolumeAlert.h
Added
@@ -0,0 +1,26 @@ +/* This file was written for the GostCrypt project +under the GPLV3 license. + +*/ + + +#ifndef GST_HEADER_Volume_VolumeAlert +#define GST_HEADER_Volume_VolumeAlert + +#include "Platform/Platform.h" +//#include <wx/wx.h> +#include <wx/msgdlg.h> + +namespace GostCrypt +{ + struct VolumeAlert : public Exception + { + public: + VolumeAlert (); + + void SetAlert (const int message, const wstring subject); + }; + +} + +#endif // GST_HEADER_Volume_VolumeAlert \ No newline at end of file
View file
GostCrypt_Linux_1.0.tar.gz/Volume/VolumeException.h -> GostCrypt_Linux_1.3.tar.gz/Volume/VolumeException.h
Changed
@@ -27,7 +27,9 @@ #undef GST_EXCEPTION_SET #define GST_EXCEPTION_SET \ GST_EXCEPTION (HigherVersionRequired); \ + GST_EXCEPTION (OlderVersionRequired); \ GST_EXCEPTION (KeyfilePathEmpty); \ + GST_EXCEPTION (NextDeprecated); \ GST_EXCEPTION (MissingVolumeData); \ GST_EXCEPTION (MountedVolumeInUse); \ GST_EXCEPTION (UnsupportedSectorSize); \ @@ -39,6 +41,7 @@ GST_EXCEPTION_SET; #undef GST_EXCEPTION + } #endif // GST_HEADER_Volume_VolumeExceptions
View file
GostCrypt_Linux_1.0.tar.gz/Volume/VolumeHeader.cpp -> GostCrypt_Linux_1.3.tar.gz/Volume/VolumeHeader.cpp
Changed
@@ -13,6 +13,7 @@ #include "Pkcs5Kdf.h" #include "VolumeHeader.h" #include "VolumeException.h" +#include "VolumeAlert.h" #include "Common/Crypto.h" namespace GostCrypt @@ -132,8 +133,10 @@ return false; } + bool VolumeHeader::Deserialize (const ConstBufferPtr &header, shared_ptr <EncryptionAlgorithm> &ea, shared_ptr <EncryptionMode> &mode) { + if (header.Size() != EncryptedHeaderDataSize) throw ParameterIncorrect (SRC_POS); @@ -143,11 +146,12 @@ header[3] != 'E') return false; +/* Vérification de la version du header */ size_t offset = 4; HeaderVersion = DeserializeEntry <uint16> (header, offset); if (HeaderVersion < MinAllowedHeaderVersion) - return false; + throw OlderVersionRequired (SRC_POS); if (HeaderVersion > CurrentHeaderVersion) throw HigherVersionRequired (SRC_POS); @@ -161,6 +165,7 @@ RequiredMinProgramVersion = DeserializeEntry <uint16> (header, offset); + if (RequiredMinProgramVersion > Version::Number()) throw HigherVersionRequired (SRC_POS); @@ -215,6 +220,7 @@ return true; } + template <typename T> T VolumeHeader::DeserializeEntry (const ConstBufferPtr &header, size_t &offset) const
View file
GostCrypt_Linux_1.0.tar.gz/Volume/VolumeHeader.h -> GostCrypt_Linux_1.3.tar.gz/Volume/VolumeHeader.h
Changed
@@ -73,6 +73,7 @@ uint64 GetVolumeDataSize () const { return VolumeDataSize; } VolumeTime GetVolumeCreationTime () const { return VolumeCreationTime; } void SetSize (uint32 headerSize); + uint16 GetHeaderVersion () const { return HeaderVersion; } protected: bool Deserialize (const ConstBufferPtr &header, shared_ptr <EncryptionAlgorithm> &ea, shared_ptr <EncryptionMode> &mode);
View file
GostCrypt_Linux_1.0.tar.gz/Volume/VolumeLayout.cpp -> GostCrypt_Linux_1.3.tar.gz/Volume/VolumeLayout.cpp
Changed
@@ -8,11 +8,8 @@ #include "Volume/EncryptionMode.h" -#include "Volume/EncryptionModeCBC.h" -#include "Volume/EncryptionModeLRW.h" #include "Volume/EncryptionModeXTS.h" #include "VolumeLayout.h" -#include "Boot/Windows/BootCommon.h" namespace GostCrypt { @@ -66,10 +63,10 @@ HeaderSize = GST_VOLUME_HEADER_SIZE_LEGACY; SupportedEncryptionAlgorithms.push_back (shared_ptr <EncryptionAlgorithm> (new GOST ())); + SupportedEncryptionAlgorithms.push_back (shared_ptr <EncryptionAlgorithm> (new GRASSHOPPER())); SupportedEncryptionModes.push_back (shared_ptr <EncryptionMode> (new EncryptionModeXTS ())); - SupportedEncryptionModes.push_back (shared_ptr <EncryptionMode> (new EncryptionModeLRW ())); - SupportedEncryptionModes.push_back (shared_ptr <EncryptionMode> (new EncryptionModeCBC ())); + } uint64 VolumeLayoutV1Normal::GetDataOffset (uint64 volumeHostSize) const @@ -90,10 +87,10 @@ HeaderSize = GST_VOLUME_HEADER_SIZE_LEGACY; SupportedEncryptionAlgorithms.push_back (shared_ptr <EncryptionAlgorithm> (new GOST ())); + SupportedEncryptionAlgorithms.push_back (shared_ptr <EncryptionAlgorithm> (new GRASSHOPPER())); SupportedEncryptionModes.push_back (shared_ptr <EncryptionMode> (new EncryptionModeXTS ())); - SupportedEncryptionModes.push_back (shared_ptr <EncryptionMode> (new EncryptionModeLRW ())); - SupportedEncryptionModes.push_back (shared_ptr <EncryptionMode> (new EncryptionModeCBC ())); + } uint64 VolumeLayoutV1Hidden::GetDataOffset (uint64 volumeHostSize) const @@ -115,6 +112,7 @@ BackupHeaderOffset = -GST_VOLUME_HEADER_GROUP_SIZE; SupportedEncryptionAlgorithms.push_back (shared_ptr <EncryptionAlgorithm> (new GOST ())); + SupportedEncryptionAlgorithms.push_back (shared_ptr <EncryptionAlgorithm> (new GRASSHOPPER())); SupportedEncryptionModes.push_back (shared_ptr <EncryptionMode> (new EncryptionModeXTS ())); } @@ -146,6 +144,7 @@ BackupHeaderOffset = -GST_HIDDEN_VOLUME_HEADER_OFFSET; SupportedEncryptionAlgorithms.push_back (shared_ptr <EncryptionAlgorithm> (new GOST ())); + SupportedEncryptionAlgorithms.push_back (shared_ptr <EncryptionAlgorithm> (new GRASSHOPPER())); SupportedEncryptionModes.push_back (shared_ptr <EncryptionMode> (new EncryptionModeXTS ())); } @@ -180,10 +179,11 @@ VolumeLayoutSystemEncryption::VolumeLayoutSystemEncryption () { Type = VolumeType::Normal; - HeaderOffset = GST_BOOT_VOLUME_HEADER_SECTOR_OFFSET; + //HeaderOffset = GST_BOOT_VOLUME_HEADER_SECTOR_OFFSET; HeaderSize = GST_BOOT_ENCRYPTION_VOLUME_HEADER_SIZE; SupportedEncryptionAlgorithms.push_back (shared_ptr <EncryptionAlgorithm> (new GOST ())); + SupportedEncryptionAlgorithms.push_back (shared_ptr <EncryptionAlgorithm> (new GRASSHOPPER())); SupportedEncryptionModes.push_back (shared_ptr <EncryptionMode> (new EncryptionModeXTS ())); }
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.