On Fri, 18 Jun 2010 00:22:10 -0300
Ramon de Carvalho Valle <[email protected]> wrote:

> Check the return values of RSA_public_encrypt and RSA_private_decrypt
> functions appropriately.
> 
> Signed-off-by: Ramon de Carvalho Valle <[email protected]>

Ramon,

 I was able to patch and build opencryptoki with you patches (seems
 like it was a patch ordering thing with git-am and my claws mail).

 But I'm seeing a segfault when executing the rsa tests in the
 testsuite. Backtrace below:

(gdb) run -slot 1
Starting program: 
/home/klausk/sandbox/ock/sourceforge-git/opencryptoki/testcases/driver/rsa_tests
 -slot 1
[Thread debugging using libthread_db enabled]
Using slot #1...

With option: no_init: 0
warning: the debug information found in 
"/usr/lib/debug//lib64/libselinux.so.1.debug" does not match 
"/lib64/libselinux.so.1" (CRC mismatch).

warning: the debug information found in 
"/usr/lib/debug/lib64/libselinux.so.1.debug" does not match 
"/lib64/libselinux.so.1" (CRC mismatch).

RSA tests with 2048 bits keys...

do_GenerateRSAKey...
Looks okay...
Time:  172 msec
do_EncryptRSA_PKCS...

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff768d675 in rsa_format_block (in_data=0x7fffffffdd80 "", 
in_data_len=100, out_data=0x7fffffffd5c0 "", 
    out_data_len=256, type=2) at ../common/mech_rsa.c:434
434         out_data[i] = (CK_BYTE)0;
(gdb) where
#0  0x00007ffff768d675 in rsa_format_block (in_data=0x7fffffffdd80 "", 
in_data_len=100, out_data=0x7fffffffd5c0 "", 
    out_data_len=256, type=2) at ../common/mech_rsa.c:434
#1  0x00007ffff768da33 in rsa_pkcs_encrypt (sess=0x61a7d0, length_only=0 
'\000', ctx=0x61a810, in_data=
    0x7fffffffdd80 "", in_data_len=100, out_data=0x7fffffffda80 "@\364a", 
out_data_len=0x7fffffffd9c0)
    at ../common/mech_rsa.c:640
#2  0x00007ffff7677986 in encr_mgr_encrypt (sess=0x61a7d0, length_only=0 
'\000', ctx=0x61a810, in_data=
    0x7fffffffdd80 "", in_data_len=100, out_data=0x7fffffffda80 "@\364a", 
out_data_len=0x7fffffffd9c0)
    at ../common/encr_mgr.c:846
#3  0x00007ffff769b715 in SC_Encrypt (sSession=..., pData=0x7fffffffdd80 "", 
ulDataLen=100, pEncryptedData=
    0x7fffffffda80 "@\364a", pulEncryptedDataLen=0x7fffffffd9c0) at 
../common/new_host.c:2392
#4  0x00007ffff7dcdefc in C_Encrypt (hSession=6408912, pData=0x7fffffffdd80 "", 
ulDataLen=100, pEncryptedData=
    0x7fffffffda80 "@\364a", pulEncryptedDataLen=0x7fffffffd9c0) at 
api_interface.c:1673
#5  0x00000000004011c1 in do_EncryptRSA_PKCS () at rsa_func.c:192
#6  0x0000000000405d03 in rsa_functions () at rsa_func.c:2037
#7  0x0000000000405c5e in main (argc=3, argv=0x7fffffffdfc8) at rsa_func.c:2013
(gdb) 

Could you please verify?

 Thanks!

 -Klaus

-- 
Klaus Heinrich Kiwi | [email protected] | http://blog.klauskiwi.com
Open Source Security blog :     http://www.ratliff.net/blog
IBM Linux Technology Center :   http://www.ibm.com/linux/ltc

------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
Opencryptoki-tech mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opencryptoki-tech

Reply via email to