On Fri, 18 Jun 2010 11:48:11 -0300
Klaus Heinrich Kiwi <[email protected]> wrote:

> 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;

'i' was missing an assignment when block type was '2', so something
like the below solved the issue:

diff --git a/usr/lib/pkcs11/common/mech_rsa.c
b/usr/lib/pkcs11/common/mech_rsa.c index b3682ce..b0b0f34 100755
--- a/usr/lib/pkcs11/common/mech_rsa.c
+++ b/usr/lib/pkcs11/common/mech_rsa.c
@@ -422,6 +422,7 @@ rsa_format_block( CK_BYTE   * in_data,
                 st_err_log(130, __FILE__, __LINE__);
                 return rc;
             }
+            i = i + padding_len;
 
             break;
 

I'm amending your patch 4/6 to account for this change and pushing
upstream.

 -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