HI...
I'm working on an SSL client/server application, and I've generated a digital signature, and whenever I pass it to another function, the value of the digital signature changes in the middle of the function.
int CLIENT::SSL_client_side(const char * MN, bool l, const char * digitalSignature, CkString Digital_Certificate)
{
CkSocket socket;
bool success;
success = socket.UnlockComponent("*******************");
if (success != true) {
printf("%s\n",socket.lastErrorText());
return 0;}
bool ssl;
ssl = true;
long maxWaitMillisec;
maxWaitMillisec = 60000;
const char * sslServerHost;
sslServerHost = "******";
long sslServerPort;
sslServerPort = 8123;
success = socket.Connect(sslServerHost,sslServerPort,ssl,maxWaitMillisec);
if (success != true) {
printf("%s\n",socket.lastErrorText());
return 0;}
socket.put_MaxReadIdleMs(50000);
socket.put_MaxSendIdleMs(50000);
success = socket.SendString("CLIENT PC: Hello Merchant! -EOM-");
if (success != true) {
printf("%s\n",socket.lastErrorText());
return 0;}
const char * receivedMsg;
receivedMsg = socket.receiveUntilMatch("-EOM-");
if (receivedMsg == 0 )
{
printf("%s\n",socket.lastErrorText());
return 0;
}
printf("%s\n",receivedMsg);
if (l == true)
{
char MN[4096];
printf("ENTER YOUR MOBILE NUMBER:");
gets(MN);
success=socket.SendString((const char *)MN);
if (success != true) {
printf("%s\n",socket.lastErrorText());
return 0; }
success = socket.SendString(Digital_Certificate);
if (success != true) {
printf("%s\n",socket.lastErrorText());
return 0; }
success = socket.SendString(digitalSignature);
if (success != true) {
printf("%s\n",socket.lastErrorText());
return 0; }
}
return 0;
}
And to be very specific, the contents of the digital Signature changes right after the following statement:
success = socket.Connect(sslServerHost,sslServerPort,ssl,maxWaitMillisec);
Please, need help
Regards.