Mixe for Privacy and Anonymity in the Internet
|
#include "CAASymCipher.hpp"
Go to the source code of this file.
Macros | |
#define | UNIVERSAL_ATTRIBUTE_LAST_UPDATE "lastUpdate" |
#define | UNIVERSAL_NODE_LAST_UPDATE "LastUpdate" |
#define | STR_VALUE_TRUE "true" |
#define | STR_VALUE_FALSE "false" |
#define | TMP_BUFF_SIZE 255 |
#define | TMP_LOCALE_SIZE 3 |
#define | TMP_DATE_SIZE 9 |
#define | TEMPLATE_REFID_MAXLEN ((TMP_BUFF_SIZE) + (TMP_LOCALE_SIZE) + (TMP_DATE_SIZE) + 2) |
#define | INTEGRATE_NOT_ALLOWED_POSITIONS |
Functions | |
UINT32 | strtrim (UINT8 *) |
Removes leading and ending whitespaces (chars<=32) from a zero terminated string. More... | |
UINT32 | toLower (UINT8 *a_string) |
SINT32 | memtrim (UINT8 *out, const UINT8 *in, UINT32 len) |
Removes leading and ending whitespaces (chars<=32) from a byte array. More... | |
UINT8 * | bytes2hex (const void *bytes, UINT32 len) |
Converts the byte array to a hex string. More... | |
char * | strins (const char *src, UINT32 pos, const char *ins) |
Inserts a String ins in a String src starting after pos chars. More... | |
char * | strins (const char *src, const char *pos, const char *ins) |
Inserts a String ins in a String src starting at the char pos points to. More... | |
SINT32 | getcurrentTime (timespec &t) |
Gets the current Systemtime in milli seconds. More... | |
SINT32 | getcurrentTimeMillis (UINT64 &u64Time) |
Gets the current Systemtime in milli seconds. More... | |
SINT32 | getcurrentTimeMicros (UINT64 &u64Time) |
Gets the current Systemtime in micros seconds. More... | |
SINT32 | compDate (struct tm *date1, struct tm *date2) |
SINT32 | initRandom () |
SINT32 | getRandom (UINT8 *buff, UINT32 len) |
Gets some random bytes. More... | |
SINT32 | getRandom (UINT16 *val) |
Gets 16 random bits. More... | |
SINT32 | getRandom (UINT32 *val) |
Gets 32 random bits. More... | |
SINT32 | getRandom (UINT64 *val) |
SINT32 | msSleep (UINT32 ms) |
Sleeps ms milliseconds. More... | |
SINT32 | sSleep (UINT32 sec) |
Sleeps sec Seconds. More... | |
UINT32 | getMemoryUsage () |
SINT64 | filesize64 (int handle) |
SINT32 | filesize32 (int handle) |
XERCES_CPP_NAMESPACE::DOMDocument * | parseDOMDocument (const UINT8 *const buff, UINT32 len) |
Parses a buffer containing an XML document and returns this document. More... | |
XERCES_CPP_NAMESPACE::DOMDocument * | parseDOMDocument (const UINT8 *const pathOrURL) |
parses a file via path or URL More... | |
void | initDOMParser () |
void | releaseDOMParser () |
SINT32 | getDOMChildByName (const DOMNode *pNode, const XMLCh *const name, DOMNode *&child, bool deep=false) |
SINT32 | getDOMChildByName (const DOMNode *pNode, const char *const name, DOMNode *&child, bool deep=false) |
SINT32 | getDOMChildByName (const DOMNode *pNode, const char *const name, DOMElement *&child, bool deep=false) |
SINT32 | getSignatureElements (DOMNode *parent, DOMNode **signatureNodes, UINT32 *length) |
SINT32 | getDOMElementValue (const DOMNode *const pElem, UINT8 *value, UINT32 *len) |
Returns the content of the text node(s) under elem as null-terminated C String. More... | |
SINT32 | setDOMElementAttribute (DOMNode *pElem, const char *attrName, const UINT8 *value) |
SINT32 | setDOMElementAttribute (DOMNode *pElem, const char *attrName, const char *value) |
bool | equals (const XMLCh *const e1, const char *const e2) |
SINT32 | getDOMElementAttribute (const DOMNode *const pElem, const char *attrName, SINT32 *value) |
DOMElement * | createDOMElement (XERCES_CPP_NAMESPACE::DOMDocument *pOwnerDoc, const char *const name) |
Creates a new DOMElement with the given name which belongs to the DOMDocument owernDoc. More... | |
DOMText * | createDOMText (XERCES_CPP_NAMESPACE::DOMDocument *pOwnerDoc, const char *const text) |
Creates a new DOMText with the given value which belongs to the DOMDocument owernDoc. More... | |
SINT32 | getDOMElementValue (const DOMElement *const pElem, UINT32 &value, UINT32 defaultValue) |
Gets the value from an DOM-Element as UINT32. More... | |
SINT32 | getDOMElementValue (const DOMElement *const pElem, UINT32 *value) |
XERCES_CPP_NAMESPACE::DOMDocument * | createDOMDocument () |
Creates an empty DOM DOcument. More... | |
SINT32 | encodeXMLEncryptedKey (UINT8 *key, UINT32 keylen, UINT8 *xml, UINT32 *xmllen, CAASymCipher *pRSA) |
SINT32 | encodeXMLEncryptedKey (UINT8 *key, UINT32 keylen, DOMElement *&elemRootEncodedKey, XERCES_CPP_NAMESPACE::DOMDocument *docOwner, CAASymCipher *pRSA) |
SINT32 | decodeXMLEncryptedKey (UINT8 *key, UINT32 *keylen, const UINT8 *const xml, UINT32 xmllen, CAASymCipher *pRSA) |
SINT32 | decodeXMLEncryptedKey (UINT8 *key, UINT32 *keylen, const DOMNode *pRoot, CAASymCipher *pRSA) |
SINT32 | getDOMElementValue (const DOMElement *const pElem, UINT16 *value) |
SINT32 | setDOMElementValue (DOMElement *pElem, const UINT8 *value) |
SINT32 | setDOMElementValue (DOMElement *pElem, UINT32 value) |
SINT32 | setDOMElementAttribute (DOMNode *pElem, const char *attrName, UINT32 value) |
SINT32 | getDOMElementAttribute (const DOMNode *const pElem, const char *attrName, UINT32 &value) |
SINT32 | getDOMElementAttribute (const DOMNode *const pElem, const char *attrName, UINT8 *value, UINT32 *len) |
SINT32 | getDOMElementAttribute (const DOMNode *const pElem, const char *attrName, SINT64 &value) |
SINT32 | getDOMElementAttribute (const DOMNode *const pElem, const char *attrName, bool &value) |
SINT32 | getNodeName (const DOMNode *const pElem, UINT8 *value, UINT32 *valuelen) |
SINT32 | getLastDOMChildByName (const DOMNode *pNode, const char *const name, DOMElement *&a_child) |
SINT32 | getLastDOMChildByName (const DOMNode *pNode, const XMLCh *const name, DOMNode *&a_child) |
SINT32 | getLastDOMChildByName (const DOMNode *pNode, const char *const name, DOMNode *&a_child) |
DOMNodeList * | getElementsByTagName (DOMElement *pElem, const char *const name) |
DSA * | DSA_clone (DSA *dsa) |
Clones an OpenSSL DSA structure. More... | |
RSA * | RSA_clone (RSA *rsa) |
Clones an OpenSSL RSA structure. More... | |
SINT32 | setDOMElementValue (DOMElement *pElem, SINT32 value) |
SINT32 | setDOMElementValue (DOMElement *pElem, const UINT64 text) |
Returns the content of the text node under elem as 64bit unsigned integer. More... | |
SINT32 | setDOMElementValue (DOMElement *pElem, const SINT64 text) |
SINT32 | getDOMElementValue (const DOMNode *const pElem, UINT64 &value) |
SINT32 | getDOMElementValue (const DOMElement *const pElem, SINT64 &value) |
SINT32 | getDOMElementValue (const DOMElement *const pElem, SINT32 *value) |
SINT32 | getDOMElementValue (const DOMElement *const pElem, double *value) |
SINT32 | setDOMElementAttribute (DOMNode *pElem, const char *attrName, bool value) |
SINT32 | setDOMElementAttribute (DOMNode *pElem, const char *attrName, SINT32 value) |
SINT32 | setDOMElementAttribute (DOMNode *pElem, const char *attrName, UINT64 value) |
SINT32 | setDOMElementAttribute (DOMNode *pElem, const char *attrName, SINT64 value) |
SINT32 | setDOMElementValue (DOMElement *pElem, double floatValue) |
SINT32 | setDOMElementValue (DOMElement *pElem, bool value) |
SINT32 | setCurrentTimeMilliesAsDOMAttribute (DOMNode *pElem) |
SINT32 | integrateDOMNode (const DOMNode *srcNode, DOMNode *dstNode, bool recursive, bool replace) |
integrates the source node in the destination Node. More... | |
SINT32 | encryptXMLElement (DOMNode *pElem, CAASymCipher *pRSA) |
Replaces a DOM element with an encrypted version of this element. More... | |
SINT32 | decryptXMLElement (DOMNode *pelem, CAASymCipher *pRSA) |
Replaces a DOM element with a deencrypted version of this element. More... | |
UINT8 * | getTermsAndConditionsTemplateRefId (DOMNode *tcTemplateRoot) |
UINT8 * | encryptXMLElement (UINT8 *inbuff, UINT32 inlen, UINT32 &outlen, CAASymCipher *pRSA) |
ONLY_LOCAL_PROXY or first. More... | |
void | set64 (UINT64 &op1, UINT32 op2) |
void | set64 (UINT64 &dst, UINT64 src) |
Sets the value of dst to the value of src. More... | |
void | set64 (SINT64 &dst, SINT64 src) |
Sets the value of dst to the value of src. More... | |
void | setZero64 (UINT64 &op1) |
void | setZero64 (SINT64 &op1) |
void | add64 (UINT64 &op1, UINT32 op2) |
void | inc64 (UINT64 &op1) |
UINT32 | diff64 (const UINT64 &bigop, const UINT64 &smallop) |
UINT32 | div64 (UINT64 &op1, UINT32 op2) |
bool | isGreater64 (UINT64 &op1, UINT64 &op2) |
bool | isGreater64 (SINT64 op1, SINT64 op2) |
bool | isLesser64 (UINT64 &smallOp1, UINT64 &bigOp2) |
bool | isEqual64 (UINT64 &op1, UINT64 &op2) |
bool | isZero64 (UINT64 &op1) |
bool | isZero64 (SINT64 &op1) |
void | print64 (UINT8 *buff, UINT64 num) |
UINT8 * | readFile (const UINT8 *const name, UINT32 *size) |
ONLY_LOCAL_PROXY or first. More... | |
SINT32 | saveFile (const UINT8 *const name, const UINT8 *const buff, UINT32 buffSize) |
SINT32 | parseUINT16 (const UINT8 *str, UINT16 &value) |
Parses a timestamp in JDBC timestamp escape format (as it comes from the BI) and outputs the value in milliseconds since the epoch. More... | |
SINT32 | parseU64 (const UINT8 *str, UINT64 &value) |
Parses a 64bit unsigned integer. More... | |
SINT32 | parseS64 (const UINT8 *str, SINT64 &value) |
Parses a 64bit signed integer. More... | |
SINT32 | readPasswd (UINT8 *buff, UINT32 len) |
Read a passwd (i.e. More... | |
void | formatBytesPerSecond (UINT8 *buff, UINT32 buffsize, UINT64 bytespersecond) |
void | logMemoryUsage () |
Log information about the current memory (heap) usage. More... | |
#define INTEGRATE_NOT_ALLOWED_POSITIONS |
Definition at line 48 of file CAUtil.hpp.
#define STR_VALUE_FALSE "false" |
Definition at line 36 of file CAUtil.hpp.
#define STR_VALUE_TRUE "true" |
Definition at line 35 of file CAUtil.hpp.
#define TEMPLATE_REFID_MAXLEN ((TMP_BUFF_SIZE) + (TMP_LOCALE_SIZE) + (TMP_DATE_SIZE) + 2) |
Definition at line 42 of file CAUtil.hpp.
#define TMP_BUFF_SIZE 255 |
Definition at line 38 of file CAUtil.hpp.
#define TMP_DATE_SIZE 9 |
Definition at line 40 of file CAUtil.hpp.
#define TMP_LOCALE_SIZE 3 |
Definition at line 39 of file CAUtil.hpp.
#define UNIVERSAL_ATTRIBUTE_LAST_UPDATE "lastUpdate" |
Definition at line 32 of file CAUtil.hpp.
#define UNIVERSAL_NODE_LAST_UPDATE "LastUpdate" |
Definition at line 33 of file CAUtil.hpp.
Definition at line 375 of file CAUtil.hpp.
References __UINT64__t_::high, and __UINT64__t_::low.
Referenced by CALastMixA::loop(), CALastMixB::loop(), CAHttpClient::parseHTTPHeader(), CAMuxSocket::receive(), CASocket::receiveFullyT(), and CASocket::receiveLine().
Converts the byte array to a hex string.
the caller is responsible for deleting the string
Definition at line 90 of file CAUtil.cpp.
References len.
Referenced by CAChain::getPrintableChainId(), and CAThread::start().
SINT32 compDate | ( | struct tm * | date1, |
struct tm * | date2 | ||
) |
Definition at line 323 of file CAUtil.cpp.
XERCES_CPP_NAMESPACE::DOMDocument* createDOMDocument | ( | ) |
Creates an empty DOM DOcument.
Creates an empty DOM DOcument.
strTimestamp | the string containing the timestamp |
seconds | an integer variable that gets the seconds value. |
Converts a timestamp (in seconds) to the String JDBC timestamp escape format (YYYY-MM-DD HH:MM:SS)
seconds | integer value containing the timestamp in seconds since the epoch |
strTimestamp | a string buffer that gets the result |
len | the buffer length |
Definition at line 1568 of file CAUtil.cpp.
Referenced by CACmdLnOptions::CACmdLnOptions(), CACmdLnOptions::createMixOnCDConfiguration(), CAFirstMix::doUserLogin_internal(), CAASymCipher::getPublicKeyAsXML(), CAAccountingInstance::handleAccountCertificate_internal(), CAFirstMix::handleTermsAndConditionsLogin(), CAFirstMix::init(), CAMix::initMixCascadeInfo(), CAReplayCtrlChannelMsgProc::initTimestampsMessageTemplate(), CAAccountingInstance::makeCCRequest(), CAAccountingInstance::makeInitialCCRequest(), CAAccountingInstance::prepareCCRequest(), CAReplayCtrlChannelMsgProc::proccessGetTimestamp(), CAReplayCtrlChannelMsgProc::proccessGotTimestamp(), CALastMix::processKeyExchange(), CAMiddleMix::processKeyExchange(), CAAccountingInstance::sendAILoginConfirmation(), CAReplayCtrlChannelMsgProc::sendGetTimestamp(), CAAbstractXMLSignable::setSignature(), CACmdLnOptions::setTermsAndConditionsList(), CAAccountingBIInterface::settleAll(), TermsAndConditions::TermsAndConditions(), and CAAbstractXMLEncodable::toXmlDocument().
DOMElement* createDOMElement | ( | XERCES_CPP_NAMESPACE::DOMDocument * | pOwnerDoc, |
const char *const | name | ||
) |
Creates a new DOMElement with the given name which belongs to the DOMDocument owernDoc.
Definition at line 814 of file CAUtil.cpp.
Referenced by CAASymCipher::addKeyPart(), CAMix::appendCompatibilityInfo(), CACmdLnOptions::buildDefaultConfig(), CAFirstMix::doUserLogin_internal(), CACertStore::encode(), CACertificate::encode(), encodeXMLEncryptedKey(), encryptXMLElement(), CAInfoService::getCascadeHeloXMLAsString(), CACmdLnOptions::getMixXml(), CAASymCipher::getPublicKeyAsDOMElement(), CASignature::getSignKey(), CAAccountingInstance::handleAccountCertificate_internal(), CAFirstMix::handleTermsAndConditionsLogin(), CAMix::initMixCascadeInfo(), CAReplayCtrlChannelMsgProc::initTimestampsMessageTemplate(), CAAccountingInstance::makeCCRequest(), CAAccountingInstance::makeInitialCCRequest(), CAAccountingInstance::prepareCCRequest(), CAReplayCtrlChannelMsgProc::proccessGetTimestamp(), CAReplayCtrlChannelMsgProc::proccessGotTimestamp(), CALastMix::processKeyExchange(), CAMiddleMix::processKeyExchange(), CACmdLnOptions::processXmlConfiguration(), CAAccountingInstance::sendAILoginConfirmation(), CAReplayCtrlChannelMsgProc::sendGetTimestamp(), CACmdLnOptions::setMixName(), CACmdLnOptions::setNextMix(), CACmdLnOptions::setPrepaidInterval(), CACmdLnOptions::setPrevMix(), CACmdLnOptions::setSymChannelCipherAlgorithm(), CACmdLnOptions::setTargetInterfaces(), CAAccountingBIInterface::settleAll(), CAMultiSignature::signXML(), CAListenerInterface::toDOMElement(), and CAXMLErrorMessage::toXmlElement().
DOMText* createDOMText | ( | XERCES_CPP_NAMESPACE::DOMDocument * | pOwnerDoc, |
const char *const | text | ||
) |
Creates a new DOMText with the given value which belongs to the DOMDocument owernDoc.
Definition at line 822 of file CAUtil.cpp.
Referenced by CAASymCipher::addKeyPart().
SINT32 decodeXMLEncryptedKey | ( | UINT8 * | key, |
UINT32 * | keylen, | ||
const DOMNode * | pRoot, | ||
CAASymCipher * | pRSA | ||
) |
Definition at line 1646 of file CAUtil.cpp.
References CABase64::decode(), CAASymCipher::decrypt(), E_SUCCESS, E_UNKNOWN, getDOMChildByName(), and getDOMElementValue().
SINT32 decodeXMLEncryptedKey | ( | UINT8 * | key, |
UINT32 * | keylen, | ||
const UINT8 *const | xml, | ||
UINT32 | xmllen, | ||
CAASymCipher * | pRSA | ||
) |
Definition at line 1625 of file CAUtil.cpp.
References E_UNKNOWN, and parseDOMDocument().
Referenced by CALastMix::processKeyExchange(), and CAMiddleMix::processKeyExchange().
SINT32 decryptXMLElement | ( | DOMNode * | pelem, |
CAASymCipher * | pRSA | ||
) |
Replaces a DOM element with a deencrypted version of this element.
Definition at line 1224 of file CAUtil.cpp.
References CABase64::decode(), CASymCipher::decryptCBCwithPKCS7(), CAASymCipher::decryptOAEP(), E_SUCCESS, E_UNKNOWN, equals(), getDOMChildByName(), getDOMElementValue(), len, parseDOMDocument(), CASymCipher::setIV(), and CASymCipher::setKey().
Referenced by CAFirstMix::doUserLogin_internal().
Definition at line 398 of file CAUtil.hpp.
Referenced by CACryptoBenchmark::benchmarkThread(), CACryptoBenchmark::doBenchmark(), CAInfoService::getStatusXMLAsString(), CAFirstMixA::loop(), CAFirstMixB::loop(), CADatabase::measurePerformance(), CAReplayDatabase::measurePerformance(), CAHttpClient::parseHTTPHeader(), CAFirstMixChannelToQueueList::performanceTest(), CAMuxSocket::receive(), CASocket::receiveFullyT(), CASocket::receiveLine(), CAASymCipher::testSpeed(), and CAChain::~CAChain().
Definition at line 407 of file CAUtil.hpp.
Referenced by CAInfoService::getStatusXMLAsString().
|
inline |
Clones an OpenSSL DSA structure.
Definition at line 191 of file CAUtil.hpp.
Referenced by CASignature::clone(), CASignature::setSignKey(), and CASignature::setVerifyKey().
SINT32 encodeXMLEncryptedKey | ( | UINT8 * | key, |
UINT32 | keylen, | ||
DOMElement *& | elemRootEncodedKey, | ||
XERCES_CPP_NAMESPACE::DOMDocument * | docOwner, | ||
CAASymCipher * | pRSA | ||
) |
Definition at line 1694 of file CAUtil.cpp.
References __encryptKey(), createDOMElement(), E_SUCCESS, setDOMElementAttribute(), and setDOMElementValue().
SINT32 encodeXMLEncryptedKey | ( | UINT8 * | key, |
UINT32 | keylen, | ||
UINT8 * | xml, | ||
UINT32 * | xmllen, | ||
CAASymCipher * | pRSA | ||
) |
Definition at line 1683 of file CAUtil.cpp.
References __encryptKey(), E_SUCCESS, len, and XML_ENCODE_KEY_TEMPLATE.
Referenced by CAMiddleMix::processKeyExchange().
SINT32 encryptXMLElement | ( | DOMNode * | node, |
CAASymCipher * | pRSA | ||
) |
Replaces a DOM element with an encrypted version of this element.
Replaces a DOM element with an encrypted version of this element.
* <EncryptedData Type='http://www.w3.org/2001/04/xmlenc#Element'> * <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#aes128-cbc"/> * <ds:KeyInfo xmlns:ds='http://www.w3.org/2000/09/xmldsig#'> * <EncryptedKey> * <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p"/> * <CipherData> * <CipherValue>...</CipherValue> * </CipherData> * </EncryptedKey> * </ds:KeyInfo> * <CipherData> * <CipherValue>...</CipherValue> * </CipherData> * </EncryptedData> *
Definition at line 1086 of file CAUtil.cpp.
References createDOMElement(), DOM_Output::dumpToMem(), E_SUCCESS, CABase64::encode(), CASymCipher::encryptCBCwithPKCS7(), CAASymCipher::encryptOAEP(), getRandom(), setDOMElementValue(), CASymCipher::setIV(), and CASymCipher::setKey().
Referenced by CALocalProxy::processKeyExchange().
UINT8* encryptXMLElement | ( | UINT8 * | inbuff, |
UINT32 | inlen, | ||
UINT32 & | outlen, | ||
CAASymCipher * | pRSA | ||
) |
ONLY_LOCAL_PROXY or first.
ONLY_LOCAL_PROXY or first.
* \<EncryptedData Type='http://www.w3.org/2001/04/xmlenc#Element'> * \<EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#aes128-cbc"/> * \<ds:KeyInfo xmlns:ds='http://www.w3.org/2000/09/xmldsig#'> * \<EncryptedKey> * \<EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p"/> * \<CipherData\> * \<CipherValue>...\</CipherValue> * \</CipherData> * \</EncryptedKey> * \</ds:KeyInfo> * \<CipherData> * \<CipherValue>...\</CipherValue> * \</CipherData> * \</EncryptedData> *
Definition at line 1188 of file CAUtil.cpp.
References CABase64::encode(), CASymCipher::encryptCBCwithPKCS7(), CAASymCipher::encryptOAEP(), getRandom(), CASymCipher::setIV(), and CASymCipher::setKey().
bool equals | ( | const XMLCh *const | e1, |
const char *const | e2 | ||
) |
Definition at line 645 of file CAUtil.cpp.
Referenced by CACmdLnOptions::addVisibleAddresses(), CACertificate::decode(), decryptXMLElement(), CAFirstMix::doUserLogin_internal(), getDOMChildByName(), getLastDOMChildByName(), getSignatureElements(), CAFirstMix::handleTermsAndConditionsLogin(), CAMix::initMixCascadeInfo(), integrateDOMNode(), CASignature::parseSignKeyXML(), CAMiddleMix::processKeyExchange(), CALocalProxy::processKeyExchange(), CAReplayControlChannel::processXMLMessage(), CAASymCipher::setPublicKeyAsDOMNode(), CASignature::setSignKey(), and CASignature::setVerifyKey().
|
inline |
Definition at line 102 of file CAUtil.hpp.
References E_UNKNOWN.
Referenced by readFile(), and CACmdLnOptions::readXmlConfiguration().
|
inline |
Definition at line 85 of file CAUtil.hpp.
References E_UNKNOWN.
Referenced by CAMsg::printMsg().
Definition at line 1821 of file CAUtil.cpp.
Referenced by CACryptoBenchmark::benchmarkThread(), and CACryptoBenchmark::doBenchmark().
SINT32 getcurrentTime | ( | timespec & | t | ) |
Gets the current Systemtime in milli seconds.
bnTime | - Big Number, in which the current time is placed |
E_UNSPECIFIED,if | bnTime was NULL |
E_UNKNOWN,if | an error occurs |
E_SUCCESS,otherwise |
Definition at line 227 of file CAUtil.cpp.
References E_SUCCESS.
Referenced by CAChain::addChannel(), CAChain::forceImmediateResponsesInternal(), CAAccountingInstance::handleAccountCertificate_internal(), initRandom(), CAChain::processDownstream(), and CAConditionVariable::wait().
Gets the current Systemtime in micros seconds.
Depending on the operating system, the time may not be so accurat.
u64Time | - 64 bit Integer, in which the current time is placed |
E_UNKNOWN,if | an error occurs |
E_SUCCESS,otherwise |
Definition at line 280 of file CAUtil.cpp.
References E_SUCCESS, and E_UNKNOWN.
Referenced by CAChain::CAChain(), CAFirstMixA::loop(), CALastMixA::loop(), CAFirstMixB::loop(), CALastMixB::loop(), CADatabase::measurePerformance(), CAReplayDatabase::measurePerformance(), CAFirstMixA::sendToUsers(), and CAChain::~CAChain().
Gets the current Systemtime in milli seconds.
u64Time | - 64 bit Integer, in which the current time is placed |
E_UNKNOWN,if | an error occurs |
E_SUCCESS,otherwise |
Definition at line 252 of file CAUtil.cpp.
References E_SUCCESS, and E_UNKNOWN.
Referenced by CAFirstMixChannelList::add(), CACryptoBenchmark::benchmarkThread(), CATempIPBlockList::checkIP(), CATempIPBlockList::cleanupThreadMainLoop(), CAFirstMixA::closeConnection(), CACryptoBenchmark::doBenchmark(), CAInfoService::getCascadeHeloXMLAsString(), CACmdLnOptions::getMixXml(), CAInfoService::getStatusXMLAsString(), CAAccountingInstance::handleCostConfirmation_internal(), CATempIPBlockList::insertIP(), CALastMixA::loop(), CAFirstMixB::loop(), CAHttpClient::parseHTTPHeader(), CAFirstMixChannelToQueueList::performanceTest(), CAMuxSocket::receive(), CASocket::receiveFullyT(), CASocket::receiveLine(), CAInfoService::sendCascadeHelo(), CASocket::sendFullyTimeOut(), CAInfoService::sendMixHelo(), CAInfoService::sendStatus(), setCurrentTimeMilliesAsDOMAttribute(), CAMix::start(), and CAASymCipher::testSpeed().
SINT32 getDOMChildByName | ( | const DOMNode * | pNode, |
const char *const | name, | ||
DOMElement *& | child, | ||
bool | deep = false |
||
) |
Definition at line 458 of file CAUtil.cpp.
Referenced by CACmdLnOptions::addVisibleAddresses(), CAMix::checkCompatibility(), decodeXMLEncryptedKey(), decryptXMLElement(), CAFirstMix::doUserLogin_internal(), CAInfoService::getCascadeHeloXMLAsString(), getDOMChildByName(), CAListenerInterface::getInstance(), CACmdLnOptions::getMixXml(), CAAccountingInstance::handleAccountCertificate_internal(), CAAccountingInstance::handleChallengeResponse_internal(), CAFirstMix::handleKeyInfoExtensions(), CAFirstMix::handleTermsAndConditionsExtension(), CAFirstMix::handleTermsAndConditionsLogin(), CAMix::initMixCascadeInfo(), CAAccountingInstance::makeCCRequest(), CAAccountingInstance::makeInitialCCRequest(), CACmdLnOptions::parseInfoServices(), CASignature::parseSignKeyXML(), CAAccountingInstance::prepareCCRequest(), CAReplayCtrlChannelMsgProc::proccessGetTimestamp(), CALastMix::processKeyExchange(), CAMiddleMix::processKeyExchange(), CALocalProxy::processKeyExchange(), CACmdLnOptions::processXmlConfiguration(), CAReplayControlChannel::processXMLMessage(), CAReplayCtrlChannelMsgProc::propagateCurrentReplayTimestamp(), CACmdLnOptions::setAccessControlCredential(), CACmdLnOptions::setAccountingDatabase(), CACmdLnOptions::setAccountingHardLimit(), CACmdLnOptions::setAccountingOptions(), CACmdLnOptions::setAccountingSoftLimit(), CACmdLnOptions::setCascadeNameFromOptions(), CACmdLnOptions::setCertificateOptions(), CACmdLnOptions::setDaemonMode(), CACmdLnOptions::setDynamicMix(), CACmdLnOptions::setGeneralOptions(), CACmdLnOptions::setInfoServices(), CACmdLnOptions::setKeepAliveTraffic(), CACmdLnOptions::setListenerInterfaces(), CACmdLnOptions::setLoggingOptions(), CACmdLnOptions::setMaxUsers(), CACmdLnOptions::setMinCascadeLength(), CACmdLnOptions::setMixCertificateVerification(), CACmdLnOptions::setMixDescription(), CACmdLnOptions::setMixID(), CACmdLnOptions::setMixName(), CACmdLnOptions::setMixType(), CACmdLnOptions::setNetworkOptions(), CACmdLnOptions::setNextMix(), CACmdLnOptions::setNextMixCertificate(), CACmdLnOptions::setNrOfFileDescriptors(), CACmdLnOptions::setOwnCertificate(), CACmdLnOptions::setOwnOperatorCertificate(), CACmdLnOptions::setPaymentInstance(), CACmdLnOptions::setPaymentReminder(), CACmdLnOptions::setPrepaidInterval(), CACmdLnOptions::setPrevMix(), CACmdLnOptions::setPrevMixCertificate(), CACmdLnOptions::setPriceCertificate(), CACmdLnOptions::setRessourceOptions(), CACmdLnOptions::setServerMonitoring(), CACmdLnOptions::setSettleInterval(), CACmdLnOptions::setSymChannelCipherAlgorithm(), CACmdLnOptions::setTargetInterfaces(), CACmdLnOptions::setTermsAndConditions(), CACmdLnOptions::setTermsAndConditionsList(), CACmdLnOptions::setTermsAndConditionsTemplates(), CACmdLnOptions::setTrustedRootCertificates(), CACmdLnOptions::setUserID(), CAXMLErrorMessage::setValues(), CASignature::setVerifyKey(), CAMultiSignature::signXML(), CACertStore::verifyMixCert(), CAMultiSignature::verifyXML(), and CASignature::verifyXML().
SINT32 getDOMChildByName | ( | const DOMNode * | pNode, |
const char *const | name, | ||
DOMNode *& | child, | ||
bool | deep = false |
||
) |
Definition at line 485 of file CAUtil.cpp.
References E_UNKNOWN, and getDOMChildByName().
SINT32 getDOMChildByName | ( | const DOMNode * | pNode, |
const XMLCh *const | name, | ||
DOMNode *& | child, | ||
bool | deep = false |
||
) |
Definition at line 462 of file CAUtil.cpp.
References E_SUCCESS, E_UNKNOWN, equals(), and getDOMChildByName().
SINT32 getDOMElementAttribute | ( | const DOMNode *const | pElem, |
const char * | attrName, | ||
bool & | value | ||
) |
Definition at line 1756 of file CAUtil.cpp.
References E_SUCCESS, E_UNKNOWN, E_UNSPECIFIED, getDOMElementAttribute(), len, STR_VALUE_FALSE, and STR_VALUE_TRUE.
Definition at line 804 of file CAUtil.cpp.
References E_SUCCESS, E_UNKNOWN, getDOMElementAttribute(), and len.
Definition at line 1778 of file CAUtil.cpp.
References E_SUCCESS, E_UNKNOWN, getDOMElementAttribute(), len, and parseS64().
Definition at line 1613 of file CAUtil.cpp.
References E_SUCCESS, E_UNKNOWN, getDOMElementAttribute(), and len.
SINT32 getDOMElementAttribute | ( | const DOMNode *const | pElem, |
const char * | attrName, | ||
UINT8 * | value, | ||
UINT32 * | len | ||
) |
Definition at line 780 of file CAUtil.cpp.
References E_SPACE, E_SUCCESS, E_UNKNOWN, and len.
Referenced by CAMix::checkCompatibility(), getDOMElementAttribute(), CAListenerInterface::getInstance(), CAInfoService::getOperatorTnCsAsStrings(), getTermsAndConditionsTemplateRefId(), CAFirstMix::handleTermsAndConditionsExtension(), CAFirstMix::handleTermsAndConditionsLogin(), CAFirstMix::initMixParameters(), CAMiddleMix::processKeyExchange(), CALocalProxy::processKeyExchange(), CACmdLnOptions::processXmlConfiguration(), CAReplayControlChannel::processXMLMessage(), CACmdLnOptions::setLoggingOptions(), CACmdLnOptions::setMixName(), CACmdLnOptions::setPaymentReminder(), CACmdLnOptions::setTermsAndConditionsList(), CAAccountingBIInterface::settleAll(), CAXMLErrorMessage::setValues(), CASignature::setVerifyKey(), and CAMultiSignature::verifyXML().
SINT32 getDOMElementValue | ( | const DOMElement *const | pElem, |
double * | value | ||
) |
Definition at line 1021 of file CAUtil.cpp.
References ASSERT, E_SUCCESS, E_UNKNOWN, and getDOMElementValue().
Definition at line 1008 of file CAUtil.cpp.
References ASSERT, E_SUCCESS, E_UNKNOWN, and getDOMElementValue().
Definition at line 1051 of file CAUtil.cpp.
References ASSERT, E_SUCCESS, E_UNKNOWN, getDOMElementValue(), and parseS64().
Definition at line 1808 of file CAUtil.cpp.
References E_SUCCESS, E_UNKNOWN, and getDOMElementValue().
Gets the value from an DOM-Element as UINT32.
If an error occurs, the default value is returned.
Definition at line 908 of file CAUtil.cpp.
References E_SUCCESS, and getDOMElementValue().
Definition at line 920 of file CAUtil.cpp.
References ASSERT, E_SUCCESS, E_UNKNOWN, and getDOMElementValue().
Definition at line 1034 of file CAUtil.cpp.
References ASSERT, E_SUCCESS, E_UNKNOWN, getDOMElementValue(), and parseU64().
Returns the content of the text node(s) under elem as null-terminated C String.
If there is no text node len is set to 0.
DOM_Node | the element which has a text node under it |
value | a buffer that gets the text value |
len | on call contains the buffer size, on return contains the number of bytes copied |
If there is no text node len is set to 0.
TODO: Why is elem a DOM_Node and not a DOM_Element here?
elem | the element which has a text node under it |
value | a buffer that gets the text value |
valuelen | on call contains the buffer size, on return contains the number of bytes copied |
E_SPACE | if the buffer is too small |
E_UNKNOWN | if the element is NULL |
E_SUCCESS | otherwise |
Definition at line 746 of file CAUtil.cpp.
References ASSERT, E_SPACE, E_SUCCESS, and E_UNKNOWN.
Referenced by CACmdLnOptions::addVisibleAddresses(), CACertificate::decode(), decodeXMLEncryptedKey(), decryptXMLElement(), CAFirstMix::doUserLogin_internal(), getDOMElementValue(), CAListenerInterface::getInstance(), CAASymCipher::getKeyPart(), CAAccountingInstance::handleAccountCertificate_internal(), CAAccountingInstance::handleChallengeResponse_internal(), CACmdLnOptions::parseInfoServices(), CALastMix::processKeyExchange(), CAMiddleMix::processKeyExchange(), CALocalProxy::processKeyExchange(), CACmdLnOptions::processXmlConfiguration(), CAReplayControlChannel::processXMLMessage(), CACmdLnOptions::setAccessControlCredential(), CACmdLnOptions::setAccountingDatabase(), CACmdLnOptions::setAccountingHardLimit(), CACmdLnOptions::setAccountingSoftLimit(), CACmdLnOptions::setCascadeNameFromOptions(), CACmdLnOptions::setDaemonMode(), CACmdLnOptions::setDynamicMix(), CACmdLnOptions::setInfoServices(), CACmdLnOptions::setKeepAliveTraffic(), CACmdLnOptions::setLoggingOptions(), CACmdLnOptions::setMaxUsers(), CACmdLnOptions::setMixCertificateVerification(), CACmdLnOptions::setMixID(), CACmdLnOptions::setMixName(), CACmdLnOptions::setMixType(), CACmdLnOptions::setNrOfFileDescriptors(), CACmdLnOptions::setPaymentReminder(), CACmdLnOptions::setPrepaidInterval(), CACmdLnOptions::setRessourceOptions(), CACmdLnOptions::setServerMonitoring(), CACmdLnOptions::setSettleInterval(), CASignature::setSignKey(), CACmdLnOptions::setTargetInterfaces(), CACmdLnOptions::setTermsAndConditionsTemplates(), CACmdLnOptions::setUserID(), CAXMLErrorMessage::setValues(), CASignature::setVerifyKey(), CAMultiSignature::verifyXML(), and CASignature::verifyXML().
DOMNodeList* getElementsByTagName | ( | DOMElement * | pElem, |
const char *const | name | ||
) |
Definition at line 1711 of file CAUtil.cpp.
Referenced by CACmdLnOptions::appendMixInfo_internal(), CACertStore::decode(), CAListenerInterface::getInstance(), CAInfoService::getOperatorTnCsAsStrings(), CAFirstMix::handleTermsAndConditionsExtension(), CAFirstMix::handleTermsAndConditionsLogin(), CAFirstMix::initMixParameters(), CACmdLnOptions::parseInfoServices(), CAAccountingInstance::prepareCCRequest(), CACmdLnOptions::processXmlConfiguration(), CACmdLnOptions::setOwnCertificate(), CACmdLnOptions::setOwnOperatorCertificate(), CACmdLnOptions::setTargetInterfaces(), CACmdLnOptions::setTermsAndConditionsList(), CACmdLnOptions::setTermsAndConditionsTemplates(), CAAccountingBIInterface::settleAll(), and CACmdLnOptions::setTrustedRootCertificates().
SINT32 getLastDOMChildByName | ( | const DOMNode * | pNode, |
const char *const | name, | ||
DOMElement *& | a_child | ||
) |
Definition at line 1719 of file CAUtil.cpp.
Referenced by getLastDOMChildByName(), and CAMix::initMixCascadeInfo().
SINT32 getLastDOMChildByName | ( | const DOMNode * | pNode, |
const char *const | name, | ||
DOMNode *& | a_child | ||
) |
Definition at line 1724 of file CAUtil.cpp.
References E_UNKNOWN, and getLastDOMChildByName().
SINT32 getLastDOMChildByName | ( | const DOMNode * | pNode, |
const XMLCh *const | name, | ||
DOMNode *& | a_child | ||
) |
Definition at line 1735 of file CAUtil.cpp.
References E_SUCCESS, E_UNKNOWN, and equals().
UINT32 getMemoryUsage | ( | ) |
Definition at line 443 of file CAUtil.cpp.
Referenced by CAFirstMix::clean(), and CAFirstMixB::loop().
Definition at line 707 of file CAUtil.cpp.
References ASSERT, E_SPACE, E_SUCCESS, and E_UNKNOWN.
Referenced by CAMix::checkCompatibility().
Gets 16 random bits.
val | - on return the bits are random |
E_UNKNOWN,if | an error occured |
E_SUCCESS,if | successful |
Definition at line 363 of file CAUtil.cpp.
Gets 32 random bits.
val | - on return the bits are random |
E_UNKNOWN,if | an error occured |
E_SUCCESS,if | successful |
Definition at line 346 of file CAUtil.cpp.
References ASSERT, E_SUCCESS, and E_UNKNOWN.
Referenced by CAFirstMixChannelList::add(), CASocketList::add(), CAMiddleMixChannelList::add(), CAFirstMixChannelList::addChannel(), CAIPList::CAIPList(), CAPool::CAPool(), CAFirstMixA::closeConnection(), CAChainTable::createEntry(), encryptXMLElement(), CADatabase::fill(), CAReplayDatabase::fill(), CAAccountingInstance::handleAccountCertificate_internal(), CALocalProxy::loop(), CAFirstMixA::loop(), CALastMixA::loop(), CAFirstMixB::loop(), CALastMixB::loop(), CADatabase::measurePerformance(), CAReplayDatabase::measurePerformance(), CAFirstMixA::notifyAllUserChannels(), CAMsg::openEncryptedLog(), CAFirstMixChannelToQueueList::performanceTest(), CAPool::pool(), CAChain::processDownstream(), CALastMix::processKeyExchange(), CAMiddleMix::processKeyExchange(), CALocalProxy::processKeyExchange(), CALastMixChannelList::test(), CAMiddleMixChannelList::test(), CAQueue::test(), CAReplayDatabase::test(), and CAASymCipher::testSpeed().
Definition at line 375 of file CAUtil.cpp.
Gets some random bytes.
buff | - buff which is filled with randomness |
len | - number of bytes requested |
E_UNKNOWN,if | an error occured |
E_SUCCESS,if | successful |
Definition at line 393 of file CAUtil.cpp.
Definition at line 496 of file CAUtil.cpp.
References E_SUCCESS, E_UNKNOWN, and equals().
Referenced by CACertStore::verifyMixCert(), and CAMultiSignature::verifyXML().
UINT8* getTermsAndConditionsTemplateRefId | ( | DOMNode * | tcTemplateRoot | ) |
Definition at line 865 of file CAUtil.cpp.
References E_SUCCESS, getDOMElementAttribute(), TMP_BUFF_SIZE, TMP_DATE_SIZE, and TMP_LOCALE_SIZE.
Referenced by CAFirstMix::getTermsAndConditionsTemplate(), and CACmdLnOptions::setTermsAndConditionsTemplates().
|
inline |
Definition at line 387 of file CAUtil.hpp.
References __UINT64__t_::high, and __UINT64__t_::low.
Referenced by CAFirstMix::incMixedPackets().
void initDOMParser | ( | ) |
Definition at line 656 of file CAUtil.cpp.
References theDOMParser, and theParseDOMDocumentLock.
Referenced by CALibProxytest::init().
SINT32 initRandom | ( | ) |
Definition at line 302 of file CAUtil.cpp.
References E_SUCCESS, and getcurrentTime().
Referenced by CALibProxytest::init(), CADatabase::measurePerformance(), and CAReplayDatabase::measurePerformance().
SINT32 integrateDOMNode | ( | const DOMNode * | srcNode, |
DOMNode * | dstNode, | ||
bool | recursive, | ||
bool | replace | ||
) |
integrates the source node in the destination Node.
TODO 1. test for XERCES >= 3.0.1
Definition at line 533 of file CAUtil.cpp.
References E_SUCCESS, E_UNKNOWN, equals(), INTEGRATE_NOT_ALLOWED_POSITIONS, and CAMsg::printMsg().
Referenced by CACmdLnOptions::setTermsAndConditionsList().
Definition at line 455 of file CAUtil.hpp.
References __UINT64__t_::high, and __UINT64__t_::low.
Referenced by CAMuxSocket::receive().
Definition at line 416 of file CAUtil.hpp.
References __UINT64__t_::high, and __UINT64__t_::low.
Referenced by CALastMixA::loop(), CAMsg::printMsg(), and CAMuxSocket::receive().
Definition at line 442 of file CAUtil.hpp.
References __UINT64__t_::high, and __UINT64__t_::low.
Referenced by CAHttpClient::parseHTTPHeader(), CASocket::receiveFullyT(), and CASocket::receiveLine().
|
inline |
|
inline |
Definition at line 464 of file CAUtil.hpp.
References __UINT64__t_::high, and __UINT64__t_::low.
Referenced by CAFirstMixB::loop(), CAMsg::printMsg(), and CAFirstMixA::sendToUsers().
void logMemoryUsage | ( | ) |
Log information about the current memory (heap) usage.
Definition at line 177 of file CAUtil.cpp.
References CAMsg::printMsg().
Removes leading and ending whitespaces (chars<=32) from a byte array.
src | input byte array |
dest | output byte array |
size | size of the input byte array |
E_UNSPECIFIED,if | dest was NULL |
Definition at line 126 of file CAUtil.cpp.
References E_UNSPECIFIED.
Sleeps ms milliseconds.
Definition at line 406 of file CAUtil.cpp.
References E_SUCCESS.
Referenced by consumer(), CAFirstMixA::loop(), CALastMixA::loop(), CAFirstMixB::loop(), CALastMixB::loop(), my_terminate(), CAHttpClient::parseHTTPHeader(), producer(), CAClientSocket::receiveFully(), CASocket::sendTimeOut(), and CACryptoBenchmark::timerThread().
Parses a buffer containing an XML document and returns this document.
Definition at line 663 of file CAUtil.cpp.
References len, CAMutex::lock(), theDOMParser, theParseDOMDocumentLock, and CAMutex::unlock().
Referenced by CAXMLErrorMessage::CAXMLErrorMessage(), CACertificate::decode(), decodeXMLEncryptedKey(), decryptXMLElement(), CAFirstMix::doUserLogin_internal(), CAInfoService::getPaymentInstance(), CASignature::parseSignKeyXML(), CASyncControlChannel::proccessMessageComplete(), CALastMix::processKeyExchange(), CAMiddleMix::processKeyExchange(), CALocalProxy::processKeyExchange(), CACmdLnOptions::readXmlConfiguration(), CAASymCipher::setPublicKeyAsXML(), CACmdLnOptions::setTermsAndConditionsTemplates(), CAAccountingBIInterface::settleAll(), CAMultiSignature::signXML(), and CAMultiSignature::verifyXML().
XERCES_CPP_NAMESPACE::DOMDocument* parseDOMDocument | ( | const UINT8 *const | pathOrURL | ) |
parses a file via path or URL
Definition at line 679 of file CAUtil.cpp.
References CAMutex::lock(), theDOMParser, theParseDOMDocumentLock, and CAMutex::unlock().
Parses a 64bit signed integer.
Note: If the value is out of range or not parseable an erro is returned.
Definition at line 1430 of file CAUtil.cpp.
References E_SUCCESS, E_UNKNOWN, and len.
Referenced by getDOMElementAttribute(), and getDOMElementValue().
Parses a 64bit unsigned integer.
Note: If the value is out of range or not parseable an error is returned.
Definition at line 1378 of file CAUtil.cpp.
References E_SUCCESS, E_UNKNOWN, and len.
Referenced by getDOMElementAttribute(), and getDOMElementValue().
Parses a timestamp in JDBC timestamp escape format (as it comes from the BI) and outputs the value in milliseconds since the epoch.
strTimestamp | the string containing the timestamp |
value | an integer variable that gets the milliseconds value. Converts a timestamp (in seconds) to the String JDBC timestamp escape format (YYYY-MM-DD HH:MM:SS) |
seconds | integer value containing the timestamp in seconds since the epoch |
strTimestamp | a string buffer that gets the result |
len | the buffer length |
Parses a 16bit unsigned integer
Definition at line 1367 of file CAUtil.cpp.
References E_SUCCESS.
Definition at line 482 of file CAUtil.hpp.
Referenced by CAAccountingDBInterface::__deleteCC(), CAAccountingDBInterface::__getAccountStatus(), CAAccountingDBInterface::__getCostConfirmation(), CAAccountingDBInterface::__getPrepaidAmount(), CAAccountingInstance::__handleSettleResult(), CAAccountingDBInterface::__markAsSettled(), CAAccountingDBInterface::__storeAccountStatus(), CAAccountingDBInterface::__storeCostConfirmation(), CAAccountingDBInterface::__storePrepaidAmount(), CAAccountingInstance::cleanupTableEntry(), CAInfoService::getCascadeHeloXMLAsString(), CACmdLnOptions::getMixXml(), CAInfoService::getStatusXMLAsString(), CAAccountingInstance::handleChallengeResponse_internal(), CAAccountingInstance::handleCostConfirmation_internal(), CAAccountingInstance::handleJapPacket_internal(), CAAccountingInstance::returnKickout(), setCurrentTimeMilliesAsDOMAttribute(), setDOMElementAttribute(), setDOMElementValue(), and CAAccountingInstance::settlementTransaction().
ONLY_LOCAL_PROXY or first.
Definition at line 1330 of file CAUtil.cpp.
References filesize32(), and O_BINARY.
Referenced by CALastMix::init(), and CAMiddleMix::init().
Read a passwd (i.e.
without echoing the chars typed in)
Definition at line 1473 of file CAUtil.cpp.
References E_SUCCESS, flags, and len.
Referenced by CACmdLnOptions::setOwnCertificate().
void releaseDOMParser | ( | ) |
Definition at line 694 of file CAUtil.cpp.
References CAMutex::lock(), theDOMParser, theParseDOMDocumentLock, and CAMutex::unlock().
Referenced by CALibProxytest::cleanup().
|
inline |
Clones an OpenSSL RSA structure.
Definition at line 220 of file CAUtil.hpp.
Referenced by CASignature::clone(), CASignature::setSignKey(), and CASignature::setVerifyKey().
Definition at line 1352 of file CAUtil.cpp.
References E_SUCCESS, E_UNKNOWN, myfilewrite, O_BINARY, S_IREAD, and S_IWRITE.
Referenced by CALastMix::init(), and CAMiddleMix::init().
Sets the value of dst to the value of src.
Definition at line 345 of file CAUtil.hpp.
References __SINT64__t_::high, and __SINT64__t_::low.
Sets the value of dst to the value of src.
Definition at line 333 of file CAUtil.hpp.
References __UINT64__t_::high, and __UINT64__t_::low.
Definition at line 321 of file CAUtil.hpp.
References __UINT64__t_::high, and __UINT64__t_::low.
Referenced by CAFirstMix::getMixedPackets(), CAInfoService::getStatusXMLAsString(), CAFirstMixA::loop(), CALastMixA::loop(), CAFirstMixB::loop(), CALastMixB::loop(), CAHttpClient::parseHTTPHeader(), CASocket::receiveFullyT(), CASocket::receiveLine(), CAMsg::setMaxLogFileSize(), and CAInfoService::start().
SINT32 setCurrentTimeMilliesAsDOMAttribute | ( | DOMNode * | pElem | ) |
Definition at line 848 of file CAUtil.cpp.
References E_SUCCESS, E_UNKNOWN, getcurrentTimeMillis(), print64(), setDOMElementAttribute(), and UNIVERSAL_ATTRIBUTE_LAST_UPDATE.
Referenced by CAInfoService::getOperatorTnCsAsStrings().
SINT32 setDOMElementAttribute | ( | DOMNode * | pElem, |
const char * | attrName, | ||
bool | value | ||
) |
Definition at line 996 of file CAUtil.cpp.
References setDOMElementAttribute(), STR_VALUE_FALSE, and STR_VALUE_TRUE.
SINT32 setDOMElementAttribute | ( | DOMNode * | pElem, |
const char * | attrName, | ||
const char * | value | ||
) |
Definition at line 831 of file CAUtil.cpp.
Referenced by CACmdLnOptions::addMixIdToMixInfo(), CAMix::appendCompatibilityInfo(), CACmdLnOptions::buildDefaultConfig(), CAFirstMix::doUserLogin_internal(), encodeXMLEncryptedKey(), CAInfoService::getCascadeHeloXMLAsString(), CAInfoService::getMixHeloXMLAsString(), CAInfoService::getOperatorTnCsAsStrings(), CACmdLnOptions::getTermsAndConditions(), CAAccountingInstance::handleAccountCertificate_internal(), CALastMix::initMixCascadeInfo(), CAMix::initMixCascadeInfo(), CAReplayCtrlChannelMsgProc::initTimestampsMessageTemplate(), CAAccountingInstance::makeInitialCCRequest(), CAAccountingInstance::prepareCCRequest(), CAReplayCtrlChannelMsgProc::proccessGetTimestamp(), CAReplayCtrlChannelMsgProc::proccessGotTimestamp(), CALastMix::processKeyExchange(), CAMiddleMix::processKeyExchange(), CAAccountingInstance::sendAILoginConfirmation(), CAReplayCtrlChannelMsgProc::sendGetTimestamp(), CACmdLnOptions::setAccessControlCredential(), setCurrentTimeMilliesAsDOMAttribute(), setDOMElementAttribute(), CACmdLnOptions::setMixName(), CACmdLnOptions::setTargetInterfaces(), CAMultiSignature::signXML(), and CAXMLErrorMessage::toXmlElement().
Definition at line 836 of file CAUtil.cpp.
Definition at line 988 of file CAUtil.cpp.
References setDOMElementAttribute().
Definition at line 980 of file CAUtil.cpp.
References setDOMElementAttribute().
Definition at line 1606 of file CAUtil.cpp.
References setDOMElementAttribute().
Definition at line 973 of file CAUtil.cpp.
References print64(), and setDOMElementAttribute().
SINT32 setDOMElementValue | ( | DOMElement * | pElem, |
bool | value | ||
) |
Definition at line 1002 of file CAUtil.cpp.
References setDOMElementValue(), STR_VALUE_FALSE, and STR_VALUE_TRUE.
Returns the content of the text node under elem as 64bit unsigned integer.
Sets the decimal text representation of a 64bit integer as node value TODO: implement this for non-64bit platforms
Returns the content of the text node under elem as 64bit unsigned integer.
Definition at line 962 of file CAUtil.cpp.
References E_SUCCESS, print64(), and setDOMElementValue().
SINT32 setDOMElementValue | ( | DOMElement * | pElem, |
double | floatValue | ||
) |
Definition at line 949 of file CAUtil.cpp.
References E_SUCCESS, and setDOMElementValue().
Definition at line 939 of file CAUtil.cpp.
References E_SUCCESS.
Referenced by CACmdLnOptions::buildDefaultConfig(), CAFirstMix::doUserLogin_internal(), CACertificate::encode(), encodeXMLEncryptedKey(), encryptXMLElement(), CAInfoService::getCascadeHeloXMLAsString(), CACmdLnOptions::getMixXml(), CASignature::getSignKey(), CAAccountingInstance::handleAccountCertificate_internal(), CAMix::initMixCascadeInfo(), CAReplayCtrlChannelMsgProc::initTimestampsMessageTemplate(), CAAccountingInstance::makeCCRequest(), CAAccountingInstance::makeInitialCCRequest(), CAAccountingInstance::prepareCCRequest(), CAReplayCtrlChannelMsgProc::proccessGetTimestamp(), CAReplayCtrlChannelMsgProc::proccessGotTimestamp(), CALastMix::processKeyExchange(), CAMiddleMix::processKeyExchange(), CACmdLnOptions::processXmlConfiguration(), CAReplayCtrlChannelMsgProc::propagateCurrentReplayTimestamp(), CAAccountingInstance::sendAILoginConfirmation(), setDOMElementValue(), CACmdLnOptions::setMixName(), CACmdLnOptions::setPrepaidInterval(), CACmdLnOptions::setSymChannelCipherAlgorithm(), CACmdLnOptions::setTargetInterfaces(), CAMultiSignature::signXML(), CAListenerInterface::toDOMElement(), and CAXMLErrorMessage::toXmlElement().
Definition at line 1574 of file CAUtil.cpp.
References E_SUCCESS, and setDOMElementValue().
|
inline |
|
inline |
Definition at line 355 of file CAUtil.hpp.
References __UINT64__t_::high, and __UINT64__t_::low.
Referenced by CACmdLnOptions::CACmdLnOptions(), CAMsg::CAMsg(), CAPool::CAPool(), CAFirstMixA::closeConnection(), CAFirstMixA::loop(), CALastMixA::loop(), CAFirstMixB::loop(), and CALastMixB::loop().
Sleeps sec Seconds.
Definition at line 425 of file CAUtil.cpp.
References E_SUCCESS.
Referenced by CATempIPBlockList::cleanupThreadMainLoop(), CASocket::connect(), CAFirstMix::connectToNextMix(), CAMiddleMix::connectToNextMix(), CAInfoService::InfoLoop(), CALocalProxy::loop(), signal_segv(), CALocalProxy::start(), and CAMix::start().
char* strins | ( | const char * | src, |
const char * | pos, | ||
const char * | ins | ||
) |
Inserts a String ins in a String src starting at the char pos points to.
Returns a newly allocated String which must be freed using delete.
Definition at line 168 of file CAUtil.cpp.
References strins().
char* strins | ( | const char * | src, |
UINT32 | pos, | ||
const char * | ins | ||
) |
Inserts a String ins in a String src starting after pos chars.
Returns a newly allocated String which must be freed using delete.
Definition at line 148 of file CAUtil.cpp.
Referenced by strins().
Removes leading and ending whitespaces (chars<=32) from a zero terminated string.
s | input string (null terminated) |
0 | means, that either s was NULL or that the new string has a zero length (that means, that the old string only contains whitespaces) |
Definition at line 49 of file CAUtil.cpp.
Referenced by CAListenerInterface::getInstance(), CAChain::getPrintableChainId(), CAMultiSignature::getSKI(), CAAccountingInstance::prepareCCRequest(), CACmdLnOptions::setAccountingDatabase(), CACmdLnOptions::setLoggingOptions(), CACmdLnOptions::setMixID(), and CACmdLnOptions::setTargetInterfaces().
Definition at line 74 of file CAUtil.cpp.
References E_SUCCESS.
Referenced by CACmdLnOptions::setLoggingOptions().