• Home
  • Help
  • Search
  • Login
  • Register
Pages: [1]
Author Topic: truecrypt compilation problem  (Read 5485 times)
theblop
Newbie
*

Karma: 0
Posts: 21


View Profile
« on: September 16, 2009, 01:59:12 PM »

Hi,

Has anyone managed to get truecrypt (v6.2a) to work on the plug?

I get this error at the end of the compilation:

Code:
Linking truecrypt
Error: TestFailed at TrueCrypt::EncryptionTest::TestXtsAES:440

I tried recompiling with optimisation and got the same error.

The exception is raised in at the end of TestXtsAES() in ./Volume/EncryptionTest.cpp by a failed memcmp() test:

Code:
    412         void EncryptionTest::TestXtsAES ()
    413         {
    414                 unsigned __int8 p[ENCRYPTION_DATA_UNIT_SIZE];
    415                 uint64 dataUnitNo;
    416                 int i;
    417
    418                 for (i = 0; i < array_capacity (XtsTestVectors); i++)
    419                 {
    420                         AES aes;
    421                         shared_ptr <EncryptionMode> xts (new EncryptionModeXTS);
    422
    423                         aes.SetKey (ConstBufferPtr (XtsTestVectors[i].key1, sizeof (XtsTestVectors[i].key1)));
    424                         xts->SetKey (ConstBufferPtr (XtsTestVectors[i].key2, sizeof (XtsTestVectors[i].key2)));
    425                         aes.SetMode (xts);
    426
    427                         memcpy (p, XtsTestVectors[i].plaintext, sizeof (p));
    428
    429                         dataUnitNo = Endian::Big (*((uint64 *) XtsTestVectors[i].dataUnitNo));
    430
    431                         aes.EncryptSectors (p, dataUnitNo, sizeof (p) / ENCRYPTION_DATA_UNIT_SIZE, ENCRYPTION_DATA_UNIT_SI    431 ZE);
    432
    433                         aes.DecryptSectors (p, dataUnitNo, sizeof (p) / ENCRYPTION_DATA_UNIT_SIZE, ENCRYPTION_DATA_UNIT_SI    433 ZE);
    434                         if (memcmp (XtsTestVectors[i].ciphertext, p, sizeof (p)) == 0)
    435                                 throw TestFailed (SRC_POS);
    436
    437                         aes.EncryptSectors (p, dataUnitNo, sizeof (p) / ENCRYPTION_DATA_UNIT_SIZE, ENCRYPTION_DATA_UNIT_SI    437 ZE);
    438
>>> 439                         if (memcmp (XtsTestVectors[i].ciphertext, p, sizeof (p)) != 0)
>>> 440                                 throw TestFailed (SRC_POS);
    441                 }
    442         }

I commented out all the encryption tests and recompiled, this removes the error and I even get truecrypt to generate an encrypted volume file but it can't decrypt it so I guess these failed tests can't really be ignored Smiley

I'm using gcc 4.3.2 on debian with the 2.6.29-2-kirkwood kernel.

- theblop
Logged

nigelhealy
Newbie
*

Karma: 0
Posts: 8


View Profile
« Reply #1 on: July 14, 2010, 05:01:27 AM »

Hi, I've wasted a day on the topic of getting Truecrypt compiled. I lost a lot of time in WX related stuff.

For your specific problem, the wiki is out of date. There is a need to patch a file in the source code.
http://www.plugcomputer.org/plugwiki/index.php/Ubuntu_TrueCrypt_Compilation

The actual patch applies version 6.3, not 6.3a, the patch fails on 6.3a. I looked at the patch and looked at the source code and made my own edits.

Then make would finish successfully.

You then to use the truecrypt executable must use --mount-options=nokernelcrypto option.

then it works (so far... I'm still testing)
Logged

alessio
Newbie
*

Karma: 2
Posts: 5


View Profile
« Reply #2 on: July 21, 2010, 11:55:44 AM »

I had a lot of problems compiling truecrypt 6.3, mainly with wxwidgets.
The latest version 7.0 compiles without problems. Just follow the instructions
in the accopanying Readme.txt
Logged

nigelhealy
Newbie
*

Karma: 0
Posts: 8


View Profile
« Reply #3 on: November 22, 2010, 09:40:33 PM »

Once you've done it the first time its not a challenge, however the combination of an old Ubuntu 9.04 and the Sheevaplug makes for some wrinkles.

So
Code:
# Get the sourcecode for Truectypt off their website, here assume called Source.tar.gz
tar -xvzf Source.tar.gz
wget http://prdownloads.sourceforge.net/wxwindows/wxWidgets-2.8.11.tar.gz
tar -xvf wxWidgets-2.8.11.tar.gz
cd truecrypt-7.0a-source
wget 'ftp://ftp.rsasecurity.com/pub/pkcs/pkcs-11/v2-20/pkcs11.h'
wget 'ftp://ftp.rsasecurity.com/pub/pkcs/pkcs-11/v2-20/pkcs11f.h'
wget 'ftp://ftp.rsasecurity.com/pub/pkcs/pkcs-11/v2-20/pkcs11t.h'
make NOGUI=1 WX_ROOT=/home/nigel/wxWidgets-2.8.11 wxbuild
cd to Crypto and edit Rmd160.c around line 91 so one line is commented out and 2 lines added so it looks like this
Code:

                /* Process data in RIPEMD160_BLOCK_LENGTH-byte chunks. */
                while (len >= RIPEMD160_BLOCK_LENGTH) {
/*                      RMD160Transform ((uint32 *) ctx->state, (const uint32 *) input); */
                        memcpy(ctx->buffer, input, RIPEMD160_BLOCK_LENGTH);
                        RMD160Transform ((uint32 *) ctx->state, (const uint32 *) ctx->buffer);
                        input += RIPEMD160_BLOCK_LENGTH;
                        len -= RIPEMD160_BLOCK_LENGTH;
                }

Then cd back up and then 'make'.

It should compile now no problems.  The executable is in the Main folder.

To run you must use the  --mount-options=nokernelcrypto command-line. e.g.
Code:
truecrypt --mount-options=nokernelcrypto /mnt/usb_16gb_ext3/nigel/nigel
Logged

odoll
Full Member
***

Karma: 0
Posts: 148


View Profile
« Reply #4 on: December 02, 2010, 10:47:14 AM »

sorry, u*x noob question:

I tried to follow the instructions given in the Readme.txt and here, however I ran into the following error trying to build wxWidgets under Debian Squeeze (2.6.32.5) on my SheevaPlug.

Code:
root@Share:/mnt/sda1/dev/TrueCrypt/truecrypt-7.0a-source# make NOGUI=1 WX_ROOT=/mnt/sda1/dev/TrueCrypt/wxWidgets-2.8.11 wxbuild
Configuring wxWidgets library...
configure: error: Can't use --enable-std_string without std::wstring or std::basic_string<wchar_t>
make: *** [wxbuild] Error 1

Any idea what went wrong and how to overcome this? - thx
Logged

Pages: [1]
Print
Jump to: