const or not const that is the question, whether we're on mac or on a different system; refs #22

This commit is contained in:
Marc Wäckerlin
2011-02-02 12:22:49 +00:00
parent 7fa2ba91f8
commit b3023927a4
8 changed files with 187 additions and 167 deletions

View File

@@ -22,6 +22,12 @@
#include <sstream>
#include <string>
#if defined win32 || defined linux
#define CONST_OR_NOTCONST const
#else
#define CONST_OR_NOTCONST
#endif
CertificateList::CertificateList()
: m_num_certs(0)
@@ -130,7 +136,7 @@ void CertificateList::init(SlotList& slots)
for(cert_map_t::const_iterator it = cert_temp_map.begin(); it != cert_temp_map.end();++it)
{
const act::Blob& certblob = it->first;
unsigned char *cbp = const_cast<unsigned char*>(&certblob[0]);
CONST_OR_NOTCONST unsigned char *cbp = const_cast<CONST_OR_NOTCONST unsigned char*>(&certblob[0]);
cert_p->cert = d2i_X509(NULL, &cbp, certblob.size());

View File

@@ -28,6 +28,12 @@
#include <openssl/ssl.h>
#if defined win32 || defined linux
#define CONST_OR_NOTCONST const
#else
#define CONST_OR_NOTCONST
#endif
EVP_PKEY *SecureTokenEngine::encapsule_CardKey(CardKey *ck)
{
EVP_PKEY* pk(EVP_PKEY_new());
@@ -157,7 +163,7 @@ int SecureTokenEngine::loadCertCtrl(ENGINE *e, load_cert_params *p)
return NULL;
const act::Blob& certblob = co.getCertBlob();
unsigned char *cbp = const_cast<unsigned char*>(&certblob[0]);
CONST_OR_NOTCONST unsigned char *cbp = const_cast<CONST_OR_NOTCONST unsigned char*>(&certblob[0]);
p->cert = d2i_X509(NULL, &cbp, certblob.size());