cross compilation and GPGME: Invalid crypto engine error

Oguz Yarimtepe comp.ogz at gmail.com
Sat Mar 14 12:43:50 CET 2009


On Fri, 2009-03-13 at 22:36 +0100, Marcus Brinkmann wrote:
> Oguz Yarimtepe wrote:
> > Hi,
> > 
> > I cross compiled gpgme1.0-1.1.5 for STLinux2.2 system. First i cross
> > compiled and installed pth-2.0.7, then libgpg-error-1.4, gnupg-1.4.6 and
> > gpgme1.0-1.1.5. I disabled lfs while compiling gpgme. After installation
> > i compiled my c code. When i ran the binary, i got the error message
> > saying "GPGME: Invalid crypto engine error" at the line 111 that is
> > gpgme_engine_check_version function. 
> 
> This could be due to gpgme not finding the gpg binary.  gpgme detects the path
> to gpg at configure time and it is compiled into the library.
> 
> Check the output of configure, it prints the detected paths.  It should have
> complained about cross compilation and given you advice to use --with-gpg=path
> to configure it,
> 

After struggling with a little more, i gave up and transferred the files
to the cross environment. Compiled them on the cross platform. 

Here is the version numbers and how i configure them. 

pth-2.0.7

./configure --prefix=/usr, make, make install

libgpg-error-1.4

./configure --prefix=/usr, make, make install

gnupg-1.4.6

./configure --prefix=/usr --disable-largefile, make, make install

gpgme1.0-1.1.5

./configure --prefix=/usr --enable-static --with-gpg=/usr/bin/gpg
--without-gpgsm --disable-largefile --without-pth-test

I am attaching the c and header file also. The application is decrypting
a file and creating the decrypted version.

I created the encrypted file as

gpg -se -r "Mr Receiver" thefile

The program is taking thefile as input. It is working on my desktop
machine but the same app is not running on the cross platform. The
gpgme_data_read is returning 0 so the created file size is always 0. I
am attaching the log file also after the GPGME_DEBUG=9 setting.

Will be happy if someone guide me to make it work. Below is the settings
of the cross environment

# cat /proc/cpuinfo
machine		: STb7100 Reference board
processor	: 0
cpu family	: sh4
cpu type	: STb710x
cpu flags	: fpu
cache type	: split (harvard)
icache size	: 16KiB (2-way)
dcache size	: 32KiB (2-way)
bogomips	: 263.16
pll0_clk    	: 531.00MHz
pll1_clk    	: 400.00MHz
sh4_clk     	: 265.50MHz
sh4_ic_clk  	: 132.75MHz
module_clk  	: 66.37MHz
slim_clk    	: 265.50MHz
comms_clk   	: 100.00MHz
tmu0_clk    	: 16.59MHz

# cat /proc/meminfo 
MemTotal:        46216 kB
MemFree:         21636 kB
Buffers:             0 kB
Cached:          19420 kB
SwapCached:          0 kB
Active:           4876 kB
Inactive:        15952 kB
HighTotal:           0 kB
HighFree:            0 kB
LowTotal:        46216 kB
LowFree:         21636 kB
SwapTotal:           0 kB
SwapFree:            0 kB
Dirty:               0 kB
Writeback:           0 kB
Mapped:           3416 kB
Slab:             2624 kB
CommitLimit:     23108 kB
Committed_AS:     4156 kB
PageTables:        156 kB
VmallocTotal:   523252 kB
VmallocUsed:       372 kB
VmallocChunk:   522880 kB



