1
0
mirror of https://github.com/VCMP-SqMod/SqMod.git synced 2025-08-05 15:41:47 +02:00

Update POCO to 1.11.0

This commit is contained in:
Sandu Liviu Catalin
2021-08-22 18:07:06 +03:00
parent 151077c799
commit 7a3d92d1d1
450 changed files with 25219 additions and 6528 deletions

View File

@@ -151,7 +151,7 @@ namespace
int CryptoTransformImpl::setPadding(int padding)
{
#if OPENSSL_VERSION_NUMBER >= 0x10100000L
return EVP_CIPHER_CTX_block_size(_pContext);
return EVP_CIPHER_CTX_set_padding(_pContext, padding);
#else
return EVP_CIPHER_CTX_set_padding(&_context, padding);
#endif

View File

@@ -16,6 +16,7 @@
#include "Poco/Crypto/ECDSADigestEngine.h"
#include "Poco/Crypto/CryptoException.h"
#include <openssl/ecdsa.h>
#include <openssl/bn.h>
namespace Poco {

View File

@@ -13,6 +13,11 @@
//
#if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_WARNINGS)
#define _CRT_SECURE_NO_WARNINGS
#endif
#include "Poco/Crypto/PKCS12Container.h"
#include "Poco/NumberFormatter.h"
#include "Poco/StreamCopier.h"
@@ -155,6 +160,7 @@ void PKCS12Container::load(PKCS12* pPKCS12, const std::string& password)
{
_pX509Cert.reset(new X509Certificate(pCert, true));
_pkcsFriendlyName = extractFriendlyName(pCert);
X509_free(pCert);
}
else _pX509Cert.reset();
@@ -171,17 +177,22 @@ void PKCS12Container::load(PKCS12* pPKCS12, const std::string& password)
_caCertList.push_back(X509Certificate(pX509, true));
_caCertNames.push_back(extractFriendlyName(pX509));
}
else throw OpenSSLException("PKCS12Container::load()");
else
{
sk_X509_pop_free(pCA, X509_free);
PKCS12_free(pPKCS12);
throw OpenSSLException("PKCS12Container::load()");
}
}
sk_X509_pop_free(pCA, X509_free);
}
}
else
{
PKCS12_free(pPKCS12);
throw OpenSSLException();
}
PKCS12_free(pPKCS12);
sk_X509_pop_free(pCA, X509_free);
if (pCert) X509_free(pCert);
poco_assert_dbg (_caCertList.size() == _caCertNames.size());
}
else

View File

@@ -50,8 +50,6 @@ namespace
return RSA_PKCS1_PADDING;
case RSA_PADDING_PKCS1_OAEP:
return RSA_PKCS1_OAEP_PADDING;
case RSA_PADDING_SSLV23:
return RSA_SSLV23_PADDING;
case RSA_PADDING_NONE:
return RSA_NO_PADDING;
default:
@@ -116,7 +114,6 @@ namespace
switch (_paddingMode)
{
case RSA_PADDING_PKCS1:
case RSA_PADDING_SSLV23:
size -= 11;
break;
case RSA_PADDING_PKCS1_OAEP:

View File

@@ -349,6 +349,24 @@ Poco::DateTime X509Certificate::expiresOn() const
}
Poco::DigestEngine::Digest X509Certificate::fingerprint(const std::string& algorithm) const
{
unsigned char buffer[EVP_MAX_MD_SIZE];
unsigned int length;
const EVP_MD* md = EVP_get_digestbyname(algorithm.c_str());
if (!md) throw Poco::InvalidArgumentException(algorithm);
if (X509_digest(_pCert, md, buffer, &length))
{
return Poco::DigestEngine::Digest(buffer, buffer + length);
}
else
{
throw OpenSSLException("failed to compute fingerprint");
}
}
bool X509Certificate::issuedBy(const X509Certificate& issuerCertificate) const
{
X509* pCert = const_cast<X509*>(_pCert);