Hi,
We are facing some issue with rsa key size while porting our application
from montavista to RHEL 6.4.

The RSA key size(RSA_size) for montavista is returning 128 bytes but on
RHEL its returning 129 bytes.

#include <openssl/bn.h>

#include <stdlib.h>
#include <time.h>
#include <openssl/ssl.h>
#include <openssl/rsa.h>
#include <openssl/md5.h>
#include <openssl/evp.h>


/*using namespace std; */
int main()
{

RSA *rsa_pb = 0;
unsigned int authMsgLen = 0;
rsa_pb = RSA_new();
static char evc41_lg_n[] =
"155461468878137924780952081903031227576222509385846279319048916001752025100615237943340425486157346876604219223131643357452911097864741470169369275270067558869064161833650298945491423162034462611882047283976121790220680041467155931440845770244995083344133190925465159949456383958641405933050126040553008833193";*
// evc41 lg public exponent
static char evc41_lg_e[] = "65537";

BN_dec2bn( &(rsa_pb->n), evc40_lg_n);
BN_dec2bn( &(rsa_pb->e), evc40_lg_e);

authMsgLen = RSA_size(rsa_pb);
printf("Msg Length:z %d:%d",authMsgLen,z);

return 0;
}

authMsgLen in montavista is 128 and for rhel 6.4 it is 129.

There is a check in our code which checks authMsgLen against 128 and this
fails in rhel. We commented the same but later RSA_verify also failed.

Montavista openssl version : 0.98
RHEL openssl version : 1.0.0

Can anyone please let me know what is the issue?

Thanks,
Som

Reply via email to