> How did you invoke configure for cross compilation?
> 
> > At the cross compiled system, i ran gpg --list-keys and i could see the
> > keys. Also i could see the gpg -se -r "something" test.txt working. gpg
> > -d also working. 
> 
> env GPGME_DEBUG=9 gives you more info about what GPGME is doing.
> 
> Thanks,
> Marcus
> 
> _______________________________________________
> Gnupg-devel mailing list
> Gnupg-devel at gnupg.org
> http://lists.gnupg.org/mailman/listinfo/gnupg-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: trustcheck.c
Type: text/x-csrc
Size: 474 bytes
Desc: not available
URL: </pipermail/attachments/20090314/f476e020/attachment.c>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: trustcheck.h
Type: text/x-chdr
Size: 4049 bytes
Desc: not available
URL: </pipermail/attachments/20090314/f476e020/attachment.h>
-------------- next part --------------
gpgme_debug: level=9
posix-io.c:145: closing fd 4
posix-io.c:82: fd 3: about to read 79 bytes
posix-io.c:89: fd 3: got 79 bytes
fd 3: got `gpg (GnuPG) 1.4.6
Copyright (C) 2006 Free Software Foundation, Inc.
This progra'
posix-io.c:145: closing fd 3
posix-io.c:167: set notification for fd 3
posix-io.c:167: set notification for fd 4
posix-io.c:167: set notification for fd 5
posix-io.c:167: set notification for fd 6
posix-io.c:145: closing fd 4
posix-io.c:145: closing fd 6
posix-io.c:332: gpgme:select on [ r3 r5 ]
posix-io.c:378: select OK [ r5 ]
posix-io.c:332: gpgme:select on [ r5 ]
posix-io.c:378: select OK [ r5 ]
posix-io.c:82: fd 5: about to read 1024 bytes
posix-io.c:89: fd 5: got 340 bytes
fd 5: got `tru::1:1236586545:0:3:1:5
pub:u:1024:17:40E1989F942A4E66:1236586538:::u:::scESC:
fpr:::::::::0F772D0FAB0426EC5FC9C2E040E1989F942A4E66:
uid:u::::1236586538::B1F263E767B5CA05C1DEE169D11EC4F0A09E8F90::Mr Receiver <receiver at somewhere.com>:
sub:u:2048:16:E1BD67542A86D5F0:1236586545::::::e:
fpr:::::::::3BA720B8428086FAAC1B5272E1BD67542A86D5F0:
'
keylist.c:397: keylist_colon_handler ctx = 0x4120b0, key = (nil), line = tru::1:1236586545:0:3:1:5
keylist.c:397: keylist_colon_handler ctx = 0x4120b0, key = (nil), line = pub:u:1024:17:40E1989F942A4E66:1236586538:::u:::scESC:
keylist.c:397: keylist_colon_handler ctx = 0x4120b0, key = 0x412fd8, line = fpr:::::::::0F772D0FAB0426EC5FC9C2E040E1989F942A4E66:
keylist.c:397: keylist_colon_handler ctx = 0x4120b0, key = 0x412fd8, line = uid:u::::1236586538::B1F263E767B5CA05C1DEE169D11EC4F0A09E8F90::Mr Receiver <receiver at somewhere.com>:
keylist.c:397: keylist_colon_handler ctx = 0x4120b0, key = 0x412fd8, line = sub:u:2048:16:E1BD67542A86D5F0:1236586545::::::e:
keylist.c:397: keylist_colon_handler ctx = 0x4120b0, key = 0x412fd8, line = fpr:::::::::3BA720B8428086FAAC1B5272E1BD67542A86D5F0:
posix-io.c:332: gpgme:select on [ r3 r5 ]
posix-io.c:378: select OK [ r5 ]
posix-io.c:332: gpgme:select on [ r5 ]
posix-io.c:378: select OK [ r5 ]
posix-io.c:82: fd 5: about to read 1024 bytes
posix-io.c:89: fd 5: got 0 bytes
keylist.c:397: keylist_colon_handler ctx = 0x4120b0, key = 0x412fd8, line = (null)
posix-io.c:145: closing fd 5
wait.c:160: setting fd 5 (item=0x413140) done
posix-io.c:145: closing fd 3
wait.c:160: setting fd 3 (item=0x413020) done
posix-io.c:167: set notification for fd 3
posix-io.c:167: set notification for fd 4
posix-io.c:167: set notification for fd 5
posix-io.c:167: set notification for fd 6
posix-io.c:167: set notification for fd 7
posix-io.c:167: set notification for fd 8
posix-io.c:167: set notification for fd 9
posix-io.c:167: set notification for fd 10
posix-io.c:332: gpgme:select on [ ]
posix-io.c:145: closing fd 3
posix-io.c:145: closing fd 4
posix-io.c:145: closing fd 6
posix-io.c:145: closing fd 5
posix-io.c:145: closing fd 7
posix-io.c:145: closing fd 8
posix-io.c:145: closing fd 10
posix-io.c:145: closing fd 9
40E1989F942A4E66 receiver at somewhere.com Mr Receiver <receiver at somewhere.com>
ret: 0
return size=0


More information about the Gnupg-devel mailing list