12#include "ct_context_p.h"
14#include <gwenhywfar/misc.h>
15#include <gwenhywfar/debug.h>
30 p_struct->_refCount=1;
35 p_struct->signKeyId=0;
36 p_struct->signKeyNum=0;
37 p_struct->signKeyVer=0;
38 p_struct->verifyKeyId=0;
39 p_struct->encipherKeyId=0;
40 p_struct->decipherKeyId=0;
41 p_struct->decipherKeyNum=0;
42 p_struct->decipherKeyVer=0;
43 p_struct->authSignKeyId=0;
44 p_struct->authSignKeyNum=0;
45 p_struct->authSignKeyVer=0;
46 p_struct->authVerifyKeyId=0;
47 p_struct->tempSignKeyId=0;
48 p_struct->keyHashNum=0;
49 p_struct->keyHashVer=0;
50 p_struct->keyHashAlgo=0;
51 p_struct->keyHash.pointer=
NULL;
52 p_struct->keyHash.length=0;
53 p_struct->keyStatus=0;
54 p_struct->protocolVersion=0;
55 p_struct->cid.pointer=
NULL;
56 p_struct->cid.length=0;
57 p_struct->serviceId=
NULL;
58 p_struct->userId=
NULL;
59 p_struct->customerId=
NULL;
60 p_struct->userName=
NULL;
61 p_struct->peerId=
NULL;
62 p_struct->peerName=
NULL;
63 p_struct->address=
NULL;
65 p_struct->systemId=
NULL;
74 assert(p_struct->_refCount);
75 if (p_struct->_refCount==1) {
79 if (p_struct->keyHash.length && p_struct->keyHash.pointer) {
80 free(p_struct->keyHash.pointer);
82 p_struct->keyHash.pointer=
NULL;
83 p_struct->keyHash.length=0;
84 if (p_struct->cid.length && p_struct->cid.pointer) {
85 free(p_struct->cid.pointer);
87 p_struct->cid.pointer=
NULL;
88 p_struct->cid.length=0;
89 free(p_struct->serviceId);
90 p_struct->serviceId=
NULL;
91 free(p_struct->userId);
92 p_struct->userId=
NULL;
93 free(p_struct->customerId);
94 p_struct->customerId=
NULL;
95 free(p_struct->userName);
96 p_struct->userName=
NULL;
97 free(p_struct->peerId);
98 p_struct->peerId=
NULL;
99 free(p_struct->peerName);
100 p_struct->peerName=
NULL;
101 free(p_struct->address);
102 p_struct->address=
NULL;
103 free(p_struct->systemId);
104 p_struct->systemId=
NULL;
105 p_struct->_refCount=0;
109 p_struct->_refCount--;
116 assert(p_struct->_refCount);
117 p_struct->_refCount++;
127 p_struct->id=p_src->id;
130 p_struct->signKeyId=p_src->signKeyId;
133 p_struct->signKeyNum=p_src->signKeyNum;
136 p_struct->signKeyVer=p_src->signKeyVer;
139 p_struct->verifyKeyId=p_src->verifyKeyId;
142 p_struct->encipherKeyId=p_src->encipherKeyId;
145 p_struct->decipherKeyId=p_src->decipherKeyId;
148 p_struct->decipherKeyNum=p_src->decipherKeyNum;
151 p_struct->decipherKeyVer=p_src->decipherKeyVer;
154 p_struct->authSignKeyId=p_src->authSignKeyId;
157 p_struct->authSignKeyNum=p_src->authSignKeyNum;
160 p_struct->authSignKeyVer=p_src->authSignKeyVer;
163 p_struct->authVerifyKeyId=p_src->authVerifyKeyId;
166 p_struct->tempSignKeyId=p_src->tempSignKeyId;
169 p_struct->keyHashNum=p_src->keyHashNum;
172 p_struct->keyHashVer=p_src->keyHashVer;
175 p_struct->keyHashAlgo=p_src->keyHashAlgo;
178 if (p_src->keyHash.length && p_src->keyHash.pointer) {
179 p_struct->keyHash.pointer=(uint8_t *) malloc(p_src->keyHash.length);
180 if (p_struct->keyHash.pointer) {
181 p_struct->keyHash.length=p_src->keyHash.length;
182 memmove(p_struct->keyHash.pointer, p_src->keyHash.pointer, p_src->keyHash.length);
185 p_struct->keyHash.pointer=
NULL;
186 p_struct->keyHash.length=0;
190 p_struct->keyHash.pointer=
NULL;
191 p_struct->keyHash.length=0;
195 p_struct->keyStatus=p_src->keyStatus;
198 p_struct->protocolVersion=p_src->protocolVersion;
201 if (p_src->cid.length && p_src->cid.pointer) {
202 p_struct->cid.pointer=(uint8_t *) malloc(p_src->cid.length);
203 if (p_struct->cid.pointer) {
204 p_struct->cid.length=p_src->cid.length;
205 memmove(p_struct->cid.pointer, p_src->cid.pointer, p_src->cid.length);
208 p_struct->cid.pointer=
NULL;
209 p_struct->cid.length=0;
213 p_struct->cid.pointer=
NULL;
214 p_struct->cid.length=0;
218 if (p_struct->serviceId) {
219 free(p_struct->serviceId);
220 p_struct->serviceId=
NULL;
221 p_struct->serviceId=
NULL;
223 if (p_src->serviceId) {
224 p_struct->serviceId=strdup(p_src->serviceId);
228 if (p_struct->userId) {
229 free(p_struct->userId);
230 p_struct->userId=
NULL;
231 p_struct->userId=
NULL;
234 p_struct->userId=strdup(p_src->userId);
238 if (p_struct->customerId) {
239 free(p_struct->customerId);
240 p_struct->customerId=
NULL;
241 p_struct->customerId=
NULL;
243 if (p_src->customerId) {
244 p_struct->customerId=strdup(p_src->customerId);
248 if (p_struct->userName) {
249 free(p_struct->userName);
250 p_struct->userName=
NULL;
251 p_struct->userName=
NULL;
253 if (p_src->userName) {
254 p_struct->userName=strdup(p_src->userName);
258 if (p_struct->peerId) {
259 free(p_struct->peerId);
260 p_struct->peerId=
NULL;
261 p_struct->peerId=
NULL;
264 p_struct->peerId=strdup(p_src->peerId);
268 if (p_struct->peerName) {
269 free(p_struct->peerName);
270 p_struct->peerName=
NULL;
271 p_struct->peerName=
NULL;
273 if (p_src->peerName) {
274 p_struct->peerName=strdup(p_src->peerName);
278 if (p_struct->address) {
279 free(p_struct->address);
280 p_struct->address=
NULL;
281 p_struct->address=
NULL;
283 if (p_src->address) {
284 p_struct->address=strdup(p_src->address);
288 p_struct->port=p_src->port;
291 if (p_struct->systemId) {
292 free(p_struct->systemId);
293 p_struct->systemId=
NULL;
294 p_struct->systemId=
NULL;
296 if (p_src->systemId) {
297 p_struct->systemId=strdup(p_src->systemId);
309 p_struct->id=p_src->id;
312 p_struct->signKeyId=p_src->signKeyId;
315 p_struct->signKeyNum=p_src->signKeyNum;
318 p_struct->signKeyVer=p_src->signKeyVer;
321 p_struct->verifyKeyId=p_src->verifyKeyId;
324 p_struct->encipherKeyId=p_src->encipherKeyId;
327 p_struct->decipherKeyId=p_src->decipherKeyId;
330 p_struct->decipherKeyNum=p_src->decipherKeyNum;
333 p_struct->decipherKeyVer=p_src->decipherKeyVer;
336 p_struct->authSignKeyId=p_src->authSignKeyId;
339 p_struct->authSignKeyNum=p_src->authSignKeyNum;
342 p_struct->authSignKeyVer=p_src->authSignKeyVer;
345 p_struct->authVerifyKeyId=p_src->authVerifyKeyId;
348 p_struct->tempSignKeyId=p_src->tempSignKeyId;
351 p_struct->keyHashNum=p_src->keyHashNum;
354 p_struct->keyHashVer=p_src->keyHashVer;
357 p_struct->keyHashAlgo=p_src->keyHashAlgo;
360 if (p_src->keyHash.length && p_src->keyHash.pointer) {
361 p_struct->keyHash.pointer=(uint8_t *) malloc(p_src->keyHash.length);
362 if (p_struct->keyHash.pointer) {
363 p_struct->keyHash.length=p_src->keyHash.length;
364 memmove(p_struct->keyHash.pointer, p_src->keyHash.pointer, p_src->keyHash.length);
367 p_struct->keyHash.pointer=
NULL;
368 p_struct->keyHash.length=0;
372 p_struct->keyHash.pointer=
NULL;
373 p_struct->keyHash.length=0;
377 p_struct->keyStatus=p_src->keyStatus;
380 p_struct->protocolVersion=p_src->protocolVersion;
383 if (p_src->cid.length && p_src->cid.pointer) {
384 p_struct->cid.pointer=(uint8_t *) malloc(p_src->cid.length);
385 if (p_struct->cid.pointer) {
386 p_struct->cid.length=p_src->cid.length;
387 memmove(p_struct->cid.pointer, p_src->cid.pointer, p_src->cid.length);
390 p_struct->cid.pointer=
NULL;
391 p_struct->cid.length=0;
395 p_struct->cid.pointer=
NULL;
396 p_struct->cid.length=0;
400 if (p_struct->serviceId) {
401 free(p_struct->serviceId);
402 p_struct->serviceId=
NULL;
403 p_struct->serviceId=
NULL;
405 if (p_src->serviceId) {
406 p_struct->serviceId=strdup(p_src->serviceId);
410 if (p_struct->userId) {
411 free(p_struct->userId);
412 p_struct->userId=
NULL;
413 p_struct->userId=
NULL;
416 p_struct->userId=strdup(p_src->userId);
420 if (p_struct->customerId) {
421 free(p_struct->customerId);
422 p_struct->customerId=
NULL;
423 p_struct->customerId=
NULL;
425 if (p_src->customerId) {
426 p_struct->customerId=strdup(p_src->customerId);
430 if (p_struct->userName) {
431 free(p_struct->userName);
432 p_struct->userName=
NULL;
433 p_struct->userName=
NULL;
435 if (p_src->userName) {
436 p_struct->userName=strdup(p_src->userName);
440 if (p_struct->peerId) {
441 free(p_struct->peerId);
442 p_struct->peerId=
NULL;
443 p_struct->peerId=
NULL;
446 p_struct->peerId=strdup(p_src->peerId);
450 if (p_struct->peerName) {
451 free(p_struct->peerName);
452 p_struct->peerName=
NULL;
453 p_struct->peerName=
NULL;
455 if (p_src->peerName) {
456 p_struct->peerName=strdup(p_src->peerName);
460 if (p_struct->address) {
461 free(p_struct->address);
462 p_struct->address=
NULL;
463 p_struct->address=
NULL;
465 if (p_src->address) {
466 p_struct->address=strdup(p_src->address);
470 p_struct->port=p_src->port;
473 if (p_struct->systemId) {
474 free(p_struct->systemId);
475 p_struct->systemId=
NULL;
476 p_struct->systemId=
NULL;
478 if (p_src->systemId) {
479 p_struct->systemId=strdup(p_src->systemId);
494 return p_struct->signKeyId;
500 return p_struct->signKeyNum;
506 return p_struct->signKeyVer;
512 return p_struct->verifyKeyId;
518 return p_struct->encipherKeyId;
524 return p_struct->decipherKeyId;
530 return p_struct->decipherKeyNum;
536 return p_struct->decipherKeyVer;
542 return p_struct->authSignKeyId;
548 return p_struct->authSignKeyNum;
554 return p_struct->authSignKeyVer;
560 return p_struct->authVerifyKeyId;
566 return p_struct->tempSignKeyId;
572 return p_struct->keyHashNum;
578 return p_struct->keyHashVer;
584 return p_struct->keyHashAlgo;
590 return p_struct->keyStatus;
596 return p_struct->protocolVersion;
602 return p_struct->serviceId;
608 return p_struct->userId;
614 return p_struct->customerId;
620 return p_struct->userName;
626 return p_struct->peerId;
632 return p_struct->peerName;
638 return p_struct->address;
644 return p_struct->port;
650 return p_struct->systemId;
662 p_struct->signKeyId=p_src;
668 p_struct->signKeyNum=p_src;
674 p_struct->signKeyVer=p_src;
680 p_struct->verifyKeyId=p_src;
686 p_struct->encipherKeyId=p_src;
692 p_struct->decipherKeyId=p_src;
698 p_struct->decipherKeyNum=p_src;
704 p_struct->decipherKeyVer=p_src;
710 p_struct->authSignKeyId=p_src;
716 p_struct->authSignKeyNum=p_src;
722 p_struct->authSignKeyVer=p_src;
728 p_struct->authVerifyKeyId=p_src;
734 p_struct->tempSignKeyId=p_src;
740 p_struct->keyHashNum=p_src;
746 p_struct->keyHashVer=p_src;
752 p_struct->keyHashAlgo=p_src;
758 p_struct->keyStatus=p_src;
764 p_struct->protocolVersion=p_src;
770 if (p_struct->serviceId) {
771 free(p_struct->serviceId);
772 p_struct->serviceId=
NULL;
775 p_struct->serviceId=strdup(p_src);
778 p_struct->serviceId=
NULL;
785 if (p_struct->userId) {
786 free(p_struct->userId);
787 p_struct->userId=
NULL;
790 p_struct->userId=strdup(p_src);
793 p_struct->userId=
NULL;
800 if (p_struct->customerId) {
801 free(p_struct->customerId);
802 p_struct->customerId=
NULL;
805 p_struct->customerId=strdup(p_src);
808 p_struct->customerId=
NULL;
815 if (p_struct->userName) {
816 free(p_struct->userName);
817 p_struct->userName=
NULL;
820 p_struct->userName=strdup(p_src);
823 p_struct->userName=
NULL;
830 if (p_struct->peerId) {
831 free(p_struct->peerId);
832 p_struct->peerId=
NULL;
835 p_struct->peerId=strdup(p_src);
838 p_struct->peerId=
NULL;
845 if (p_struct->peerName) {
846 free(p_struct->peerName);
847 p_struct->peerName=
NULL;
850 p_struct->peerName=strdup(p_src);
853 p_struct->peerName=
NULL;
860 if (p_struct->address) {
861 free(p_struct->address);
862 p_struct->address=
NULL;
865 p_struct->address=strdup(p_src);
868 p_struct->address=
NULL;
875 p_struct->port=p_src;
881 if (p_struct->systemId) {
882 free(p_struct->systemId);
883 p_struct->systemId=
NULL;
886 p_struct->systemId=strdup(p_src);
889 p_struct->systemId=
NULL;
974 dest=(uint8_t *) malloc(vlen);
975 memmove(dest, v, vlen);
976 p_struct->keyHash.pointer=dest;
977 p_struct->keyHash.length=vlen;
994 dest=(uint8_t *) malloc(vlen);
995 memmove(dest, v, vlen);
996 p_struct->cid.pointer=dest;
997 p_struct->cid.length=vlen;
1002 if (p_struct->serviceId) {
1003 free(p_struct->serviceId);
1004 p_struct->serviceId=
NULL;
1010 p_struct->serviceId=strdup(s);
1012 if (p_struct->serviceId==
NULL) {
1013 p_struct->serviceId=
NULL;
1017 if (p_struct->userId) {
1018 free(p_struct->userId);
1019 p_struct->userId=
NULL;
1025 p_struct->userId=strdup(s);
1027 if (p_struct->userId==
NULL) {
1028 p_struct->userId=
NULL;
1032 if (p_struct->customerId) {
1033 free(p_struct->customerId);
1034 p_struct->customerId=
NULL;
1040 p_struct->customerId=strdup(s);
1042 if (p_struct->customerId==
NULL) {
1043 p_struct->customerId=
NULL;
1047 if (p_struct->userName) {
1048 free(p_struct->userName);
1049 p_struct->userName=
NULL;
1055 p_struct->userName=strdup(s);
1057 if (p_struct->userName==
NULL) {
1058 p_struct->userName=
NULL;
1062 if (p_struct->peerId) {
1063 free(p_struct->peerId);
1064 p_struct->peerId=
NULL;
1070 p_struct->peerId=strdup(s);
1072 if (p_struct->peerId==
NULL) {
1073 p_struct->peerId=
NULL;
1077 if (p_struct->peerName) {
1078 free(p_struct->peerName);
1079 p_struct->peerName=
NULL;
1085 p_struct->peerName=strdup(s);
1087 if (p_struct->peerName==
NULL) {
1088 p_struct->peerName=
NULL;
1092 if (p_struct->address) {
1093 free(p_struct->address);
1094 p_struct->address=
NULL;
1100 p_struct->address=strdup(s);
1102 if (p_struct->address==
NULL) {
1103 p_struct->address=
NULL;
1110 if (p_struct->systemId) {
1111 free(p_struct->systemId);
1112 p_struct->systemId=
NULL;
1118 p_struct->systemId=strdup(s);
1120 if (p_struct->systemId==
NULL) {
1121 p_struct->systemId=
NULL;
1252 if (p_struct->keyHash.length && p_struct->keyHash.pointer) {
1254 p_struct->keyHash.length);
1282 if (p_struct->cid.length && p_struct->cid.pointer) {
1296 if (p_struct->serviceId)
1308 if (p_struct->userId)
1320 if (p_struct->customerId)
1332 if (p_struct->userName)
1344 if (p_struct->peerId)
1356 if (p_struct->peerName)
1368 if (p_struct->address)
1387 if (p_struct->systemId)
1487 dest=(uint8_t *) malloc(len);
1488 memmove(dest, t, len);
1489 p_struct->keyHash.pointer=dest;
1490 p_struct->keyHash.length=len;
1493 p_struct->keyHash.pointer=(uint8_t *) t;
1494 p_struct->keyHash.length=len;
1526 dest=(uint8_t *) malloc(len);
1527 memmove(dest, t, len);
1528 p_struct->cid.pointer=dest;
1529 p_struct->cid.length=len;
1532 p_struct->cid.pointer=(uint8_t *) t;
1533 p_struct->cid.length=len;
1541 if (p_struct->serviceId) {
1542 free(p_struct->serviceId);
1543 p_struct->serviceId=
NULL;
1549 p_struct->serviceId=strdup(s);
1551 if (p_struct->serviceId==
NULL) {
1552 p_struct->serviceId=
NULL;
1556 if (p_struct->userId) {
1557 free(p_struct->userId);
1558 p_struct->userId=
NULL;
1564 p_struct->userId=strdup(s);
1566 if (p_struct->userId==
NULL) {
1567 p_struct->userId=
NULL;
1571 if (p_struct->customerId) {
1572 free(p_struct->customerId);
1573 p_struct->customerId=
NULL;
1579 p_struct->customerId=strdup(s);
1581 if (p_struct->customerId==
NULL) {
1582 p_struct->customerId=
NULL;
1586 if (p_struct->userName) {
1587 free(p_struct->userName);
1588 p_struct->userName=
NULL;
1594 p_struct->userName=strdup(s);
1596 if (p_struct->userName==
NULL) {
1597 p_struct->userName=
NULL;
1601 if (p_struct->peerId) {
1602 free(p_struct->peerId);
1603 p_struct->peerId=
NULL;
1609 p_struct->peerId=strdup(s);
1611 if (p_struct->peerId==
NULL) {
1612 p_struct->peerId=
NULL;
1616 if (p_struct->peerName) {
1617 free(p_struct->peerName);
1618 p_struct->peerName=
NULL;
1624 p_struct->peerName=strdup(s);
1626 if (p_struct->peerName==
NULL) {
1627 p_struct->peerName=
NULL;
1631 if (p_struct->address) {
1632 free(p_struct->address);
1633 p_struct->address=
NULL;
1639 p_struct->address=strdup(s);
1641 if (p_struct->address==
NULL) {
1642 p_struct->address=
NULL;
1649 if (p_struct->systemId) {
1650 free(p_struct->systemId);
1651 p_struct->systemId=
NULL;
1657 p_struct->systemId=strdup(s);
1659 if (p_struct->systemId==
NULL) {
1660 p_struct->systemId=
NULL;
1721 if (p_struct->keyHash.length && p_struct->keyHash.pointer) {
1725 rv=
GWEN_Base64_Encode((
const unsigned char *) p_struct->keyHash.pointer, p_struct->keyHash.length, tbuf, 80);
1744 if (p_struct->cid.length && p_struct->cid.pointer) {
1748 rv=
GWEN_Base64_Encode((
const unsigned char *) p_struct->cid.pointer, p_struct->cid.length, tbuf, 80);
1811 if (p_struct->id==p_cmp)
1813 else if (p_cmp<p_struct->
id)
1827 if (st->keyHash.length && st->keyHash.pointer)
1828 free(st->keyHash.pointer);
1830 st->keyHash.pointer=(uint8_t *) malloc(len);
1831 if (st->keyHash.pointer) {
1832 st->keyHash.length=len;
1833 memmove(st->keyHash.pointer, p, len);
1836 st->keyHash.pointer=
NULL;
1837 st->keyHash.length=0;
1841 st->keyHash.length=0;
1842 st->keyHash.pointer=
NULL;
1848 return st->keyHash.pointer;
1853 return st->keyHash.length;
1858 if (st->cid.length && st->cid.pointer)
1859 free(st->cid.pointer);
1861 st->cid.pointer=(uint8_t *) malloc(len);
1862 if (st->cid.pointer) {
1864 memmove(st->cid.pointer, p, len);
1867 st->cid.pointer=
NULL;
1873 st->cid.pointer=
NULL;
1879 return st->cid.pointer;
1884 return st->cid.length;
int GWEN_Base64_Encode(const unsigned char *src, unsigned int size, GWEN_BUFFER *dst, unsigned int maxLineLength)
int GWEN_Base64_Decode(const unsigned char *src, unsigned int size, GWEN_BUFFER *dst)
GWEN_BUFFER * GWEN_Buffer_new(char *buffer, uint32_t size, uint32_t used, int take)
void GWEN_Buffer_free(GWEN_BUFFER *bf)
int GWEN_Buffer_Relinquish(GWEN_BUFFER *bf)
uint32_t GWEN_Buffer_GetUsedBytes(const GWEN_BUFFER *bf)
char * GWEN_Buffer_GetStart(const GWEN_BUFFER *bf)
uint32_t GWEN_Crypt_Token_Context_GetAuthSignKeyNum(const GWEN_CRYPT_TOKEN_CONTEXT *p_struct)
void GWEN_Crypt_Token_Context_SetDecipherKeyId(GWEN_CRYPT_TOKEN_CONTEXT *p_struct, uint32_t p_src)
uint32_t GWEN_Crypt_Token_Context_GetProtocolVersion(const GWEN_CRYPT_TOKEN_CONTEXT *p_struct)
void GWEN_Crypt_Token_Context_SetKeyHashNum(GWEN_CRYPT_TOKEN_CONTEXT *p_struct, uint32_t p_src)
void GWEN_Crypt_Token_Context_free(GWEN_CRYPT_TOKEN_CONTEXT *p_struct)
const char * GWEN_Crypt_Token_Context_GetServiceId(const GWEN_CRYPT_TOKEN_CONTEXT *p_struct)
void GWEN_Crypt_Token_Context_SetAuthSignKeyNum(GWEN_CRYPT_TOKEN_CONTEXT *p_struct, uint32_t p_src)
void GWEN_Crypt_Token_Context_ReadDb(GWEN_CRYPT_TOKEN_CONTEXT *p_struct, GWEN_DB_NODE *p_db)
uint32_t GWEN_Crypt_Token_Context_GetKeyHashLen(const GWEN_CRYPT_TOKEN_CONTEXT *st)
uint32_t GWEN_Crypt_Token_Context_GetDecipherKeyVer(const GWEN_CRYPT_TOKEN_CONTEXT *p_struct)
uint32_t GWEN_Crypt_Token_Context_GetKeyHashNum(const GWEN_CRYPT_TOKEN_CONTEXT *p_struct)
void GWEN_Crypt_Token_Context_SetSignKeyId(GWEN_CRYPT_TOKEN_CONTEXT *p_struct, uint32_t p_src)
const char * GWEN_Crypt_Token_Context_GetUserId(const GWEN_CRYPT_TOKEN_CONTEXT *p_struct)
void GWEN_Crypt_Token_Context_SetCid(GWEN_CRYPT_TOKEN_CONTEXT *st, const uint8_t *p, uint32_t len)
void GWEN_Crypt_Token_Context_SetSignKeyNum(GWEN_CRYPT_TOKEN_CONTEXT *p_struct, uint32_t p_src)
void GWEN_Crypt_Token_Context_SetCustomerId(GWEN_CRYPT_TOKEN_CONTEXT *p_struct, const char *p_src)
GWEN_CRYPT_TOKEN_CONTEXT * GWEN_Crypt_Token_Context_copy(GWEN_CRYPT_TOKEN_CONTEXT *p_struct, const GWEN_CRYPT_TOKEN_CONTEXT *p_src)
void GWEN_Crypt_Token_Context_SetUserId(GWEN_CRYPT_TOKEN_CONTEXT *p_struct, const char *p_src)
void GWEN_Crypt_Token_Context_SetId(GWEN_CRYPT_TOKEN_CONTEXT *p_struct, uint32_t p_src)
const char * GWEN_Crypt_Token_Context_GetSystemId(const GWEN_CRYPT_TOKEN_CONTEXT *p_struct)
void GWEN_Crypt_Token_Context_SetSignKeyVer(GWEN_CRYPT_TOKEN_CONTEXT *p_struct, uint32_t p_src)
void GWEN_Crypt_Token_Context_ReadXml(GWEN_CRYPT_TOKEN_CONTEXT *p_struct, GWEN_XMLNODE *p_db)
const char * GWEN_Crypt_Token_Context_GetPeerName(const GWEN_CRYPT_TOKEN_CONTEXT *p_struct)
uint32_t GWEN_Crypt_Token_Context_GetKeyHashAlgo(const GWEN_CRYPT_TOKEN_CONTEXT *p_struct)
uint32_t GWEN_Crypt_Token_Context_GetKeyStatus(const GWEN_CRYPT_TOKEN_CONTEXT *p_struct)
void GWEN_Crypt_Token_Context_SetAuthSignKeyVer(GWEN_CRYPT_TOKEN_CONTEXT *p_struct, uint32_t p_src)
int GWEN_Crypt_Token_Context_GetPort(const GWEN_CRYPT_TOKEN_CONTEXT *p_struct)
void GWEN_Crypt_Token_Context_SetDecipherKeyNum(GWEN_CRYPT_TOKEN_CONTEXT *p_struct, uint32_t p_src)
void GWEN_Crypt_Token_Context_WriteXml(const GWEN_CRYPT_TOKEN_CONTEXT *p_struct, GWEN_XMLNODE *p_db)
void GWEN_Crypt_Token_Context_Attach(GWEN_CRYPT_TOKEN_CONTEXT *p_struct)
uint32_t GWEN_Crypt_Token_Context_GetAuthVerifyKeyId(const GWEN_CRYPT_TOKEN_CONTEXT *p_struct)
uint32_t GWEN_Crypt_Token_Context_GetTempSignKeyId(const GWEN_CRYPT_TOKEN_CONTEXT *p_struct)
uint32_t GWEN_Crypt_Token_Context_GetSignKeyVer(const GWEN_CRYPT_TOKEN_CONTEXT *p_struct)
void GWEN_Crypt_Token_Context_SetSystemId(GWEN_CRYPT_TOKEN_CONTEXT *p_struct, const char *p_src)
void GWEN_Crypt_Token_Context_SetKeyHashAlgo(GWEN_CRYPT_TOKEN_CONTEXT *p_struct, uint32_t p_src)
void GWEN_Crypt_Token_Context_SetAuthSignKeyId(GWEN_CRYPT_TOKEN_CONTEXT *p_struct, uint32_t p_src)
void GWEN_Crypt_Token_Context_SetDecipherKeyVer(GWEN_CRYPT_TOKEN_CONTEXT *p_struct, uint32_t p_src)
void GWEN_Crypt_Token_Context_SetKeyHashVer(GWEN_CRYPT_TOKEN_CONTEXT *p_struct, uint32_t p_src)
GWEN_CRYPT_TOKEN_CONTEXT * GWEN_Crypt_Token_Context_dup(const GWEN_CRYPT_TOKEN_CONTEXT *p_src)
const char * GWEN_Crypt_Token_Context_GetCustomerId(const GWEN_CRYPT_TOKEN_CONTEXT *p_struct)
void GWEN_Crypt_Token_Context_SetProtocolVersion(GWEN_CRYPT_TOKEN_CONTEXT *p_struct, uint32_t p_src)
uint32_t GWEN_Crypt_Token_Context_GetCidLen(const GWEN_CRYPT_TOKEN_CONTEXT *st)
void GWEN_Crypt_Token_Context_SetKeyHash(GWEN_CRYPT_TOKEN_CONTEXT *st, const uint8_t *p, uint32_t len)
uint32_t GWEN_Crypt_Token_Context_GetDecipherKeyNum(const GWEN_CRYPT_TOKEN_CONTEXT *p_struct)
void GWEN_Crypt_Token_Context_SetPeerName(GWEN_CRYPT_TOKEN_CONTEXT *p_struct, const char *p_src)
void GWEN_Crypt_Token_Context_SetAuthVerifyKeyId(GWEN_CRYPT_TOKEN_CONTEXT *p_struct, uint32_t p_src)
uint32_t GWEN_Crypt_Token_Context_GetKeyHashVer(const GWEN_CRYPT_TOKEN_CONTEXT *p_struct)
const uint8_t * GWEN_Crypt_Token_Context_GetKeyHashPtr(const GWEN_CRYPT_TOKEN_CONTEXT *st)
void GWEN_Crypt_Token_Context_SetEncipherKeyId(GWEN_CRYPT_TOKEN_CONTEXT *p_struct, uint32_t p_src)
void GWEN_Crypt_Token_Context_SetUserName(GWEN_CRYPT_TOKEN_CONTEXT *p_struct, const char *p_src)
int GWEN_Crypt_Token_Context_WriteDb(const GWEN_CRYPT_TOKEN_CONTEXT *p_struct, GWEN_DB_NODE *p_db)
const char * GWEN_Crypt_Token_Context_GetAddress(const GWEN_CRYPT_TOKEN_CONTEXT *p_struct)
GWEN_CRYPT_TOKEN_CONTEXT * GWEN_Crypt_Token_Context_List_GetById(const GWEN_CRYPT_TOKEN_CONTEXT_LIST *p_list, uint32_t p_cmp)
uint32_t GWEN_Crypt_Token_Context_GetAuthSignKeyId(const GWEN_CRYPT_TOKEN_CONTEXT *p_struct)
void GWEN_Crypt_Token_Context_SetPort(GWEN_CRYPT_TOKEN_CONTEXT *p_struct, int p_src)
GWEN_CRYPT_TOKEN_CONTEXT * GWEN_Crypt_Token_Context_fromXml(GWEN_XMLNODE *p_db)
void GWEN_Crypt_Token_Context_SetVerifyKeyId(GWEN_CRYPT_TOKEN_CONTEXT *p_struct, uint32_t p_src)
GWEN_CRYPT_TOKEN_CONTEXT * GWEN_Crypt_Token_Context_fromDb(GWEN_DB_NODE *p_db)
GWEN_CRYPT_TOKEN_CONTEXT * GWEN_Crypt_Token_Context_new(void)
void GWEN_Crypt_Token_Context_SetAddress(GWEN_CRYPT_TOKEN_CONTEXT *p_struct, const char *p_src)
uint32_t GWEN_Crypt_Token_Context_GetEncipherKeyId(const GWEN_CRYPT_TOKEN_CONTEXT *p_struct)
uint32_t GWEN_Crypt_Token_Context_GetAuthSignKeyVer(const GWEN_CRYPT_TOKEN_CONTEXT *p_struct)
uint32_t GWEN_Crypt_Token_Context_GetVerifyKeyId(const GWEN_CRYPT_TOKEN_CONTEXT *p_struct)
const uint8_t * GWEN_Crypt_Token_Context_GetCidPtr(const GWEN_CRYPT_TOKEN_CONTEXT *st)
GWEN_CRYPT_TOKEN_CONTEXT_LIST * GWEN_Crypt_Token_Context_List_dup(const GWEN_CRYPT_TOKEN_CONTEXT_LIST *p_src)
void GWEN_Crypt_Token_Context_SetServiceId(GWEN_CRYPT_TOKEN_CONTEXT *p_struct, const char *p_src)
uint32_t GWEN_Crypt_Token_Context_GetDecipherKeyId(const GWEN_CRYPT_TOKEN_CONTEXT *p_struct)
const char * GWEN_Crypt_Token_Context_GetUserName(const GWEN_CRYPT_TOKEN_CONTEXT *p_struct)
void GWEN_Crypt_Token_Context_SetKeyStatus(GWEN_CRYPT_TOKEN_CONTEXT *p_struct, uint32_t p_src)
uint32_t GWEN_Crypt_Token_Context_GetId(const GWEN_CRYPT_TOKEN_CONTEXT *p_struct)
void GWEN_Crypt_Token_Context_toXml(const GWEN_CRYPT_TOKEN_CONTEXT *p_struct, GWEN_XMLNODE *p_db)
int GWEN_Crypt_Token_Context_toDb(const GWEN_CRYPT_TOKEN_CONTEXT *p_struct, GWEN_DB_NODE *p_db)
void GWEN_Crypt_Token_Context_SetPeerId(GWEN_CRYPT_TOKEN_CONTEXT *p_struct, const char *p_src)
void GWEN_Crypt_Token_Context_SetTempSignKeyId(GWEN_CRYPT_TOKEN_CONTEXT *p_struct, uint32_t p_src)
const char * GWEN_Crypt_Token_Context_GetPeerId(const GWEN_CRYPT_TOKEN_CONTEXT *p_struct)
uint32_t GWEN_Crypt_Token_Context_GetSignKeyNum(const GWEN_CRYPT_TOKEN_CONTEXT *p_struct)
uint32_t GWEN_Crypt_Token_Context_GetSignKeyId(const GWEN_CRYPT_TOKEN_CONTEXT *p_struct)
struct GWEN_CRYPT_TOKEN_CONTEXT GWEN_CRYPT_TOKEN_CONTEXT
const char * GWEN_DB_GetCharValue(GWEN_DB_NODE *n, const char *path, int idx, const char *defVal)
int GWEN_DB_DeleteVar(GWEN_DB_NODE *n, const char *path)
int GWEN_DB_SetIntValue(GWEN_DB_NODE *n, uint32_t flags, const char *path, int val)
int GWEN_DB_SetCharValue(GWEN_DB_NODE *n, uint32_t flags, const char *path, const char *val)
int GWEN_DB_SetBinValue(GWEN_DB_NODE *n, uint32_t flags, const char *path, const void *val, unsigned int valSize)
const void * GWEN_DB_GetBinValue(GWEN_DB_NODE *n, const char *path, int idx, const void *defVal, unsigned int defValSize, unsigned int *returnValueSize)
int GWEN_DB_GetIntValue(GWEN_DB_NODE *n, const char *path, int idx, int defVal)
#define GWEN_DB_FLAGS_OVERWRITE_VARS
struct GWEN_DB_NODE GWEN_DB_NODE
#define DBG_INFO(dbg_logger, format, args...)
struct GWEN_BUFFER GWEN_BUFFER
A dynamically resizeable text buffer.
#define GWEN_INHERIT_FUNCTIONS(t)
#define GWEN_INHERIT_INIT(t, element)
#define GWEN_INHERIT_FINI(t, element)
#define GWEN_LIST_FINI(t, element)
#define GWEN_LIST_FUNCTIONS(t, pr)
#define GWEN_LIST_INIT(t, element)
#define GWEN_LIST2_FUNCTIONS(t, pr)
GWEN_CRYPT_TOKEN_CONTEXT * GWEN_Crypt_Token_Context_List_Next(const GWEN_CRYPT_TOKEN_CONTEXT *element)
GWEN_CRYPT_TOKEN_CONTEXT_LIST * GWEN_Crypt_Token_Context_List_new()
void GWEN_Crypt_Token_Context_List_Add(GWEN_CRYPT_TOKEN_CONTEXT *element, GWEN_CRYPT_TOKEN_CONTEXT_LIST *list)
GWEN_CRYPT_TOKEN_CONTEXT * GWEN_Crypt_Token_Context_List_First(const GWEN_CRYPT_TOKEN_CONTEXT_LIST *l)
#define GWEN_FREE_OBJECT(varname)
#define GWEN_NEW_OBJECT(typ, varname)
void GWEN_XMLNode_SetIntValue(GWEN_XMLNODE *n, const char *name, int value)
int GWEN_XMLNode_GetIntValue(const GWEN_XMLNODE *n, const char *name, int defValue)
const char * GWEN_XMLNode_GetCharValue(const GWEN_XMLNODE *n, const char *name, const char *defValue)
void GWEN_XMLNode_SetCharValue(GWEN_XMLNODE *n, const char *name, const char *value)
struct GWEN__XMLNODE GWEN_XMLNODE