Hi,
am I missing something or following source code shows an OpenSSL bug
(duplication is not well performed) ?
NL
OpenSSL version: 1.0.0 beta 3 and 1.0.0 beta 4
OS : Win 32 xp
//-------------------------------------------------------------------------
--------------------------------------------------
#include "openssl\ts.h"
#include <iostream>
int main(int argc, char* argv[])
{
X509_ALGOR * algo = X509_ALGOR_new();
ASN1_OBJECT_free(algo->algorithm);
algo->algorithm = OBJ_nid2obj(EVP_MD_nid(EVP_sha1()));
X509_ALGOR * new_alg = X509_ALGOR_dup(algo);
std::cout<<algo->algorithm->sn<<"\n";
if(NULL == new_alg->algorithm->sn)
{
std::cout<<"Something wrong ? \n";
}
else
{
std::cout<<"Ok \n";
}
return 0;
} //-------------------------------------------------------------------------
--------------------------------------------------
Hi,
am I missing something or following source code shows an OpenSSL bug (duplication is not well performed) ?
NL
OpenSSL version: 1.0.0 beta 3 and 1.0.0 beta 4 OS : Win 32 xp
//------------------------------------------------------------------------- --------------------------------------------------
#include "openssl\ts.h"
#include <iostream>
int main(int argc, char* argv[]) {
X509_ALGOR * algo = X509_ALGOR_new();
ASN1_OBJECT_free(algo->algorithm); algo->algorithm = OBJ_nid2obj(EVP_MD_nid(EVP_sha1()));
X509_ALGOR * new_alg = X509_ALGOR_dup(algo);
std::cout<<algo->algorithm->sn<<"\n"; if(NULL == new_alg->algorithm->sn) { std::cout<<"Something wrong ? \n"; } else { std::cout<<"Ok \n"; } return 0;
} //------------------------------------------------------------------------- --------------------------------------------------
|