OpenQNX :: The QNX Community Portal

Jul 05, 2008 - 11:07 AM
Google
  Web openqnx.com   
     Create an account Home · Submit News · QNX Forums · QNX Download · Search   
_
Main Menu
Who's Online
There are 41 unlogged users and 0 registered users online.

You can log-in or register for a user account here.

Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
nayak
Post subject: openSSL ->QNX ->MPC5200b  PostPosted: Dec 06, 2007 - 05:32 AM
Active Member


Joined: Nov 19, 2007
Posts: 16

I have ported the openssl for QNX6 and I have modified the "Configure" and added a configuration for the MPC5200B target.
I have made the following change in the configuartion file:

"qnx6-mpc5200b-qcc", "qcc:-Vgcc_ntoppcbe -DCPU=MPC5200b -DVARIANT_be -DTERMIOS::(unknown)::-lsocket::",

After configuring the openssl when I do "Make" the lib's(libcrypto.a,libssl.a) are generated.

I created a sample application which does signing and verification. I built the code with the openssl Lib(libcrypto.a,libssl.a).
The sample application looks like this.
/***************************************/
int main()
{
EC_KEY *eckey ;
int ret;
ECDSA_SIG *sig = NULL;

unsigned char dgst[20]= "myapplication";
size_t readchar = 0 ;

eckey = EC_KEY_new();
if (eckey == NULL)
{
printf("Could not generate key\n");
}
else
printf(" EC_KEY_new() success\n");
eckey->group = EC_GROUP_new_by_curve_name(NID_sect163k1);
if (eckey->group == NULL)
{
/* error */
}
else
printf(" EC_GROUP_new_by_curve_name() success\n");
if (!EC_KEY_generate_key(eckey))
{
printf("\n\n Error in key generation\n");

}
else
printf("\n\n ECC Private and Public key pair generated Successfully.\n");

sig = ECDSA_do_sign(dgst,(int)readchar, eckey);
if(sig == NULL)
printf("\n\n Signing Failed");

ret = ECDSA_do_verify(dgst,(int)readchar , sig, eckey);

if(ret == 0 ||ret == -1 )
printf("\n\n Verfication Failed");
else
printf("\n ECC Signing and Verfication using OpenSSL is done Successfully.\n");

return 0;
}
/***************************************/

But "EC_KEY_generate_key(eckey)" fails subsequently "ECDSA_do_sign" and "ECDSA_do_verify".
The same code runs on windows.Does that mean openssl is not ported properly? Am I missing something here?

It will be great if I get some pointers.

regards
Nayak
 
 View user's profile Send private message  
Reply with quote Back to top
rgallen
Post subject: Re: openSSL ->QNX ->MPC5200b  PostPosted: Dec 09, 2007 - 04:24 PM
QNX Master


Joined: Jul 11, 2002
Posts: 600

nayak wrote:

But "EC_KEY_generate_key(eckey)" fails subsequently "ECDSA_do_sign" and "ECDSA_do_verify".
The same code runs on windows.Does that mean openssl is not ported properly? Am I missing something here?

It will be great if I get some pointers.

regards
Nayak


Do you have /dev/random?
 
 View user's profile Send private message Visit poster's website  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by PNphpBB2 © 2003-2007 The PNphpBB Group
Credits
All logos and trademarks in this site are property of their respective owners. The comments are property of their posters.
Powered by OpenQNX: The QNX Community Portal Site
QNX and the QNX logo are registered trademarks of QNX Software Systems.