Skip to content

OpenSSL 3 compatibility #3504

@andy9a9

Description

@andy9a9

I was trying to compile the application with OpenSSL 3 crypto libs, but looks like is it's not compatible.

PKCS12Container::PKCS12Container(std::istream& istr, const std::string& password): _pKey(0)
{
	std::ostringstream ostr;
	Poco::StreamCopier::copyStream(istr, ostr);
	const std::string& cont = ostr.str();

	BIO *pBIO = BIO_new_mem_buf(const_cast<char*>(cont.data()), static_cast<int>(cont.size()));
	if (pBIO)
	{
		PKCS12* pPKCS12 = 0;
		d2i_PKCS12_bio(pBIO, &pPKCS12);
		BIO_free(pBIO);
		if (!pPKCS12) throw OpenSSLException("PKCS12Container(istream&, const string&)");
--->		load(pPKCS12, password);
	}
	else
	{
<---		throw Poco::NullPointerException("PKCS12Container(istream&, const string&)");
	}
}
		
void PKCS12Container::load(PKCS12* pPKCS12, const std::string& password)
{
	if (pPKCS12)
	{
		X509* pCert = 0;
		STACK_OF(X509)* pCA = 0;
--->		if (PKCS12_parse(pPKCS12, password.c_str(), &_pKey, &pCert, &pCA))
		{
		...
		}
		else
		{
			PKCS12_free(pPKCS12);
<---			throw OpenSSLException();
		}

Unable to parse PKCS#12 container: "error:0308010C:digital envelope routines::unsupported"

Would it be possible to make it compatible also with OpenSSL 3?

Metadata

Metadata

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions