Title: CRYPTO_malloc - segmentation fault on Solaris 2.5.1

Hello,

I've just installed openssl-0.9.6g on a sparc Solaris 2.5.1 - (compiler: gcc version 2.95.3 20010315 (release)).

I also compiled an program which uses OpenSSL for its libcrypto library. When running this program,
I keep getting a segmentation fault when calling CRYPTO_malloc and I can't seem to figure out why this is happenning:


Here's a truss of my program when it crashes:

    Incurred fault #6, FLTBOUNDS  %pc = 0x0044B630
      siginfo: SIGSEGV SEGV_MAPERR addr=0x0044B630
    Received signal #11, SIGSEGV [default]
      siginfo: SIGSEGV SEGV_MAPERR addr=0x0044B630
        *** process killed ***

And here's what gdb says:

(gdb) where
#0  0x44b630 in ?? ()
#1  0xef52429c in CRYPTO_malloc ()
#2  0xef55ee10 in BIO_new ()
#3  0xef560110 in BIO_new_mem_buf ()
#4  0xef791b60 in CryptOpenSSL_read_public_RSA_from_mem (
    clePublique=0x255f0 "-----BEGIN PUBLIC KEY-----\nMIGdMA0GCSqGSIb3DQEBAQUAA4GLADCBhwKBgQDptYTOdOuFa0tPCLL3qWZ1Aymv\nf9GL18CYD2x6n9i7C7juCVueYutFkRYLt5uqzuejpT2BibaxlNgN/9KcMC+odQvv\nlfFMRy6yDCqaFiw6Xzb+qABTNQ/L3nWvLYjO1Fu1Ml/"...)

    at KercashCrypt-openssl.c:239
#5  0xef79128c in Crypt_RSAEncryptString (
    clePublique=0x255f0 "-----BEGIN PUBLIC KEY-----\nMIGdMA0GCSqGSIb3DQEBAQUAA4GLADCBhwKBgQDptYTOdOuFa0tPCLL3qWZ1Aymv\nf9GL18CYD2x6n9i7C7juCVueYutFkRYLt5uqzuejpT2BibaxlNgN/9KcMC+odQvv\nlfFMRy6yDCqaFiw6Xzb+qABTNQ/L3nWvLYjO1Fu1Ml/"...,

    message=0x24608 "00&12") at KercashCrypt.c:68
#6  0xef7735e8 in KertelMP_Send (Con=0x244c8, c=0x24608 "00&12", bAvecCryptage=1) at KercashApi.c:963
#7  0xef773884 in KertelMP_SendCommande (Con=0x244c8, cmd=0x25ac0) at KercashApi.c:1023
#8  0xef7744e0 in KertelMP_Connect (sSiteId=0xeffffd6f "12", Con=0x220c8, pRet=0x220c4) at KercashApi.c:1399
#9  0x109c4 in main (argc=5, argv=0xeffffc6c) at kmpclient.c:85


... and here's the source which generates this:


/**
 * Read a public RSA structure from memory.
 * clePublique should be a null-terminated string.
 */
RSA* CryptOpenSSL_read_public_RSA_from_mem(const char* clePublique) {
        BIO* bio = NULL;
        EVP_PKEY* pKey = NULL;
        RSA* rsa = NULL;

        bio = BIO_new_mem_buf(clePublique, -1);

        pKey = PEM_read_bio_PUBKEY (bio, NULL, NULL, NULL);
        rsa = EVP_PKEY_get1_RSA(pKey);
        EVP_PKEY_free(pKey);

        BIO_free(bio);
        return rsa;
}


Should you have any idea, I'd be more than happy to hear it.

Best regards,

Adrian Petru Dimulescu

01.72.30.52.51
Kertel



**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.


**********************************************************************

Reply via email to