1 /* This file is auto-generated from "ssl_cert_descr.xml" by the typemaker
2    tool of Gwenhywfar.
3    Do not edit this file -- all changes will be lost! */
4 #ifdef HAVE_CONFIG_H
5 # include "config.h"
6 #endif
7 
8 #include "ssl_cert_descr_p.h"
9 #include <gwenhywfar/misc.h>
10 #include <gwenhywfar/db.h>
11 #include <gwenhywfar/debug.h>
12 #include <assert.h>
13 #include <stdlib.h>
14 #include <strings.h>
15 
16 #include <gwenhywfar/gwentime.h>
17 #include <gwenhywfar/ssl_cert_flags.h>
18 
19 
20 GWEN_LIST_FUNCTIONS(GWEN_SSLCERTDESCR, GWEN_SslCertDescr)
21 GWEN_LIST2_FUNCTIONS(GWEN_SSLCERTDESCR, GWEN_SslCertDescr)
22 
23 
24 
25 static GWEN_SSLCERTDESCR *GWEN_SslCertDescr_List2__freeAll_cb(GWEN_SSLCERTDESCR *st, void *user_data);
26 
27 
28 
GWEN_SslCertDescr_new(void)29 GWEN_SSLCERTDESCR *GWEN_SslCertDescr_new(void)
30 {
31   GWEN_SSLCERTDESCR *st;
32 
33   GWEN_NEW_OBJECT(GWEN_SSLCERTDESCR, st)
34   st->_usage=1;
35   GWEN_LIST_INIT(GWEN_SSLCERTDESCR, st)
36   return st;
37 }
38 
39 
GWEN_SslCertDescr_free(GWEN_SSLCERTDESCR * st)40 void GWEN_SslCertDescr_free(GWEN_SSLCERTDESCR *st)
41 {
42   if (st) {
43     assert(st->_usage);
44     if (--(st->_usage)==0) {
45       if (st->countryName)
46         free(st->countryName);
47       if (st->commonName)
48         free(st->commonName);
49       if (st->organizationName)
50         free(st->organizationName);
51       if (st->organizationalUnitName)
52         free(st->organizationalUnitName);
53       if (st->localityName)
54         free(st->localityName);
55       if (st->stateOrProvinceName)
56         free(st->stateOrProvinceName);
57       if (st->notBefore)
58         GWEN_Time_free(st->notBefore);
59       if (st->notAfter)
60         GWEN_Time_free(st->notAfter);
61       if (st->ipAddress)
62         free(st->ipAddress);
63       if (st->fingerPrint)
64         free(st->fingerPrint);
65       if (st->fingerPrintSha1)
66         free(st->fingerPrintSha1);
67       if (st->fingerPrintSha512)
68         free(st->fingerPrintSha512);
69       if (st->pubKeyModulus)
70         free(st->pubKeyModulus);
71       if (st->pubKeyExponent)
72         free(st->pubKeyExponent);
73       if (st->statusText)
74         free(st->statusText);
75       GWEN_LIST_FINI(GWEN_SSLCERTDESCR, st)
76       GWEN_FREE_OBJECT(st);
77     }
78   }
79 
80 }
81 
82 
GWEN_SslCertDescr_dup(const GWEN_SSLCERTDESCR * d)83 GWEN_SSLCERTDESCR *GWEN_SslCertDescr_dup(const GWEN_SSLCERTDESCR *d)
84 {
85   GWEN_SSLCERTDESCR *st;
86 
87   assert(d);
88   st=GWEN_SslCertDescr_new();
89   if (d->countryName)
90     st->countryName=strdup(d->countryName);
91   if (d->commonName)
92     st->commonName=strdup(d->commonName);
93   if (d->organizationName)
94     st->organizationName=strdup(d->organizationName);
95   if (d->organizationalUnitName)
96     st->organizationalUnitName=strdup(d->organizationalUnitName);
97   if (d->localityName)
98     st->localityName=strdup(d->localityName);
99   if (d->stateOrProvinceName)
100     st->stateOrProvinceName=strdup(d->stateOrProvinceName);
101   if (d->notBefore)
102     st->notBefore=GWEN_Time_dup(d->notBefore);
103   if (d->notAfter)
104     st->notAfter=GWEN_Time_dup(d->notAfter);
105   if (d->ipAddress)
106     st->ipAddress=strdup(d->ipAddress);
107   if (d->fingerPrint)
108     st->fingerPrint=strdup(d->fingerPrint);
109   if (d->fingerPrintSha1)
110     st->fingerPrintSha1=strdup(d->fingerPrintSha1);
111   if (d->fingerPrintSha512)
112     st->fingerPrintSha512=strdup(d->fingerPrintSha512);
113   if (d->pubKeyModulus)
114     st->pubKeyModulus=strdup(d->pubKeyModulus);
115   if (d->pubKeyExponent)
116     st->pubKeyExponent=strdup(d->pubKeyExponent);
117   if (d->statusText)
118     st->statusText=strdup(d->statusText);
119   st->isError=d->isError;
120   st->statusFlags=d->statusFlags;
121   return st;
122 }
123 
124 
GWEN_SslCertDescr_toDb(const GWEN_SSLCERTDESCR * st,GWEN_DB_NODE * db)125 int GWEN_SslCertDescr_toDb(const GWEN_SSLCERTDESCR *st, GWEN_DB_NODE *db)
126 {
127   assert(st);
128   assert(db);
129   if (st->countryName)
130     if (GWEN_DB_SetCharValue(db, GWEN_DB_FLAGS_OVERWRITE_VARS, "countryName", st->countryName))
131       return -1;
132   if (st->commonName)
133     if (GWEN_DB_SetCharValue(db, GWEN_DB_FLAGS_OVERWRITE_VARS, "commonName", st->commonName))
134       return -1;
135   if (st->organizationName)
136     if (GWEN_DB_SetCharValue(db, GWEN_DB_FLAGS_OVERWRITE_VARS, "organizationName", st->organizationName))
137       return -1;
138   if (st->organizationalUnitName)
139     if (GWEN_DB_SetCharValue(db, GWEN_DB_FLAGS_OVERWRITE_VARS, "organizationalUnitName", st->organizationalUnitName))
140       return -1;
141   if (st->localityName)
142     if (GWEN_DB_SetCharValue(db, GWEN_DB_FLAGS_OVERWRITE_VARS, "localityName", st->localityName))
143       return -1;
144   if (st->stateOrProvinceName)
145     if (GWEN_DB_SetCharValue(db, GWEN_DB_FLAGS_OVERWRITE_VARS, "stateOrProvinceName", st->stateOrProvinceName))
146       return -1;
147   if (st->notBefore)
148     if (GWEN_Time_toDb(st->notBefore, GWEN_DB_GetGroup(db, GWEN_DB_FLAGS_DEFAULT, "notBefore")))
149       return -1;
150   if (st->notAfter)
151     if (GWEN_Time_toDb(st->notAfter, GWEN_DB_GetGroup(db, GWEN_DB_FLAGS_DEFAULT, "notAfter")))
152       return -1;
153   if (st->ipAddress)
154     if (GWEN_DB_SetCharValue(db, GWEN_DB_FLAGS_OVERWRITE_VARS, "ipAddress", st->ipAddress))
155       return -1;
156   if (st->fingerPrint)
157     if (GWEN_DB_SetCharValue(db, GWEN_DB_FLAGS_OVERWRITE_VARS, "fingerPrint", st->fingerPrint))
158       return -1;
159   if (st->fingerPrintSha1)
160     if (GWEN_DB_SetCharValue(db, GWEN_DB_FLAGS_OVERWRITE_VARS, "fingerPrintSha1", st->fingerPrintSha1))
161       return -1;
162   if (st->fingerPrintSha512)
163     if (GWEN_DB_SetCharValue(db, GWEN_DB_FLAGS_OVERWRITE_VARS, "fingerPrintSha512", st->fingerPrintSha512))
164       return -1;
165   if (st->pubKeyModulus)
166     if (GWEN_DB_SetCharValue(db, GWEN_DB_FLAGS_OVERWRITE_VARS, "pubKeyModulus", st->pubKeyModulus))
167       return -1;
168   if (st->pubKeyExponent)
169     if (GWEN_DB_SetCharValue(db, GWEN_DB_FLAGS_OVERWRITE_VARS, "pubKeyExponent", st->pubKeyExponent))
170       return -1;
171   if (st->statusText)
172     if (GWEN_DB_SetCharValue(db, GWEN_DB_FLAGS_OVERWRITE_VARS, "statusText", st->statusText))
173       return -1;
174   if (GWEN_DB_SetIntValue(db, GWEN_DB_FLAGS_OVERWRITE_VARS, "isError", st->isError))
175     return -1;
176   if (GWEN_DB_SetIntValue(db, GWEN_DB_FLAGS_OVERWRITE_VARS, "statusFlags", st->statusFlags))
177     return -1;
178   return 0;
179 }
180 
181 
GWEN_SslCertDescr_ReadDb(GWEN_SSLCERTDESCR * st,GWEN_DB_NODE * db)182 int GWEN_SslCertDescr_ReadDb(GWEN_SSLCERTDESCR *st, GWEN_DB_NODE *db)
183 {
184   assert(st);
185   assert(db);
186   GWEN_SslCertDescr_SetCountryName(st, GWEN_DB_GetCharValue(db, "countryName", 0, 0));
187   GWEN_SslCertDescr_SetCommonName(st, GWEN_DB_GetCharValue(db, "commonName", 0, 0));
188   GWEN_SslCertDescr_SetOrganizationName(st, GWEN_DB_GetCharValue(db, "organizationName", 0, 0));
189   GWEN_SslCertDescr_SetOrganizationalUnitName(st, GWEN_DB_GetCharValue(db, "organizationalUnitName", 0, 0));
190   GWEN_SslCertDescr_SetLocalityName(st, GWEN_DB_GetCharValue(db, "localityName", 0, 0));
191   GWEN_SslCertDescr_SetStateOrProvinceName(st, GWEN_DB_GetCharValue(db, "stateOrProvinceName", 0, 0));
192   if (1) { /* for local vars */
193     GWEN_DB_NODE *dbT;
194 
195     dbT=GWEN_DB_GetGroup(db, GWEN_PATH_FLAGS_NAMEMUSTEXIST, "notBefore");
196     if (dbT) {
197       if (st->notBefore)
198         GWEN_Time_free(st->notBefore);
199       st->notBefore=GWEN_Time_fromDb(dbT);
200     }
201   }
202   if (1) { /* for local vars */
203     GWEN_DB_NODE *dbT;
204 
205     dbT=GWEN_DB_GetGroup(db, GWEN_PATH_FLAGS_NAMEMUSTEXIST, "notAfter");
206     if (dbT) {
207       if (st->notAfter)
208         GWEN_Time_free(st->notAfter);
209       st->notAfter=GWEN_Time_fromDb(dbT);
210     }
211   }
212   GWEN_SslCertDescr_SetIpAddress(st, GWEN_DB_GetCharValue(db, "ipAddress", 0, 0));
213   GWEN_SslCertDescr_SetFingerPrint(st, GWEN_DB_GetCharValue(db, "fingerPrint", 0, 0));
214   GWEN_SslCertDescr_SetFingerPrintSha1(st, GWEN_DB_GetCharValue(db, "fingerPrintSha1", 0, 0));
215   GWEN_SslCertDescr_SetFingerPrintSha512(st, GWEN_DB_GetCharValue(db, "fingerPrintSha512", 0, 0));
216   GWEN_SslCertDescr_SetPubKeyModulus(st, GWEN_DB_GetCharValue(db, "pubKeyModulus", 0, 0));
217   GWEN_SslCertDescr_SetPubKeyExponent(st, GWEN_DB_GetCharValue(db, "pubKeyExponent", 0, 0));
218   GWEN_SslCertDescr_SetStatusText(st, GWEN_DB_GetCharValue(db, "statusText", 0, 0));
219   GWEN_SslCertDescr_SetIsError(st, GWEN_DB_GetIntValue(db, "isError", 0, 0));
220   GWEN_SslCertDescr_SetStatusFlags(st, GWEN_DB_GetIntValue(db, "statusFlags", 0, 0));
221   return 0;
222 }
223 
224 
GWEN_SslCertDescr_fromDb(GWEN_DB_NODE * db)225 GWEN_SSLCERTDESCR *GWEN_SslCertDescr_fromDb(GWEN_DB_NODE *db)
226 {
227   GWEN_SSLCERTDESCR *st;
228 
229   assert(db);
230   st=GWEN_SslCertDescr_new();
231   GWEN_SslCertDescr_ReadDb(st, db);
232   st->_modified=0;
233   return st;
234 }
235 
236 
237 
238 
GWEN_SslCertDescr_GetCountryName(const GWEN_SSLCERTDESCR * st)239 const char *GWEN_SslCertDescr_GetCountryName(const GWEN_SSLCERTDESCR *st)
240 {
241   assert(st);
242   return st->countryName;
243 }
244 
245 
GWEN_SslCertDescr_SetCountryName(GWEN_SSLCERTDESCR * st,const char * d)246 void GWEN_SslCertDescr_SetCountryName(GWEN_SSLCERTDESCR *st, const char *d)
247 {
248   assert(st);
249   if (st->countryName)
250     free(st->countryName);
251   if (d && *d)
252     st->countryName=strdup(d);
253   else
254     st->countryName=0;
255   st->_modified=1;
256 }
257 
258 
259 
260 
GWEN_SslCertDescr_GetCommonName(const GWEN_SSLCERTDESCR * st)261 const char *GWEN_SslCertDescr_GetCommonName(const GWEN_SSLCERTDESCR *st)
262 {
263   assert(st);
264   return st->commonName;
265 }
266 
267 
GWEN_SslCertDescr_SetCommonName(GWEN_SSLCERTDESCR * st,const char * d)268 void GWEN_SslCertDescr_SetCommonName(GWEN_SSLCERTDESCR *st, const char *d)
269 {
270   assert(st);
271   if (st->commonName)
272     free(st->commonName);
273   if (d && *d)
274     st->commonName=strdup(d);
275   else
276     st->commonName=0;
277   st->_modified=1;
278 }
279 
280 
281 
282 
GWEN_SslCertDescr_GetOrganizationName(const GWEN_SSLCERTDESCR * st)283 const char *GWEN_SslCertDescr_GetOrganizationName(const GWEN_SSLCERTDESCR *st)
284 {
285   assert(st);
286   return st->organizationName;
287 }
288 
289 
GWEN_SslCertDescr_SetOrganizationName(GWEN_SSLCERTDESCR * st,const char * d)290 void GWEN_SslCertDescr_SetOrganizationName(GWEN_SSLCERTDESCR *st, const char *d)
291 {
292   assert(st);
293   if (st->organizationName)
294     free(st->organizationName);
295   if (d && *d)
296     st->organizationName=strdup(d);
297   else
298     st->organizationName=0;
299   st->_modified=1;
300 }
301 
302 
303 
304 
GWEN_SslCertDescr_GetOrganizationalUnitName(const GWEN_SSLCERTDESCR * st)305 const char *GWEN_SslCertDescr_GetOrganizationalUnitName(const GWEN_SSLCERTDESCR *st)
306 {
307   assert(st);
308   return st->organizationalUnitName;
309 }
310 
311 
GWEN_SslCertDescr_SetOrganizationalUnitName(GWEN_SSLCERTDESCR * st,const char * d)312 void GWEN_SslCertDescr_SetOrganizationalUnitName(GWEN_SSLCERTDESCR *st, const char *d)
313 {
314   assert(st);
315   if (st->organizationalUnitName)
316     free(st->organizationalUnitName);
317   if (d && *d)
318     st->organizationalUnitName=strdup(d);
319   else
320     st->organizationalUnitName=0;
321   st->_modified=1;
322 }
323 
324 
325 
326 
GWEN_SslCertDescr_GetLocalityName(const GWEN_SSLCERTDESCR * st)327 const char *GWEN_SslCertDescr_GetLocalityName(const GWEN_SSLCERTDESCR *st)
328 {
329   assert(st);
330   return st->localityName;
331 }
332 
333 
GWEN_SslCertDescr_SetLocalityName(GWEN_SSLCERTDESCR * st,const char * d)334 void GWEN_SslCertDescr_SetLocalityName(GWEN_SSLCERTDESCR *st, const char *d)
335 {
336   assert(st);
337   if (st->localityName)
338     free(st->localityName);
339   if (d && *d)
340     st->localityName=strdup(d);
341   else
342     st->localityName=0;
343   st->_modified=1;
344 }
345 
346 
347 
348 
GWEN_SslCertDescr_GetStateOrProvinceName(const GWEN_SSLCERTDESCR * st)349 const char *GWEN_SslCertDescr_GetStateOrProvinceName(const GWEN_SSLCERTDESCR *st)
350 {
351   assert(st);
352   return st->stateOrProvinceName;
353 }
354 
355 
GWEN_SslCertDescr_SetStateOrProvinceName(GWEN_SSLCERTDESCR * st,const char * d)356 void GWEN_SslCertDescr_SetStateOrProvinceName(GWEN_SSLCERTDESCR *st, const char *d)
357 {
358   assert(st);
359   if (st->stateOrProvinceName)
360     free(st->stateOrProvinceName);
361   if (d && *d)
362     st->stateOrProvinceName=strdup(d);
363   else
364     st->stateOrProvinceName=0;
365   st->_modified=1;
366 }
367 
368 
369 
370 
GWEN_SslCertDescr_GetNotBefore(const GWEN_SSLCERTDESCR * st)371 const GWEN_TIME *GWEN_SslCertDescr_GetNotBefore(const GWEN_SSLCERTDESCR *st)
372 {
373   assert(st);
374   return st->notBefore;
375 }
376 
377 
GWEN_SslCertDescr_SetNotBefore(GWEN_SSLCERTDESCR * st,const GWEN_TIME * d)378 void GWEN_SslCertDescr_SetNotBefore(GWEN_SSLCERTDESCR *st, const GWEN_TIME *d)
379 {
380   assert(st);
381   if (st->notBefore)
382     GWEN_Time_free(st->notBefore);
383   if (d)
384     st->notBefore=GWEN_Time_dup(d);
385   else
386     st->notBefore=0;
387   st->_modified=1;
388 }
389 
390 
391 
392 
GWEN_SslCertDescr_GetNotAfter(const GWEN_SSLCERTDESCR * st)393 const GWEN_TIME *GWEN_SslCertDescr_GetNotAfter(const GWEN_SSLCERTDESCR *st)
394 {
395   assert(st);
396   return st->notAfter;
397 }
398 
399 
GWEN_SslCertDescr_SetNotAfter(GWEN_SSLCERTDESCR * st,const GWEN_TIME * d)400 void GWEN_SslCertDescr_SetNotAfter(GWEN_SSLCERTDESCR *st, const GWEN_TIME *d)
401 {
402   assert(st);
403   if (st->notAfter)
404     GWEN_Time_free(st->notAfter);
405   if (d)
406     st->notAfter=GWEN_Time_dup(d);
407   else
408     st->notAfter=0;
409   st->_modified=1;
410 }
411 
412 
413 
414 
GWEN_SslCertDescr_GetIpAddress(const GWEN_SSLCERTDESCR * st)415 const char *GWEN_SslCertDescr_GetIpAddress(const GWEN_SSLCERTDESCR *st)
416 {
417   assert(st);
418   return st->ipAddress;
419 }
420 
421 
GWEN_SslCertDescr_SetIpAddress(GWEN_SSLCERTDESCR * st,const char * d)422 void GWEN_SslCertDescr_SetIpAddress(GWEN_SSLCERTDESCR *st, const char *d)
423 {
424   assert(st);
425   if (st->ipAddress)
426     free(st->ipAddress);
427   if (d && *d)
428     st->ipAddress=strdup(d);
429   else
430     st->ipAddress=0;
431   st->_modified=1;
432 }
433 
434 
435 
436 
GWEN_SslCertDescr_GetFingerPrint(const GWEN_SSLCERTDESCR * st)437 const char *GWEN_SslCertDescr_GetFingerPrint(const GWEN_SSLCERTDESCR *st)
438 {
439   assert(st);
440   return st->fingerPrint;
441 }
442 
443 
GWEN_SslCertDescr_SetFingerPrint(GWEN_SSLCERTDESCR * st,const char * d)444 void GWEN_SslCertDescr_SetFingerPrint(GWEN_SSLCERTDESCR *st, const char *d)
445 {
446   assert(st);
447   if (st->fingerPrint)
448     free(st->fingerPrint);
449   if (d && *d)
450     st->fingerPrint=strdup(d);
451   else
452     st->fingerPrint=0;
453   st->_modified=1;
454 }
455 
456 
457 
458 
GWEN_SslCertDescr_GetFingerPrintSha1(const GWEN_SSLCERTDESCR * st)459 const char *GWEN_SslCertDescr_GetFingerPrintSha1(const GWEN_SSLCERTDESCR *st)
460 {
461   assert(st);
462   return st->fingerPrintSha1;
463 }
464 
465 
GWEN_SslCertDescr_SetFingerPrintSha1(GWEN_SSLCERTDESCR * st,const char * d)466 void GWEN_SslCertDescr_SetFingerPrintSha1(GWEN_SSLCERTDESCR *st, const char *d)
467 {
468   assert(st);
469   if (st->fingerPrintSha1)
470     free(st->fingerPrintSha1);
471   if (d && *d)
472     st->fingerPrintSha1=strdup(d);
473   else
474     st->fingerPrintSha1=0;
475   st->_modified=1;
476 }
477 
478 
479 
480 
GWEN_SslCertDescr_GetFingerPrintSha512(const GWEN_SSLCERTDESCR * st)481 const char *GWEN_SslCertDescr_GetFingerPrintSha512(const GWEN_SSLCERTDESCR *st)
482 {
483   assert(st);
484   return st->fingerPrintSha512;
485 }
486 
487 
GWEN_SslCertDescr_SetFingerPrintSha512(GWEN_SSLCERTDESCR * st,const char * d)488 void GWEN_SslCertDescr_SetFingerPrintSha512(GWEN_SSLCERTDESCR *st, const char *d)
489 {
490   assert(st);
491   if (st->fingerPrintSha512)
492     free(st->fingerPrintSha512);
493   if (d && *d)
494     st->fingerPrintSha512=strdup(d);
495   else
496     st->fingerPrintSha512=0;
497   st->_modified=1;
498 }
499 
500 
501 
502 
GWEN_SslCertDescr_GetPubKeyModulus(const GWEN_SSLCERTDESCR * st)503 const char *GWEN_SslCertDescr_GetPubKeyModulus(const GWEN_SSLCERTDESCR *st)
504 {
505   assert(st);
506   return st->pubKeyModulus;
507 }
508 
509 
GWEN_SslCertDescr_SetPubKeyModulus(GWEN_SSLCERTDESCR * st,const char * d)510 void GWEN_SslCertDescr_SetPubKeyModulus(GWEN_SSLCERTDESCR *st, const char *d)
511 {
512   assert(st);
513   if (st->pubKeyModulus)
514     free(st->pubKeyModulus);
515   if (d && *d)
516     st->pubKeyModulus=strdup(d);
517   else
518     st->pubKeyModulus=0;
519   st->_modified=1;
520 }
521 
522 
523 
524 
GWEN_SslCertDescr_GetPubKeyExponent(const GWEN_SSLCERTDESCR * st)525 const char *GWEN_SslCertDescr_GetPubKeyExponent(const GWEN_SSLCERTDESCR *st)
526 {
527   assert(st);
528   return st->pubKeyExponent;
529 }
530 
531 
GWEN_SslCertDescr_SetPubKeyExponent(GWEN_SSLCERTDESCR * st,const char * d)532 void GWEN_SslCertDescr_SetPubKeyExponent(GWEN_SSLCERTDESCR *st, const char *d)
533 {
534   assert(st);
535   if (st->pubKeyExponent)
536     free(st->pubKeyExponent);
537   if (d && *d)
538     st->pubKeyExponent=strdup(d);
539   else
540     st->pubKeyExponent=0;
541   st->_modified=1;
542 }
543 
544 
545 
546 
GWEN_SslCertDescr_GetStatusText(const GWEN_SSLCERTDESCR * st)547 const char *GWEN_SslCertDescr_GetStatusText(const GWEN_SSLCERTDESCR *st)
548 {
549   assert(st);
550   return st->statusText;
551 }
552 
553 
GWEN_SslCertDescr_SetStatusText(GWEN_SSLCERTDESCR * st,const char * d)554 void GWEN_SslCertDescr_SetStatusText(GWEN_SSLCERTDESCR *st, const char *d)
555 {
556   assert(st);
557   if (st->statusText)
558     free(st->statusText);
559   if (d && *d)
560     st->statusText=strdup(d);
561   else
562     st->statusText=0;
563   st->_modified=1;
564 }
565 
566 
567 
568 
GWEN_SslCertDescr_GetIsError(const GWEN_SSLCERTDESCR * st)569 int GWEN_SslCertDescr_GetIsError(const GWEN_SSLCERTDESCR *st)
570 {
571   assert(st);
572   return st->isError;
573 }
574 
575 
GWEN_SslCertDescr_SetIsError(GWEN_SSLCERTDESCR * st,int d)576 void GWEN_SslCertDescr_SetIsError(GWEN_SSLCERTDESCR *st, int d)
577 {
578   assert(st);
579   st->isError=d;
580   st->_modified=1;
581 }
582 
583 
584 
585 
GWEN_SslCertDescr_GetStatusFlags(const GWEN_SSLCERTDESCR * st)586 uint32_t GWEN_SslCertDescr_GetStatusFlags(const GWEN_SSLCERTDESCR *st)
587 {
588   assert(st);
589   return st->statusFlags;
590 }
591 
592 
GWEN_SslCertDescr_SetStatusFlags(GWEN_SSLCERTDESCR * st,uint32_t d)593 void GWEN_SslCertDescr_SetStatusFlags(GWEN_SSLCERTDESCR *st, uint32_t d)
594 {
595   assert(st);
596   st->statusFlags=d;
597   st->_modified=1;
598 }
599 
600 
601 
602 
GWEN_SslCertDescr_IsModified(const GWEN_SSLCERTDESCR * st)603 int GWEN_SslCertDescr_IsModified(const GWEN_SSLCERTDESCR *st)
604 {
605   assert(st);
606   return st->_modified;
607 }
608 
609 
GWEN_SslCertDescr_SetModified(GWEN_SSLCERTDESCR * st,int i)610 void GWEN_SslCertDescr_SetModified(GWEN_SSLCERTDESCR *st, int i)
611 {
612   assert(st);
613   st->_modified=i;
614 }
615 
616 
GWEN_SslCertDescr_Attach(GWEN_SSLCERTDESCR * st)617 void GWEN_SslCertDescr_Attach(GWEN_SSLCERTDESCR *st)
618 {
619   assert(st);
620   st->_usage++;
621 }
GWEN_SslCertDescr_List2__freeAll_cb(GWEN_SSLCERTDESCR * st,GWEN_UNUSED void * user_data)622 GWEN_SSLCERTDESCR *GWEN_SslCertDescr_List2__freeAll_cb(GWEN_SSLCERTDESCR *st, GWEN_UNUSED void *user_data)
623 {
624   GWEN_SslCertDescr_free(st);
625   return 0;
626 }
627 
628 
GWEN_SslCertDescr_List2_freeAll(GWEN_SSLCERTDESCR_LIST2 * stl)629 void GWEN_SslCertDescr_List2_freeAll(GWEN_SSLCERTDESCR_LIST2 *stl)
630 {
631   if (stl) {
632     GWEN_SslCertDescr_List2_ForEach(stl, GWEN_SslCertDescr_List2__freeAll_cb, 0);
633     GWEN_SslCertDescr_List2_free(stl);
634   }
635 }
636 
637 
GWEN_SslCertDescr_List_dup(const GWEN_SSLCERTDESCR_LIST * stl)638 GWEN_SSLCERTDESCR_LIST *GWEN_SslCertDescr_List_dup(const GWEN_SSLCERTDESCR_LIST *stl)
639 {
640   if (stl) {
641     GWEN_SSLCERTDESCR_LIST *nl;
642     GWEN_SSLCERTDESCR *e;
643 
644     nl=GWEN_SslCertDescr_List_new();
645     e=GWEN_SslCertDescr_List_First(stl);
646     while (e) {
647       GWEN_SSLCERTDESCR *ne;
648 
649       ne=GWEN_SslCertDescr_dup(e);
650       assert(ne);
651       GWEN_SslCertDescr_List_Add(ne, nl);
652       e=GWEN_SslCertDescr_List_Next(e);
653     } /* while (e) */
654     return nl;
655   }
656   else
657     return 0;
658 }
659 
660 
661 
662 
663