32 #define UNIVERSAL_ATTRIBUTE_LAST_UPDATE "lastUpdate"
33 #define UNIVERSAL_NODE_LAST_UPDATE "LastUpdate"
35 #define STR_VALUE_TRUE "true"
36 #define STR_VALUE_FALSE "false"
38 #define TMP_BUFF_SIZE 255
39 #define TMP_LOCALE_SIZE 3
40 #define TMP_DATE_SIZE 9
42 #define TEMPLATE_REFID_MAXLEN ((TMP_BUFF_SIZE) + (TMP_LOCALE_SIZE) + (TMP_DATE_SIZE) + 2)
44 #if _XERCES_VERSION >= 30001
45 #define INTEGRATE_NOT_ALLOWED_POSITIONS \
46 (DOMNode::DOCUMENT_POSITION_CONTAINED_BY | DOMNode::DOCUMENT_POSITION_CONTAINS )
48 #define INTEGRATE_NOT_ALLOWED_POSITIONS \
49 (DOMNode::TREE_POSITION_ANCESTOR | DOMNode::TREE_POSITION_DESCENDANT | \
50 DOMNode::TREE_POSITION_EQUIVALENT | DOMNode::TREE_POSITION_SAME_NODE )
61 char*
strins(
const char* src,
UINT32 pos,
const char* ins);
62 char*
strins(
const char* src,
const char * pos,
const char* ins);
88 return _filelengthi64(handle);
89 #elif defined (HAVE_FSTAT64)
91 if(fstat64(handle, &info) != 0)
96 if(fstat(handle, &info) != 0)
105 return _filelength(handle);
108 if(fstat(handle, &info) != 0)
145 bool equals(
const XMLCh*
const e1,
const char*
const e2);
151 DOMElement*
createDOMElement(XERCES_CPP_NAMESPACE::DOMDocument* pOwnerDoc,
const char *
const name);
155 DOMText*
createDOMText(XERCES_CPP_NAMESPACE::DOMDocument* pOwnerDoc,
const char *
const text);
164 #if !defined LOCAL_PROXY_ONLY || defined INCLUDE_MIDDLE_MIX
195 DSA* tmpDSA=DSA_new();
196 #if OPENSSL_VERSION_NUMBER > 0x100020cfL
200 BIGNUM* pub_key = NULL;
201 BIGNUM* priv_key = NULL;
202 DSA_get0_pqg(dsa,(
const BIGNUM**) &p,(
const BIGNUM**) &q,(
const BIGNUM**) &g);
203 DSA_set0_pqg(tmpDSA,BN_dup(p), BN_dup(q), BN_dup(g));
204 DSA_get0_key(dsa,(
const BIGNUM**) &pub_key,(
const BIGNUM**) &priv_key);
205 DSA_set0_key(tmpDSA,BN_dup(pub_key), BN_dup(priv_key));
207 tmpDSA->g=BN_dup(dsa->g);
208 tmpDSA->p=BN_dup(dsa->p);
209 tmpDSA->q=BN_dup(dsa->q);
210 tmpDSA->pub_key=BN_dup(dsa->pub_key);
211 if(dsa->priv_key!=NULL)
212 tmpDSA->priv_key=BN_dup(dsa->priv_key);
226 #if OPENSSL_VERSION_NUMBER >= 0x1000204fL
227 return RSAPrivateKey_dup(rsa);
229 RSA* tmpRSA = RSA_new();
230 tmpRSA->n = BN_dup(rsa->n);
231 tmpRSA->e = BN_dup(rsa->e);
234 tmpRSA->d = BN_dup(rsa->d);
235 if(tmpRSA->p != NULL)
237 tmpRSA->p = BN_dup(rsa->p);
239 if(tmpRSA->q != NULL)
241 tmpRSA->q = BN_dup(rsa->q);
244 if(tmpRSA->dmp1 != NULL)
246 tmpRSA->dmp1 = BN_dup(rsa->dmp1);
248 if(tmpRSA->dmq1 != NULL)
250 tmpRSA->dmq1 = BN_dup(rsa->dmq1);
252 if(tmpRSA->iqmp != NULL)
254 tmpRSA->iqmp = BN_dup(rsa->iqmp);
263 #ifndef ONLY_LOCAL_PROXY
267 DOMText*
createDOMText(XERCES_CPP_NAMESPACE::DOMDocument* pOwnerDoc,
const char *
const text);
310 #if !defined ONLY_LOCAL_PROXY || defined INCLUDE_FIRST_MIX
323 #if !defined(HAVE_NATIVE_UINT64)
335 #if !defined(HAVE_NATIVE_UINT64)
347 #if !defined(HAVE_NATIVE_UINT64)
357 #if !defined(HAVE_NATIVE_UINT64)
367 #if !defined(HAVE_NATIVE_UINT64)
377 #if !defined(HAVE_NATIVE_UINT64)
389 #if !defined(HAVE_NATIVE_UINT64)
400 #if !defined(HAVE_NATIVE_UINT64)
403 return (
UINT32)(bigop-smallop);
409 #if !defined(HAVE_NATIVE_UINT64)
418 #if !defined(HAVE_NATIVE_UINT64)
431 #if !defined(HAVE_NATIVE_UINT64)
444 #if !defined(HAVE_NATIVE_UINT64)
448 return smallOp1.
low<bigOp2.
low;
451 return smallOp1<bigOp2;
457 #if !defined(HAVE_NATIVE_UINT64)
466 #if !defined(HAVE_NATIVE_UINT64)
467 return (op1.
high==0)&&op1.
low==0;
475 #if !defined(HAVE_NATIVE_UINT64)
476 return (op1.
high==0)&&op1.
low==0;
484 #ifdef HAVE_NATIVE_UINT64
491 UINT64 mask=10000000000000000000ULL;
493 bool bprintZero=
false;
504 if(digit>0||bprintZero)
506 buff[index++]=(
UINT8)(digit+
'0');
513 sprintf((
char*)buff,
"(%lu:%lu)",op.high,op.low);
565 #if !defined ONLY_LOCAL_PROXY || defined INCLUDE_LAST_MIX
SINT32 getNodeName(const DOMNode *const pElem, UINT8 *value, UINT32 *valuelen)
UINT32 diff64(const UINT64 &bigop, const UINT64 &smallop)
UINT8 * bytes2hex(const void *bytes, UINT32 len)
Converts the byte array to a hex string.
SINT32 getcurrentTimeMillis(UINT64 &u64Time)
Gets the current Systemtime in milli seconds.
UINT8 * readFile(const UINT8 *const name, UINT32 *size)
ONLY_LOCAL_PROXY or first.
SINT32 setCurrentTimeMilliesAsDOMAttribute(DOMNode *pElem)
SINT32 readPasswd(UINT8 *buff, UINT32 len)
Read a passwd (i.e.
char * strins(const char *src, UINT32 pos, const char *ins)
Inserts a String ins in a String src starting after pos chars.
DSA * DSA_clone(DSA *dsa)
Clones an OpenSSL DSA structure.
SINT32 getcurrentTimeMicros(UINT64 &u64Time)
Gets the current Systemtime in micros seconds.
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.
SINT32 setDOMElementAttribute(DOMNode *pElem, const char *attrName, const UINT8 *value)
SINT32 parseS64(const UINT8 *str, SINT64 &value)
Parses a 64bit signed integer.
SINT32 encryptXMLElement(DOMNode *pElem, CAASymCipher *pRSA)
Replaces a DOM element with an encrypted version of this element.
SINT32 getRandom(UINT8 *buff, UINT32 len)
Gets some random bytes.
bool equals(const XMLCh *const e1, const char *const e2)
bool isEqual64(UINT64 &op1, UINT64 &op2)
SINT32 sSleep(UINT32 sec)
Sleeps sec Seconds.
void setZero64(UINT64 &op1)
UINT8 * getTermsAndConditionsTemplateRefId(DOMNode *tcTemplateRoot)
XERCES_CPP_NAMESPACE::DOMDocument * parseDOMDocument(const UINT8 *const buff, UINT32 len)
Parses a buffer containing an XML document and returns this document.
DOMNodeList * getElementsByTagName(DOMElement *pElem, const char *const name)
SINT32 memtrim(UINT8 *out, const UINT8 *in, UINT32 len)
Removes leading and ending whitespaces (chars<=32) from a byte array.
SINT32 parseU64(const UINT8 *str, UINT64 &value)
Parses a 64bit unsigned integer.
SINT32 getDOMElementAttribute(const DOMNode *const pElem, const char *attrName, SINT32 *value)
UINT32 div64(UINT64 &op1, UINT32 op2)
UINT32 strtrim(UINT8 *)
Removes leading and ending whitespaces (chars<=32) from a zero terminated string.
XERCES_CPP_NAMESPACE::DOMDocument * createDOMDocument()
Creates an empty DOM DOcument.
SINT32 filesize32(int handle)
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.
SINT32 decryptXMLElement(DOMNode *pelem, CAASymCipher *pRSA)
Replaces a DOM element with a deencrypted version of this element.
SINT32 getcurrentTime(timespec &t)
Gets the current Systemtime in milli seconds.
SINT64 filesize64(int handle)
RSA * RSA_clone(RSA *rsa)
Clones an OpenSSL RSA structure.
UINT32 toLower(UINT8 *a_string)
void formatBytesPerSecond(UINT8 *buff, UINT32 buffsize, UINT64 bytespersecond)
bool isZero64(UINT64 &op1)
void logMemoryUsage()
Log information about the current memory (heap) usage.
void print64(UINT8 *buff, UINT64 num)
SINT32 saveFile(const UINT8 *const name, const UINT8 *const buff, UINT32 buffSize)
SINT32 encodeXMLEncryptedKey(UINT8 *key, UINT32 keylen, UINT8 *xml, UINT32 *xmllen, CAASymCipher *pRSA)
void add64(UINT64 &op1, UINT32 op2)
SINT32 getLastDOMChildByName(const DOMNode *pNode, const char *const name, DOMElement *&a_child)
SINT32 decodeXMLEncryptedKey(UINT8 *key, UINT32 *keylen, const UINT8 *const xml, UINT32 xmllen, CAASymCipher *pRSA)
bool isGreater64(UINT64 &op1, UINT64 &op2)
bool isLesser64(UINT64 &smallOp1, UINT64 &bigOp2)
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.
SINT32 getSignatureElements(DOMNode *parent, DOMNode **signatureNodes, UINT32 *length)
void set64(UINT64 &op1, UINT32 op2)
SINT32 msSleep(UINT32 ms)
Sleeps ms milliseconds.
SINT32 getDOMChildByName(const DOMNode *pNode, const XMLCh *const name, DOMNode *&child, bool deep=false)
SINT32 integrateDOMNode(const DOMNode *srcNode, DOMNode *dstNode, bool recursive, bool replace)
integrates the source node in the destination Node.
SINT32 compDate(struct tm *date1, struct tm *date2)
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...
SINT32 setDOMElementValue(DOMElement *pElem, const UINT8 *value)