NanoSSL memory allocation problem

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

NanoSSL memory allocation problem

953 Views
ARQuattr
Contributor IV

Hi,

I'm trying to integrate Mocana NanoSSL into a project (CW10.0, MQX 3.6.2, MCF52255) and I tried to run a shell command (mss_ssl_client_cmd) that was included with some demo code.  The output is below, but essentially it seems to work fine up to the ASN1_Parse command, where it returns with a -6101 (ERR_MEM_ALLOC_FAIL) error.  Based on the reported line number I believe the problem is occurring at the MALLOC in TREE_MakeNewTreeItem() in the tree.c file.

Any ideas what is causing this error?

Thanks

Connecting to   [209.132.180.195: 443]

MOCANA_initLog()

LOG_OUTPUT: MSS WARNING NOT A PRODUCTION BUILD: MOCANA DEBUG CONSOLE HAS BEEN ENABLED.

SSL_init()

SSL_init: completed after = ( (0.70)) milliseconds.

mss_ssl_ca_mgmt_init_upcalls()

mss_rtcs_connect_socket()

SSL_connect()

LOG_OUTPUT: SSL INFO SSL client made connection.

SSL_negotiateConnection()

Handshake length = 57

(CLIENT) Client Hello

01 00 00 35 03 01 94 56 51 06 31 28 5a 82 0b 68

5d 4b ca 80 1d f2 a5 9d 50 e7 c7 32 14 0a cd a9

20 f9 35 49 ff c4 00 00 0e 00 2f 00 3c 00 35 00

3d 00 04 00 05 00 0a 01 00

Handshake length = 74

(CLIENT) Server hello

02 00 00 46 03 01 00 03 d4 2e 47 e1 63 fd 36 27

4e c3 20 1a ff e2 26 54 9d 89 30 8f be 76 45 96

dc fa a2 e1 a3 19 20 63 c9 2b c5 6f a5 9d 6f 86

5e 21 6a a4 02 a1 18 7c 3c f2 db 71 22 dd b0 d5

2a ce 11 d7 08 9c a4 00 04 00

ASN1_Parse() returns status = -6101

ASN1_Parse() @ line # 4651

handleClientHandshakeMessages() returns status = -6101

SSL_SOCK_receive() returns status = -6101

SSL:doProtocol() returns status = -6101

SSL_negotiateConnection() returns status = -6101

SSL negotiation is failed!

LOG_OUTPUT: SSL INFO SSL stack shutting down.

Connection failed

Connection closed


4 Replies

490 Views
aeroscalar
Contributor I

This is a critical question that deserves an answer!

0 Kudos

490 Views
Petr_H
NXP Employee
NXP Employee

Just a note - for critical issues and error please post a service request on our website www.freescale.com using the menu Support > Technical service request.

I was informed that this issue has already been submitted and our engineers are already solving the issue.

best regards

Petr Hradsky

Processor Expert Support Team

0 Kudos

490 Views
MPotts
Contributor III

Hi Petr,

If this issue has been solved I think it would be helpful to post details in this thread. This would help other NanoSSL users and avoid repeating similar queries via a service request which I have had to do.

FYI, my issue is simple. I am getting a memory allocation failure when I execute SSL_negotiateConnection(). This is presumably because NanoSSL is using the default MQX heap in on-chip RAM and there is not enough free memory. I have plenty of external RAM and I want to switch NanoSSL to use this memory. I have seen this capability mentioned but I have not located a mechanism to do it.

Any pointers to this information would be much appreciated.

Mark

0 Kudos

490 Views
ARQuattr
Contributor IV

Hi Mark, in working with Freescale we concluded as you did that there is simply insufficient internal RAM to support this module.

But I'm now in a similar situation as you are trying to get SSL to work off external RAM.  Please let me know if you make any progress with this.

Angelo

0 Kudos