gwenhywfar 5.12.0
ct_context.c
Go to the documentation of this file.
1/**********************************************************
2 * This file has been automatically created by "typemaker2"
3 * from the file "ct_context.xml".
4 * Please do not edit this file, all changes will be lost.
5 * Better edit the mentioned source file instead.
6 **********************************************************/
7
8#ifdef HAVE_CONFIG_H
9# include <config.h>
10#endif
11
12#include "ct_context_p.h"
13
14#include <gwenhywfar/misc.h>
15#include <gwenhywfar/debug.h>
16
17/* code headers */
18
19/* macro functions */
20GWEN_LIST_FUNCTIONS(GWEN_CRYPT_TOKEN_CONTEXT, GWEN_Crypt_Token_Context)
21GWEN_LIST2_FUNCTIONS(GWEN_CRYPT_TOKEN_CONTEXT, GWEN_Crypt_Token_Context)
23
24
26{
28
30 p_struct->_refCount=1;
33 /* members */
34 p_struct->id=0;
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;
64 p_struct->port=0;
65 p_struct->systemId=NULL;
66 /* virtual functions */
67
68 return p_struct;
69}
70
72{
73 if (p_struct) {
74 assert(p_struct->_refCount);
75 if (p_struct->_refCount==1) {
78 /* members */
79 if (p_struct->keyHash.length && p_struct->keyHash.pointer) {
80 free(p_struct->keyHash.pointer);
81 }
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);
86 }
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;
106 GWEN_FREE_OBJECT(p_struct);
107 }
108 else
109 p_struct->_refCount--;
110 }
111}
112
114{
115 assert(p_struct);
116 assert(p_struct->_refCount);
117 p_struct->_refCount++;
118}
119
121{
122 GWEN_CRYPT_TOKEN_CONTEXT *p_struct;
123
124 assert(p_src);
126 /* member "id" */
127 p_struct->id=p_src->id;
128
129 /* member "signKeyId" */
130 p_struct->signKeyId=p_src->signKeyId;
131
132 /* member "signKeyNum" */
133 p_struct->signKeyNum=p_src->signKeyNum;
134
135 /* member "signKeyVer" */
136 p_struct->signKeyVer=p_src->signKeyVer;
137
138 /* member "verifyKeyId" */
139 p_struct->verifyKeyId=p_src->verifyKeyId;
140
141 /* member "encipherKeyId" */
142 p_struct->encipherKeyId=p_src->encipherKeyId;
143
144 /* member "decipherKeyId" */
145 p_struct->decipherKeyId=p_src->decipherKeyId;
146
147 /* member "decipherKeyNum" */
148 p_struct->decipherKeyNum=p_src->decipherKeyNum;
149
150 /* member "decipherKeyVer" */
151 p_struct->decipherKeyVer=p_src->decipherKeyVer;
152
153 /* member "authSignKeyId" */
154 p_struct->authSignKeyId=p_src->authSignKeyId;
155
156 /* member "authSignKeyNum" */
157 p_struct->authSignKeyNum=p_src->authSignKeyNum;
158
159 /* member "authSignKeyVer" */
160 p_struct->authSignKeyVer=p_src->authSignKeyVer;
161
162 /* member "authVerifyKeyId" */
163 p_struct->authVerifyKeyId=p_src->authVerifyKeyId;
164
165 /* member "tempSignKeyId" */
166 p_struct->tempSignKeyId=p_src->tempSignKeyId;
167
168 /* member "keyHashNum" */
169 p_struct->keyHashNum=p_src->keyHashNum;
170
171 /* member "keyHashVer" */
172 p_struct->keyHashVer=p_src->keyHashVer;
173
174 /* member "keyHashAlgo" */
175 p_struct->keyHashAlgo=p_src->keyHashAlgo;
176
177 /* member "keyHash" */
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);
183 }
184 else {
185 p_struct->keyHash.pointer=NULL;
186 p_struct->keyHash.length=0;
187 }
188 }
189 else {
190 p_struct->keyHash.pointer=NULL;
191 p_struct->keyHash.length=0;
192 }
193
194 /* member "keyStatus" */
195 p_struct->keyStatus=p_src->keyStatus;
196
197 /* member "protocolVersion" */
198 p_struct->protocolVersion=p_src->protocolVersion;
199
200 /* member "cid" */
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);
206 }
207 else {
208 p_struct->cid.pointer=NULL;
209 p_struct->cid.length=0;
210 }
211 }
212 else {
213 p_struct->cid.pointer=NULL;
214 p_struct->cid.length=0;
215 }
216
217 /* member "serviceId" */
218 if (p_struct->serviceId) {
219 free(p_struct->serviceId);
220 p_struct->serviceId=NULL;
221 p_struct->serviceId=NULL;
222 }
223 if (p_src->serviceId) {
224 p_struct->serviceId=strdup(p_src->serviceId);
225 }
226
227 /* member "userId" */
228 if (p_struct->userId) {
229 free(p_struct->userId);
230 p_struct->userId=NULL;
231 p_struct->userId=NULL;
232 }
233 if (p_src->userId) {
234 p_struct->userId=strdup(p_src->userId);
235 }
236
237 /* member "customerId" */
238 if (p_struct->customerId) {
239 free(p_struct->customerId);
240 p_struct->customerId=NULL;
241 p_struct->customerId=NULL;
242 }
243 if (p_src->customerId) {
244 p_struct->customerId=strdup(p_src->customerId);
245 }
246
247 /* member "userName" */
248 if (p_struct->userName) {
249 free(p_struct->userName);
250 p_struct->userName=NULL;
251 p_struct->userName=NULL;
252 }
253 if (p_src->userName) {
254 p_struct->userName=strdup(p_src->userName);
255 }
256
257 /* member "peerId" */
258 if (p_struct->peerId) {
259 free(p_struct->peerId);
260 p_struct->peerId=NULL;
261 p_struct->peerId=NULL;
262 }
263 if (p_src->peerId) {
264 p_struct->peerId=strdup(p_src->peerId);
265 }
266
267 /* member "peerName" */
268 if (p_struct->peerName) {
269 free(p_struct->peerName);
270 p_struct->peerName=NULL;
271 p_struct->peerName=NULL;
272 }
273 if (p_src->peerName) {
274 p_struct->peerName=strdup(p_src->peerName);
275 }
276
277 /* member "address" */
278 if (p_struct->address) {
279 free(p_struct->address);
280 p_struct->address=NULL;
281 p_struct->address=NULL;
282 }
283 if (p_src->address) {
284 p_struct->address=strdup(p_src->address);
285 }
286
287 /* member "port" */
288 p_struct->port=p_src->port;
289
290 /* member "systemId" */
291 if (p_struct->systemId) {
292 free(p_struct->systemId);
293 p_struct->systemId=NULL;
294 p_struct->systemId=NULL;
295 }
296 if (p_src->systemId) {
297 p_struct->systemId=strdup(p_src->systemId);
298 }
299
300 return p_struct;
301}
302
304 const GWEN_CRYPT_TOKEN_CONTEXT *p_src)
305{
306 assert(p_struct);
307 assert(p_src);
308 /* member "id" */
309 p_struct->id=p_src->id;
310
311 /* member "signKeyId" */
312 p_struct->signKeyId=p_src->signKeyId;
313
314 /* member "signKeyNum" */
315 p_struct->signKeyNum=p_src->signKeyNum;
316
317 /* member "signKeyVer" */
318 p_struct->signKeyVer=p_src->signKeyVer;
319
320 /* member "verifyKeyId" */
321 p_struct->verifyKeyId=p_src->verifyKeyId;
322
323 /* member "encipherKeyId" */
324 p_struct->encipherKeyId=p_src->encipherKeyId;
325
326 /* member "decipherKeyId" */
327 p_struct->decipherKeyId=p_src->decipherKeyId;
328
329 /* member "decipherKeyNum" */
330 p_struct->decipherKeyNum=p_src->decipherKeyNum;
331
332 /* member "decipherKeyVer" */
333 p_struct->decipherKeyVer=p_src->decipherKeyVer;
334
335 /* member "authSignKeyId" */
336 p_struct->authSignKeyId=p_src->authSignKeyId;
337
338 /* member "authSignKeyNum" */
339 p_struct->authSignKeyNum=p_src->authSignKeyNum;
340
341 /* member "authSignKeyVer" */
342 p_struct->authSignKeyVer=p_src->authSignKeyVer;
343
344 /* member "authVerifyKeyId" */
345 p_struct->authVerifyKeyId=p_src->authVerifyKeyId;
346
347 /* member "tempSignKeyId" */
348 p_struct->tempSignKeyId=p_src->tempSignKeyId;
349
350 /* member "keyHashNum" */
351 p_struct->keyHashNum=p_src->keyHashNum;
352
353 /* member "keyHashVer" */
354 p_struct->keyHashVer=p_src->keyHashVer;
355
356 /* member "keyHashAlgo" */
357 p_struct->keyHashAlgo=p_src->keyHashAlgo;
358
359 /* member "keyHash" */
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);
365 }
366 else {
367 p_struct->keyHash.pointer=NULL;
368 p_struct->keyHash.length=0;
369 }
370 }
371 else {
372 p_struct->keyHash.pointer=NULL;
373 p_struct->keyHash.length=0;
374 }
375
376 /* member "keyStatus" */
377 p_struct->keyStatus=p_src->keyStatus;
378
379 /* member "protocolVersion" */
380 p_struct->protocolVersion=p_src->protocolVersion;
381
382 /* member "cid" */
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);
388 }
389 else {
390 p_struct->cid.pointer=NULL;
391 p_struct->cid.length=0;
392 }
393 }
394 else {
395 p_struct->cid.pointer=NULL;
396 p_struct->cid.length=0;
397 }
398
399 /* member "serviceId" */
400 if (p_struct->serviceId) {
401 free(p_struct->serviceId);
402 p_struct->serviceId=NULL;
403 p_struct->serviceId=NULL;
404 }
405 if (p_src->serviceId) {
406 p_struct->serviceId=strdup(p_src->serviceId);
407 }
408
409 /* member "userId" */
410 if (p_struct->userId) {
411 free(p_struct->userId);
412 p_struct->userId=NULL;
413 p_struct->userId=NULL;
414 }
415 if (p_src->userId) {
416 p_struct->userId=strdup(p_src->userId);
417 }
418
419 /* member "customerId" */
420 if (p_struct->customerId) {
421 free(p_struct->customerId);
422 p_struct->customerId=NULL;
423 p_struct->customerId=NULL;
424 }
425 if (p_src->customerId) {
426 p_struct->customerId=strdup(p_src->customerId);
427 }
428
429 /* member "userName" */
430 if (p_struct->userName) {
431 free(p_struct->userName);
432 p_struct->userName=NULL;
433 p_struct->userName=NULL;
434 }
435 if (p_src->userName) {
436 p_struct->userName=strdup(p_src->userName);
437 }
438
439 /* member "peerId" */
440 if (p_struct->peerId) {
441 free(p_struct->peerId);
442 p_struct->peerId=NULL;
443 p_struct->peerId=NULL;
444 }
445 if (p_src->peerId) {
446 p_struct->peerId=strdup(p_src->peerId);
447 }
448
449 /* member "peerName" */
450 if (p_struct->peerName) {
451 free(p_struct->peerName);
452 p_struct->peerName=NULL;
453 p_struct->peerName=NULL;
454 }
455 if (p_src->peerName) {
456 p_struct->peerName=strdup(p_src->peerName);
457 }
458
459 /* member "address" */
460 if (p_struct->address) {
461 free(p_struct->address);
462 p_struct->address=NULL;
463 p_struct->address=NULL;
464 }
465 if (p_src->address) {
466 p_struct->address=strdup(p_src->address);
467 }
468
469 /* member "port" */
470 p_struct->port=p_src->port;
471
472 /* member "systemId" */
473 if (p_struct->systemId) {
474 free(p_struct->systemId);
475 p_struct->systemId=NULL;
476 p_struct->systemId=NULL;
477 }
478 if (p_src->systemId) {
479 p_struct->systemId=strdup(p_src->systemId);
480 }
481
482 return p_struct;
483}
484
486{
487 assert(p_struct);
488 return p_struct->id;
489}
490
492{
493 assert(p_struct);
494 return p_struct->signKeyId;
495}
496
498{
499 assert(p_struct);
500 return p_struct->signKeyNum;
501}
502
504{
505 assert(p_struct);
506 return p_struct->signKeyVer;
507}
508
510{
511 assert(p_struct);
512 return p_struct->verifyKeyId;
513}
514
516{
517 assert(p_struct);
518 return p_struct->encipherKeyId;
519}
520
522{
523 assert(p_struct);
524 return p_struct->decipherKeyId;
525}
526
528{
529 assert(p_struct);
530 return p_struct->decipherKeyNum;
531}
532
534{
535 assert(p_struct);
536 return p_struct->decipherKeyVer;
537}
538
540{
541 assert(p_struct);
542 return p_struct->authSignKeyId;
543}
544
546{
547 assert(p_struct);
548 return p_struct->authSignKeyNum;
549}
550
552{
553 assert(p_struct);
554 return p_struct->authSignKeyVer;
555}
556
558{
559 assert(p_struct);
560 return p_struct->authVerifyKeyId;
561}
562
564{
565 assert(p_struct);
566 return p_struct->tempSignKeyId;
567}
568
570{
571 assert(p_struct);
572 return p_struct->keyHashNum;
573}
574
576{
577 assert(p_struct);
578 return p_struct->keyHashVer;
579}
580
582{
583 assert(p_struct);
584 return p_struct->keyHashAlgo;
585}
586
588{
589 assert(p_struct);
590 return p_struct->keyStatus;
591}
592
594{
595 assert(p_struct);
596 return p_struct->protocolVersion;
597}
598
600{
601 assert(p_struct);
602 return p_struct->serviceId;
603}
604
606{
607 assert(p_struct);
608 return p_struct->userId;
609}
610
612{
613 assert(p_struct);
614 return p_struct->customerId;
615}
616
618{
619 assert(p_struct);
620 return p_struct->userName;
621}
622
624{
625 assert(p_struct);
626 return p_struct->peerId;
627}
628
630{
631 assert(p_struct);
632 return p_struct->peerName;
633}
634
636{
637 assert(p_struct);
638 return p_struct->address;
639}
640
642{
643 assert(p_struct);
644 return p_struct->port;
645}
646
648{
649 assert(p_struct);
650 return p_struct->systemId;
651}
652
654{
655 assert(p_struct);
656 p_struct->id=p_src;
657}
658
660{
661 assert(p_struct);
662 p_struct->signKeyId=p_src;
663}
664
666{
667 assert(p_struct);
668 p_struct->signKeyNum=p_src;
669}
670
672{
673 assert(p_struct);
674 p_struct->signKeyVer=p_src;
675}
676
678{
679 assert(p_struct);
680 p_struct->verifyKeyId=p_src;
681}
682
684{
685 assert(p_struct);
686 p_struct->encipherKeyId=p_src;
687}
688
690{
691 assert(p_struct);
692 p_struct->decipherKeyId=p_src;
693}
694
696{
697 assert(p_struct);
698 p_struct->decipherKeyNum=p_src;
699}
700
702{
703 assert(p_struct);
704 p_struct->decipherKeyVer=p_src;
705}
706
708{
709 assert(p_struct);
710 p_struct->authSignKeyId=p_src;
711}
712
714{
715 assert(p_struct);
716 p_struct->authSignKeyNum=p_src;
717}
718
720{
721 assert(p_struct);
722 p_struct->authSignKeyVer=p_src;
723}
724
726{
727 assert(p_struct);
728 p_struct->authVerifyKeyId=p_src;
729}
730
732{
733 assert(p_struct);
734 p_struct->tempSignKeyId=p_src;
735}
736
738{
739 assert(p_struct);
740 p_struct->keyHashNum=p_src;
741}
742
744{
745 assert(p_struct);
746 p_struct->keyHashVer=p_src;
747}
748
750{
751 assert(p_struct);
752 p_struct->keyHashAlgo=p_src;
753}
754
756{
757 assert(p_struct);
758 p_struct->keyStatus=p_src;
759}
760
762{
763 assert(p_struct);
764 p_struct->protocolVersion=p_src;
765}
766
768{
769 assert(p_struct);
770 if (p_struct->serviceId) {
771 free(p_struct->serviceId);
772 p_struct->serviceId=NULL;
773 }
774 if (p_src) {
775 p_struct->serviceId=strdup(p_src);
776 }
777 else {
778 p_struct->serviceId=NULL;
779 }
780}
781
783{
784 assert(p_struct);
785 if (p_struct->userId) {
786 free(p_struct->userId);
787 p_struct->userId=NULL;
788 }
789 if (p_src) {
790 p_struct->userId=strdup(p_src);
791 }
792 else {
793 p_struct->userId=NULL;
794 }
795}
796
798{
799 assert(p_struct);
800 if (p_struct->customerId) {
801 free(p_struct->customerId);
802 p_struct->customerId=NULL;
803 }
804 if (p_src) {
805 p_struct->customerId=strdup(p_src);
806 }
807 else {
808 p_struct->customerId=NULL;
809 }
810}
811
813{
814 assert(p_struct);
815 if (p_struct->userName) {
816 free(p_struct->userName);
817 p_struct->userName=NULL;
818 }
819 if (p_src) {
820 p_struct->userName=strdup(p_src);
821 }
822 else {
823 p_struct->userName=NULL;
824 }
825}
826
828{
829 assert(p_struct);
830 if (p_struct->peerId) {
831 free(p_struct->peerId);
832 p_struct->peerId=NULL;
833 }
834 if (p_src) {
835 p_struct->peerId=strdup(p_src);
836 }
837 else {
838 p_struct->peerId=NULL;
839 }
840}
841
843{
844 assert(p_struct);
845 if (p_struct->peerName) {
846 free(p_struct->peerName);
847 p_struct->peerName=NULL;
848 }
849 if (p_src) {
850 p_struct->peerName=strdup(p_src);
851 }
852 else {
853 p_struct->peerName=NULL;
854 }
855}
856
858{
859 assert(p_struct);
860 if (p_struct->address) {
861 free(p_struct->address);
862 p_struct->address=NULL;
863 }
864 if (p_src) {
865 p_struct->address=strdup(p_src);
866 }
867 else {
868 p_struct->address=NULL;
869 }
870}
871
873{
874 assert(p_struct);
875 p_struct->port=p_src;
876}
877
879{
880 assert(p_struct);
881 if (p_struct->systemId) {
882 free(p_struct->systemId);
883 p_struct->systemId=NULL;
884 }
885 if (p_src) {
886 p_struct->systemId=strdup(p_src);
887 }
888 else {
889 p_struct->systemId=NULL;
890 }
891}
892
893/* list1 functions */
895{
898
899 assert(p_src);
902 while (p_elem) {
904
905 p_cpy=GWEN_Crypt_Token_Context_dup(p_elem);
908 }
909
910 return p_dest;
911}
912
914{
915 assert(p_struct);
916 /* member "id" */
917 p_struct->id=GWEN_DB_GetIntValue(p_db, "id", 0, 0);
918
919 /* member "signKeyId" */
920 p_struct->signKeyId=GWEN_DB_GetIntValue(p_db, "signKeyId", 0, 0);
921
922 /* member "signKeyNum" */
923 p_struct->signKeyNum=GWEN_DB_GetIntValue(p_db, "signKeyNum", 0, 0);
924
925 /* member "signKeyVer" */
926 p_struct->signKeyVer=GWEN_DB_GetIntValue(p_db, "signKeyVer", 0, 0);
927
928 /* member "verifyKeyId" */
929 p_struct->verifyKeyId=GWEN_DB_GetIntValue(p_db, "verifyKeyId", 0, 0);
930
931 /* member "encipherKeyId" */
932 p_struct->encipherKeyId=GWEN_DB_GetIntValue(p_db, "encipherKeyId", 0, 0);
933
934 /* member "decipherKeyId" */
935 p_struct->decipherKeyId=GWEN_DB_GetIntValue(p_db, "decipherKeyId", 0, 0);
936
937 /* member "decipherKeyNum" */
938 p_struct->decipherKeyNum=GWEN_DB_GetIntValue(p_db, "decipherKeyNum", 0, 0);
939
940 /* member "decipherKeyVer" */
941 p_struct->decipherKeyVer=GWEN_DB_GetIntValue(p_db, "decipherKeyVer", 0, 0);
942
943 /* member "authSignKeyId" */
944 p_struct->authSignKeyId=GWEN_DB_GetIntValue(p_db, "authSignKeyId", 0, 0);
945
946 /* member "authSignKeyNum" */
947 p_struct->authSignKeyNum=GWEN_DB_GetIntValue(p_db, "authSignKeyNum", 0, 0);
948
949 /* member "authSignKeyVer" */
950 p_struct->authSignKeyVer=GWEN_DB_GetIntValue(p_db, "authSignKeyVer", 0, 0);
951
952 /* member "authVerifyKeyId" */
953 p_struct->authVerifyKeyId=GWEN_DB_GetIntValue(p_db, "authVerifyKeyId", 0, 0);
954
955 /* member "tempSignKeyId" */
956 p_struct->tempSignKeyId=GWEN_DB_GetIntValue(p_db, "tempSignKeyId", 0, 0);
957
958 /* member "keyHashNum" */
959 p_struct->keyHashNum=GWEN_DB_GetIntValue(p_db, "keyHashNum", 0, 0);
960
961 /* member "keyHashVer" */
962 p_struct->keyHashVer=GWEN_DB_GetIntValue(p_db, "keyHashVer", 0, 0);
963
964 /* member "keyHashAlgo" */
965 p_struct->keyHashAlgo=GWEN_DB_GetIntValue(p_db, "keyHashAlgo", 0, 0);
966
967 /* member "keyHash" */
968 {
969 const void *v;
970 unsigned int vlen;
971 v=GWEN_DB_GetBinValue(p_db, "keyHash", 0, NULL, 0, &vlen);
972 if (v && vlen) {
973 uint8_t *dest;
974 dest=(uint8_t *) malloc(vlen);
975 memmove(dest, v, vlen);
976 p_struct->keyHash.pointer=dest;
977 p_struct->keyHash.length=vlen;
978 }
979 }
980
981 /* member "keyStatus" */
982 p_struct->keyStatus=GWEN_DB_GetIntValue(p_db, "keyStatus", 0, 0);
983
984 /* member "protocolVersion" */
985 p_struct->protocolVersion=GWEN_DB_GetIntValue(p_db, "protocolVersion", 0, 0);
986
987 /* member "cid" */
988 {
989 const void *v;
990 unsigned int vlen;
991 v=GWEN_DB_GetBinValue(p_db, "cid", 0, NULL, 0, &vlen);
992 if (v && vlen) {
993 uint8_t *dest;
994 dest=(uint8_t *) malloc(vlen);
995 memmove(dest, v, vlen);
996 p_struct->cid.pointer=dest;
997 p_struct->cid.length=vlen;
998 }
999 }
1000
1001 /* member "serviceId" */
1002 if (p_struct->serviceId) {
1003 free(p_struct->serviceId);
1004 p_struct->serviceId=NULL;
1005 }
1006 {
1007 const char *s;
1008 s=GWEN_DB_GetCharValue(p_db, "serviceId", 0, NULL);
1009 if (s)
1010 p_struct->serviceId=strdup(s);
1011 }
1012 if (p_struct->serviceId==NULL) {
1013 p_struct->serviceId=NULL;
1014 }
1015
1016 /* member "userId" */
1017 if (p_struct->userId) {
1018 free(p_struct->userId);
1019 p_struct->userId=NULL;
1020 }
1021 {
1022 const char *s;
1023 s=GWEN_DB_GetCharValue(p_db, "userId", 0, NULL);
1024 if (s)
1025 p_struct->userId=strdup(s);
1026 }
1027 if (p_struct->userId==NULL) {
1028 p_struct->userId=NULL;
1029 }
1030
1031 /* member "customerId" */
1032 if (p_struct->customerId) {
1033 free(p_struct->customerId);
1034 p_struct->customerId=NULL;
1035 }
1036 {
1037 const char *s;
1038 s=GWEN_DB_GetCharValue(p_db, "customerId", 0, NULL);
1039 if (s)
1040 p_struct->customerId=strdup(s);
1041 }
1042 if (p_struct->customerId==NULL) {
1043 p_struct->customerId=NULL;
1044 }
1045
1046 /* member "userName" */
1047 if (p_struct->userName) {
1048 free(p_struct->userName);
1049 p_struct->userName=NULL;
1050 }
1051 {
1052 const char *s;
1053 s=GWEN_DB_GetCharValue(p_db, "userName", 0, NULL);
1054 if (s)
1055 p_struct->userName=strdup(s);
1056 }
1057 if (p_struct->userName==NULL) {
1058 p_struct->userName=NULL;
1059 }
1060
1061 /* member "peerId" */
1062 if (p_struct->peerId) {
1063 free(p_struct->peerId);
1064 p_struct->peerId=NULL;
1065 }
1066 {
1067 const char *s;
1068 s=GWEN_DB_GetCharValue(p_db, "peerId", 0, NULL);
1069 if (s)
1070 p_struct->peerId=strdup(s);
1071 }
1072 if (p_struct->peerId==NULL) {
1073 p_struct->peerId=NULL;
1074 }
1075
1076 /* member "peerName" */
1077 if (p_struct->peerName) {
1078 free(p_struct->peerName);
1079 p_struct->peerName=NULL;
1080 }
1081 {
1082 const char *s;
1083 s=GWEN_DB_GetCharValue(p_db, "peerName", 0, NULL);
1084 if (s)
1085 p_struct->peerName=strdup(s);
1086 }
1087 if (p_struct->peerName==NULL) {
1088 p_struct->peerName=NULL;
1089 }
1090
1091 /* member "address" */
1092 if (p_struct->address) {
1093 free(p_struct->address);
1094 p_struct->address=NULL;
1095 }
1096 {
1097 const char *s;
1098 s=GWEN_DB_GetCharValue(p_db, "address", 0, NULL);
1099 if (s)
1100 p_struct->address=strdup(s);
1101 }
1102 if (p_struct->address==NULL) {
1103 p_struct->address=NULL;
1104 }
1105
1106 /* member "port" */
1107 p_struct->port=GWEN_DB_GetIntValue(p_db, "port", 0, 0);
1108
1109 /* member "systemId" */
1110 if (p_struct->systemId) {
1111 free(p_struct->systemId);
1112 p_struct->systemId=NULL;
1113 }
1114 {
1115 const char *s;
1116 s=GWEN_DB_GetCharValue(p_db, "systemId", 0, NULL);
1117 if (s)
1118 p_struct->systemId=strdup(s);
1119 }
1120 if (p_struct->systemId==NULL) {
1121 p_struct->systemId=NULL;
1122 }
1123
1124}
1125
1127{
1128 int p_rv;
1129
1130 assert(p_struct);
1131 /* member "id" */
1132 p_rv=GWEN_DB_SetIntValue(p_db, GWEN_DB_FLAGS_OVERWRITE_VARS, "id", p_struct->id);
1133 if (p_rv<0) {
1134 DBG_INFO(GWEN_LOGDOMAIN, "here (%d)\n", p_rv);
1135 return p_rv;
1136 }
1137
1138 /* member "signKeyId" */
1139 p_rv=GWEN_DB_SetIntValue(p_db, GWEN_DB_FLAGS_OVERWRITE_VARS, "signKeyId", p_struct->signKeyId);
1140 if (p_rv<0) {
1141 DBG_INFO(GWEN_LOGDOMAIN, "here (%d)\n", p_rv);
1142 return p_rv;
1143 }
1144
1145 /* member "signKeyNum" */
1146 p_rv=GWEN_DB_SetIntValue(p_db, GWEN_DB_FLAGS_OVERWRITE_VARS, "signKeyNum", p_struct->signKeyNum);
1147 if (p_rv<0) {
1148 DBG_INFO(GWEN_LOGDOMAIN, "here (%d)\n", p_rv);
1149 return p_rv;
1150 }
1151
1152 /* member "signKeyVer" */
1153 p_rv=GWEN_DB_SetIntValue(p_db, GWEN_DB_FLAGS_OVERWRITE_VARS, "signKeyVer", p_struct->signKeyVer);
1154 if (p_rv<0) {
1155 DBG_INFO(GWEN_LOGDOMAIN, "here (%d)\n", p_rv);
1156 return p_rv;
1157 }
1158
1159 /* member "verifyKeyId" */
1160 p_rv=GWEN_DB_SetIntValue(p_db, GWEN_DB_FLAGS_OVERWRITE_VARS, "verifyKeyId", p_struct->verifyKeyId);
1161 if (p_rv<0) {
1162 DBG_INFO(GWEN_LOGDOMAIN, "here (%d)\n", p_rv);
1163 return p_rv;
1164 }
1165
1166 /* member "encipherKeyId" */
1167 p_rv=GWEN_DB_SetIntValue(p_db, GWEN_DB_FLAGS_OVERWRITE_VARS, "encipherKeyId", p_struct->encipherKeyId);
1168 if (p_rv<0) {
1169 DBG_INFO(GWEN_LOGDOMAIN, "here (%d)\n", p_rv);
1170 return p_rv;
1171 }
1172
1173 /* member "decipherKeyId" */
1174 p_rv=GWEN_DB_SetIntValue(p_db, GWEN_DB_FLAGS_OVERWRITE_VARS, "decipherKeyId", p_struct->decipherKeyId);
1175 if (p_rv<0) {
1176 DBG_INFO(GWEN_LOGDOMAIN, "here (%d)\n", p_rv);
1177 return p_rv;
1178 }
1179
1180 /* member "decipherKeyNum" */
1181 p_rv=GWEN_DB_SetIntValue(p_db, GWEN_DB_FLAGS_OVERWRITE_VARS, "decipherKeyNum", p_struct->decipherKeyNum);
1182 if (p_rv<0) {
1183 DBG_INFO(GWEN_LOGDOMAIN, "here (%d)\n", p_rv);
1184 return p_rv;
1185 }
1186
1187 /* member "decipherKeyVer" */
1188 p_rv=GWEN_DB_SetIntValue(p_db, GWEN_DB_FLAGS_OVERWRITE_VARS, "decipherKeyVer", p_struct->decipherKeyVer);
1189 if (p_rv<0) {
1190 DBG_INFO(GWEN_LOGDOMAIN, "here (%d)\n", p_rv);
1191 return p_rv;
1192 }
1193
1194 /* member "authSignKeyId" */
1195 p_rv=GWEN_DB_SetIntValue(p_db, GWEN_DB_FLAGS_OVERWRITE_VARS, "authSignKeyId", p_struct->authSignKeyId);
1196 if (p_rv<0) {
1197 DBG_INFO(GWEN_LOGDOMAIN, "here (%d)\n", p_rv);
1198 return p_rv;
1199 }
1200
1201 /* member "authSignKeyNum" */
1202 p_rv=GWEN_DB_SetIntValue(p_db, GWEN_DB_FLAGS_OVERWRITE_VARS, "authSignKeyNum", p_struct->authSignKeyNum);
1203 if (p_rv<0) {
1204 DBG_INFO(GWEN_LOGDOMAIN, "here (%d)\n", p_rv);
1205 return p_rv;
1206 }
1207
1208 /* member "authSignKeyVer" */
1209 p_rv=GWEN_DB_SetIntValue(p_db, GWEN_DB_FLAGS_OVERWRITE_VARS, "authSignKeyVer", p_struct->authSignKeyVer);
1210 if (p_rv<0) {
1211 DBG_INFO(GWEN_LOGDOMAIN, "here (%d)\n", p_rv);
1212 return p_rv;
1213 }
1214
1215 /* member "authVerifyKeyId" */
1216 p_rv=GWEN_DB_SetIntValue(p_db, GWEN_DB_FLAGS_OVERWRITE_VARS, "authVerifyKeyId", p_struct->authVerifyKeyId);
1217 if (p_rv<0) {
1218 DBG_INFO(GWEN_LOGDOMAIN, "here (%d)\n", p_rv);
1219 return p_rv;
1220 }
1221
1222 /* member "tempSignKeyId" */
1223 p_rv=GWEN_DB_SetIntValue(p_db, GWEN_DB_FLAGS_OVERWRITE_VARS, "tempSignKeyId", p_struct->tempSignKeyId);
1224 if (p_rv<0) {
1225 DBG_INFO(GWEN_LOGDOMAIN, "here (%d)\n", p_rv);
1226 return p_rv;
1227 }
1228
1229 /* member "keyHashNum" */
1230 p_rv=GWEN_DB_SetIntValue(p_db, GWEN_DB_FLAGS_OVERWRITE_VARS, "keyHashNum", p_struct->keyHashNum);
1231 if (p_rv<0) {
1232 DBG_INFO(GWEN_LOGDOMAIN, "here (%d)\n", p_rv);
1233 return p_rv;
1234 }
1235
1236 /* member "keyHashVer" */
1237 p_rv=GWEN_DB_SetIntValue(p_db, GWEN_DB_FLAGS_OVERWRITE_VARS, "keyHashVer", p_struct->keyHashVer);
1238 if (p_rv<0) {
1239 DBG_INFO(GWEN_LOGDOMAIN, "here (%d)\n", p_rv);
1240 return p_rv;
1241 }
1242
1243 /* member "keyHashAlgo" */
1244 p_rv=GWEN_DB_SetIntValue(p_db, GWEN_DB_FLAGS_OVERWRITE_VARS, "keyHashAlgo", p_struct->keyHashAlgo);
1245 if (p_rv<0) {
1246 DBG_INFO(GWEN_LOGDOMAIN, "here (%d)\n", p_rv);
1247 return p_rv;
1248 }
1249
1250 /* member "keyHash" */
1251 {
1252 if (p_struct->keyHash.length && p_struct->keyHash.pointer) {
1253 GWEN_DB_SetBinValue(p_db, GWEN_DB_FLAGS_OVERWRITE_VARS, "keyHash", p_struct->keyHash.pointer,
1254 p_struct->keyHash.length);
1255 }
1256 else {
1257 GWEN_DB_DeleteVar(p_db, "keyHash");
1258 p_rv=0;
1259 }
1260 }
1261 if (p_rv<0) {
1262 DBG_INFO(GWEN_LOGDOMAIN, "here (%d)\n", p_rv);
1263 return p_rv;
1264 }
1265
1266 /* member "keyStatus" */
1267 p_rv=GWEN_DB_SetIntValue(p_db, GWEN_DB_FLAGS_OVERWRITE_VARS, "keyStatus", p_struct->keyStatus);
1268 if (p_rv<0) {
1269 DBG_INFO(GWEN_LOGDOMAIN, "here (%d)\n", p_rv);
1270 return p_rv;
1271 }
1272
1273 /* member "protocolVersion" */
1274 p_rv=GWEN_DB_SetIntValue(p_db, GWEN_DB_FLAGS_OVERWRITE_VARS, "protocolVersion", p_struct->protocolVersion);
1275 if (p_rv<0) {
1276 DBG_INFO(GWEN_LOGDOMAIN, "here (%d)\n", p_rv);
1277 return p_rv;
1278 }
1279
1280 /* member "cid" */
1281 {
1282 if (p_struct->cid.length && p_struct->cid.pointer) {
1283 GWEN_DB_SetBinValue(p_db, GWEN_DB_FLAGS_OVERWRITE_VARS, "cid", p_struct->cid.pointer, p_struct->cid.length);
1284 }
1285 else {
1286 GWEN_DB_DeleteVar(p_db, "cid");
1287 p_rv=0;
1288 }
1289 }
1290 if (p_rv<0) {
1291 DBG_INFO(GWEN_LOGDOMAIN, "here (%d)\n", p_rv);
1292 return p_rv;
1293 }
1294
1295 /* member "serviceId" */
1296 if (p_struct->serviceId)
1297 p_rv=GWEN_DB_SetCharValue(p_db, GWEN_DB_FLAGS_OVERWRITE_VARS, "serviceId", p_struct->serviceId);
1298 else {
1299 GWEN_DB_DeleteVar(p_db, "serviceId");
1300 p_rv=0;
1301 }
1302 if (p_rv<0) {
1303 DBG_INFO(GWEN_LOGDOMAIN, "here (%d)\n", p_rv);
1304 return p_rv;
1305 }
1306
1307 /* member "userId" */
1308 if (p_struct->userId)
1309 p_rv=GWEN_DB_SetCharValue(p_db, GWEN_DB_FLAGS_OVERWRITE_VARS, "userId", p_struct->userId);
1310 else {
1311 GWEN_DB_DeleteVar(p_db, "userId");
1312 p_rv=0;
1313 }
1314 if (p_rv<0) {
1315 DBG_INFO(GWEN_LOGDOMAIN, "here (%d)\n", p_rv);
1316 return p_rv;
1317 }
1318
1319 /* member "customerId" */
1320 if (p_struct->customerId)
1321 p_rv=GWEN_DB_SetCharValue(p_db, GWEN_DB_FLAGS_OVERWRITE_VARS, "customerId", p_struct->customerId);
1322 else {
1323 GWEN_DB_DeleteVar(p_db, "customerId");
1324 p_rv=0;
1325 }
1326 if (p_rv<0) {
1327 DBG_INFO(GWEN_LOGDOMAIN, "here (%d)\n", p_rv);
1328 return p_rv;
1329 }
1330
1331 /* member "userName" */
1332 if (p_struct->userName)
1333 p_rv=GWEN_DB_SetCharValue(p_db, GWEN_DB_FLAGS_OVERWRITE_VARS, "userName", p_struct->userName);
1334 else {
1335 GWEN_DB_DeleteVar(p_db, "userName");
1336 p_rv=0;
1337 }
1338 if (p_rv<0) {
1339 DBG_INFO(GWEN_LOGDOMAIN, "here (%d)\n", p_rv);
1340 return p_rv;
1341 }
1342
1343 /* member "peerId" */
1344 if (p_struct->peerId)
1345 p_rv=GWEN_DB_SetCharValue(p_db, GWEN_DB_FLAGS_OVERWRITE_VARS, "peerId", p_struct->peerId);
1346 else {
1347 GWEN_DB_DeleteVar(p_db, "peerId");
1348 p_rv=0;
1349 }
1350 if (p_rv<0) {
1351 DBG_INFO(GWEN_LOGDOMAIN, "here (%d)\n", p_rv);
1352 return p_rv;
1353 }
1354
1355 /* member "peerName" */
1356 if (p_struct->peerName)
1357 p_rv=GWEN_DB_SetCharValue(p_db, GWEN_DB_FLAGS_OVERWRITE_VARS, "peerName", p_struct->peerName);
1358 else {
1359 GWEN_DB_DeleteVar(p_db, "peerName");
1360 p_rv=0;
1361 }
1362 if (p_rv<0) {
1363 DBG_INFO(GWEN_LOGDOMAIN, "here (%d)\n", p_rv);
1364 return p_rv;
1365 }
1366
1367 /* member "address" */
1368 if (p_struct->address)
1369 p_rv=GWEN_DB_SetCharValue(p_db, GWEN_DB_FLAGS_OVERWRITE_VARS, "address", p_struct->address);
1370 else {
1371 GWEN_DB_DeleteVar(p_db, "address");
1372 p_rv=0;
1373 }
1374 if (p_rv<0) {
1375 DBG_INFO(GWEN_LOGDOMAIN, "here (%d)\n", p_rv);
1376 return p_rv;
1377 }
1378
1379 /* member "port" */
1380 p_rv=GWEN_DB_SetIntValue(p_db, GWEN_DB_FLAGS_OVERWRITE_VARS, "port", p_struct->port);
1381 if (p_rv<0) {
1382 DBG_INFO(GWEN_LOGDOMAIN, "here (%d)\n", p_rv);
1383 return p_rv;
1384 }
1385
1386 /* member "systemId" */
1387 if (p_struct->systemId)
1388 p_rv=GWEN_DB_SetCharValue(p_db, GWEN_DB_FLAGS_OVERWRITE_VARS, "systemId", p_struct->systemId);
1389 else {
1390 GWEN_DB_DeleteVar(p_db, "systemId");
1391 p_rv=0;
1392 }
1393 if (p_rv<0) {
1394 DBG_INFO(GWEN_LOGDOMAIN, "here (%d)\n", p_rv);
1395 return p_rv;
1396 }
1397
1398 return 0;
1399}
1400
1408
1410{
1411 return GWEN_Crypt_Token_Context_WriteDb(p_struct, p_db);
1412}
1413
1415{
1416 assert(p_struct);
1417 /* member "id" */
1418 p_struct->id=GWEN_XMLNode_GetIntValue(p_db, "id", 0);
1419
1420 /* member "signKeyId" */
1421 p_struct->signKeyId=GWEN_XMLNode_GetIntValue(p_db, "signKeyId", 0);
1422
1423 /* member "signKeyNum" */
1424 p_struct->signKeyNum=GWEN_XMLNode_GetIntValue(p_db, "signKeyNum", 0);
1425
1426 /* member "signKeyVer" */
1427 p_struct->signKeyVer=GWEN_XMLNode_GetIntValue(p_db, "signKeyVer", 0);
1428
1429 /* member "verifyKeyId" */
1430 p_struct->verifyKeyId=GWEN_XMLNode_GetIntValue(p_db, "verifyKeyId", 0);
1431
1432 /* member "encipherKeyId" */
1433 p_struct->encipherKeyId=GWEN_XMLNode_GetIntValue(p_db, "encipherKeyId", 0);
1434
1435 /* member "decipherKeyId" */
1436 p_struct->decipherKeyId=GWEN_XMLNode_GetIntValue(p_db, "decipherKeyId", 0);
1437
1438 /* member "decipherKeyNum" */
1439 p_struct->decipherKeyNum=GWEN_XMLNode_GetIntValue(p_db, "decipherKeyNum", 0);
1440
1441 /* member "decipherKeyVer" */
1442 p_struct->decipherKeyVer=GWEN_XMLNode_GetIntValue(p_db, "decipherKeyVer", 0);
1443
1444 /* member "authSignKeyId" */
1445 p_struct->authSignKeyId=GWEN_XMLNode_GetIntValue(p_db, "authSignKeyId", 0);
1446
1447 /* member "authSignKeyNum" */
1448 p_struct->authSignKeyNum=GWEN_XMLNode_GetIntValue(p_db, "authSignKeyNum", 0);
1449
1450 /* member "authSignKeyVer" */
1451 p_struct->authSignKeyVer=GWEN_XMLNode_GetIntValue(p_db, "authSignKeyVer", 0);
1452
1453 /* member "authVerifyKeyId" */
1454 p_struct->authVerifyKeyId=GWEN_XMLNode_GetIntValue(p_db, "authVerifyKeyId", 0);
1455
1456 /* member "tempSignKeyId" */
1457 p_struct->tempSignKeyId=GWEN_XMLNode_GetIntValue(p_db, "tempSignKeyId", 0);
1458
1459 /* member "keyHashNum" */
1460 p_struct->keyHashNum=GWEN_XMLNode_GetIntValue(p_db, "keyHashNum", 0);
1461
1462 /* member "keyHashVer" */
1463 p_struct->keyHashVer=GWEN_XMLNode_GetIntValue(p_db, "keyHashVer", 0);
1464
1465 /* member "keyHashAlgo" */
1466 p_struct->keyHashAlgo=GWEN_XMLNode_GetIntValue(p_db, "keyHashAlgo", 0);
1467
1468 /* member "keyHash" */
1469 {
1470 const char *s;
1471 s=GWEN_XMLNode_GetCharValue(p_db, "keyHash", NULL);
1472 if (s) {
1473 GWEN_BUFFER *tbuf;
1474 int rv;
1475 tbuf=GWEN_Buffer_new(0, 1024, 0, 1);
1476 rv=GWEN_Base64_Decode((const unsigned char *)s, strlen(s), tbuf);
1477 if (rv < 0) {
1478 DBG_INFO(GWEN_LOGDOMAIN, "here (%d)", rv);
1479 }
1480 else {
1481 char *t;
1482 uint32_t len;
1483 len=GWEN_Buffer_GetUsedBytes(tbuf);
1484 t=GWEN_Buffer_GetStart(tbuf);
1485 if (GWEN_Buffer_Relinquish(tbuf) < 0) {
1486 uint8_t *dest;
1487 dest=(uint8_t *) malloc(len);
1488 memmove(dest, t, len);
1489 p_struct->keyHash.pointer=dest;
1490 p_struct->keyHash.length=len;
1491 }
1492 else {
1493 p_struct->keyHash.pointer=(uint8_t *) t;
1494 p_struct->keyHash.length=len;
1495 }
1496 }
1497 GWEN_Buffer_free(tbuf);
1498 }
1499 }
1500
1501 /* member "keyStatus" */
1502 p_struct->keyStatus=GWEN_XMLNode_GetIntValue(p_db, "keyStatus", 0);
1503
1504 /* member "protocolVersion" */
1505 p_struct->protocolVersion=GWEN_XMLNode_GetIntValue(p_db, "protocolVersion", 0);
1506
1507 /* member "cid" */
1508 {
1509 const char *s;
1510 s=GWEN_XMLNode_GetCharValue(p_db, "cid", NULL);
1511 if (s) {
1512 GWEN_BUFFER *tbuf;
1513 int rv;
1514 tbuf=GWEN_Buffer_new(0, 1024, 0, 1);
1515 rv=GWEN_Base64_Decode((const unsigned char *)s, strlen(s), tbuf);
1516 if (rv < 0) {
1517 DBG_INFO(GWEN_LOGDOMAIN, "here (%d)", rv);
1518 }
1519 else {
1520 char *t;
1521 uint32_t len;
1522 len=GWEN_Buffer_GetUsedBytes(tbuf);
1523 t=GWEN_Buffer_GetStart(tbuf);
1524 if (GWEN_Buffer_Relinquish(tbuf) < 0) {
1525 uint8_t *dest;
1526 dest=(uint8_t *) malloc(len);
1527 memmove(dest, t, len);
1528 p_struct->cid.pointer=dest;
1529 p_struct->cid.length=len;
1530 }
1531 else {
1532 p_struct->cid.pointer=(uint8_t *) t;
1533 p_struct->cid.length=len;
1534 }
1535 }
1536 GWEN_Buffer_free(tbuf);
1537 }
1538 }
1539
1540 /* member "serviceId" */
1541 if (p_struct->serviceId) {
1542 free(p_struct->serviceId);
1543 p_struct->serviceId=NULL;
1544 }
1545 {
1546 const char *s;
1547 s=GWEN_XMLNode_GetCharValue(p_db, "serviceId", NULL);
1548 if (s)
1549 p_struct->serviceId=strdup(s);
1550 }
1551 if (p_struct->serviceId==NULL) { /* preset member "serviceId" if empty */
1552 p_struct->serviceId=NULL;
1553 }
1554
1555 /* member "userId" */
1556 if (p_struct->userId) {
1557 free(p_struct->userId);
1558 p_struct->userId=NULL;
1559 }
1560 {
1561 const char *s;
1562 s=GWEN_XMLNode_GetCharValue(p_db, "userId", NULL);
1563 if (s)
1564 p_struct->userId=strdup(s);
1565 }
1566 if (p_struct->userId==NULL) { /* preset member "userId" if empty */
1567 p_struct->userId=NULL;
1568 }
1569
1570 /* member "customerId" */
1571 if (p_struct->customerId) {
1572 free(p_struct->customerId);
1573 p_struct->customerId=NULL;
1574 }
1575 {
1576 const char *s;
1577 s=GWEN_XMLNode_GetCharValue(p_db, "customerId", NULL);
1578 if (s)
1579 p_struct->customerId=strdup(s);
1580 }
1581 if (p_struct->customerId==NULL) { /* preset member "customerId" if empty */
1582 p_struct->customerId=NULL;
1583 }
1584
1585 /* member "userName" */
1586 if (p_struct->userName) {
1587 free(p_struct->userName);
1588 p_struct->userName=NULL;
1589 }
1590 {
1591 const char *s;
1592 s=GWEN_XMLNode_GetCharValue(p_db, "userName", NULL);
1593 if (s)
1594 p_struct->userName=strdup(s);
1595 }
1596 if (p_struct->userName==NULL) { /* preset member "userName" if empty */
1597 p_struct->userName=NULL;
1598 }
1599
1600 /* member "peerId" */
1601 if (p_struct->peerId) {
1602 free(p_struct->peerId);
1603 p_struct->peerId=NULL;
1604 }
1605 {
1606 const char *s;
1607 s=GWEN_XMLNode_GetCharValue(p_db, "peerId", NULL);
1608 if (s)
1609 p_struct->peerId=strdup(s);
1610 }
1611 if (p_struct->peerId==NULL) { /* preset member "peerId" if empty */
1612 p_struct->peerId=NULL;
1613 }
1614
1615 /* member "peerName" */
1616 if (p_struct->peerName) {
1617 free(p_struct->peerName);
1618 p_struct->peerName=NULL;
1619 }
1620 {
1621 const char *s;
1622 s=GWEN_XMLNode_GetCharValue(p_db, "peerName", NULL);
1623 if (s)
1624 p_struct->peerName=strdup(s);
1625 }
1626 if (p_struct->peerName==NULL) { /* preset member "peerName" if empty */
1627 p_struct->peerName=NULL;
1628 }
1629
1630 /* member "address" */
1631 if (p_struct->address) {
1632 free(p_struct->address);
1633 p_struct->address=NULL;
1634 }
1635 {
1636 const char *s;
1637 s=GWEN_XMLNode_GetCharValue(p_db, "address", NULL);
1638 if (s)
1639 p_struct->address=strdup(s);
1640 }
1641 if (p_struct->address==NULL) { /* preset member "address" if empty */
1642 p_struct->address=NULL;
1643 }
1644
1645 /* member "port" */
1646 p_struct->port=GWEN_XMLNode_GetIntValue(p_db, "port", 0);
1647
1648 /* member "systemId" */
1649 if (p_struct->systemId) {
1650 free(p_struct->systemId);
1651 p_struct->systemId=NULL;
1652 }
1653 {
1654 const char *s;
1655 s=GWEN_XMLNode_GetCharValue(p_db, "systemId", NULL);
1656 if (s)
1657 p_struct->systemId=strdup(s);
1658 }
1659 if (p_struct->systemId==NULL) { /* preset member "systemId" if empty */
1660 p_struct->systemId=NULL;
1661 }
1662
1663}
1664
1666{
1667 assert(p_struct);
1668 /* member "id" */
1669 GWEN_XMLNode_SetIntValue(p_db, "id", p_struct->id);
1670
1671 /* member "signKeyId" */
1672 GWEN_XMLNode_SetIntValue(p_db, "signKeyId", p_struct->signKeyId);
1673
1674 /* member "signKeyNum" */
1675 GWEN_XMLNode_SetIntValue(p_db, "signKeyNum", p_struct->signKeyNum);
1676
1677 /* member "signKeyVer" */
1678 GWEN_XMLNode_SetIntValue(p_db, "signKeyVer", p_struct->signKeyVer);
1679
1680 /* member "verifyKeyId" */
1681 GWEN_XMLNode_SetIntValue(p_db, "verifyKeyId", p_struct->verifyKeyId);
1682
1683 /* member "encipherKeyId" */
1684 GWEN_XMLNode_SetIntValue(p_db, "encipherKeyId", p_struct->encipherKeyId);
1685
1686 /* member "decipherKeyId" */
1687 GWEN_XMLNode_SetIntValue(p_db, "decipherKeyId", p_struct->decipherKeyId);
1688
1689 /* member "decipherKeyNum" */
1690 GWEN_XMLNode_SetIntValue(p_db, "decipherKeyNum", p_struct->decipherKeyNum);
1691
1692 /* member "decipherKeyVer" */
1693 GWEN_XMLNode_SetIntValue(p_db, "decipherKeyVer", p_struct->decipherKeyVer);
1694
1695 /* member "authSignKeyId" */
1696 GWEN_XMLNode_SetIntValue(p_db, "authSignKeyId", p_struct->authSignKeyId);
1697
1698 /* member "authSignKeyNum" */
1699 GWEN_XMLNode_SetIntValue(p_db, "authSignKeyNum", p_struct->authSignKeyNum);
1700
1701 /* member "authSignKeyVer" */
1702 GWEN_XMLNode_SetIntValue(p_db, "authSignKeyVer", p_struct->authSignKeyVer);
1703
1704 /* member "authVerifyKeyId" */
1705 GWEN_XMLNode_SetIntValue(p_db, "authVerifyKeyId", p_struct->authVerifyKeyId);
1706
1707 /* member "tempSignKeyId" */
1708 GWEN_XMLNode_SetIntValue(p_db, "tempSignKeyId", p_struct->tempSignKeyId);
1709
1710 /* member "keyHashNum" */
1711 GWEN_XMLNode_SetIntValue(p_db, "keyHashNum", p_struct->keyHashNum);
1712
1713 /* member "keyHashVer" */
1714 GWEN_XMLNode_SetIntValue(p_db, "keyHashVer", p_struct->keyHashVer);
1715
1716 /* member "keyHashAlgo" */
1717 GWEN_XMLNode_SetIntValue(p_db, "keyHashAlgo", p_struct->keyHashAlgo);
1718
1719 /* member "keyHash" */
1720 {
1721 if (p_struct->keyHash.length && p_struct->keyHash.pointer) {
1722 GWEN_BUFFER *tbuf;
1723 int rv;
1724 tbuf=GWEN_Buffer_new(0, 1024, 0, 1);
1725 rv=GWEN_Base64_Encode((const unsigned char *) p_struct->keyHash.pointer, p_struct->keyHash.length, tbuf, 80);
1726 if (rv < 0) {
1727 DBG_INFO(GWEN_LOGDOMAIN, "here (%d)", rv);
1728 }
1729 else {
1730 GWEN_XMLNode_SetCharValue(p_db, "keyHash", GWEN_Buffer_GetStart(tbuf));
1731 GWEN_Buffer_free(tbuf);
1732 }
1733 }
1734 }
1735
1736 /* member "keyStatus" */
1737 GWEN_XMLNode_SetIntValue(p_db, "keyStatus", p_struct->keyStatus);
1738
1739 /* member "protocolVersion" */
1740 GWEN_XMLNode_SetIntValue(p_db, "protocolVersion", p_struct->protocolVersion);
1741
1742 /* member "cid" */
1743 {
1744 if (p_struct->cid.length && p_struct->cid.pointer) {
1745 GWEN_BUFFER *tbuf;
1746 int rv;
1747 tbuf=GWEN_Buffer_new(0, 1024, 0, 1);
1748 rv=GWEN_Base64_Encode((const unsigned char *) p_struct->cid.pointer, p_struct->cid.length, tbuf, 80);
1749 if (rv < 0) {
1750 DBG_INFO(GWEN_LOGDOMAIN, "here (%d)", rv);
1751 }
1752 else {
1754 GWEN_Buffer_free(tbuf);
1755 }
1756 }
1757 }
1758
1759 /* member "serviceId" */
1760 GWEN_XMLNode_SetCharValue(p_db, "serviceId", p_struct->serviceId);
1761
1762 /* member "userId" */
1763 GWEN_XMLNode_SetCharValue(p_db, "userId", p_struct->userId);
1764
1765 /* member "customerId" */
1766 GWEN_XMLNode_SetCharValue(p_db, "customerId", p_struct->customerId);
1767
1768 /* member "userName" */
1769 GWEN_XMLNode_SetCharValue(p_db, "userName", p_struct->userName);
1770
1771 /* member "peerId" */
1772 GWEN_XMLNode_SetCharValue(p_db, "peerId", p_struct->peerId);
1773
1774 /* member "peerName" */
1775 GWEN_XMLNode_SetCharValue(p_db, "peerName", p_struct->peerName);
1776
1777 /* member "address" */
1778 GWEN_XMLNode_SetCharValue(p_db, "address", p_struct->address);
1779
1780 /* member "port" */
1781 GWEN_XMLNode_SetIntValue(p_db, "port", p_struct->port);
1782
1783 /* member "systemId" */
1784 GWEN_XMLNode_SetCharValue(p_db, "systemId", p_struct->systemId);
1785
1786}
1787
1792
1800
1802 uint32_t p_cmp)
1803{
1804 GWEN_CRYPT_TOKEN_CONTEXT *p_struct;
1805
1806 assert(p_list);
1807 p_struct = GWEN_Crypt_Token_Context_List_First(p_list);
1808 while (p_struct) {
1809 int p_rv;
1810
1811 if (p_struct->id==p_cmp)
1812 p_rv=0;
1813 else if (p_cmp<p_struct->id)
1814 p_rv=-1;
1815 else
1816 p_rv=1;
1817 if (p_rv == 0)
1818 return p_struct;
1819 p_struct = GWEN_Crypt_Token_Context_List_Next(p_struct);
1820 }
1821 return NULL;
1822}
1823
1824void GWEN_Crypt_Token_Context_SetKeyHash(GWEN_CRYPT_TOKEN_CONTEXT *st, const uint8_t *p, uint32_t len)
1825{
1826 assert(st);
1827 if (st->keyHash.length && st->keyHash.pointer)
1828 free(st->keyHash.pointer);
1829 if (p && len) {
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);
1834 }
1835 else {
1836 st->keyHash.pointer=NULL;
1837 st->keyHash.length=0;
1838 }
1839 }
1840 else {
1841 st->keyHash.length=0;
1842 st->keyHash.pointer=NULL;
1843 }
1844}
1846{
1847 assert(st);
1848 return st->keyHash.pointer;
1849}
1851{
1852 assert(st);
1853 return st->keyHash.length;
1854}
1855void GWEN_Crypt_Token_Context_SetCid(GWEN_CRYPT_TOKEN_CONTEXT *st, const uint8_t *p, uint32_t len)
1856{
1857 assert(st);
1858 if (st->cid.length && st->cid.pointer)
1859 free(st->cid.pointer);
1860 if (p && len) {
1861 st->cid.pointer=(uint8_t *) malloc(len);
1862 if (st->cid.pointer) {
1863 st->cid.length=len;
1864 memmove(st->cid.pointer, p, len);
1865 }
1866 else {
1867 st->cid.pointer=NULL;
1868 st->cid.length=0;
1869 }
1870 }
1871 else {
1872 st->cid.length=0;
1873 st->cid.pointer=NULL;
1874 }
1875}
1877{
1878 assert(st);
1879 return st->cid.pointer;
1880}
1882{
1883 assert(st);
1884 return st->cid.length;
1885}
1886
1887/* code headers */
1888
int GWEN_Base64_Encode(const unsigned char *src, unsigned int size, GWEN_BUFFER *dst, unsigned int maxLineLength)
Definition base64.c:44
int GWEN_Base64_Decode(const unsigned char *src, unsigned int size, GWEN_BUFFER *dst)
Definition base64.c:133
#define NULL
Definition binreloc.c:300
GWEN_BUFFER * GWEN_Buffer_new(char *buffer, uint32_t size, uint32_t used, int take)
Definition buffer.c:42
void GWEN_Buffer_free(GWEN_BUFFER *bf)
Definition buffer.c:89
int GWEN_Buffer_Relinquish(GWEN_BUFFER *bf)
Definition buffer.c:143
uint32_t GWEN_Buffer_GetUsedBytes(const GWEN_BUFFER *bf)
Definition buffer.c:277
char * GWEN_Buffer_GetStart(const GWEN_BUFFER *bf)
Definition buffer.c:235
uint32_t GWEN_Crypt_Token_Context_GetAuthSignKeyNum(const GWEN_CRYPT_TOKEN_CONTEXT *p_struct)
Definition ct_context.c:545
void GWEN_Crypt_Token_Context_SetDecipherKeyId(GWEN_CRYPT_TOKEN_CONTEXT *p_struct, uint32_t p_src)
Definition ct_context.c:689
uint32_t GWEN_Crypt_Token_Context_GetProtocolVersion(const GWEN_CRYPT_TOKEN_CONTEXT *p_struct)
Definition ct_context.c:593
void GWEN_Crypt_Token_Context_SetKeyHashNum(GWEN_CRYPT_TOKEN_CONTEXT *p_struct, uint32_t p_src)
Definition ct_context.c:737
void GWEN_Crypt_Token_Context_free(GWEN_CRYPT_TOKEN_CONTEXT *p_struct)
Definition ct_context.c:71
const char * GWEN_Crypt_Token_Context_GetServiceId(const GWEN_CRYPT_TOKEN_CONTEXT *p_struct)
Definition ct_context.c:599
void GWEN_Crypt_Token_Context_SetAuthSignKeyNum(GWEN_CRYPT_TOKEN_CONTEXT *p_struct, uint32_t p_src)
Definition ct_context.c:713
void GWEN_Crypt_Token_Context_ReadDb(GWEN_CRYPT_TOKEN_CONTEXT *p_struct, GWEN_DB_NODE *p_db)
Definition ct_context.c:913
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)
Definition ct_context.c:533
uint32_t GWEN_Crypt_Token_Context_GetKeyHashNum(const GWEN_CRYPT_TOKEN_CONTEXT *p_struct)
Definition ct_context.c:569
void GWEN_Crypt_Token_Context_SetSignKeyId(GWEN_CRYPT_TOKEN_CONTEXT *p_struct, uint32_t p_src)
Definition ct_context.c:659
const char * GWEN_Crypt_Token_Context_GetUserId(const GWEN_CRYPT_TOKEN_CONTEXT *p_struct)
Definition ct_context.c:605
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)
Definition ct_context.c:665
void GWEN_Crypt_Token_Context_SetCustomerId(GWEN_CRYPT_TOKEN_CONTEXT *p_struct, const char *p_src)
Definition ct_context.c:797
GWEN_CRYPT_TOKEN_CONTEXT * GWEN_Crypt_Token_Context_copy(GWEN_CRYPT_TOKEN_CONTEXT *p_struct, const GWEN_CRYPT_TOKEN_CONTEXT *p_src)
Definition ct_context.c:303
void GWEN_Crypt_Token_Context_SetUserId(GWEN_CRYPT_TOKEN_CONTEXT *p_struct, const char *p_src)
Definition ct_context.c:782
void GWEN_Crypt_Token_Context_SetId(GWEN_CRYPT_TOKEN_CONTEXT *p_struct, uint32_t p_src)
Definition ct_context.c:653
const char * GWEN_Crypt_Token_Context_GetSystemId(const GWEN_CRYPT_TOKEN_CONTEXT *p_struct)
Definition ct_context.c:647
void GWEN_Crypt_Token_Context_SetSignKeyVer(GWEN_CRYPT_TOKEN_CONTEXT *p_struct, uint32_t p_src)
Definition ct_context.c:671
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)
Definition ct_context.c:629
uint32_t GWEN_Crypt_Token_Context_GetKeyHashAlgo(const GWEN_CRYPT_TOKEN_CONTEXT *p_struct)
Definition ct_context.c:581
uint32_t GWEN_Crypt_Token_Context_GetKeyStatus(const GWEN_CRYPT_TOKEN_CONTEXT *p_struct)
Definition ct_context.c:587
void GWEN_Crypt_Token_Context_SetAuthSignKeyVer(GWEN_CRYPT_TOKEN_CONTEXT *p_struct, uint32_t p_src)
Definition ct_context.c:719
int GWEN_Crypt_Token_Context_GetPort(const GWEN_CRYPT_TOKEN_CONTEXT *p_struct)
Definition ct_context.c:641
void GWEN_Crypt_Token_Context_SetDecipherKeyNum(GWEN_CRYPT_TOKEN_CONTEXT *p_struct, uint32_t p_src)
Definition ct_context.c:695
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)
Definition ct_context.c:113
uint32_t GWEN_Crypt_Token_Context_GetAuthVerifyKeyId(const GWEN_CRYPT_TOKEN_CONTEXT *p_struct)
Definition ct_context.c:557
uint32_t GWEN_Crypt_Token_Context_GetTempSignKeyId(const GWEN_CRYPT_TOKEN_CONTEXT *p_struct)
Definition ct_context.c:563
uint32_t GWEN_Crypt_Token_Context_GetSignKeyVer(const GWEN_CRYPT_TOKEN_CONTEXT *p_struct)
Definition ct_context.c:503
void GWEN_Crypt_Token_Context_SetSystemId(GWEN_CRYPT_TOKEN_CONTEXT *p_struct, const char *p_src)
Definition ct_context.c:878
void GWEN_Crypt_Token_Context_SetKeyHashAlgo(GWEN_CRYPT_TOKEN_CONTEXT *p_struct, uint32_t p_src)
Definition ct_context.c:749
void GWEN_Crypt_Token_Context_SetAuthSignKeyId(GWEN_CRYPT_TOKEN_CONTEXT *p_struct, uint32_t p_src)
Definition ct_context.c:707
void GWEN_Crypt_Token_Context_SetDecipherKeyVer(GWEN_CRYPT_TOKEN_CONTEXT *p_struct, uint32_t p_src)
Definition ct_context.c:701
void GWEN_Crypt_Token_Context_SetKeyHashVer(GWEN_CRYPT_TOKEN_CONTEXT *p_struct, uint32_t p_src)
Definition ct_context.c:743
GWEN_CRYPT_TOKEN_CONTEXT * GWEN_Crypt_Token_Context_dup(const GWEN_CRYPT_TOKEN_CONTEXT *p_src)
Definition ct_context.c:120
const char * GWEN_Crypt_Token_Context_GetCustomerId(const GWEN_CRYPT_TOKEN_CONTEXT *p_struct)
Definition ct_context.c:611
void GWEN_Crypt_Token_Context_SetProtocolVersion(GWEN_CRYPT_TOKEN_CONTEXT *p_struct, uint32_t p_src)
Definition ct_context.c:761
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)
Definition ct_context.c:527
void GWEN_Crypt_Token_Context_SetPeerName(GWEN_CRYPT_TOKEN_CONTEXT *p_struct, const char *p_src)
Definition ct_context.c:842
void GWEN_Crypt_Token_Context_SetAuthVerifyKeyId(GWEN_CRYPT_TOKEN_CONTEXT *p_struct, uint32_t p_src)
Definition ct_context.c:725
uint32_t GWEN_Crypt_Token_Context_GetKeyHashVer(const GWEN_CRYPT_TOKEN_CONTEXT *p_struct)
Definition ct_context.c:575
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)
Definition ct_context.c:683
void GWEN_Crypt_Token_Context_SetUserName(GWEN_CRYPT_TOKEN_CONTEXT *p_struct, const char *p_src)
Definition ct_context.c:812
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)
Definition ct_context.c:635
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)
Definition ct_context.c:539
void GWEN_Crypt_Token_Context_SetPort(GWEN_CRYPT_TOKEN_CONTEXT *p_struct, int p_src)
Definition ct_context.c:872
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)
Definition ct_context.c:677
GWEN_CRYPT_TOKEN_CONTEXT * GWEN_Crypt_Token_Context_fromDb(GWEN_DB_NODE *p_db)
GWEN_CRYPT_TOKEN_CONTEXT * GWEN_Crypt_Token_Context_new(void)
Definition ct_context.c:25
void GWEN_Crypt_Token_Context_SetAddress(GWEN_CRYPT_TOKEN_CONTEXT *p_struct, const char *p_src)
Definition ct_context.c:857
uint32_t GWEN_Crypt_Token_Context_GetEncipherKeyId(const GWEN_CRYPT_TOKEN_CONTEXT *p_struct)
Definition ct_context.c:515
uint32_t GWEN_Crypt_Token_Context_GetAuthSignKeyVer(const GWEN_CRYPT_TOKEN_CONTEXT *p_struct)
Definition ct_context.c:551
uint32_t GWEN_Crypt_Token_Context_GetVerifyKeyId(const GWEN_CRYPT_TOKEN_CONTEXT *p_struct)
Definition ct_context.c:509
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)
Definition ct_context.c:894
void GWEN_Crypt_Token_Context_SetServiceId(GWEN_CRYPT_TOKEN_CONTEXT *p_struct, const char *p_src)
Definition ct_context.c:767
uint32_t GWEN_Crypt_Token_Context_GetDecipherKeyId(const GWEN_CRYPT_TOKEN_CONTEXT *p_struct)
Definition ct_context.c:521
const char * GWEN_Crypt_Token_Context_GetUserName(const GWEN_CRYPT_TOKEN_CONTEXT *p_struct)
Definition ct_context.c:617
void GWEN_Crypt_Token_Context_SetKeyStatus(GWEN_CRYPT_TOKEN_CONTEXT *p_struct, uint32_t p_src)
Definition ct_context.c:755
uint32_t GWEN_Crypt_Token_Context_GetId(const GWEN_CRYPT_TOKEN_CONTEXT *p_struct)
Definition ct_context.c:485
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)
Definition ct_context.c:827
void GWEN_Crypt_Token_Context_SetTempSignKeyId(GWEN_CRYPT_TOKEN_CONTEXT *p_struct, uint32_t p_src)
Definition ct_context.c:731
const char * GWEN_Crypt_Token_Context_GetPeerId(const GWEN_CRYPT_TOKEN_CONTEXT *p_struct)
Definition ct_context.c:623
uint32_t GWEN_Crypt_Token_Context_GetSignKeyNum(const GWEN_CRYPT_TOKEN_CONTEXT *p_struct)
Definition ct_context.c:497
uint32_t GWEN_Crypt_Token_Context_GetSignKeyId(const GWEN_CRYPT_TOKEN_CONTEXT *p_struct)
Definition ct_context.c:491
struct GWEN_CRYPT_TOKEN_CONTEXT GWEN_CRYPT_TOKEN_CONTEXT
Definition ct_context.h:221
const char * GWEN_DB_GetCharValue(GWEN_DB_NODE *n, const char *path, int idx, const char *defVal)
Definition db.c:971
int GWEN_DB_DeleteVar(GWEN_DB_NODE *n, const char *path)
Definition db.c:899
int GWEN_DB_SetIntValue(GWEN_DB_NODE *n, uint32_t flags, const char *path, int val)
Definition db.c:1202
int GWEN_DB_SetCharValue(GWEN_DB_NODE *n, uint32_t flags, const char *path, const char *val)
Definition db.c:997
int GWEN_DB_SetBinValue(GWEN_DB_NODE *n, uint32_t flags, const char *path, const void *val, unsigned int valSize)
Definition db.c:1269
const void * GWEN_DB_GetBinValue(GWEN_DB_NODE *n, const char *path, int idx, const void *defVal, unsigned int defValSize, unsigned int *returnValueSize)
Definition db.c:1237
int GWEN_DB_GetIntValue(GWEN_DB_NODE *n, const char *path, int idx, int defVal)
Definition db.c:1163
#define GWEN_DB_FLAGS_OVERWRITE_VARS
Definition db.h:121
struct GWEN_DB_NODE GWEN_DB_NODE
Definition db.h:228
#define DBG_INFO(dbg_logger, format,...)
Definition debug.h:181
struct GWEN_BUFFER GWEN_BUFFER
A dynamically resizeable text buffer.
Definition buffer.h:38
#define GWEN_INHERIT_FUNCTIONS(t)
Definition inherit.h:163
#define GWEN_INHERIT_INIT(t, element)
Definition inherit.h:223
#define GWEN_INHERIT_FINI(t, element)
Definition inherit.h:238
#define GWEN_LIST_FINI(t, element)
Definition list1.h:475
#define GWEN_LIST_FUNCTIONS(t, pr)
Definition list1.h:367
#define GWEN_LIST_INIT(t, element)
Definition list1.h:466
#define GWEN_LIST2_FUNCTIONS(t, pr)
Definition list2.h:99
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_LOGDOMAIN
Definition logger.h:35
#define GWEN_FREE_OBJECT(varname)
Definition memory.h:61
#define GWEN_NEW_OBJECT(typ, varname)
Definition memory.h:55
void GWEN_XMLNode_SetIntValue(GWEN_XMLNODE *n, const char *name, int value)
Definition xml.c:940
int GWEN_XMLNode_GetIntValue(const GWEN_XMLNODE *n, const char *name, int defValue)
Definition xml.c:923
const char * GWEN_XMLNode_GetCharValue(const GWEN_XMLNODE *n, const char *name, const char *defValue)
Definition xml.c:812
void GWEN_XMLNode_SetCharValue(GWEN_XMLNODE *n, const char *name, const char *value)
Definition xml.c:897
struct GWEN__XMLNODE GWEN_XMLNODE
Definition xml.h:156