Crash in BN_PRIME.c generating prime number for NASSLX509Generate

Hello All,

Whilst single stepping through and leaving breakpoints like bread crumbs, I found the following problem in my applicationStart() (please see the gdb output below)…

I am curious if anyone has seen the same. Basically I copied the https example code into a copy of the template application.

Also, I have undef’ed the stdio port redirection and am attempting to use the SPI driver on the gpio pins… this seems to be OK (in that it does not appear to crash as I am into applicationStart()). I don’t know if this is related or of consequence…

I am curious the issue lies with the callback variable in the following gdb console window ‘dump’?

Thank you,
-chris

Breakpoint 21, applicationStart () at …/root.c:167
NASSLX509Generate (certificate_data=0x307c2c, key_data=0x307c20, key_data_len=0x307c1c, certificate_key_type=0x1, certificate_key_size=0x400, serial_number=0x1, name_sub=0x8109d64 “NAHTTPS Example Certificate”, not_before_utc=0x8109d80 “020630120000Z”, not_after_utc=0x8109d90 “120630120000Z”) at src/ssl/tls_api.c:640

Breakpoint 27, 0x080adf9c in NASSLX509Generate (certificate_data=0x307c2c, key_data=0x307c20, key_data_len=0x307c1c, certificate_key_type=0x1, certificate_key_size=0x400, serial_number=0x1, name_sub=0x8109d64 “NAHTTPS Example Certificate”, not_before_utc=0x8109d80 “020630120000Z”, not_after_utc=0x8109d90 “120630120000Z”) at src/ssl/tls_api.c:692
RSA_generate_key (bits=0x0, e_value=0x0, callback=0, cb_arg=0x0) at rsa_gen.c:67

Breakpoint 29, 0x080ce4a0 in RSA_generate_key (bits=0x0, e_value=0x23, callback=0, cb_arg=0x0) at rsa_gen.c:108
BN_generate_prime (ret=0x0, bits=0x38e540, safe=0x0, add=0x0, rem=0xffffffff, callback=0x23, cb_arg=0x0) at bn_prime.c:135

Breakpoint 30, 0x080eaa7c in BN_generate_prime (ret=0x0, bits=0x200, safe=0x0, add=0x0, rem=0x0, callback=0, cb_arg=0x0) at bn_prime.c:141

Breakpoint 32, 0x080eaa90 in BN_generate_prime (ret=0x0, bits=0x200, safe=0x0, add=0x0, rem=0x0, callback=0, cb_arg=0x0) at bn_prime.c:141

Breakpoint 31, 0x080eaa94 in BN_generate_prime (ret=0x0, bits=0x200, safe=0x0, add=0x0, rem=0x0, callback=0, cb_arg=0x0) at bn_prime.c:141

Breakpoint 33, 0x080eaaa4 in BN_generate_prime (ret=0x0, bits=0x200, safe=0x0, add=0x0, rem=0x0, callback=0, cb_arg=0x0) at bn_prime.c:141

Breakpoint 34, 0x080eaacc in BN_generate_prime (ret=0x0, bits=0x200, safe=0x0, add=0x0, rem=0x0, callback=0, cb_arg=0x0) at bn_prime.c:141

Breakpoint 2, customizeExceptionHandler (exceptionType=Cannot access memory at address 0xfffffff0

Two notes:

>> I have undef’ed the stdio port redirection and am attempting to use the SPI driver on the gpio pins…

That doesn’t work on the ConnectME. Also there are a few spots that force the use of DCD and its brethren. These need to be manually commented out. I think it is in netos_serl.c.

>> I don’t know if this is related or of consequence…

Consequence. The serial driver has nothing to do with the SSL library. Since Digi uses a kludged piecemeal SSL library, they will have to help you with that.

-Erik

Yah, I have given up on the SPI in hardware… Now I am faking it in software with GPIO (yikes!).

Cheers,
-chris

How did you get around the startup issues? The GPIOs lock up at startup and freeze my SPI bus when I do that.

-Erik