I am using the virtual machine instant-veins-4-7-1-i1
on VirtualBox with Omnet++-5.3
and Sumo-0.32.0
.
I have installed the library openssl
version 1.1.0. When I try to access to the struct ECDSA_SIG
that store the signature with the function ECDSA_SIG_get0
the simulation terminate suddenly with the following error
This is a snippet of the code that generate the error:
ECDSA_SIG * signed_hash;
s->generateSignature(message, messageLength, signed_hash);
const BIGNUM **pr;
const BIGNUM **ps;
ECDSA_SIG_get0(signed_hash, pr, ps);
The generateSignature
function code is:
void SignatureOpenSSL::generateSignature(const unsigned char* message, int messageLength, ECDSA_SIG * signed_hash)
{
unsigned char *md;
unsigned char *hash;
hash = SHA256(message, messageLength, md);
// Computes the ECDSA signature of the given message using the supplied private key and returns the created signature
signed_hash = ECDSA_do_sign(hash, 32, eckey);
if (signed_hash == NULL){
std::cout <<" ko signature " << std::endl;
}else{
std::cout <<" ok signature" << std::endl;
}
}
I have upgraded the openssl
library to version 1.1.1 but the error keeps occurring.
What am I doing wrong?
Thanks