Hi,

I am seeing a core dump in RSA_check_key() function. The backtrace is as below.
I am unable to understand what is causing the issue. The core dump is 
intermittent (not always reproduced).
Could someone please provide any pointers if I am missing any check?

--
Thanks,
Nilesh

P.S.

The code generating crash is:
                        // fp is a valid pointer to the private key file in PEM 
format.
                RSA *rsa = (RSA *) PEM_read_RSAPrivateKey(fp, NULL, NULL, NULL);
                if (!rsa) {                        
                        return -1;
                }

                if (RSA_check_key(rsa) != 1) {
                        RSA_free(rsa);
                        rsa = NULL;
                }

Back trace:
Program terminated with signal 11, Segmentation fault.
#0  sha1_block_data_order_ssse3 () at sha1-x86_64.s:2240
#0  sha1_block_data_order_ssse3 () at sha1-x86_64.s:2240
#1  0xca62c1d6ca62c1d6 in ?? ()
#2  0xca62c1d6ca62c1d6 in ?? ()
#3  0xca62c1d6ca62c1d6 in ?? ()
#4  0xca62c1d6ca62c1d6 in ?? ()
#5  0xca62c1d6ca62c1d6 in ?? ()
#6  0xca62c1d6ca62c1d6 in ?? ()
#7  0xca62c1d6ca62c1d6 in ?? ()
#8  0xca62c1d6ca62c1d6 in ?? ()
#9  0x00000032543be076 in state () from /lib64/libcrypto.so.10
#10 0x00007fd508008210 in ?? ()
#11 0x0000000000000029 in ?? ()
#12 0x000000325406acf7 in SHA1_Update (c=0xe992ba8d, data_=<value optimized 
out>, len=<value optimized out>) at ../md32_common.h:325
#13 0x00000032540ce30f in ssleay_rand_bytes (buf=0x7fd5080081c0 "", num=54, 
pseudo=1) at md_rand.c:498
#14 0x00000032540a2535 in bnrand (pseudorand=1, rnd=0x7fd5080075f0, bits=512, 
top=-1, bottom=0) at bn_rand.c:147
#15 0x00000032540a2358 in bn_rand_range (pseudo=<value optimized out>, 
r=0x7fd5080075f0, range=0x7fd5080075c0) at bn_rand.c:281
#16 0x00000032540a533b in BN_is_prime_fasttest_ex (a=0x7fd508007be0, checks=6, 
ctx_passed=0x0, do_trial_division=<value optimized out>, cb=0x0)
    at bn_prime.c:322
#17 0x00000032540b2775 in RSA_check_key (key=0x7fd508007940) at rsa_chk.c:88

______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           majord...@openssl.org

Reply via email to