Bug Summary

File:libpskc/parser.c
Location:line 50, column 8
Description:Null pointer passed as an argument to a 'nonnull' parameter

Annotated Source Code

1/*
2 * parser.c - Parse PSKC data structure in XML and convert to internal format.
3 * Copyright (C) 2012-2016 Simon Josefsson
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public License
7 * as published by the Free Software Foundation; either version 2.1 of
8 * the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18 * 02110-1301 USA
19 *
20 */
21
22#include <config.h>
23
24#include <pskc/pskc.h>
25
26#define INTERNAL_NEED_PSKC_STRUCT
27#define INTERNAL_NEED_PSKC_KEY_STRUCT
28#include "internal.h"
29
30#include <string.h>
31#include "base64.h"
32
33static void
34parse_deviceinfo (xmlNode * x, struct pskc_key *kp, int *rc)
35{
36 xmlNode *cur_node = NULL((void*)0);
37
38 for (cur_node = x; cur_node; cur_node = cur_node->next)
1
Loop condition is true. Entering loop body
12
Loop condition is true. Entering loop body
23
Loop condition is true. Entering loop body
34
Loop condition is true. Entering loop body
39 {
40 const char *name = (const char *) cur_node->name;
41 const char *content = (const char *)
36
'content' initialized to a null pointer value
42 (cur_node->children ? cur_node->children->content : NULL((void*)0));
2
'?' condition is false
13
'?' condition is false
24
'?' condition is false
35
'?' condition is false
43
44 if (cur_node->type != XML_ELEMENT_NODE)
3
Taking false branch
14
Taking false branch
25
Taking false branch
37
Taking false branch
45 continue;
46
47 if (strcmp ("Manufacturer", name)__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p
("Manufacturer") && __builtin_constant_p (name) &&
(__s1_len = __builtin_strlen ("Manufacturer"), __s2_len = __builtin_strlen
(name), (!((size_t)(const void *)(("Manufacturer") + 1) - (size_t
)(const void *)("Manufacturer") == 1) || __s1_len >= 4) &&
(!((size_t)(const void *)((name) + 1) - (size_t)(const void *
)(name) == 1) || __s2_len >= 4)) ? __builtin_strcmp ("Manufacturer"
, name) : (__builtin_constant_p ("Manufacturer") && (
(size_t)(const void *)(("Manufacturer") + 1) - (size_t)(const
void *)("Manufacturer") == 1) && (__s1_len = __builtin_strlen
("Manufacturer"), __s1_len < 4) ? (__builtin_constant_p (
name) && ((size_t)(const void *)((name) + 1) - (size_t
)(const void *)(name) == 1) ? __builtin_strcmp ("Manufacturer"
, name) : (__extension__ ({ const unsigned char *__s2 = (const
unsigned char *) (const char *) (name); int __result = (((const
unsigned char *) (const char *) ("Manufacturer"))[0] - __s2[
0]); if (__s1_len > 0 && __result == 0) { __result
= (((const unsigned char *) (const char *) ("Manufacturer"))
[1] - __s2[1]); if (__s1_len > 1 && __result == 0)
{ __result = (((const unsigned char *) (const char *) ("Manufacturer"
))[2] - __s2[2]); if (__s1_len > 2 && __result == 0
) __result = (((const unsigned char *) (const char *) ("Manufacturer"
))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p (
name) && ((size_t)(const void *)((name) + 1) - (size_t
)(const void *)(name) == 1) && (__s2_len = __builtin_strlen
(name), __s2_len < 4) ? (__builtin_constant_p ("Manufacturer"
) && ((size_t)(const void *)(("Manufacturer") + 1) - (
size_t)(const void *)("Manufacturer") == 1) ? __builtin_strcmp
("Manufacturer", name) : (- (__extension__ ({ const unsigned
char *__s2 = (const unsigned char *) (const char *) ("Manufacturer"
); int __result = (((const unsigned char *) (const char *) (name
))[0] - __s2[0]); if (__s2_len > 0 && __result == 0
) { __result = (((const unsigned char *) (const char *) (name
))[1] - __s2[1]); if (__s2_len > 1 && __result == 0
) { __result = (((const unsigned char *) (const char *) (name
))[2] - __s2[2]); if (__s2_len > 2 && __result == 0
) __result = (((const unsigned char *) (const char *) (name))
[3] - __s2[3]); } } __result; })))) : __builtin_strcmp ("Manufacturer"
, name)))); })
== 0)
4
Taking false branch
15
Taking false branch
26
Taking false branch
38
Taking true branch
48 {
49 kp->device_manufacturer = content;
50 if (strncmp ("oath.", content, 5)(__extension__ (__builtin_constant_p (5) && ((__builtin_constant_p
("oath.") && strlen ("oath.") < ((size_t) (5))) ||
(__builtin_constant_p (content) && strlen (content) <
((size_t) (5)))) ? __extension__ ({ size_t __s1_len, __s2_len
; (__builtin_constant_p ("oath.") && __builtin_constant_p
(content) && (__s1_len = __builtin_strlen ("oath."),
__s2_len = __builtin_strlen (content), (!((size_t)(const void
*)(("oath.") + 1) - (size_t)(const void *)("oath.") == 1) ||
__s1_len >= 4) && (!((size_t)(const void *)((content
) + 1) - (size_t)(const void *)(content) == 1) || __s2_len >=
4)) ? __builtin_strcmp ("oath.", content) : (__builtin_constant_p
("oath.") && ((size_t)(const void *)(("oath.") + 1) -
(size_t)(const void *)("oath.") == 1) && (__s1_len =
__builtin_strlen ("oath."), __s1_len < 4) ? (__builtin_constant_p
(content) && ((size_t)(const void *)((content) + 1) -
(size_t)(const void *)(content) == 1) ? __builtin_strcmp ("oath."
, content) : (__extension__ ({ const unsigned char *__s2 = (const
unsigned char *) (const char *) (content); int __result = ((
(const unsigned char *) (const char *) ("oath."))[0] - __s2[0
]); if (__s1_len > 0 && __result == 0) { __result =
(((const unsigned char *) (const char *) ("oath."))[1] - __s2
[1]); if (__s1_len > 1 && __result == 0) { __result
= (((const unsigned char *) (const char *) ("oath."))[2] - __s2
[2]); if (__s1_len > 2 && __result == 0) __result =
(((const unsigned char *) (const char *) ("oath."))[3] - __s2
[3]); } } __result; }))) : (__builtin_constant_p (content) &&
((size_t)(const void *)((content) + 1) - (size_t)(const void
*)(content) == 1) && (__s2_len = __builtin_strlen (content
), __s2_len < 4) ? (__builtin_constant_p ("oath.") &&
((size_t)(const void *)(("oath.") + 1) - (size_t)(const void
*)("oath.") == 1) ? __builtin_strcmp ("oath.", content) : (-
(__extension__ ({ const unsigned char *__s2 = (const unsigned
char *) (const char *) ("oath."); int __result = (((const unsigned
char *) (const char *) (content))[0] - __s2[0]); if (__s2_len
> 0 && __result == 0) { __result = (((const unsigned
char *) (const char *) (content))[1] - __s2[1]); if (__s2_len
> 1 && __result == 0) { __result = (((const unsigned
char *) (const char *) (content))[2] - __s2[2]); if (__s2_len
> 2 && __result == 0) __result = (((const unsigned
char *) (const char *) (content))[3] - __s2[3]); } } __result
; })))) : __builtin_strcmp ("oath.", content)))); }) : strncmp
("oath.", content, 5)))
!= 0
39
Within the expansion of the macro 'strncmp':
a
Null pointer passed as an argument to a 'nonnull' parameter
51 && strncmp ("iana.", content, 5)(__extension__ (__builtin_constant_p (5) && ((__builtin_constant_p
("iana.") && strlen ("iana.") < ((size_t) (5))) ||
(__builtin_constant_p (content) && strlen (content) <
((size_t) (5)))) ? __extension__ ({ size_t __s1_len, __s2_len
; (__builtin_constant_p ("iana.") && __builtin_constant_p
(content) && (__s1_len = __builtin_strlen ("iana."),
__s2_len = __builtin_strlen (content), (!((size_t)(const void
*)(("iana.") + 1) - (size_t)(const void *)("iana.") == 1) ||
__s1_len >= 4) && (!((size_t)(const void *)((content
) + 1) - (size_t)(const void *)(content) == 1) || __s2_len >=
4)) ? __builtin_strcmp ("iana.", content) : (__builtin_constant_p
("iana.") && ((size_t)(const void *)(("iana.") + 1) -
(size_t)(const void *)("iana.") == 1) && (__s1_len =
__builtin_strlen ("iana."), __s1_len < 4) ? (__builtin_constant_p
(content) && ((size_t)(const void *)((content) + 1) -
(size_t)(const void *)(content) == 1) ? __builtin_strcmp ("iana."
, content) : (__extension__ ({ const unsigned char *__s2 = (const
unsigned char *) (const char *) (content); int __result = ((
(const unsigned char *) (const char *) ("iana."))[0] - __s2[0
]); if (__s1_len > 0 && __result == 0) { __result =
(((const unsigned char *) (const char *) ("iana."))[1] - __s2
[1]); if (__s1_len > 1 && __result == 0) { __result
= (((const unsigned char *) (const char *) ("iana."))[2] - __s2
[2]); if (__s1_len > 2 && __result == 0) __result =
(((const unsigned char *) (const char *) ("iana."))[3] - __s2
[3]); } } __result; }))) : (__builtin_constant_p (content) &&
((size_t)(const void *)((content) + 1) - (size_t)(const void
*)(content) == 1) && (__s2_len = __builtin_strlen (content
), __s2_len < 4) ? (__builtin_constant_p ("iana.") &&
((size_t)(const void *)(("iana.") + 1) - (size_t)(const void
*)("iana.") == 1) ? __builtin_strcmp ("iana.", content) : (-
(__extension__ ({ const unsigned char *__s2 = (const unsigned
char *) (const char *) ("iana."); int __result = (((const unsigned
char *) (const char *) (content))[0] - __s2[0]); if (__s2_len
> 0 && __result == 0) { __result = (((const unsigned
char *) (const char *) (content))[1] - __s2[1]); if (__s2_len
> 1 && __result == 0) { __result = (((const unsigned
char *) (const char *) (content))[2] - __s2[2]); if (__s2_len
> 2 && __result == 0) __result = (((const unsigned
char *) (const char *) (content))[3] - __s2[3]); } } __result
; })))) : __builtin_strcmp ("iana.", content)))); }) : strncmp
("iana.", content, 5)))
!= 0)
52 _pskc_debug ("non-compliant Manufacturer value: %s", content);
53 }
54 else if (strcmp ("SerialNo", name)__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p
("SerialNo") && __builtin_constant_p (name) &&
(__s1_len = __builtin_strlen ("SerialNo"), __s2_len = __builtin_strlen
(name), (!((size_t)(const void *)(("SerialNo") + 1) - (size_t
)(const void *)("SerialNo") == 1) || __s1_len >= 4) &&
(!((size_t)(const void *)((name) + 1) - (size_t)(const void *
)(name) == 1) || __s2_len >= 4)) ? __builtin_strcmp ("SerialNo"
, name) : (__builtin_constant_p ("SerialNo") && ((size_t
)(const void *)(("SerialNo") + 1) - (size_t)(const void *)("SerialNo"
) == 1) && (__s1_len = __builtin_strlen ("SerialNo"),
__s1_len < 4) ? (__builtin_constant_p (name) && (
(size_t)(const void *)((name) + 1) - (size_t)(const void *)(name
) == 1) ? __builtin_strcmp ("SerialNo", name) : (__extension__
({ const unsigned char *__s2 = (const unsigned char *) (const
char *) (name); int __result = (((const unsigned char *) (const
char *) ("SerialNo"))[0] - __s2[0]); if (__s1_len > 0 &&
__result == 0) { __result = (((const unsigned char *) (const
char *) ("SerialNo"))[1] - __s2[1]); if (__s1_len > 1 &&
__result == 0) { __result = (((const unsigned char *) (const
char *) ("SerialNo"))[2] - __s2[2]); if (__s1_len > 2 &&
__result == 0) __result = (((const unsigned char *) (const char
*) ("SerialNo"))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p
(name) && ((size_t)(const void *)((name) + 1) - (size_t
)(const void *)(name) == 1) && (__s2_len = __builtin_strlen
(name), __s2_len < 4) ? (__builtin_constant_p ("SerialNo"
) && ((size_t)(const void *)(("SerialNo") + 1) - (size_t
)(const void *)("SerialNo") == 1) ? __builtin_strcmp ("SerialNo"
, name) : (- (__extension__ ({ const unsigned char *__s2 = (const
unsigned char *) (const char *) ("SerialNo"); int __result =
(((const unsigned char *) (const char *) (name))[0] - __s2[0
]); if (__s2_len > 0 && __result == 0) { __result =
(((const unsigned char *) (const char *) (name))[1] - __s2[1
]); if (__s2_len > 1 && __result == 0) { __result =
(((const unsigned char *) (const char *) (name))[2] - __s2[2
]); if (__s2_len > 2 && __result == 0) __result = (
((const unsigned char *) (const char *) (name))[3] - __s2[3])
; } } __result; })))) : __builtin_strcmp ("SerialNo", name)))
); })
== 0)
5
Taking false branch
16
Taking false branch
27
Taking false branch
55 kp->device_serialno = content;
56 else if (strcmp ("Model", name)__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p
("Model") && __builtin_constant_p (name) && (
__s1_len = __builtin_strlen ("Model"), __s2_len = __builtin_strlen
(name), (!((size_t)(const void *)(("Model") + 1) - (size_t)(
const void *)("Model") == 1) || __s1_len >= 4) && (
!((size_t)(const void *)((name) + 1) - (size_t)(const void *)
(name) == 1) || __s2_len >= 4)) ? __builtin_strcmp ("Model"
, name) : (__builtin_constant_p ("Model") && ((size_t
)(const void *)(("Model") + 1) - (size_t)(const void *)("Model"
) == 1) && (__s1_len = __builtin_strlen ("Model"), __s1_len
< 4) ? (__builtin_constant_p (name) && ((size_t)(
const void *)((name) + 1) - (size_t)(const void *)(name) == 1
) ? __builtin_strcmp ("Model", name) : (__extension__ ({ const
unsigned char *__s2 = (const unsigned char *) (const char *)
(name); int __result = (((const unsigned char *) (const char
*) ("Model"))[0] - __s2[0]); if (__s1_len > 0 && __result
== 0) { __result = (((const unsigned char *) (const char *) (
"Model"))[1] - __s2[1]); if (__s1_len > 1 && __result
== 0) { __result = (((const unsigned char *) (const char *) (
"Model"))[2] - __s2[2]); if (__s1_len > 2 && __result
== 0) __result = (((const unsigned char *) (const char *) ("Model"
))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p (
name) && ((size_t)(const void *)((name) + 1) - (size_t
)(const void *)(name) == 1) && (__s2_len = __builtin_strlen
(name), __s2_len < 4) ? (__builtin_constant_p ("Model") &&
((size_t)(const void *)(("Model") + 1) - (size_t)(const void
*)("Model") == 1) ? __builtin_strcmp ("Model", name) : (- (__extension__
({ const unsigned char *__s2 = (const unsigned char *) (const
char *) ("Model"); int __result = (((const unsigned char *) (
const char *) (name))[0] - __s2[0]); if (__s2_len > 0 &&
__result == 0) { __result = (((const unsigned char *) (const
char *) (name))[1] - __s2[1]); if (__s2_len > 1 &&
__result == 0) { __result = (((const unsigned char *) (const
char *) (name))[2] - __s2[2]); if (__s2_len > 2 &&
__result == 0) __result = (((const unsigned char *) (const char
*) (name))[3] - __s2[3]); } } __result; })))) : __builtin_strcmp
("Model", name)))); })
== 0)
6
Taking false branch
17
Taking false branch
28
Taking false branch
57 kp->device_model = content;
58 else if (strcmp ("IssueNo", name)__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p
("IssueNo") && __builtin_constant_p (name) &&
(__s1_len = __builtin_strlen ("IssueNo"), __s2_len = __builtin_strlen
(name), (!((size_t)(const void *)(("IssueNo") + 1) - (size_t
)(const void *)("IssueNo") == 1) || __s1_len >= 4) &&
(!((size_t)(const void *)((name) + 1) - (size_t)(const void *
)(name) == 1) || __s2_len >= 4)) ? __builtin_strcmp ("IssueNo"
, name) : (__builtin_constant_p ("IssueNo") && ((size_t
)(const void *)(("IssueNo") + 1) - (size_t)(const void *)("IssueNo"
) == 1) && (__s1_len = __builtin_strlen ("IssueNo"), __s1_len
< 4) ? (__builtin_constant_p (name) && ((size_t)(
const void *)((name) + 1) - (size_t)(const void *)(name) == 1
) ? __builtin_strcmp ("IssueNo", name) : (__extension__ ({ const
unsigned char *__s2 = (const unsigned char *) (const char *)
(name); int __result = (((const unsigned char *) (const char
*) ("IssueNo"))[0] - __s2[0]); if (__s1_len > 0 &&
__result == 0) { __result = (((const unsigned char *) (const
char *) ("IssueNo"))[1] - __s2[1]); if (__s1_len > 1 &&
__result == 0) { __result = (((const unsigned char *) (const
char *) ("IssueNo"))[2] - __s2[2]); if (__s1_len > 2 &&
__result == 0) __result = (((const unsigned char *) (const char
*) ("IssueNo"))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p
(name) && ((size_t)(const void *)((name) + 1) - (size_t
)(const void *)(name) == 1) && (__s2_len = __builtin_strlen
(name), __s2_len < 4) ? (__builtin_constant_p ("IssueNo")
&& ((size_t)(const void *)(("IssueNo") + 1) - (size_t
)(const void *)("IssueNo") == 1) ? __builtin_strcmp ("IssueNo"
, name) : (- (__extension__ ({ const unsigned char *__s2 = (const
unsigned char *) (const char *) ("IssueNo"); int __result = (
((const unsigned char *) (const char *) (name))[0] - __s2[0])
; if (__s2_len > 0 && __result == 0) { __result = (
((const unsigned char *) (const char *) (name))[1] - __s2[1])
; if (__s2_len > 1 && __result == 0) { __result = (
((const unsigned char *) (const char *) (name))[2] - __s2[2])
; if (__s2_len > 2 && __result == 0) __result = ((
(const unsigned char *) (const char *) (name))[3] - __s2[3]);
} } __result; })))) : __builtin_strcmp ("IssueNo", name))));
})
== 0)
7
Taking false branch
18
Taking false branch
29
Taking false branch
59 kp->device_issueno = content;
60 else if (strcmp ("DeviceBinding", name)__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p
("DeviceBinding") && __builtin_constant_p (name) &&
(__s1_len = __builtin_strlen ("DeviceBinding"), __s2_len = __builtin_strlen
(name), (!((size_t)(const void *)(("DeviceBinding") + 1) - (
size_t)(const void *)("DeviceBinding") == 1) || __s1_len >=
4) && (!((size_t)(const void *)((name) + 1) - (size_t
)(const void *)(name) == 1) || __s2_len >= 4)) ? __builtin_strcmp
("DeviceBinding", name) : (__builtin_constant_p ("DeviceBinding"
) && ((size_t)(const void *)(("DeviceBinding") + 1) -
(size_t)(const void *)("DeviceBinding") == 1) && (__s1_len
= __builtin_strlen ("DeviceBinding"), __s1_len < 4) ? (__builtin_constant_p
(name) && ((size_t)(const void *)((name) + 1) - (size_t
)(const void *)(name) == 1) ? __builtin_strcmp ("DeviceBinding"
, name) : (__extension__ ({ const unsigned char *__s2 = (const
unsigned char *) (const char *) (name); int __result = (((const
unsigned char *) (const char *) ("DeviceBinding"))[0] - __s2
[0]); if (__s1_len > 0 && __result == 0) { __result
= (((const unsigned char *) (const char *) ("DeviceBinding")
)[1] - __s2[1]); if (__s1_len > 1 && __result == 0
) { __result = (((const unsigned char *) (const char *) ("DeviceBinding"
))[2] - __s2[2]); if (__s1_len > 2 && __result == 0
) __result = (((const unsigned char *) (const char *) ("DeviceBinding"
))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p (
name) && ((size_t)(const void *)((name) + 1) - (size_t
)(const void *)(name) == 1) && (__s2_len = __builtin_strlen
(name), __s2_len < 4) ? (__builtin_constant_p ("DeviceBinding"
) && ((size_t)(const void *)(("DeviceBinding") + 1) -
(size_t)(const void *)("DeviceBinding") == 1) ? __builtin_strcmp
("DeviceBinding", name) : (- (__extension__ ({ const unsigned
char *__s2 = (const unsigned char *) (const char *) ("DeviceBinding"
); int __result = (((const unsigned char *) (const char *) (name
))[0] - __s2[0]); if (__s2_len > 0 && __result == 0
) { __result = (((const unsigned char *) (const char *) (name
))[1] - __s2[1]); if (__s2_len > 1 && __result == 0
) { __result = (((const unsigned char *) (const char *) (name
))[2] - __s2[2]); if (__s2_len > 2 && __result == 0
) __result = (((const unsigned char *) (const char *) (name))
[3] - __s2[3]); } } __result; })))) : __builtin_strcmp ("DeviceBinding"
, name)))); })
== 0)
8
Taking false branch
19
Taking false branch
30
Taking false branch
61 kp->device_devicebinding = content;
62 else if (strcmp ("StartDate", name)__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p
("StartDate") && __builtin_constant_p (name) &&
(__s1_len = __builtin_strlen ("StartDate"), __s2_len = __builtin_strlen
(name), (!((size_t)(const void *)(("StartDate") + 1) - (size_t
)(const void *)("StartDate") == 1) || __s1_len >= 4) &&
(!((size_t)(const void *)((name) + 1) - (size_t)(const void *
)(name) == 1) || __s2_len >= 4)) ? __builtin_strcmp ("StartDate"
, name) : (__builtin_constant_p ("StartDate") && ((size_t
)(const void *)(("StartDate") + 1) - (size_t)(const void *)("StartDate"
) == 1) && (__s1_len = __builtin_strlen ("StartDate")
, __s1_len < 4) ? (__builtin_constant_p (name) && (
(size_t)(const void *)((name) + 1) - (size_t)(const void *)(name
) == 1) ? __builtin_strcmp ("StartDate", name) : (__extension__
({ const unsigned char *__s2 = (const unsigned char *) (const
char *) (name); int __result = (((const unsigned char *) (const
char *) ("StartDate"))[0] - __s2[0]); if (__s1_len > 0 &&
__result == 0) { __result = (((const unsigned char *) (const
char *) ("StartDate"))[1] - __s2[1]); if (__s1_len > 1 &&
__result == 0) { __result = (((const unsigned char *) (const
char *) ("StartDate"))[2] - __s2[2]); if (__s1_len > 2 &&
__result == 0) __result = (((const unsigned char *) (const char
*) ("StartDate"))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p
(name) && ((size_t)(const void *)((name) + 1) - (size_t
)(const void *)(name) == 1) && (__s2_len = __builtin_strlen
(name), __s2_len < 4) ? (__builtin_constant_p ("StartDate"
) && ((size_t)(const void *)(("StartDate") + 1) - (size_t
)(const void *)("StartDate") == 1) ? __builtin_strcmp ("StartDate"
, name) : (- (__extension__ ({ const unsigned char *__s2 = (const
unsigned char *) (const char *) ("StartDate"); int __result =
(((const unsigned char *) (const char *) (name))[0] - __s2[0
]); if (__s2_len > 0 && __result == 0) { __result =
(((const unsigned char *) (const char *) (name))[1] - __s2[1
]); if (__s2_len > 1 && __result == 0) { __result =
(((const unsigned char *) (const char *) (name))[2] - __s2[2
]); if (__s2_len > 2 && __result == 0) __result = (
((const unsigned char *) (const char *) (name))[3] - __s2[3])
; } } __result; })))) : __builtin_strcmp ("StartDate", name))
)); })
== 0)
9
Taking false branch
20
Taking false branch
31
Taking false branch
63 {
64 const char *p;
65 kp->device_startdate_str = content;
66 memset (&kp->device_startdate, 0, sizeof (struct tm));
67 p = strptime (kp->device_startdate_str,
68 "%Y-%m-%dT%H:%M:%SZ", &kp->device_startdate);
69 if (p == NULL((void*)0) || *p != '\0')
70 {
71 _pskc_debug ("cannot convert time string '%s'",
72 kp->device_startdate_str);
73 *rc = PSKC_PARSE_ERROR;
74 }
75 }
76 else if (strcmp ("ExpiryDate", name)__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p
("ExpiryDate") && __builtin_constant_p (name) &&
(__s1_len = __builtin_strlen ("ExpiryDate"), __s2_len = __builtin_strlen
(name), (!((size_t)(const void *)(("ExpiryDate") + 1) - (size_t
)(const void *)("ExpiryDate") == 1) || __s1_len >= 4) &&
(!((size_t)(const void *)((name) + 1) - (size_t)(const void *
)(name) == 1) || __s2_len >= 4)) ? __builtin_strcmp ("ExpiryDate"
, name) : (__builtin_constant_p ("ExpiryDate") && ((size_t
)(const void *)(("ExpiryDate") + 1) - (size_t)(const void *)(
"ExpiryDate") == 1) && (__s1_len = __builtin_strlen (
"ExpiryDate"), __s1_len < 4) ? (__builtin_constant_p (name
) && ((size_t)(const void *)((name) + 1) - (size_t)(const
void *)(name) == 1) ? __builtin_strcmp ("ExpiryDate", name) :
(__extension__ ({ const unsigned char *__s2 = (const unsigned
char *) (const char *) (name); int __result = (((const unsigned
char *) (const char *) ("ExpiryDate"))[0] - __s2[0]); if (__s1_len
> 0 && __result == 0) { __result = (((const unsigned
char *) (const char *) ("ExpiryDate"))[1] - __s2[1]); if (__s1_len
> 1 && __result == 0) { __result = (((const unsigned
char *) (const char *) ("ExpiryDate"))[2] - __s2[2]); if (__s1_len
> 2 && __result == 0) __result = (((const unsigned
char *) (const char *) ("ExpiryDate"))[3] - __s2[3]); } } __result
; }))) : (__builtin_constant_p (name) && ((size_t)(const
void *)((name) + 1) - (size_t)(const void *)(name) == 1) &&
(__s2_len = __builtin_strlen (name), __s2_len < 4) ? (__builtin_constant_p
("ExpiryDate") && ((size_t)(const void *)(("ExpiryDate"
) + 1) - (size_t)(const void *)("ExpiryDate") == 1) ? __builtin_strcmp
("ExpiryDate", name) : (- (__extension__ ({ const unsigned char
*__s2 = (const unsigned char *) (const char *) ("ExpiryDate"
); int __result = (((const unsigned char *) (const char *) (name
))[0] - __s2[0]); if (__s2_len > 0 && __result == 0
) { __result = (((const unsigned char *) (const char *) (name
))[1] - __s2[1]); if (__s2_len > 1 && __result == 0
) { __result = (((const unsigned char *) (const char *) (name
))[2] - __s2[2]); if (__s2_len > 2 && __result == 0
) __result = (((const unsigned char *) (const char *) (name))
[3] - __s2[3]); } } __result; })))) : __builtin_strcmp ("ExpiryDate"
, name)))); })
== 0)
10
Taking false branch
21
Taking false branch
32
Taking false branch
77 {
78 const char *p;
79 kp->device_expirydate_str = content;
80 memset (&kp->device_expirydate, 0, sizeof (struct tm));
81 p = strptime (kp->device_expirydate_str,
82 "%Y-%m-%dT%H:%M:%SZ", &kp->device_expirydate);
83 if (p == NULL((void*)0) || *p != '\0')
84 {
85 _pskc_debug ("cannot convert time string '%s'",
86 kp->device_expirydate_str);
87 *rc = PSKC_PARSE_ERROR;
88 }
89 }
90 else if (strcmp ("UserId", name)__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p
("UserId") && __builtin_constant_p (name) &&
(__s1_len = __builtin_strlen ("UserId"), __s2_len = __builtin_strlen
(name), (!((size_t)(const void *)(("UserId") + 1) - (size_t)
(const void *)("UserId") == 1) || __s1_len >= 4) &&
(!((size_t)(const void *)((name) + 1) - (size_t)(const void *
)(name) == 1) || __s2_len >= 4)) ? __builtin_strcmp ("UserId"
, name) : (__builtin_constant_p ("UserId") && ((size_t
)(const void *)(("UserId") + 1) - (size_t)(const void *)("UserId"
) == 1) && (__s1_len = __builtin_strlen ("UserId"), __s1_len
< 4) ? (__builtin_constant_p (name) && ((size_t)(
const void *)((name) + 1) - (size_t)(const void *)(name) == 1
) ? __builtin_strcmp ("UserId", name) : (__extension__ ({ const
unsigned char *__s2 = (const unsigned char *) (const char *)
(name); int __result = (((const unsigned char *) (const char
*) ("UserId"))[0] - __s2[0]); if (__s1_len > 0 &&
__result == 0) { __result = (((const unsigned char *) (const
char *) ("UserId"))[1] - __s2[1]); if (__s1_len > 1 &&
__result == 0) { __result = (((const unsigned char *) (const
char *) ("UserId"))[2] - __s2[2]); if (__s1_len > 2 &&
__result == 0) __result = (((const unsigned char *) (const char
*) ("UserId"))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p
(name) && ((size_t)(const void *)((name) + 1) - (size_t
)(const void *)(name) == 1) && (__s2_len = __builtin_strlen
(name), __s2_len < 4) ? (__builtin_constant_p ("UserId") &&
((size_t)(const void *)(("UserId") + 1) - (size_t)(const void
*)("UserId") == 1) ? __builtin_strcmp ("UserId", name) : (- (
__extension__ ({ const unsigned char *__s2 = (const unsigned char
*) (const char *) ("UserId"); int __result = (((const unsigned
char *) (const char *) (name))[0] - __s2[0]); if (__s2_len >
0 && __result == 0) { __result = (((const unsigned char
*) (const char *) (name))[1] - __s2[1]); if (__s2_len > 1
&& __result == 0) { __result = (((const unsigned char
*) (const char *) (name))[2] - __s2[2]); if (__s2_len > 2
&& __result == 0) __result = (((const unsigned char *
) (const char *) (name))[3] - __s2[3]); } } __result; })))) :
__builtin_strcmp ("UserId", name)))); })
== 0)
11
Taking false branch
22
Taking false branch
33
Taking false branch
91 kp->device_userid = content;
92 else
93 {
94 _pskc_debug ("unknown <%s> element <%s>", x->parent->name, name);
95 *rc = PSKC_PARSE_ERROR;
96 }
97 }
98}
99
100static void
101parse_cryptomoduleinfo (xmlNode * x, struct pskc_key *kp, int *rc)
102{
103 xmlNode *cur_node = NULL((void*)0);
104
105 for (cur_node = x; cur_node; cur_node = cur_node->next)
106 {
107 const char *name = (const char *) cur_node->name;
108 const char *content = (const char *)
109 (cur_node->children ? cur_node->children->content : NULL((void*)0));
110
111 if (cur_node->type != XML_ELEMENT_NODE)
112 continue;
113
114 if (strcmp ("Id", name)__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p
("Id") && __builtin_constant_p (name) && (__s1_len
= __builtin_strlen ("Id"), __s2_len = __builtin_strlen (name
), (!((size_t)(const void *)(("Id") + 1) - (size_t)(const void
*)("Id") == 1) || __s1_len >= 4) && (!((size_t)(const
void *)((name) + 1) - (size_t)(const void *)(name) == 1) || __s2_len
>= 4)) ? __builtin_strcmp ("Id", name) : (__builtin_constant_p
("Id") && ((size_t)(const void *)(("Id") + 1) - (size_t
)(const void *)("Id") == 1) && (__s1_len = __builtin_strlen
("Id"), __s1_len < 4) ? (__builtin_constant_p (name) &&
((size_t)(const void *)((name) + 1) - (size_t)(const void *)
(name) == 1) ? __builtin_strcmp ("Id", name) : (__extension__
({ const unsigned char *__s2 = (const unsigned char *) (const
char *) (name); int __result = (((const unsigned char *) (const
char *) ("Id"))[0] - __s2[0]); if (__s1_len > 0 &&
__result == 0) { __result = (((const unsigned char *) (const
char *) ("Id"))[1] - __s2[1]); if (__s1_len > 1 &&
__result == 0) { __result = (((const unsigned char *) (const
char *) ("Id"))[2] - __s2[2]); if (__s1_len > 2 &&
__result == 0) __result = (((const unsigned char *) (const char
*) ("Id"))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p
(name) && ((size_t)(const void *)((name) + 1) - (size_t
)(const void *)(name) == 1) && (__s2_len = __builtin_strlen
(name), __s2_len < 4) ? (__builtin_constant_p ("Id") &&
((size_t)(const void *)(("Id") + 1) - (size_t)(const void *)
("Id") == 1) ? __builtin_strcmp ("Id", name) : (- (__extension__
({ const unsigned char *__s2 = (const unsigned char *) (const
char *) ("Id"); int __result = (((const unsigned char *) (const
char *) (name))[0] - __s2[0]); if (__s2_len > 0 &&
__result == 0) { __result = (((const unsigned char *) (const
char *) (name))[1] - __s2[1]); if (__s2_len > 1 &&
__result == 0) { __result = (((const unsigned char *) (const
char *) (name))[2] - __s2[2]); if (__s2_len > 2 &&
__result == 0) __result = (((const unsigned char *) (const char
*) (name))[3] - __s2[3]); } } __result; })))) : __builtin_strcmp
("Id", name)))); })
== 0)
115 kp->cryptomodule_id = content;
116 else
117 {
118 _pskc_debug ("unknown <%s> element <%s>", x->parent->name, name);
119 *rc = PSKC_PARSE_ERROR;
120 }
121 }
122}
123
124static void
125parse_intlongstrdatatype (xmlNode * x, const char **var, int *rc)
126{
127 xmlNode *cur_node = NULL((void*)0);
128
129 *var = NULL((void*)0);
130
131 for (cur_node = x; cur_node; cur_node = cur_node->next)
132 {
133 const char *name = (const char *) cur_node->name;
134 const char *content = (const char *)
135 (cur_node->children ? cur_node->children->content : NULL((void*)0));
136
137 if (cur_node->type != XML_ELEMENT_NODE)
138 continue;
139
140 if (strcmp ("PlainValue", name)__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p
("PlainValue") && __builtin_constant_p (name) &&
(__s1_len = __builtin_strlen ("PlainValue"), __s2_len = __builtin_strlen
(name), (!((size_t)(const void *)(("PlainValue") + 1) - (size_t
)(const void *)("PlainValue") == 1) || __s1_len >= 4) &&
(!((size_t)(const void *)((name) + 1) - (size_t)(const void *
)(name) == 1) || __s2_len >= 4)) ? __builtin_strcmp ("PlainValue"
, name) : (__builtin_constant_p ("PlainValue") && ((size_t
)(const void *)(("PlainValue") + 1) - (size_t)(const void *)(
"PlainValue") == 1) && (__s1_len = __builtin_strlen (
"PlainValue"), __s1_len < 4) ? (__builtin_constant_p (name
) && ((size_t)(const void *)((name) + 1) - (size_t)(const
void *)(name) == 1) ? __builtin_strcmp ("PlainValue", name) :
(__extension__ ({ const unsigned char *__s2 = (const unsigned
char *) (const char *) (name); int __result = (((const unsigned
char *) (const char *) ("PlainValue"))[0] - __s2[0]); if (__s1_len
> 0 && __result == 0) { __result = (((const unsigned
char *) (const char *) ("PlainValue"))[1] - __s2[1]); if (__s1_len
> 1 && __result == 0) { __result = (((const unsigned
char *) (const char *) ("PlainValue"))[2] - __s2[2]); if (__s1_len
> 2 && __result == 0) __result = (((const unsigned
char *) (const char *) ("PlainValue"))[3] - __s2[3]); } } __result
; }))) : (__builtin_constant_p (name) && ((size_t)(const
void *)((name) + 1) - (size_t)(const void *)(name) == 1) &&
(__s2_len = __builtin_strlen (name), __s2_len < 4) ? (__builtin_constant_p
("PlainValue") && ((size_t)(const void *)(("PlainValue"
) + 1) - (size_t)(const void *)("PlainValue") == 1) ? __builtin_strcmp
("PlainValue", name) : (- (__extension__ ({ const unsigned char
*__s2 = (const unsigned char *) (const char *) ("PlainValue"
); int __result = (((const unsigned char *) (const char *) (name
))[0] - __s2[0]); if (__s2_len > 0 && __result == 0
) { __result = (((const unsigned char *) (const char *) (name
))[1] - __s2[1]); if (__s2_len > 1 && __result == 0
) { __result = (((const unsigned char *) (const char *) (name
))[2] - __s2[2]); if (__s2_len > 2 && __result == 0
) __result = (((const unsigned char *) (const char *) (name))
[3] - __s2[3]); } } __result; })))) : __builtin_strcmp ("PlainValue"
, name)))); })
== 0)
141 *var = content;
142 else
143 {
144 _pskc_debug ("unknown <%s> element <%s>", x->parent->name, name);
145 *rc = PSKC_PARSE_ERROR;
146 }
147 }
148}
149
150static char *
151remove_whitespace (const char *str, size_t * outlen)
152{
153 size_t len = strlen (str);
154 char *out = malloc (len + 1);
155 size_t i, j;
156
157 if (out == NULL((void*)0))
158 return NULL((void*)0);
159
160 for (i = 0, j = 0; i < len; i++)
161 if (isbase64 (str[i]) || str[i] == '=')
162 out[j++] = str[i];
163
164 out[j] = '\0';
165
166 *outlen = j;
167
168 return out;
169}
170
171static void
172parse_data (xmlNode * x, struct pskc_key *kp, int *rc)
173{
174 xmlNode *cur_node = NULL((void*)0);
175
176 for (cur_node = x; cur_node; cur_node = cur_node->next)
177 {
178 const char *name = (const char *) cur_node->name;
179
180 if (cur_node->type != XML_ELEMENT_NODE)
181 continue;
182
183 if (strcmp ("Secret", name)__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p
("Secret") && __builtin_constant_p (name) &&
(__s1_len = __builtin_strlen ("Secret"), __s2_len = __builtin_strlen
(name), (!((size_t)(const void *)(("Secret") + 1) - (size_t)
(const void *)("Secret") == 1) || __s1_len >= 4) &&
(!((size_t)(const void *)((name) + 1) - (size_t)(const void *
)(name) == 1) || __s2_len >= 4)) ? __builtin_strcmp ("Secret"
, name) : (__builtin_constant_p ("Secret") && ((size_t
)(const void *)(("Secret") + 1) - (size_t)(const void *)("Secret"
) == 1) && (__s1_len = __builtin_strlen ("Secret"), __s1_len
< 4) ? (__builtin_constant_p (name) && ((size_t)(
const void *)((name) + 1) - (size_t)(const void *)(name) == 1
) ? __builtin_strcmp ("Secret", name) : (__extension__ ({ const
unsigned char *__s2 = (const unsigned char *) (const char *)
(name); int __result = (((const unsigned char *) (const char
*) ("Secret"))[0] - __s2[0]); if (__s1_len > 0 &&
__result == 0) { __result = (((const unsigned char *) (const
char *) ("Secret"))[1] - __s2[1]); if (__s1_len > 1 &&
__result == 0) { __result = (((const unsigned char *) (const
char *) ("Secret"))[2] - __s2[2]); if (__s1_len > 2 &&
__result == 0) __result = (((const unsigned char *) (const char
*) ("Secret"))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p
(name) && ((size_t)(const void *)((name) + 1) - (size_t
)(const void *)(name) == 1) && (__s2_len = __builtin_strlen
(name), __s2_len < 4) ? (__builtin_constant_p ("Secret") &&
((size_t)(const void *)(("Secret") + 1) - (size_t)(const void
*)("Secret") == 1) ? __builtin_strcmp ("Secret", name) : (- (
__extension__ ({ const unsigned char *__s2 = (const unsigned char
*) (const char *) ("Secret"); int __result = (((const unsigned
char *) (const char *) (name))[0] - __s2[0]); if (__s2_len >
0 && __result == 0) { __result = (((const unsigned char
*) (const char *) (name))[1] - __s2[1]); if (__s2_len > 1
&& __result == 0) { __result = (((const unsigned char
*) (const char *) (name))[2] - __s2[2]); if (__s2_len > 2
&& __result == 0) __result = (((const unsigned char *
) (const char *) (name))[3] - __s2[3]); } } __result; })))) :
__builtin_strcmp ("Secret", name)))); })
== 0)
184 {
185 parse_intlongstrdatatype (cur_node->children,
186 &kp->key_secret_str, rc);
187 if (kp->key_secret_str)
188 {
189 bool_Bool ok;
190 size_t l;
191
192 kp->key_b64secret = remove_whitespace (kp->key_secret_str, &l);
193 if (kp->key_b64secret == NULL((void*)0))
194 {
195 _pskc_debug ("base64 whitespace malloc failed");
196 *rc = PSKC_MALLOC_ERROR;
197 }
198 else
199 {
200 ok = base64_decode_alloc (kp->key_b64secret, l,base64_decode_alloc_ctx (((void*)0), kp->key_b64secret, l,
&kp->key_secret, &kp->key_secret_len)
201 &kp->key_secret,base64_decode_alloc_ctx (((void*)0), kp->key_b64secret, l,
&kp->key_secret, &kp->key_secret_len)
202 &kp->key_secret_len)base64_decode_alloc_ctx (((void*)0), kp->key_b64secret, l,
&kp->key_secret, &kp->key_secret_len)
;
203 if (!ok)
204 {
205 _pskc_debug ("base64 decoding failed");
206 *rc = PSKC_BASE64_ERROR;
207 }
208 if (kp->key_secret == NULL((void*)0))
209 {
210 _pskc_debug ("base64 malloc failed");
211 *rc = PSKC_MALLOC_ERROR;
212 }
213 }
214 }
215 }
216 else if (strcmp ("Counter", name)__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p
("Counter") && __builtin_constant_p (name) &&
(__s1_len = __builtin_strlen ("Counter"), __s2_len = __builtin_strlen
(name), (!((size_t)(const void *)(("Counter") + 1) - (size_t
)(const void *)("Counter") == 1) || __s1_len >= 4) &&
(!((size_t)(const void *)((name) + 1) - (size_t)(const void *
)(name) == 1) || __s2_len >= 4)) ? __builtin_strcmp ("Counter"
, name) : (__builtin_constant_p ("Counter") && ((size_t
)(const void *)(("Counter") + 1) - (size_t)(const void *)("Counter"
) == 1) && (__s1_len = __builtin_strlen ("Counter"), __s1_len
< 4) ? (__builtin_constant_p (name) && ((size_t)(
const void *)((name) + 1) - (size_t)(const void *)(name) == 1
) ? __builtin_strcmp ("Counter", name) : (__extension__ ({ const
unsigned char *__s2 = (const unsigned char *) (const char *)
(name); int __result = (((const unsigned char *) (const char
*) ("Counter"))[0] - __s2[0]); if (__s1_len > 0 &&
__result == 0) { __result = (((const unsigned char *) (const
char *) ("Counter"))[1] - __s2[1]); if (__s1_len > 1 &&
__result == 0) { __result = (((const unsigned char *) (const
char *) ("Counter"))[2] - __s2[2]); if (__s1_len > 2 &&
__result == 0) __result = (((const unsigned char *) (const char
*) ("Counter"))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p
(name) && ((size_t)(const void *)((name) + 1) - (size_t
)(const void *)(name) == 1) && (__s2_len = __builtin_strlen
(name), __s2_len < 4) ? (__builtin_constant_p ("Counter")
&& ((size_t)(const void *)(("Counter") + 1) - (size_t
)(const void *)("Counter") == 1) ? __builtin_strcmp ("Counter"
, name) : (- (__extension__ ({ const unsigned char *__s2 = (const
unsigned char *) (const char *) ("Counter"); int __result = (
((const unsigned char *) (const char *) (name))[0] - __s2[0])
; if (__s2_len > 0 && __result == 0) { __result = (
((const unsigned char *) (const char *) (name))[1] - __s2[1])
; if (__s2_len > 1 && __result == 0) { __result = (
((const unsigned char *) (const char *) (name))[2] - __s2[2])
; if (__s2_len > 2 && __result == 0) __result = ((
(const unsigned char *) (const char *) (name))[3] - __s2[3]);
} } __result; })))) : __builtin_strcmp ("Counter", name))));
})
== 0)
217 {
218 parse_intlongstrdatatype (cur_node->children,
219 &kp->key_counter_str, rc);
220 if (kp->key_counter_str)
221 kp->key_counter = strtoull (kp->key_counter_str, NULL((void*)0), 10);
222 }
223 else if (strcmp ("Time", name)__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p
("Time") && __builtin_constant_p (name) && (
__s1_len = __builtin_strlen ("Time"), __s2_len = __builtin_strlen
(name), (!((size_t)(const void *)(("Time") + 1) - (size_t)(const
void *)("Time") == 1) || __s1_len >= 4) && (!((size_t
)(const void *)((name) + 1) - (size_t)(const void *)(name) ==
1) || __s2_len >= 4)) ? __builtin_strcmp ("Time", name) :
(__builtin_constant_p ("Time") && ((size_t)(const void
*)(("Time") + 1) - (size_t)(const void *)("Time") == 1) &&
(__s1_len = __builtin_strlen ("Time"), __s1_len < 4) ? (__builtin_constant_p
(name) && ((size_t)(const void *)((name) + 1) - (size_t
)(const void *)(name) == 1) ? __builtin_strcmp ("Time", name)
: (__extension__ ({ const unsigned char *__s2 = (const unsigned
char *) (const char *) (name); int __result = (((const unsigned
char *) (const char *) ("Time"))[0] - __s2[0]); if (__s1_len
> 0 && __result == 0) { __result = (((const unsigned
char *) (const char *) ("Time"))[1] - __s2[1]); if (__s1_len
> 1 && __result == 0) { __result = (((const unsigned
char *) (const char *) ("Time"))[2] - __s2[2]); if (__s1_len
> 2 && __result == 0) __result = (((const unsigned
char *) (const char *) ("Time"))[3] - __s2[3]); } } __result
; }))) : (__builtin_constant_p (name) && ((size_t)(const
void *)((name) + 1) - (size_t)(const void *)(name) == 1) &&
(__s2_len = __builtin_strlen (name), __s2_len < 4) ? (__builtin_constant_p
("Time") && ((size_t)(const void *)(("Time") + 1) - (
size_t)(const void *)("Time") == 1) ? __builtin_strcmp ("Time"
, name) : (- (__extension__ ({ const unsigned char *__s2 = (const
unsigned char *) (const char *) ("Time"); int __result = (((
const unsigned char *) (const char *) (name))[0] - __s2[0]); if
(__s2_len > 0 && __result == 0) { __result = (((const
unsigned char *) (const char *) (name))[1] - __s2[1]); if (__s2_len
> 1 && __result == 0) { __result = (((const unsigned
char *) (const char *) (name))[2] - __s2[2]); if (__s2_len >
2 && __result == 0) __result = (((const unsigned char
*) (const char *) (name))[3] - __s2[3]); } } __result; }))))
: __builtin_strcmp ("Time", name)))); })
== 0)
224 {
225 parse_intlongstrdatatype (cur_node->children,
226 &kp->key_time_str, rc);
227 if (kp->key_time_str)
228 kp->key_time = strtoul (kp->key_time_str, NULL((void*)0), 10);
229 }
230 else if (strcmp ("TimeInterval", name)__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p
("TimeInterval") && __builtin_constant_p (name) &&
(__s1_len = __builtin_strlen ("TimeInterval"), __s2_len = __builtin_strlen
(name), (!((size_t)(const void *)(("TimeInterval") + 1) - (size_t
)(const void *)("TimeInterval") == 1) || __s1_len >= 4) &&
(!((size_t)(const void *)((name) + 1) - (size_t)(const void *
)(name) == 1) || __s2_len >= 4)) ? __builtin_strcmp ("TimeInterval"
, name) : (__builtin_constant_p ("TimeInterval") && (
(size_t)(const void *)(("TimeInterval") + 1) - (size_t)(const
void *)("TimeInterval") == 1) && (__s1_len = __builtin_strlen
("TimeInterval"), __s1_len < 4) ? (__builtin_constant_p (
name) && ((size_t)(const void *)((name) + 1) - (size_t
)(const void *)(name) == 1) ? __builtin_strcmp ("TimeInterval"
, name) : (__extension__ ({ const unsigned char *__s2 = (const
unsigned char *) (const char *) (name); int __result = (((const
unsigned char *) (const char *) ("TimeInterval"))[0] - __s2[
0]); if (__s1_len > 0 && __result == 0) { __result
= (((const unsigned char *) (const char *) ("TimeInterval"))
[1] - __s2[1]); if (__s1_len > 1 && __result == 0)
{ __result = (((const unsigned char *) (const char *) ("TimeInterval"
))[2] - __s2[2]); if (__s1_len > 2 && __result == 0
) __result = (((const unsigned char *) (const char *) ("TimeInterval"
))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p (
name) && ((size_t)(const void *)((name) + 1) - (size_t
)(const void *)(name) == 1) && (__s2_len = __builtin_strlen
(name), __s2_len < 4) ? (__builtin_constant_p ("TimeInterval"
) && ((size_t)(const void *)(("TimeInterval") + 1) - (
size_t)(const void *)("TimeInterval") == 1) ? __builtin_strcmp
("TimeInterval", name) : (- (__extension__ ({ const unsigned
char *__s2 = (const unsigned char *) (const char *) ("TimeInterval"
); int __result = (((const unsigned char *) (const char *) (name
))[0] - __s2[0]); if (__s2_len > 0 && __result == 0
) { __result = (((const unsigned char *) (const char *) (name
))[1] - __s2[1]); if (__s2_len > 1 && __result == 0
) { __result = (((const unsigned char *) (const char *) (name
))[2] - __s2[2]); if (__s2_len > 2 && __result == 0
) __result = (((const unsigned char *) (const char *) (name))
[3] - __s2[3]); } } __result; })))) : __builtin_strcmp ("TimeInterval"
, name)))); })
== 0)
231 {
232 parse_intlongstrdatatype (cur_node->children,
233 &kp->key_timeinterval_str, rc);
234 if (kp->key_timeinterval_str)
235 kp->key_timeinterval = strtoul (kp->key_timeinterval_str,
236 NULL((void*)0), 10);
237 }
238 else if (strcmp ("TimeDrift", name)__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p
("TimeDrift") && __builtin_constant_p (name) &&
(__s1_len = __builtin_strlen ("TimeDrift"), __s2_len = __builtin_strlen
(name), (!((size_t)(const void *)(("TimeDrift") + 1) - (size_t
)(const void *)("TimeDrift") == 1) || __s1_len >= 4) &&
(!((size_t)(const void *)((name) + 1) - (size_t)(const void *
)(name) == 1) || __s2_len >= 4)) ? __builtin_strcmp ("TimeDrift"
, name) : (__builtin_constant_p ("TimeDrift") && ((size_t
)(const void *)(("TimeDrift") + 1) - (size_t)(const void *)("TimeDrift"
) == 1) && (__s1_len = __builtin_strlen ("TimeDrift")
, __s1_len < 4) ? (__builtin_constant_p (name) && (
(size_t)(const void *)((name) + 1) - (size_t)(const void *)(name
) == 1) ? __builtin_strcmp ("TimeDrift", name) : (__extension__
({ const unsigned char *__s2 = (const unsigned char *) (const
char *) (name); int __result = (((const unsigned char *) (const
char *) ("TimeDrift"))[0] - __s2[0]); if (__s1_len > 0 &&
__result == 0) { __result = (((const unsigned char *) (const
char *) ("TimeDrift"))[1] - __s2[1]); if (__s1_len > 1 &&
__result == 0) { __result = (((const unsigned char *) (const
char *) ("TimeDrift"))[2] - __s2[2]); if (__s1_len > 2 &&
__result == 0) __result = (((const unsigned char *) (const char
*) ("TimeDrift"))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p
(name) && ((size_t)(const void *)((name) + 1) - (size_t
)(const void *)(name) == 1) && (__s2_len = __builtin_strlen
(name), __s2_len < 4) ? (__builtin_constant_p ("TimeDrift"
) && ((size_t)(const void *)(("TimeDrift") + 1) - (size_t
)(const void *)("TimeDrift") == 1) ? __builtin_strcmp ("TimeDrift"
, name) : (- (__extension__ ({ const unsigned char *__s2 = (const
unsigned char *) (const char *) ("TimeDrift"); int __result =
(((const unsigned char *) (const char *) (name))[0] - __s2[0
]); if (__s2_len > 0 && __result == 0) { __result =
(((const unsigned char *) (const char *) (name))[1] - __s2[1
]); if (__s2_len > 1 && __result == 0) { __result =
(((const unsigned char *) (const char *) (name))[2] - __s2[2
]); if (__s2_len > 2 && __result == 0) __result = (
((const unsigned char *) (const char *) (name))[3] - __s2[3])
; } } __result; })))) : __builtin_strcmp ("TimeDrift", name))
)); })
== 0)
239 {
240 parse_intlongstrdatatype (cur_node->children,
241 &kp->key_timedrift_str, rc);
242 if (kp->key_timedrift_str)
243 kp->key_timedrift = strtoul (kp->key_timedrift_str, NULL((void*)0), 10);
244 }
245 else
246 {
247 _pskc_debug ("unknown <%s> element <%s>", x->parent->name, name);
248 *rc = PSKC_PARSE_ERROR;
249 }
250 }
251}
252
253static void
254parse_algorithmparameters (xmlNode * x, struct pskc_key *kp, int *rc)
255{
256 xmlNode *cur_node = NULL((void*)0);
257
258 for (cur_node = x; cur_node; cur_node = cur_node->next)
259 {
260 const char *name = (const char *) cur_node->name;
261 const char *content = (const char *)
262 (cur_node->children ? cur_node->children->content : NULL((void*)0));
263
264 if (cur_node->type != XML_ELEMENT_NODE)
265 continue;
266
267 if (strcmp ("Suite", name)__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p
("Suite") && __builtin_constant_p (name) && (
__s1_len = __builtin_strlen ("Suite"), __s2_len = __builtin_strlen
(name), (!((size_t)(const void *)(("Suite") + 1) - (size_t)(
const void *)("Suite") == 1) || __s1_len >= 4) && (
!((size_t)(const void *)((name) + 1) - (size_t)(const void *)
(name) == 1) || __s2_len >= 4)) ? __builtin_strcmp ("Suite"
, name) : (__builtin_constant_p ("Suite") && ((size_t
)(const void *)(("Suite") + 1) - (size_t)(const void *)("Suite"
) == 1) && (__s1_len = __builtin_strlen ("Suite"), __s1_len
< 4) ? (__builtin_constant_p (name) && ((size_t)(
const void *)((name) + 1) - (size_t)(const void *)(name) == 1
) ? __builtin_strcmp ("Suite", name) : (__extension__ ({ const
unsigned char *__s2 = (const unsigned char *) (const char *)
(name); int __result = (((const unsigned char *) (const char
*) ("Suite"))[0] - __s2[0]); if (__s1_len > 0 && __result
== 0) { __result = (((const unsigned char *) (const char *) (
"Suite"))[1] - __s2[1]); if (__s1_len > 1 && __result
== 0) { __result = (((const unsigned char *) (const char *) (
"Suite"))[2] - __s2[2]); if (__s1_len > 2 && __result
== 0) __result = (((const unsigned char *) (const char *) ("Suite"
))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p (
name) && ((size_t)(const void *)((name) + 1) - (size_t
)(const void *)(name) == 1) && (__s2_len = __builtin_strlen
(name), __s2_len < 4) ? (__builtin_constant_p ("Suite") &&
((size_t)(const void *)(("Suite") + 1) - (size_t)(const void
*)("Suite") == 1) ? __builtin_strcmp ("Suite", name) : (- (__extension__
({ const unsigned char *__s2 = (const unsigned char *) (const
char *) ("Suite"); int __result = (((const unsigned char *) (
const char *) (name))[0] - __s2[0]); if (__s2_len > 0 &&
__result == 0) { __result = (((const unsigned char *) (const
char *) (name))[1] - __s2[1]); if (__s2_len > 1 &&
__result == 0) { __result = (((const unsigned char *) (const
char *) (name))[2] - __s2[2]); if (__s2_len > 2 &&
__result == 0) __result = (((const unsigned char *) (const char
*) (name))[3] - __s2[3]); } } __result; })))) : __builtin_strcmp
("Suite", name)))); })
== 0)
268 kp->key_algparm_suite = content;
269 else if (strcmp ("ChallengeFormat", name)__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p
("ChallengeFormat") && __builtin_constant_p (name) &&
(__s1_len = __builtin_strlen ("ChallengeFormat"), __s2_len =
__builtin_strlen (name), (!((size_t)(const void *)(("ChallengeFormat"
) + 1) - (size_t)(const void *)("ChallengeFormat") == 1) || __s1_len
>= 4) && (!((size_t)(const void *)((name) + 1) - (
size_t)(const void *)(name) == 1) || __s2_len >= 4)) ? __builtin_strcmp
("ChallengeFormat", name) : (__builtin_constant_p ("ChallengeFormat"
) && ((size_t)(const void *)(("ChallengeFormat") + 1)
- (size_t)(const void *)("ChallengeFormat") == 1) &&
(__s1_len = __builtin_strlen ("ChallengeFormat"), __s1_len <
4) ? (__builtin_constant_p (name) && ((size_t)(const
void *)((name) + 1) - (size_t)(const void *)(name) == 1) ? __builtin_strcmp
("ChallengeFormat", name) : (__extension__ ({ const unsigned
char *__s2 = (const unsigned char *) (const char *) (name); int
__result = (((const unsigned char *) (const char *) ("ChallengeFormat"
))[0] - __s2[0]); if (__s1_len > 0 && __result == 0
) { __result = (((const unsigned char *) (const char *) ("ChallengeFormat"
))[1] - __s2[1]); if (__s1_len > 1 && __result == 0
) { __result = (((const unsigned char *) (const char *) ("ChallengeFormat"
))[2] - __s2[2]); if (__s1_len > 2 && __result == 0
) __result = (((const unsigned char *) (const char *) ("ChallengeFormat"
))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p (
name) && ((size_t)(const void *)((name) + 1) - (size_t
)(const void *)(name) == 1) && (__s2_len = __builtin_strlen
(name), __s2_len < 4) ? (__builtin_constant_p ("ChallengeFormat"
) && ((size_t)(const void *)(("ChallengeFormat") + 1)
- (size_t)(const void *)("ChallengeFormat") == 1) ? __builtin_strcmp
("ChallengeFormat", name) : (- (__extension__ ({ const unsigned
char *__s2 = (const unsigned char *) (const char *) ("ChallengeFormat"
); int __result = (((const unsigned char *) (const char *) (name
))[0] - __s2[0]); if (__s2_len > 0 && __result == 0
) { __result = (((const unsigned char *) (const char *) (name
))[1] - __s2[1]); if (__s2_len > 1 && __result == 0
) { __result = (((const unsigned char *) (const char *) (name
))[2] - __s2[2]); if (__s2_len > 2 && __result == 0
) __result = (((const unsigned char *) (const char *) (name))
[3] - __s2[3]); } } __result; })))) : __builtin_strcmp ("ChallengeFormat"
, name)))); })
== 0)
270 {
271 xmlAttr *cur_attr = NULL((void*)0);
272
273 for (cur_attr = cur_node->properties; cur_attr;
274 cur_attr = cur_attr->next)
275 {
276 const char *attr_name = (const char *) cur_attr->name;
277 const char *attr_content =
278 (const char *) cur_attr->children->content;
279
280 if (strcmp ("Encoding", attr_name)__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p
("Encoding") && __builtin_constant_p (attr_name) &&
(__s1_len = __builtin_strlen ("Encoding"), __s2_len = __builtin_strlen
(attr_name), (!((size_t)(const void *)(("Encoding") + 1) - (
size_t)(const void *)("Encoding") == 1) || __s1_len >= 4) &&
(!((size_t)(const void *)((attr_name) + 1) - (size_t)(const void
*)(attr_name) == 1) || __s2_len >= 4)) ? __builtin_strcmp
("Encoding", attr_name) : (__builtin_constant_p ("Encoding")
&& ((size_t)(const void *)(("Encoding") + 1) - (size_t
)(const void *)("Encoding") == 1) && (__s1_len = __builtin_strlen
("Encoding"), __s1_len < 4) ? (__builtin_constant_p (attr_name
) && ((size_t)(const void *)((attr_name) + 1) - (size_t
)(const void *)(attr_name) == 1) ? __builtin_strcmp ("Encoding"
, attr_name) : (__extension__ ({ const unsigned char *__s2 = (
const unsigned char *) (const char *) (attr_name); int __result
= (((const unsigned char *) (const char *) ("Encoding"))[0] -
__s2[0]); if (__s1_len > 0 && __result == 0) { __result
= (((const unsigned char *) (const char *) ("Encoding"))[1] -
__s2[1]); if (__s1_len > 1 && __result == 0) { __result
= (((const unsigned char *) (const char *) ("Encoding"))[2] -
__s2[2]); if (__s1_len > 2 && __result == 0) __result
= (((const unsigned char *) (const char *) ("Encoding"))[3] -
__s2[3]); } } __result; }))) : (__builtin_constant_p (attr_name
) && ((size_t)(const void *)((attr_name) + 1) - (size_t
)(const void *)(attr_name) == 1) && (__s2_len = __builtin_strlen
(attr_name), __s2_len < 4) ? (__builtin_constant_p ("Encoding"
) && ((size_t)(const void *)(("Encoding") + 1) - (size_t
)(const void *)("Encoding") == 1) ? __builtin_strcmp ("Encoding"
, attr_name) : (- (__extension__ ({ const unsigned char *__s2
= (const unsigned char *) (const char *) ("Encoding"); int __result
= (((const unsigned char *) (const char *) (attr_name))[0] -
__s2[0]); if (__s2_len > 0 && __result == 0) { __result
= (((const unsigned char *) (const char *) (attr_name))[1] -
__s2[1]); if (__s2_len > 1 && __result == 0) { __result
= (((const unsigned char *) (const char *) (attr_name))[2] -
__s2[2]); if (__s2_len > 2 && __result == 0) __result
= (((const unsigned char *) (const char *) (attr_name))[3] -
__s2[3]); } } __result; })))) : __builtin_strcmp ("Encoding"
, attr_name)))); })
== 0)
281 {
282 kp->key_algparm_chall_encoding_str = attr_content;
283 kp->key_algparm_chall_encoding =
284 pskc_str2valueformat (kp->key_algparm_chall_encoding_str);
285 }
286 else if (strcmp ("Min", attr_name)__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p
("Min") && __builtin_constant_p (attr_name) &&
(__s1_len = __builtin_strlen ("Min"), __s2_len = __builtin_strlen
(attr_name), (!((size_t)(const void *)(("Min") + 1) - (size_t
)(const void *)("Min") == 1) || __s1_len >= 4) && (
!((size_t)(const void *)((attr_name) + 1) - (size_t)(const void
*)(attr_name) == 1) || __s2_len >= 4)) ? __builtin_strcmp
("Min", attr_name) : (__builtin_constant_p ("Min") &&
((size_t)(const void *)(("Min") + 1) - (size_t)(const void *
)("Min") == 1) && (__s1_len = __builtin_strlen ("Min"
), __s1_len < 4) ? (__builtin_constant_p (attr_name) &&
((size_t)(const void *)((attr_name) + 1) - (size_t)(const void
*)(attr_name) == 1) ? __builtin_strcmp ("Min", attr_name) : (
__extension__ ({ const unsigned char *__s2 = (const unsigned char
*) (const char *) (attr_name); int __result = (((const unsigned
char *) (const char *) ("Min"))[0] - __s2[0]); if (__s1_len >
0 && __result == 0) { __result = (((const unsigned char
*) (const char *) ("Min"))[1] - __s2[1]); if (__s1_len > 1
&& __result == 0) { __result = (((const unsigned char
*) (const char *) ("Min"))[2] - __s2[2]); if (__s1_len > 2
&& __result == 0) __result = (((const unsigned char *
) (const char *) ("Min"))[3] - __s2[3]); } } __result; }))) :
(__builtin_constant_p (attr_name) && ((size_t)(const
void *)((attr_name) + 1) - (size_t)(const void *)(attr_name)
== 1) && (__s2_len = __builtin_strlen (attr_name), __s2_len
< 4) ? (__builtin_constant_p ("Min") && ((size_t)
(const void *)(("Min") + 1) - (size_t)(const void *)("Min") ==
1) ? __builtin_strcmp ("Min", attr_name) : (- (__extension__
({ const unsigned char *__s2 = (const unsigned char *) (const
char *) ("Min"); int __result = (((const unsigned char *) (const
char *) (attr_name))[0] - __s2[0]); if (__s2_len > 0 &&
__result == 0) { __result = (((const unsigned char *) (const
char *) (attr_name))[1] - __s2[1]); if (__s2_len > 1 &&
__result == 0) { __result = (((const unsigned char *) (const
char *) (attr_name))[2] - __s2[2]); if (__s2_len > 2 &&
__result == 0) __result = (((const unsigned char *) (const char
*) (attr_name))[3] - __s2[3]); } } __result; })))) : __builtin_strcmp
("Min", attr_name)))); })
== 0)
287 {
288 kp->key_algparm_chall_min_str = attr_content;
289 kp->key_algparm_chall_min =
290 strtoul (kp->key_algparm_chall_min_str, NULL((void*)0), 10);
291 }
292 else if (strcmp ("Max", attr_name)__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p
("Max") && __builtin_constant_p (attr_name) &&
(__s1_len = __builtin_strlen ("Max"), __s2_len = __builtin_strlen
(attr_name), (!((size_t)(const void *)(("Max") + 1) - (size_t
)(const void *)("Max") == 1) || __s1_len >= 4) && (
!((size_t)(const void *)((attr_name) + 1) - (size_t)(const void
*)(attr_name) == 1) || __s2_len >= 4)) ? __builtin_strcmp
("Max", attr_name) : (__builtin_constant_p ("Max") &&
((size_t)(const void *)(("Max") + 1) - (size_t)(const void *
)("Max") == 1) && (__s1_len = __builtin_strlen ("Max"
), __s1_len < 4) ? (__builtin_constant_p (attr_name) &&
((size_t)(const void *)((attr_name) + 1) - (size_t)(const void
*)(attr_name) == 1) ? __builtin_strcmp ("Max", attr_name) : (
__extension__ ({ const unsigned char *__s2 = (const unsigned char
*) (const char *) (attr_name); int __result = (((const unsigned
char *) (const char *) ("Max"))[0] - __s2[0]); if (__s1_len >
0 && __result == 0) { __result = (((const unsigned char
*) (const char *) ("Max"))[1] - __s2[1]); if (__s1_len > 1
&& __result == 0) { __result = (((const unsigned char
*) (const char *) ("Max"))[2] - __s2[2]); if (__s1_len > 2
&& __result == 0) __result = (((const unsigned char *
) (const char *) ("Max"))[3] - __s2[3]); } } __result; }))) :
(__builtin_constant_p (attr_name) && ((size_t)(const
void *)((attr_name) + 1) - (size_t)(const void *)(attr_name)
== 1) && (__s2_len = __builtin_strlen (attr_name), __s2_len
< 4) ? (__builtin_constant_p ("Max") && ((size_t)
(const void *)(("Max") + 1) - (size_t)(const void *)("Max") ==
1) ? __builtin_strcmp ("Max", attr_name) : (- (__extension__
({ const unsigned char *__s2 = (const unsigned char *) (const
char *) ("Max"); int __result = (((const unsigned char *) (const
char *) (attr_name))[0] - __s2[0]); if (__s2_len > 0 &&
__result == 0) { __result = (((const unsigned char *) (const
char *) (attr_name))[1] - __s2[1]); if (__s2_len > 1 &&
__result == 0) { __result = (((const unsigned char *) (const
char *) (attr_name))[2] - __s2[2]); if (__s2_len > 2 &&
__result == 0) __result = (((const unsigned char *) (const char
*) (attr_name))[3] - __s2[3]); } } __result; })))) : __builtin_strcmp
("Max", attr_name)))); })
== 0)
293 {
294 kp->key_algparm_chall_max_str = attr_content;
295 kp->key_algparm_chall_max =
296 strtoul (kp->key_algparm_chall_max_str, NULL((void*)0), 10);
297 }
298 else if (strcmp ("CheckDigits", attr_name)__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p
("CheckDigits") && __builtin_constant_p (attr_name) &&
(__s1_len = __builtin_strlen ("CheckDigits"), __s2_len = __builtin_strlen
(attr_name), (!((size_t)(const void *)(("CheckDigits") + 1) -
(size_t)(const void *)("CheckDigits") == 1) || __s1_len >=
4) && (!((size_t)(const void *)((attr_name) + 1) - (
size_t)(const void *)(attr_name) == 1) || __s2_len >= 4)) ?
__builtin_strcmp ("CheckDigits", attr_name) : (__builtin_constant_p
("CheckDigits") && ((size_t)(const void *)(("CheckDigits"
) + 1) - (size_t)(const void *)("CheckDigits") == 1) &&
(__s1_len = __builtin_strlen ("CheckDigits"), __s1_len < 4
) ? (__builtin_constant_p (attr_name) && ((size_t)(const
void *)((attr_name) + 1) - (size_t)(const void *)(attr_name)
== 1) ? __builtin_strcmp ("CheckDigits", attr_name) : (__extension__
({ const unsigned char *__s2 = (const unsigned char *) (const
char *) (attr_name); int __result = (((const unsigned char *
) (const char *) ("CheckDigits"))[0] - __s2[0]); if (__s1_len
> 0 && __result == 0) { __result = (((const unsigned
char *) (const char *) ("CheckDigits"))[1] - __s2[1]); if (__s1_len
> 1 && __result == 0) { __result = (((const unsigned
char *) (const char *) ("CheckDigits"))[2] - __s2[2]); if (__s1_len
> 2 && __result == 0) __result = (((const unsigned
char *) (const char *) ("CheckDigits"))[3] - __s2[3]); } } __result
; }))) : (__builtin_constant_p (attr_name) && ((size_t
)(const void *)((attr_name) + 1) - (size_t)(const void *)(attr_name
) == 1) && (__s2_len = __builtin_strlen (attr_name), __s2_len
< 4) ? (__builtin_constant_p ("CheckDigits") && (
(size_t)(const void *)(("CheckDigits") + 1) - (size_t)(const void
*)("CheckDigits") == 1) ? __builtin_strcmp ("CheckDigits", attr_name
) : (- (__extension__ ({ const unsigned char *__s2 = (const unsigned
char *) (const char *) ("CheckDigits"); int __result = (((const
unsigned char *) (const char *) (attr_name))[0] - __s2[0]); if
(__s2_len > 0 && __result == 0) { __result = (((const
unsigned char *) (const char *) (attr_name))[1] - __s2[1]); if
(__s2_len > 1 && __result == 0) { __result = (((const
unsigned char *) (const char *) (attr_name))[2] - __s2[2]); if
(__s2_len > 2 && __result == 0) __result = (((const
unsigned char *) (const char *) (attr_name))[3] - __s2[3]); }
} __result; })))) : __builtin_strcmp ("CheckDigits", attr_name
)))); })
== 0)
299 {
300 kp->key_algparm_chall_checkdigits_str = attr_content;
301 if (strcmp ("1", kp->key_algparm_chall_checkdigits_str)__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p
("1") && __builtin_constant_p (kp->key_algparm_chall_checkdigits_str
) && (__s1_len = __builtin_strlen ("1"), __s2_len = __builtin_strlen
(kp->key_algparm_chall_checkdigits_str), (!((size_t)(const
void *)(("1") + 1) - (size_t)(const void *)("1") == 1) || __s1_len
>= 4) && (!((size_t)(const void *)((kp->key_algparm_chall_checkdigits_str
) + 1) - (size_t)(const void *)(kp->key_algparm_chall_checkdigits_str
) == 1) || __s2_len >= 4)) ? __builtin_strcmp ("1", kp->
key_algparm_chall_checkdigits_str) : (__builtin_constant_p ("1"
) && ((size_t)(const void *)(("1") + 1) - (size_t)(const
void *)("1") == 1) && (__s1_len = __builtin_strlen (
"1"), __s1_len < 4) ? (__builtin_constant_p (kp->key_algparm_chall_checkdigits_str
) && ((size_t)(const void *)((kp->key_algparm_chall_checkdigits_str
) + 1) - (size_t)(const void *)(kp->key_algparm_chall_checkdigits_str
) == 1) ? __builtin_strcmp ("1", kp->key_algparm_chall_checkdigits_str
) : (__extension__ ({ const unsigned char *__s2 = (const unsigned
char *) (const char *) (kp->key_algparm_chall_checkdigits_str
); int __result = (((const unsigned char *) (const char *) ("1"
))[0] - __s2[0]); if (__s1_len > 0 && __result == 0
) { __result = (((const unsigned char *) (const char *) ("1")
)[1] - __s2[1]); if (__s1_len > 1 && __result == 0
) { __result = (((const unsigned char *) (const char *) ("1")
)[2] - __s2[2]); if (__s1_len > 2 && __result == 0
) __result = (((const unsigned char *) (const char *) ("1"))[
3] - __s2[3]); } } __result; }))) : (__builtin_constant_p (kp
->key_algparm_chall_checkdigits_str) && ((size_t)(
const void *)((kp->key_algparm_chall_checkdigits_str) + 1)
- (size_t)(const void *)(kp->key_algparm_chall_checkdigits_str
) == 1) && (__s2_len = __builtin_strlen (kp->key_algparm_chall_checkdigits_str
), __s2_len < 4) ? (__builtin_constant_p ("1") && (
(size_t)(const void *)(("1") + 1) - (size_t)(const void *)("1"
) == 1) ? __builtin_strcmp ("1", kp->key_algparm_chall_checkdigits_str
) : (- (__extension__ ({ const unsigned char *__s2 = (const unsigned
char *) (const char *) ("1"); int __result = (((const unsigned
char *) (const char *) (kp->key_algparm_chall_checkdigits_str
))[0] - __s2[0]); if (__s2_len > 0 && __result == 0
) { __result = (((const unsigned char *) (const char *) (kp->
key_algparm_chall_checkdigits_str))[1] - __s2[1]); if (__s2_len
> 1 && __result == 0) { __result = (((const unsigned
char *) (const char *) (kp->key_algparm_chall_checkdigits_str
))[2] - __s2[2]); if (__s2_len > 2 && __result == 0
) __result = (((const unsigned char *) (const char *) (kp->
key_algparm_chall_checkdigits_str))[3] - __s2[3]); } } __result
; })))) : __builtin_strcmp ("1", kp->key_algparm_chall_checkdigits_str
)))); })
==
302 0)
303 kp->key_algparm_chall_checkdigits = 1;
304 else if (strcmp ("true",__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p
("true") && __builtin_constant_p (kp->key_algparm_chall_checkdigits_str
) && (__s1_len = __builtin_strlen ("true"), __s2_len =
__builtin_strlen (kp->key_algparm_chall_checkdigits_str),
(!((size_t)(const void *)(("true") + 1) - (size_t)(const void
*)("true") == 1) || __s1_len >= 4) && (!((size_t)
(const void *)((kp->key_algparm_chall_checkdigits_str) + 1
) - (size_t)(const void *)(kp->key_algparm_chall_checkdigits_str
) == 1) || __s2_len >= 4)) ? __builtin_strcmp ("true", kp->
key_algparm_chall_checkdigits_str) : (__builtin_constant_p ("true"
) && ((size_t)(const void *)(("true") + 1) - (size_t)
(const void *)("true") == 1) && (__s1_len = __builtin_strlen
("true"), __s1_len < 4) ? (__builtin_constant_p (kp->key_algparm_chall_checkdigits_str
) && ((size_t)(const void *)((kp->key_algparm_chall_checkdigits_str
) + 1) - (size_t)(const void *)(kp->key_algparm_chall_checkdigits_str
) == 1) ? __builtin_strcmp ("true", kp->key_algparm_chall_checkdigits_str
) : (__extension__ ({ const unsigned char *__s2 = (const unsigned
char *) (const char *) (kp->key_algparm_chall_checkdigits_str
); int __result = (((const unsigned char *) (const char *) ("true"
))[0] - __s2[0]); if (__s1_len > 0 && __result == 0
) { __result = (((const unsigned char *) (const char *) ("true"
))[1] - __s2[1]); if (__s1_len > 1 && __result == 0
) { __result = (((const unsigned char *) (const char *) ("true"
))[2] - __s2[2]); if (__s1_len > 2 && __result == 0
) __result = (((const unsigned char *) (const char *) ("true"
))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p (
kp->key_algparm_chall_checkdigits_str) && ((size_t
)(const void *)((kp->key_algparm_chall_checkdigits_str) + 1
) - (size_t)(const void *)(kp->key_algparm_chall_checkdigits_str
) == 1) && (__s2_len = __builtin_strlen (kp->key_algparm_chall_checkdigits_str
), __s2_len < 4) ? (__builtin_constant_p ("true") &&
((size_t)(const void *)(("true") + 1) - (size_t)(const void *
)("true") == 1) ? __builtin_strcmp ("true", kp->key_algparm_chall_checkdigits_str
) : (- (__extension__ ({ const unsigned char *__s2 = (const unsigned
char *) (const char *) ("true"); int __result = (((const unsigned
char *) (const char *) (kp->key_algparm_chall_checkdigits_str
))[0] - __s2[0]); if (__s2_len > 0 && __result == 0
) { __result = (((const unsigned char *) (const char *) (kp->
key_algparm_chall_checkdigits_str))[1] - __s2[1]); if (__s2_len
> 1 && __result == 0) { __result = (((const unsigned
char *) (const char *) (kp->key_algparm_chall_checkdigits_str
))[2] - __s2[2]); if (__s2_len > 2 && __result == 0
) __result = (((const unsigned char *) (const char *) (kp->
key_algparm_chall_checkdigits_str))[3] - __s2[3]); } } __result
; })))) : __builtin_strcmp ("true", kp->key_algparm_chall_checkdigits_str
)))); })
305 kp->key_algparm_chall_checkdigits_str)__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p
("true") && __builtin_constant_p (kp->key_algparm_chall_checkdigits_str
) && (__s1_len = __builtin_strlen ("true"), __s2_len =
__builtin_strlen (kp->key_algparm_chall_checkdigits_str),
(!((size_t)(const void *)(("true") + 1) - (size_t)(const void
*)("true") == 1) || __s1_len >= 4) && (!((size_t)
(const void *)((kp->key_algparm_chall_checkdigits_str) + 1
) - (size_t)(const void *)(kp->key_algparm_chall_checkdigits_str
) == 1) || __s2_len >= 4)) ? __builtin_strcmp ("true", kp->
key_algparm_chall_checkdigits_str) : (__builtin_constant_p ("true"
) && ((size_t)(const void *)(("true") + 1) - (size_t)
(const void *)("true") == 1) && (__s1_len = __builtin_strlen
("true"), __s1_len < 4) ? (__builtin_constant_p (kp->key_algparm_chall_checkdigits_str
) && ((size_t)(const void *)((kp->key_algparm_chall_checkdigits_str
) + 1) - (size_t)(const void *)(kp->key_algparm_chall_checkdigits_str
) == 1) ? __builtin_strcmp ("true", kp->key_algparm_chall_checkdigits_str
) : (__extension__ ({ const unsigned char *__s2 = (const unsigned
char *) (const char *) (kp->key_algparm_chall_checkdigits_str
); int __result = (((const unsigned char *) (const char *) ("true"
))[0] - __s2[0]); if (__s1_len > 0 && __result == 0
) { __result = (((const unsigned char *) (const char *) ("true"
))[1] - __s2[1]); if (__s1_len > 1 && __result == 0
) { __result = (((const unsigned char *) (const char *) ("true"
))[2] - __s2[2]); if (__s1_len > 2 && __result == 0
) __result = (((const unsigned char *) (const char *) ("true"
))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p (
kp->key_algparm_chall_checkdigits_str) && ((size_t
)(const void *)((kp->key_algparm_chall_checkdigits_str) + 1
) - (size_t)(const void *)(kp->key_algparm_chall_checkdigits_str
) == 1) && (__s2_len = __builtin_strlen (kp->key_algparm_chall_checkdigits_str
), __s2_len < 4) ? (__builtin_constant_p ("true") &&
((size_t)(const void *)(("true") + 1) - (size_t)(const void *
)("true") == 1) ? __builtin_strcmp ("true", kp->key_algparm_chall_checkdigits_str
) : (- (__extension__ ({ const unsigned char *__s2 = (const unsigned
char *) (const char *) ("true"); int __result = (((const unsigned
char *) (const char *) (kp->key_algparm_chall_checkdigits_str
))[0] - __s2[0]); if (__s2_len > 0 && __result == 0
) { __result = (((const unsigned char *) (const char *) (kp->
key_algparm_chall_checkdigits_str))[1] - __s2[1]); if (__s2_len
> 1 && __result == 0) { __result = (((const unsigned
char *) (const char *) (kp->key_algparm_chall_checkdigits_str
))[2] - __s2[2]); if (__s2_len > 2 && __result == 0
) __result = (((const unsigned char *) (const char *) (kp->
key_algparm_chall_checkdigits_str))[3] - __s2[3]); } } __result
; })))) : __builtin_strcmp ("true", kp->key_algparm_chall_checkdigits_str
)))); })
==
306 0)
307 kp->key_algparm_chall_checkdigits = 1;
308 else
309 kp->key_algparm_chall_checkdigits = 0;
310 }
311 else
312 {
313 _pskc_debug ("unknown <%s> attribute <%s>",
314 name, attr_name);
315 *rc = PSKC_PARSE_ERROR;
316 }
317 }
318 }
319 else if (strcmp ("ResponseFormat", name)__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p
("ResponseFormat") && __builtin_constant_p (name) &&
(__s1_len = __builtin_strlen ("ResponseFormat"), __s2_len = __builtin_strlen
(name), (!((size_t)(const void *)(("ResponseFormat") + 1) - (
size_t)(const void *)("ResponseFormat") == 1) || __s1_len >=
4) && (!((size_t)(const void *)((name) + 1) - (size_t
)(const void *)(name) == 1) || __s2_len >= 4)) ? __builtin_strcmp
("ResponseFormat", name) : (__builtin_constant_p ("ResponseFormat"
) && ((size_t)(const void *)(("ResponseFormat") + 1) -
(size_t)(const void *)("ResponseFormat") == 1) && (__s1_len
= __builtin_strlen ("ResponseFormat"), __s1_len < 4) ? (__builtin_constant_p
(name) && ((size_t)(const void *)((name) + 1) - (size_t
)(const void *)(name) == 1) ? __builtin_strcmp ("ResponseFormat"
, name) : (__extension__ ({ const unsigned char *__s2 = (const
unsigned char *) (const char *) (name); int __result = (((const
unsigned char *) (const char *) ("ResponseFormat"))[0] - __s2
[0]); if (__s1_len > 0 && __result == 0) { __result
= (((const unsigned char *) (const char *) ("ResponseFormat"
))[1] - __s2[1]); if (__s1_len > 1 && __result == 0
) { __result = (((const unsigned char *) (const char *) ("ResponseFormat"
))[2] - __s2[2]); if (__s1_len > 2 && __result == 0
) __result = (((const unsigned char *) (const char *) ("ResponseFormat"
))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p (
name) && ((size_t)(const void *)((name) + 1) - (size_t
)(const void *)(name) == 1) && (__s2_len = __builtin_strlen
(name), __s2_len < 4) ? (__builtin_constant_p ("ResponseFormat"
) && ((size_t)(const void *)(("ResponseFormat") + 1) -
(size_t)(const void *)("ResponseFormat") == 1) ? __builtin_strcmp
("ResponseFormat", name) : (- (__extension__ ({ const unsigned
char *__s2 = (const unsigned char *) (const char *) ("ResponseFormat"
); int __result = (((const unsigned char *) (const char *) (name
))[0] - __s2[0]); if (__s2_len > 0 && __result == 0
) { __result = (((const unsigned char *) (const char *) (name
))[1] - __s2[1]); if (__s2_len > 1 && __result == 0
) { __result = (((const unsigned char *) (const char *) (name
))[2] - __s2[2]); if (__s2_len > 2 && __result == 0
) __result = (((const unsigned char *) (const char *) (name))
[3] - __s2[3]); } } __result; })))) : __builtin_strcmp ("ResponseFormat"
, name)))); })
== 0)
320 {
321 xmlAttr *cur_attr = NULL((void*)0);
322
323 for (cur_attr = cur_node->properties; cur_attr;
324 cur_attr = cur_attr->next)
325 {
326 const char *attr_name = (const char *) cur_attr->name;
327 const char *attr_content =
328 (const char *) cur_attr->children->content;
329
330 if (strcmp ("Encoding", attr_name)__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p
("Encoding") && __builtin_constant_p (attr_name) &&
(__s1_len = __builtin_strlen ("Encoding"), __s2_len = __builtin_strlen
(attr_name), (!((size_t)(const void *)(("Encoding") + 1) - (
size_t)(const void *)("Encoding") == 1) || __s1_len >= 4) &&
(!((size_t)(const void *)((attr_name) + 1) - (size_t)(const void
*)(attr_name) == 1) || __s2_len >= 4)) ? __builtin_strcmp
("Encoding", attr_name) : (__builtin_constant_p ("Encoding")
&& ((size_t)(const void *)(("Encoding") + 1) - (size_t
)(const void *)("Encoding") == 1) && (__s1_len = __builtin_strlen
("Encoding"), __s1_len < 4) ? (__builtin_constant_p (attr_name
) && ((size_t)(const void *)((attr_name) + 1) - (size_t
)(const void *)(attr_name) == 1) ? __builtin_strcmp ("Encoding"
, attr_name) : (__extension__ ({ const unsigned char *__s2 = (
const unsigned char *) (const char *) (attr_name); int __result
= (((const unsigned char *) (const char *) ("Encoding"))[0] -
__s2[0]); if (__s1_len > 0 && __result == 0) { __result
= (((const unsigned char *) (const char *) ("Encoding"))[1] -
__s2[1]); if (__s1_len > 1 && __result == 0) { __result
= (((const unsigned char *) (const char *) ("Encoding"))[2] -
__s2[2]); if (__s1_len > 2 && __result == 0) __result
= (((const unsigned char *) (const char *) ("Encoding"))[3] -
__s2[3]); } } __result; }))) : (__builtin_constant_p (attr_name
) && ((size_t)(const void *)((attr_name) + 1) - (size_t
)(const void *)(attr_name) == 1) && (__s2_len = __builtin_strlen
(attr_name), __s2_len < 4) ? (__builtin_constant_p ("Encoding"
) && ((size_t)(const void *)(("Encoding") + 1) - (size_t
)(const void *)("Encoding") == 1) ? __builtin_strcmp ("Encoding"
, attr_name) : (- (__extension__ ({ const unsigned char *__s2
= (const unsigned char *) (const char *) ("Encoding"); int __result
= (((const unsigned char *) (const char *) (attr_name))[0] -
__s2[0]); if (__s2_len > 0 && __result == 0) { __result
= (((const unsigned char *) (const char *) (attr_name))[1] -
__s2[1]); if (__s2_len > 1 && __result == 0) { __result
= (((const unsigned char *) (const char *) (attr_name))[2] -
__s2[2]); if (__s2_len > 2 && __result == 0) __result
= (((const unsigned char *) (const char *) (attr_name))[3] -
__s2[3]); } } __result; })))) : __builtin_strcmp ("Encoding"
, attr_name)))); })
== 0)
331 {
332 kp->key_algparm_resp_encoding_str = attr_content;
333 kp->key_algparm_resp_encoding =
334 pskc_str2valueformat (kp->key_algparm_resp_encoding_str);
335 }
336 else if (strcmp ("Length", attr_name)__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p
("Length") && __builtin_constant_p (attr_name) &&
(__s1_len = __builtin_strlen ("Length"), __s2_len = __builtin_strlen
(attr_name), (!((size_t)(const void *)(("Length") + 1) - (size_t
)(const void *)("Length") == 1) || __s1_len >= 4) &&
(!((size_t)(const void *)((attr_name) + 1) - (size_t)(const void
*)(attr_name) == 1) || __s2_len >= 4)) ? __builtin_strcmp
("Length", attr_name) : (__builtin_constant_p ("Length") &&
((size_t)(const void *)(("Length") + 1) - (size_t)(const void
*)("Length") == 1) && (__s1_len = __builtin_strlen (
"Length"), __s1_len < 4) ? (__builtin_constant_p (attr_name
) && ((size_t)(const void *)((attr_name) + 1) - (size_t
)(const void *)(attr_name) == 1) ? __builtin_strcmp ("Length"
, attr_name) : (__extension__ ({ const unsigned char *__s2 = (
const unsigned char *) (const char *) (attr_name); int __result
= (((const unsigned char *) (const char *) ("Length"))[0] - __s2
[0]); if (__s1_len > 0 && __result == 0) { __result
= (((const unsigned char *) (const char *) ("Length"))[1] - __s2
[1]); if (__s1_len > 1 && __result == 0) { __result
= (((const unsigned char *) (const char *) ("Length"))[2] - __s2
[2]); if (__s1_len > 2 && __result == 0) __result =
(((const unsigned char *) (const char *) ("Length"))[3] - __s2
[3]); } } __result; }))) : (__builtin_constant_p (attr_name) &&
((size_t)(const void *)((attr_name) + 1) - (size_t)(const void
*)(attr_name) == 1) && (__s2_len = __builtin_strlen (
attr_name), __s2_len < 4) ? (__builtin_constant_p ("Length"
) && ((size_t)(const void *)(("Length") + 1) - (size_t
)(const void *)("Length") == 1) ? __builtin_strcmp ("Length",
attr_name) : (- (__extension__ ({ const unsigned char *__s2 =
(const unsigned char *) (const char *) ("Length"); int __result
= (((const unsigned char *) (const char *) (attr_name))[0] -
__s2[0]); if (__s2_len > 0 && __result == 0) { __result
= (((const unsigned char *) (const char *) (attr_name))[1] -
__s2[1]); if (__s2_len > 1 && __result == 0) { __result
= (((const unsigned char *) (const char *) (attr_name))[2] -
__s2[2]); if (__s2_len > 2 && __result == 0) __result
= (((const unsigned char *) (const char *) (attr_name))[3] -
__s2[3]); } } __result; })))) : __builtin_strcmp ("Length", attr_name
)))); })
== 0)
337 {
338 kp->key_algparm_resp_length_str = attr_content;
339 kp->key_algparm_resp_length =
340 strtoul (kp->key_algparm_resp_length_str, NULL((void*)0), 10);
341 }
342 else if (strcmp ("CheckDigits", attr_name)__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p
("CheckDigits") && __builtin_constant_p (attr_name) &&
(__s1_len = __builtin_strlen ("CheckDigits"), __s2_len = __builtin_strlen
(attr_name), (!((size_t)(const void *)(("CheckDigits") + 1) -
(size_t)(const void *)("CheckDigits") == 1) || __s1_len >=
4) && (!((size_t)(const void *)((attr_name) + 1) - (
size_t)(const void *)(attr_name) == 1) || __s2_len >= 4)) ?
__builtin_strcmp ("CheckDigits", attr_name) : (__builtin_constant_p
("CheckDigits") && ((size_t)(const void *)(("CheckDigits"
) + 1) - (size_t)(const void *)("CheckDigits") == 1) &&
(__s1_len = __builtin_strlen ("CheckDigits"), __s1_len < 4
) ? (__builtin_constant_p (attr_name) && ((size_t)(const
void *)((attr_name) + 1) - (size_t)(const void *)(attr_name)
== 1) ? __builtin_strcmp ("CheckDigits", attr_name) : (__extension__
({ const unsigned char *__s2 = (const unsigned char *) (const
char *) (attr_name); int __result = (((const unsigned char *
) (const char *) ("CheckDigits"))[0] - __s2[0]); if (__s1_len
> 0 && __result == 0) { __result = (((const unsigned
char *) (const char *) ("CheckDigits"))[1] - __s2[1]); if (__s1_len
> 1 && __result == 0) { __result = (((const unsigned
char *) (const char *) ("CheckDigits"))[2] - __s2[2]); if (__s1_len
> 2 && __result == 0) __result = (((const unsigned
char *) (const char *) ("CheckDigits"))[3] - __s2[3]); } } __result
; }))) : (__builtin_constant_p (attr_name) && ((size_t
)(const void *)((attr_name) + 1) - (size_t)(const void *)(attr_name
) == 1) && (__s2_len = __builtin_strlen (attr_name), __s2_len
< 4) ? (__builtin_constant_p ("CheckDigits") && (
(size_t)(const void *)(("CheckDigits") + 1) - (size_t)(const void
*)("CheckDigits") == 1) ? __builtin_strcmp ("CheckDigits", attr_name
) : (- (__extension__ ({ const unsigned char *__s2 = (const unsigned
char *) (const char *) ("CheckDigits"); int __result = (((const
unsigned char *) (const char *) (attr_name))[0] - __s2[0]); if
(__s2_len > 0 && __result == 0) { __result = (((const
unsigned char *) (const char *) (attr_name))[1] - __s2[1]); if
(__s2_len > 1 && __result == 0) { __result = (((const
unsigned char *) (const char *) (attr_name))[2] - __s2[2]); if
(__s2_len > 2 && __result == 0) __result = (((const
unsigned char *) (const char *) (attr_name))[3] - __s2[3]); }
} __result; })))) : __builtin_strcmp ("CheckDigits", attr_name
)))); })
== 0)
343 {
344 kp->key_algparm_resp_checkdigits_str = attr_content;
345 if (strcmp ("1", kp->key_algparm_resp_checkdigits_str)__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p
("1") && __builtin_constant_p (kp->key_algparm_resp_checkdigits_str
) && (__s1_len = __builtin_strlen ("1"), __s2_len = __builtin_strlen
(kp->key_algparm_resp_checkdigits_str), (!((size_t)(const
void *)(("1") + 1) - (size_t)(const void *)("1") == 1) || __s1_len
>= 4) && (!((size_t)(const void *)((kp->key_algparm_resp_checkdigits_str
) + 1) - (size_t)(const void *)(kp->key_algparm_resp_checkdigits_str
) == 1) || __s2_len >= 4)) ? __builtin_strcmp ("1", kp->
key_algparm_resp_checkdigits_str) : (__builtin_constant_p ("1"
) && ((size_t)(const void *)(("1") + 1) - (size_t)(const
void *)("1") == 1) && (__s1_len = __builtin_strlen (
"1"), __s1_len < 4) ? (__builtin_constant_p (kp->key_algparm_resp_checkdigits_str
) && ((size_t)(const void *)((kp->key_algparm_resp_checkdigits_str
) + 1) - (size_t)(const void *)(kp->key_algparm_resp_checkdigits_str
) == 1) ? __builtin_strcmp ("1", kp->key_algparm_resp_checkdigits_str
) : (__extension__ ({ const unsigned char *__s2 = (const unsigned
char *) (const char *) (kp->key_algparm_resp_checkdigits_str
); int __result = (((const unsigned char *) (const char *) ("1"
))[0] - __s2[0]); if (__s1_len > 0 && __result == 0
) { __result = (((const unsigned char *) (const char *) ("1")
)[1] - __s2[1]); if (__s1_len > 1 && __result == 0
) { __result = (((const unsigned char *) (const char *) ("1")
)[2] - __s2[2]); if (__s1_len > 2 && __result == 0
) __result = (((const unsigned char *) (const char *) ("1"))[
3] - __s2[3]); } } __result; }))) : (__builtin_constant_p (kp
->key_algparm_resp_checkdigits_str) && ((size_t)(const
void *)((kp->key_algparm_resp_checkdigits_str) + 1) - (size_t
)(const void *)(kp->key_algparm_resp_checkdigits_str) == 1
) && (__s2_len = __builtin_strlen (kp->key_algparm_resp_checkdigits_str
), __s2_len < 4) ? (__builtin_constant_p ("1") && (
(size_t)(const void *)(("1") + 1) - (size_t)(const void *)("1"
) == 1) ? __builtin_strcmp ("1", kp->key_algparm_resp_checkdigits_str
) : (- (__extension__ ({ const unsigned char *__s2 = (const unsigned
char *) (const char *) ("1"); int __result = (((const unsigned
char *) (const char *) (kp->key_algparm_resp_checkdigits_str
))[0] - __s2[0]); if (__s2_len > 0 && __result == 0
) { __result = (((const unsigned char *) (const char *) (kp->
key_algparm_resp_checkdigits_str))[1] - __s2[1]); if (__s2_len
> 1 && __result == 0) { __result = (((const unsigned
char *) (const char *) (kp->key_algparm_resp_checkdigits_str
))[2] - __s2[2]); if (__s2_len > 2 && __result == 0
) __result = (((const unsigned char *) (const char *) (kp->
key_algparm_resp_checkdigits_str))[3] - __s2[3]); } } __result
; })))) : __builtin_strcmp ("1", kp->key_algparm_resp_checkdigits_str
)))); })
== 0)
346 kp->key_algparm_resp_checkdigits = 1;
347 else if (strcmp ("true",__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p
("true") && __builtin_constant_p (kp->key_algparm_resp_checkdigits_str
) && (__s1_len = __builtin_strlen ("true"), __s2_len =
__builtin_strlen (kp->key_algparm_resp_checkdigits_str), (
!((size_t)(const void *)(("true") + 1) - (size_t)(const void *
)("true") == 1) || __s1_len >= 4) && (!((size_t)(const
void *)((kp->key_algparm_resp_checkdigits_str) + 1) - (size_t
)(const void *)(kp->key_algparm_resp_checkdigits_str) == 1
) || __s2_len >= 4)) ? __builtin_strcmp ("true", kp->key_algparm_resp_checkdigits_str
) : (__builtin_constant_p ("true") && ((size_t)(const
void *)(("true") + 1) - (size_t)(const void *)("true") == 1)
&& (__s1_len = __builtin_strlen ("true"), __s1_len <
4) ? (__builtin_constant_p (kp->key_algparm_resp_checkdigits_str
) && ((size_t)(const void *)((kp->key_algparm_resp_checkdigits_str
) + 1) - (size_t)(const void *)(kp->key_algparm_resp_checkdigits_str
) == 1) ? __builtin_strcmp ("true", kp->key_algparm_resp_checkdigits_str
) : (__extension__ ({ const unsigned char *__s2 = (const unsigned
char *) (const char *) (kp->key_algparm_resp_checkdigits_str
); int __result = (((const unsigned char *) (const char *) ("true"
))[0] - __s2[0]); if (__s1_len > 0 && __result == 0
) { __result = (((const unsigned char *) (const char *) ("true"
))[1] - __s2[1]); if (__s1_len > 1 && __result == 0
) { __result = (((const unsigned char *) (const char *) ("true"
))[2] - __s2[2]); if (__s1_len > 2 && __result == 0
) __result = (((const unsigned char *) (const char *) ("true"
))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p (
kp->key_algparm_resp_checkdigits_str) && ((size_t)
(const void *)((kp->key_algparm_resp_checkdigits_str) + 1)
- (size_t)(const void *)(kp->key_algparm_resp_checkdigits_str
) == 1) && (__s2_len = __builtin_strlen (kp->key_algparm_resp_checkdigits_str
), __s2_len < 4) ? (__builtin_constant_p ("true") &&
((size_t)(const void *)(("true") + 1) - (size_t)(const void *
)("true") == 1) ? __builtin_strcmp ("true", kp->key_algparm_resp_checkdigits_str
) : (- (__extension__ ({ const unsigned char *__s2 = (const unsigned
char *) (const char *) ("true"); int __result = (((const unsigned
char *) (const char *) (kp->key_algparm_resp_checkdigits_str
))[0] - __s2[0]); if (__s2_len > 0 && __result == 0
) { __result = (((const unsigned char *) (const char *) (kp->
key_algparm_resp_checkdigits_str))[1] - __s2[1]); if (__s2_len
> 1 && __result == 0) { __result = (((const unsigned
char *) (const char *) (kp->key_algparm_resp_checkdigits_str
))[2] - __s2[2]); if (__s2_len > 2 && __result == 0
) __result = (((const unsigned char *) (const char *) (kp->
key_algparm_resp_checkdigits_str))[3] - __s2[3]); } } __result
; })))) : __builtin_strcmp ("true", kp->key_algparm_resp_checkdigits_str
)))); })
348 kp->key_algparm_resp_checkdigits_str)__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p
("true") && __builtin_constant_p (kp->key_algparm_resp_checkdigits_str
) && (__s1_len = __builtin_strlen ("true"), __s2_len =
__builtin_strlen (kp->key_algparm_resp_checkdigits_str), (
!((size_t)(const void *)(("true") + 1) - (size_t)(const void *
)("true") == 1) || __s1_len >= 4) && (!((size_t)(const
void *)((kp->key_algparm_resp_checkdigits_str) + 1) - (size_t
)(const void *)(kp->key_algparm_resp_checkdigits_str) == 1
) || __s2_len >= 4)) ? __builtin_strcmp ("true", kp->key_algparm_resp_checkdigits_str
) : (__builtin_constant_p ("true") && ((size_t)(const
void *)(("true") + 1) - (size_t)(const void *)("true") == 1)
&& (__s1_len = __builtin_strlen ("true"), __s1_len <
4) ? (__builtin_constant_p (kp->key_algparm_resp_checkdigits_str
) && ((size_t)(const void *)((kp->key_algparm_resp_checkdigits_str
) + 1) - (size_t)(const void *)(kp->key_algparm_resp_checkdigits_str
) == 1) ? __builtin_strcmp ("true", kp->key_algparm_resp_checkdigits_str
) : (__extension__ ({ const unsigned char *__s2 = (const unsigned
char *) (const char *) (kp->key_algparm_resp_checkdigits_str
); int __result = (((const unsigned char *) (const char *) ("true"
))[0] - __s2[0]); if (__s1_len > 0 && __result == 0
) { __result = (((const unsigned char *) (const char *) ("true"
))[1] - __s2[1]); if (__s1_len > 1 && __result == 0
) { __result = (((const unsigned char *) (const char *) ("true"
))[2] - __s2[2]); if (__s1_len > 2 && __result == 0
) __result = (((const unsigned char *) (const char *) ("true"
))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p (
kp->key_algparm_resp_checkdigits_str) && ((size_t)
(const void *)((kp->key_algparm_resp_checkdigits_str) + 1)
- (size_t)(const void *)(kp->key_algparm_resp_checkdigits_str
) == 1) && (__s2_len = __builtin_strlen (kp->key_algparm_resp_checkdigits_str
), __s2_len < 4) ? (__builtin_constant_p ("true") &&
((size_t)(const void *)(("true") + 1) - (size_t)(const void *
)("true") == 1) ? __builtin_strcmp ("true", kp->key_algparm_resp_checkdigits_str
) : (- (__extension__ ({ const unsigned char *__s2 = (const unsigned
char *) (const char *) ("true"); int __result = (((const unsigned
char *) (const char *) (kp->key_algparm_resp_checkdigits_str
))[0] - __s2[0]); if (__s2_len > 0 && __result == 0
) { __result = (((const unsigned char *) (const char *) (kp->
key_algparm_resp_checkdigits_str))[1] - __s2[1]); if (__s2_len
> 1 && __result == 0) { __result = (((const unsigned
char *) (const char *) (kp->key_algparm_resp_checkdigits_str
))[2] - __s2[2]); if (__s2_len > 2 && __result == 0
) __result = (((const unsigned char *) (const char *) (kp->
key_algparm_resp_checkdigits_str))[3] - __s2[3]); } } __result
; })))) : __builtin_strcmp ("true", kp->key_algparm_resp_checkdigits_str
)))); })
== 0)
349 kp->key_algparm_resp_checkdigits = 1;
350 else
351 kp->key_algparm_resp_checkdigits = 0;
352 }
353 else
354 {
355 _pskc_debug ("unknown <%s> attribute <%s>",
356 name, attr_name);
357 *rc = PSKC_PARSE_ERROR;
358 }
359 }
360 }
361 else
362 {
363 _pskc_debug ("unknown <%s> element <%s>", x->parent->name, name);
364 *rc = PSKC_PARSE_ERROR;
365 }
366 }
367}
368
369static void
370parse_policy (xmlNode * x, struct pskc_key *kp, int *rc)
371{
372 xmlNode *cur_node = NULL((void*)0);
373
374 for (cur_node = x; cur_node; cur_node = cur_node->next)
375 {
376 const char *name = (const char *) cur_node->name;
377 const char *content = (const char *)
378 (cur_node->children ? cur_node->children->content : NULL((void*)0));
379
380 if (cur_node->type != XML_ELEMENT_NODE)
381 continue;
382
383 if (strcmp ("StartDate", name)__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p
("StartDate") && __builtin_constant_p (name) &&
(__s1_len = __builtin_strlen ("StartDate"), __s2_len = __builtin_strlen
(name), (!((size_t)(const void *)(("StartDate") + 1) - (size_t
)(const void *)("StartDate") == 1) || __s1_len >= 4) &&
(!((size_t)(const void *)((name) + 1) - (size_t)(const void *
)(name) == 1) || __s2_len >= 4)) ? __builtin_strcmp ("StartDate"
, name) : (__builtin_constant_p ("StartDate") && ((size_t
)(const void *)(("StartDate") + 1) - (size_t)(const void *)("StartDate"
) == 1) && (__s1_len = __builtin_strlen ("StartDate")
, __s1_len < 4) ? (__builtin_constant_p (name) && (
(size_t)(const void *)((name) + 1) - (size_t)(const void *)(name
) == 1) ? __builtin_strcmp ("StartDate", name) : (__extension__
({ const unsigned char *__s2 = (const unsigned char *) (const
char *) (name); int __result = (((const unsigned char *) (const
char *) ("StartDate"))[0] - __s2[0]); if (__s1_len > 0 &&
__result == 0) { __result = (((const unsigned char *) (const
char *) ("StartDate"))[1] - __s2[1]); if (__s1_len > 1 &&
__result == 0) { __result = (((const unsigned char *) (const
char *) ("StartDate"))[2] - __s2[2]); if (__s1_len > 2 &&
__result == 0) __result = (((const unsigned char *) (const char
*) ("StartDate"))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p
(name) && ((size_t)(const void *)((name) + 1) - (size_t
)(const void *)(name) == 1) && (__s2_len = __builtin_strlen
(name), __s2_len < 4) ? (__builtin_constant_p ("StartDate"
) && ((size_t)(const void *)(("StartDate") + 1) - (size_t
)(const void *)("StartDate") == 1) ? __builtin_strcmp ("StartDate"
, name) : (- (__extension__ ({ const unsigned char *__s2 = (const
unsigned char *) (const char *) ("StartDate"); int __result =
(((const unsigned char *) (const char *) (name))[0] - __s2[0
]); if (__s2_len > 0 && __result == 0) { __result =
(((const unsigned char *) (const char *) (name))[1] - __s2[1
]); if (__s2_len > 1 && __result == 0) { __result =
(((const unsigned char *) (const char *) (name))[2] - __s2[2
]); if (__s2_len > 2 && __result == 0) __result = (
((const unsigned char *) (const char *) (name))[3] - __s2[3])
; } } __result; })))) : __builtin_strcmp ("StartDate", name))
)); })
== 0)
384 {
385 const char *p;
386 kp->key_policy_startdate_str = content;
387 memset (&kp->key_policy_startdate, 0, sizeof (struct tm));
388 p = strptime (kp->key_policy_startdate_str,
389 "%Y-%m-%dT%H:%M:%SZ", &kp->key_policy_startdate);
390 if (p == NULL((void*)0) || *p != '\0')
391 {
392 _pskc_debug ("cannot convert time string '%s'",
393 kp->key_policy_startdate_str);
394 *rc = PSKC_PARSE_ERROR;
395 }
396 }
397 else if (strcmp ("ExpiryDate", name)__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p
("ExpiryDate") && __builtin_constant_p (name) &&
(__s1_len = __builtin_strlen ("ExpiryDate"), __s2_len = __builtin_strlen
(name), (!((size_t)(const void *)(("ExpiryDate") + 1) - (size_t
)(const void *)("ExpiryDate") == 1) || __s1_len >= 4) &&
(!((size_t)(const void *)((name) + 1) - (size_t)(const void *
)(name) == 1) || __s2_len >= 4)) ? __builtin_strcmp ("ExpiryDate"
, name) : (__builtin_constant_p ("ExpiryDate") && ((size_t
)(const void *)(("ExpiryDate") + 1) - (size_t)(const void *)(
"ExpiryDate") == 1) && (__s1_len = __builtin_strlen (
"ExpiryDate"), __s1_len < 4) ? (__builtin_constant_p (name
) && ((size_t)(const void *)((name) + 1) - (size_t)(const
void *)(name) == 1) ? __builtin_strcmp ("ExpiryDate", name) :
(__extension__ ({ const unsigned char *__s2 = (const unsigned
char *) (const char *) (name); int __result = (((const unsigned
char *) (const char *) ("ExpiryDate"))[0] - __s2[0]); if (__s1_len
> 0 && __result == 0) { __result = (((const unsigned
char *) (const char *) ("ExpiryDate"))[1] - __s2[1]); if (__s1_len
> 1 && __result == 0) { __result = (((const unsigned
char *) (const char *) ("ExpiryDate"))[2] - __s2[2]); if (__s1_len
> 2 && __result == 0) __result = (((const unsigned
char *) (const char *) ("ExpiryDate"))[3] - __s2[3]); } } __result
; }))) : (__builtin_constant_p (name) && ((size_t)(const
void *)((name) + 1) - (size_t)(const void *)(name) == 1) &&
(__s2_len = __builtin_strlen (name), __s2_len < 4) ? (__builtin_constant_p
("ExpiryDate") && ((size_t)(const void *)(("ExpiryDate"
) + 1) - (size_t)(const void *)("ExpiryDate") == 1) ? __builtin_strcmp
("ExpiryDate", name) : (- (__extension__ ({ const unsigned char
*__s2 = (const unsigned char *) (const char *) ("ExpiryDate"
); int __result = (((const unsigned char *) (const char *) (name
))[0] - __s2[0]); if (__s2_len > 0 && __result == 0
) { __result = (((const unsigned char *) (const char *) (name
))[1] - __s2[1]); if (__s2_len > 1 && __result == 0
) { __result = (((const unsigned char *) (const char *) (name
))[2] - __s2[2]); if (__s2_len > 2 && __result == 0
) __result = (((const unsigned char *) (const char *) (name))
[3] - __s2[3]); } } __result; })))) : __builtin_strcmp ("ExpiryDate"
, name)))); })
== 0)
398 {
399 const char *p;
400 kp->key_policy_expirydate_str = content;
401 memset (&kp->key_policy_expirydate, 0, sizeof (struct tm));
402 p = strptime (kp->key_policy_expirydate_str,
403 "%Y-%m-%dT%H:%M:%SZ", &kp->key_policy_expirydate);
404 if (p == NULL((void*)0) || *p != '\0')
405 {
406 _pskc_debug ("cannot convert time string '%s'",
407 kp->key_policy_startdate_str);
408 *rc = PSKC_PARSE_ERROR;
409 }
410 }
411 else if (strcmp ("PINPolicy", name)__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p
("PINPolicy") && __builtin_constant_p (name) &&
(__s1_len = __builtin_strlen ("PINPolicy"), __s2_len = __builtin_strlen
(name), (!((size_t)(const void *)(("PINPolicy") + 1) - (size_t
)(const void *)("PINPolicy") == 1) || __s1_len >= 4) &&
(!((size_t)(const void *)((name) + 1) - (size_t)(const void *
)(name) == 1) || __s2_len >= 4)) ? __builtin_strcmp ("PINPolicy"
, name) : (__builtin_constant_p ("PINPolicy") && ((size_t
)(const void *)(("PINPolicy") + 1) - (size_t)(const void *)("PINPolicy"
) == 1) && (__s1_len = __builtin_strlen ("PINPolicy")
, __s1_len < 4) ? (__builtin_constant_p (name) && (
(size_t)(const void *)((name) + 1) - (size_t)(const void *)(name
) == 1) ? __builtin_strcmp ("PINPolicy", name) : (__extension__
({ const unsigned char *__s2 = (const unsigned char *) (const
char *) (name); int __result = (((const unsigned char *) (const
char *) ("PINPolicy"))[0] - __s2[0]); if (__s1_len > 0 &&
__result == 0) { __result = (((const unsigned char *) (const
char *) ("PINPolicy"))[1] - __s2[1]); if (__s1_len > 1 &&
__result == 0) { __result = (((const unsigned char *) (const
char *) ("PINPolicy"))[2] - __s2[2]); if (__s1_len > 2 &&
__result == 0) __result = (((const unsigned char *) (const char
*) ("PINPolicy"))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p
(name) && ((size_t)(const void *)((name) + 1) - (size_t
)(const void *)(name) == 1) && (__s2_len = __builtin_strlen
(name), __s2_len < 4) ? (__builtin_constant_p ("PINPolicy"
) && ((size_t)(const void *)(("PINPolicy") + 1) - (size_t
)(const void *)("PINPolicy") == 1) ? __builtin_strcmp ("PINPolicy"
, name) : (- (__extension__ ({ const unsigned char *__s2 = (const
unsigned char *) (const char *) ("PINPolicy"); int __result =
(((const unsigned char *) (const char *) (name))[0] - __s2[0
]); if (__s2_len > 0 && __result == 0) { __result =
(((const unsigned char *) (const char *) (name))[1] - __s2[1
]); if (__s2_len > 1 && __result == 0) { __result =
(((const unsigned char *) (const char *) (name))[2] - __s2[2
]); if (__s2_len > 2 && __result == 0) __result = (
((const unsigned char *) (const char *) (name))[3] - __s2[3])
; } } __result; })))) : __builtin_strcmp ("PINPolicy", name))
)); })
== 0)
412 {
413 xmlAttr *cur_attr = NULL((void*)0);
414
415 for (cur_attr = cur_node->properties; cur_attr;
416 cur_attr = cur_attr->next)
417 {
418 const char *attr_name = (const char *) cur_attr->name;
419 const char *attr_content =
420 (const char *) cur_attr->children->content;
421
422 if (strcmp ("PINKeyId", attr_name)__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p
("PINKeyId") && __builtin_constant_p (attr_name) &&
(__s1_len = __builtin_strlen ("PINKeyId"), __s2_len = __builtin_strlen
(attr_name), (!((size_t)(const void *)(("PINKeyId") + 1) - (
size_t)(const void *)("PINKeyId") == 1) || __s1_len >= 4) &&
(!((size_t)(const void *)((attr_name) + 1) - (size_t)(const void
*)(attr_name) == 1) || __s2_len >= 4)) ? __builtin_strcmp
("PINKeyId", attr_name) : (__builtin_constant_p ("PINKeyId")
&& ((size_t)(const void *)(("PINKeyId") + 1) - (size_t
)(const void *)("PINKeyId") == 1) && (__s1_len = __builtin_strlen
("PINKeyId"), __s1_len < 4) ? (__builtin_constant_p (attr_name
) && ((size_t)(const void *)((attr_name) + 1) - (size_t
)(const void *)(attr_name) == 1) ? __builtin_strcmp ("PINKeyId"
, attr_name) : (__extension__ ({ const unsigned char *__s2 = (
const unsigned char *) (const char *) (attr_name); int __result
= (((const unsigned char *) (const char *) ("PINKeyId"))[0] -
__s2[0]); if (__s1_len > 0 && __result == 0) { __result
= (((const unsigned char *) (const char *) ("PINKeyId"))[1] -
__s2[1]); if (__s1_len > 1 && __result == 0) { __result
= (((const unsigned char *) (const char *) ("PINKeyId"))[2] -
__s2[2]); if (__s1_len > 2 && __result == 0) __result
= (((const unsigned char *) (const char *) ("PINKeyId"))[3] -
__s2[3]); } } __result; }))) : (__builtin_constant_p (attr_name
) && ((size_t)(const void *)((attr_name) + 1) - (size_t
)(const void *)(attr_name) == 1) && (__s2_len = __builtin_strlen
(attr_name), __s2_len < 4) ? (__builtin_constant_p ("PINKeyId"
) && ((size_t)(const void *)(("PINKeyId") + 1) - (size_t
)(const void *)("PINKeyId") == 1) ? __builtin_strcmp ("PINKeyId"
, attr_name) : (- (__extension__ ({ const unsigned char *__s2
= (const unsigned char *) (const char *) ("PINKeyId"); int __result
= (((const unsigned char *) (const char *) (attr_name))[0] -
__s2[0]); if (__s2_len > 0 && __result == 0) { __result
= (((const unsigned char *) (const char *) (attr_name))[1] -
__s2[1]); if (__s2_len > 1 && __result == 0) { __result
= (((const unsigned char *) (const char *) (attr_name))[2] -
__s2[2]); if (__s2_len > 2 && __result == 0) __result
= (((const unsigned char *) (const char *) (attr_name))[3] -
__s2[3]); } } __result; })))) : __builtin_strcmp ("PINKeyId"
, attr_name)))); })
== 0)
423 kp->key_policy_pinkeyid = attr_content;
424 else if (strcmp ("PINUsageMode", attr_name)__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p
("PINUsageMode") && __builtin_constant_p (attr_name)
&& (__s1_len = __builtin_strlen ("PINUsageMode"), __s2_len
= __builtin_strlen (attr_name), (!((size_t)(const void *)(("PINUsageMode"
) + 1) - (size_t)(const void *)("PINUsageMode") == 1) || __s1_len
>= 4) && (!((size_t)(const void *)((attr_name) + 1
) - (size_t)(const void *)(attr_name) == 1) || __s2_len >=
4)) ? __builtin_strcmp ("PINUsageMode", attr_name) : (__builtin_constant_p
("PINUsageMode") && ((size_t)(const void *)(("PINUsageMode"
) + 1) - (size_t)(const void *)("PINUsageMode") == 1) &&
(__s1_len = __builtin_strlen ("PINUsageMode"), __s1_len <
4) ? (__builtin_constant_p (attr_name) && ((size_t)(
const void *)((attr_name) + 1) - (size_t)(const void *)(attr_name
) == 1) ? __builtin_strcmp ("PINUsageMode", attr_name) : (__extension__
({ const unsigned char *__s2 = (const unsigned char *) (const
char *) (attr_name); int __result = (((const unsigned char *
) (const char *) ("PINUsageMode"))[0] - __s2[0]); if (__s1_len
> 0 && __result == 0) { __result = (((const unsigned
char *) (const char *) ("PINUsageMode"))[1] - __s2[1]); if (
__s1_len > 1 && __result == 0) { __result = (((const
unsigned char *) (const char *) ("PINUsageMode"))[2] - __s2[
2]); if (__s1_len > 2 && __result == 0) __result =
(((const unsigned char *) (const char *) ("PINUsageMode"))[3
] - __s2[3]); } } __result; }))) : (__builtin_constant_p (attr_name
) && ((size_t)(const void *)((attr_name) + 1) - (size_t
)(const void *)(attr_name) == 1) && (__s2_len = __builtin_strlen
(attr_name), __s2_len < 4) ? (__builtin_constant_p ("PINUsageMode"
) && ((size_t)(const void *)(("PINUsageMode") + 1) - (
size_t)(const void *)("PINUsageMode") == 1) ? __builtin_strcmp
("PINUsageMode", attr_name) : (- (__extension__ ({ const unsigned
char *__s2 = (const unsigned char *) (const char *) ("PINUsageMode"
); int __result = (((const unsigned char *) (const char *) (attr_name
))[0] - __s2[0]); if (__s2_len > 0 && __result == 0
) { __result = (((const unsigned char *) (const char *) (attr_name
))[1] - __s2[1]); if (__s2_len > 1 && __result == 0
) { __result = (((const unsigned char *) (const char *) (attr_name
))[2] - __s2[2]); if (__s2_len > 2 && __result == 0
) __result = (((const unsigned char *) (const char *) (attr_name
))[3] - __s2[3]); } } __result; })))) : __builtin_strcmp ("PINUsageMode"
, attr_name)))); })
== 0)
425 {
426 kp->key_policy_pinusagemode_str = attr_content;
427 kp->key_policy_pinusagemode =
428 pskc_str2pinusagemode (kp->key_policy_pinusagemode_str);
429 }
430 else if (strcmp ("MaxFailedAttempts", attr_name)__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p
("MaxFailedAttempts") && __builtin_constant_p (attr_name
) && (__s1_len = __builtin_strlen ("MaxFailedAttempts"
), __s2_len = __builtin_strlen (attr_name), (!((size_t)(const
void *)(("MaxFailedAttempts") + 1) - (size_t)(const void *)(
"MaxFailedAttempts") == 1) || __s1_len >= 4) && (!
((size_t)(const void *)((attr_name) + 1) - (size_t)(const void
*)(attr_name) == 1) || __s2_len >= 4)) ? __builtin_strcmp
("MaxFailedAttempts", attr_name) : (__builtin_constant_p ("MaxFailedAttempts"
) && ((size_t)(const void *)(("MaxFailedAttempts") + 1
) - (size_t)(const void *)("MaxFailedAttempts") == 1) &&
(__s1_len = __builtin_strlen ("MaxFailedAttempts"), __s1_len
< 4) ? (__builtin_constant_p (attr_name) && ((size_t
)(const void *)((attr_name) + 1) - (size_t)(const void *)(attr_name
) == 1) ? __builtin_strcmp ("MaxFailedAttempts", attr_name) :
(__extension__ ({ const unsigned char *__s2 = (const unsigned
char *) (const char *) (attr_name); int __result = (((const unsigned
char *) (const char *) ("MaxFailedAttempts"))[0] - __s2[0]);
if (__s1_len > 0 && __result == 0) { __result = (
((const unsigned char *) (const char *) ("MaxFailedAttempts")
)[1] - __s2[1]); if (__s1_len > 1 && __result == 0
) { __result = (((const unsigned char *) (const char *) ("MaxFailedAttempts"
))[2] - __s2[2]); if (__s1_len > 2 && __result == 0
) __result = (((const unsigned char *) (const char *) ("MaxFailedAttempts"
))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p (
attr_name) && ((size_t)(const void *)((attr_name) + 1
) - (size_t)(const void *)(attr_name) == 1) && (__s2_len
= __builtin_strlen (attr_name), __s2_len < 4) ? (__builtin_constant_p
("MaxFailedAttempts") && ((size_t)(const void *)(("MaxFailedAttempts"
) + 1) - (size_t)(const void *)("MaxFailedAttempts") == 1) ? __builtin_strcmp
("MaxFailedAttempts", attr_name) : (- (__extension__ ({ const
unsigned char *__s2 = (const unsigned char *) (const char *)
("MaxFailedAttempts"); int __result = (((const unsigned char
*) (const char *) (attr_name))[0] - __s2[0]); if (__s2_len >
0 && __result == 0) { __result = (((const unsigned char
*) (const char *) (attr_name))[1] - __s2[1]); if (__s2_len >
1 && __result == 0) { __result = (((const unsigned char
*) (const char *) (attr_name))[2] - __s2[2]); if (__s2_len >
2 && __result == 0) __result = (((const unsigned char
*) (const char *) (attr_name))[3] - __s2[3]); } } __result; }
)))) : __builtin_strcmp ("MaxFailedAttempts", attr_name)))); }
)
== 0)
431 {
432 kp->key_policy_pinmaxfailedattempts_str = attr_content;
433 kp->key_policy_pinmaxfailedattempts =
434 strtoull (kp->key_policy_pinmaxfailedattempts_str,
435 NULL((void*)0), 10);
436 }
437 else if (strcmp ("MinLength", attr_name)__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p
("MinLength") && __builtin_constant_p (attr_name) &&
(__s1_len = __builtin_strlen ("MinLength"), __s2_len = __builtin_strlen
(attr_name), (!((size_t)(const void *)(("MinLength") + 1) - (
size_t)(const void *)("MinLength") == 1) || __s1_len >= 4)
&& (!((size_t)(const void *)((attr_name) + 1) - (size_t
)(const void *)(attr_name) == 1) || __s2_len >= 4)) ? __builtin_strcmp
("MinLength", attr_name) : (__builtin_constant_p ("MinLength"
) && ((size_t)(const void *)(("MinLength") + 1) - (size_t
)(const void *)("MinLength") == 1) && (__s1_len = __builtin_strlen
("MinLength"), __s1_len < 4) ? (__builtin_constant_p (attr_name
) && ((size_t)(const void *)((attr_name) + 1) - (size_t
)(const void *)(attr_name) == 1) ? __builtin_strcmp ("MinLength"
, attr_name) : (__extension__ ({ const unsigned char *__s2 = (
const unsigned char *) (const char *) (attr_name); int __result
= (((const unsigned char *) (const char *) ("MinLength"))[0]
- __s2[0]); if (__s1_len > 0 && __result == 0) { __result
= (((const unsigned char *) (const char *) ("MinLength"))[1]
- __s2[1]); if (__s1_len > 1 && __result == 0) { __result
= (((const unsigned char *) (const char *) ("MinLength"))[2]
- __s2[2]); if (__s1_len > 2 && __result == 0) __result
= (((const unsigned char *) (const char *) ("MinLength"))[3]
- __s2[3]); } } __result; }))) : (__builtin_constant_p (attr_name
) && ((size_t)(const void *)((attr_name) + 1) - (size_t
)(const void *)(attr_name) == 1) && (__s2_len = __builtin_strlen
(attr_name), __s2_len < 4) ? (__builtin_constant_p ("MinLength"
) && ((size_t)(const void *)(("MinLength") + 1) - (size_t
)(const void *)("MinLength") == 1) ? __builtin_strcmp ("MinLength"
, attr_name) : (- (__extension__ ({ const unsigned char *__s2
= (const unsigned char *) (const char *) ("MinLength"); int __result
= (((const unsigned char *) (const char *) (attr_name))[0] -
__s2[0]); if (__s2_len > 0 && __result == 0) { __result
= (((const unsigned char *) (const char *) (attr_name))[1] -
__s2[1]); if (__s2_len > 1 && __result == 0) { __result
= (((const unsigned char *) (const char *) (attr_name))[2] -
__s2[2]); if (__s2_len > 2 && __result == 0) __result
= (((const unsigned char *) (const char *) (attr_name))[3] -
__s2[3]); } } __result; })))) : __builtin_strcmp ("MinLength"
, attr_name)))); })
== 0)
438 {
439 kp->key_policy_pinminlength_str = attr_content;
440 kp->key_policy_pinminlength =
441 strtoull (kp->key_policy_pinminlength_str, NULL((void*)0), 10);
442 }
443 else if (strcmp ("MaxLength", attr_name)__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p
("MaxLength") && __builtin_constant_p (attr_name) &&
(__s1_len = __builtin_strlen ("MaxLength"), __s2_len = __builtin_strlen
(attr_name), (!((size_t)(const void *)(("MaxLength") + 1) - (
size_t)(const void *)("MaxLength") == 1) || __s1_len >= 4)
&& (!((size_t)(const void *)((attr_name) + 1) - (size_t
)(const void *)(attr_name) == 1) || __s2_len >= 4)) ? __builtin_strcmp
("MaxLength", attr_name) : (__builtin_constant_p ("MaxLength"
) && ((size_t)(const void *)(("MaxLength") + 1) - (size_t
)(const void *)("MaxLength") == 1) && (__s1_len = __builtin_strlen
("MaxLength"), __s1_len < 4) ? (__builtin_constant_p (attr_name
) && ((size_t)(const void *)((attr_name) + 1) - (size_t
)(const void *)(attr_name) == 1) ? __builtin_strcmp ("MaxLength"
, attr_name) : (__extension__ ({ const unsigned char *__s2 = (
const unsigned char *) (const char *) (attr_name); int __result
= (((const unsigned char *) (const char *) ("MaxLength"))[0]
- __s2[0]); if (__s1_len > 0 && __result == 0) { __result
= (((const unsigned char *) (const char *) ("MaxLength"))[1]
- __s2[1]); if (__s1_len > 1 && __result == 0) { __result
= (((const unsigned char *) (const char *) ("MaxLength"))[2]
- __s2[2]); if (__s1_len > 2 && __result == 0) __result
= (((const unsigned char *) (const char *) ("MaxLength"))[3]
- __s2[3]); } } __result; }))) : (__builtin_constant_p (attr_name
) && ((size_t)(const void *)((attr_name) + 1) - (size_t
)(const void *)(attr_name) == 1) && (__s2_len = __builtin_strlen
(attr_name), __s2_len < 4) ? (__builtin_constant_p ("MaxLength"
) && ((size_t)(const void *)(("MaxLength") + 1) - (size_t
)(const void *)("MaxLength") == 1) ? __builtin_strcmp ("MaxLength"
, attr_name) : (- (__extension__ ({ const unsigned char *__s2
= (const unsigned char *) (const char *) ("MaxLength"); int __result
= (((const unsigned char *) (const char *) (attr_name))[0] -
__s2[0]); if (__s2_len > 0 && __result == 0) { __result
= (((const unsigned char *) (const char *) (attr_name))[1] -
__s2[1]); if (__s2_len > 1 && __result == 0) { __result
= (((const unsigned char *) (const char *) (attr_name))[2] -
__s2[2]); if (__s2_len > 2 && __result == 0) __result
= (((const unsigned char *) (const char *) (attr_name))[3] -
__s2[3]); } } __result; })))) : __builtin_strcmp ("MaxLength"
, attr_name)))); })
== 0)
444 {
445 kp->key_policy_pinmaxlength_str = attr_content;
446 kp->key_policy_pinmaxlength =
447 strtoull (kp->key_policy_pinmaxlength_str, NULL((void*)0), 10);
448 }
449 else if (strcmp ("PINEncoding", attr_name)__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p
("PINEncoding") && __builtin_constant_p (attr_name) &&
(__s1_len = __builtin_strlen ("PINEncoding"), __s2_len = __builtin_strlen
(attr_name), (!((size_t)(const void *)(("PINEncoding") + 1) -
(size_t)(const void *)("PINEncoding") == 1) || __s1_len >=
4) && (!((size_t)(const void *)((attr_name) + 1) - (
size_t)(const void *)(attr_name) == 1) || __s2_len >= 4)) ?
__builtin_strcmp ("PINEncoding", attr_name) : (__builtin_constant_p
("PINEncoding") && ((size_t)(const void *)(("PINEncoding"
) + 1) - (size_t)(const void *)("PINEncoding") == 1) &&
(__s1_len = __builtin_strlen ("PINEncoding"), __s1_len < 4
) ? (__builtin_constant_p (attr_name) && ((size_t)(const
void *)((attr_name) + 1) - (size_t)(const void *)(attr_name)
== 1) ? __builtin_strcmp ("PINEncoding", attr_name) : (__extension__
({ const unsigned char *__s2 = (const unsigned char *) (const
char *) (attr_name); int __result = (((const unsigned char *
) (const char *) ("PINEncoding"))[0] - __s2[0]); if (__s1_len
> 0 && __result == 0) { __result = (((const unsigned
char *) (const char *) ("PINEncoding"))[1] - __s2[1]); if (__s1_len
> 1 && __result == 0) { __result = (((const unsigned
char *) (const char *) ("PINEncoding"))[2] - __s2[2]); if (__s1_len
> 2 && __result == 0) __result = (((const unsigned
char *) (const char *) ("PINEncoding"))[3] - __s2[3]); } } __result
; }))) : (__builtin_constant_p (attr_name) && ((size_t
)(const void *)((attr_name) + 1) - (size_t)(const void *)(attr_name
) == 1) && (__s2_len = __builtin_strlen (attr_name), __s2_len
< 4) ? (__builtin_constant_p ("PINEncoding") && (
(size_t)(const void *)(("PINEncoding") + 1) - (size_t)(const void
*)("PINEncoding") == 1) ? __builtin_strcmp ("PINEncoding", attr_name
) : (- (__extension__ ({ const unsigned char *__s2 = (const unsigned
char *) (const char *) ("PINEncoding"); int __result = (((const
unsigned char *) (const char *) (attr_name))[0] - __s2[0]); if
(__s2_len > 0 && __result == 0) { __result = (((const
unsigned char *) (const char *) (attr_name))[1] - __s2[1]); if
(__s2_len > 1 && __result == 0) { __result = (((const
unsigned char *) (const char *) (attr_name))[2] - __s2[2]); if
(__s2_len > 2 && __result == 0) __result = (((const
unsigned char *) (const char *) (attr_name))[3] - __s2[3]); }
} __result; })))) : __builtin_strcmp ("PINEncoding", attr_name
)))); })
== 0)
450 {
451 kp->key_policy_pinencoding_str = attr_content;
452 kp->key_policy_pinencoding =
453 pskc_str2valueformat (kp->key_policy_pinencoding_str);
454 }
455 else
456 {
457 _pskc_debug ("unknown <%s> attribute <%s>", name,
458 attr_name);
459 *rc = PSKC_PARSE_ERROR;
460 }
461 }
462 }
463 else if (strcmp ("KeyUsage", name)__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p
("KeyUsage") && __builtin_constant_p (name) &&
(__s1_len = __builtin_strlen ("KeyUsage"), __s2_len = __builtin_strlen
(name), (!((size_t)(const void *)(("KeyUsage") + 1) - (size_t
)(const void *)("KeyUsage") == 1) || __s1_len >= 4) &&
(!((size_t)(const void *)((name) + 1) - (size_t)(const void *
)(name) == 1) || __s2_len >= 4)) ? __builtin_strcmp ("KeyUsage"
, name) : (__builtin_constant_p ("KeyUsage") && ((size_t
)(const void *)(("KeyUsage") + 1) - (size_t)(const void *)("KeyUsage"
) == 1) && (__s1_len = __builtin_strlen ("KeyUsage"),
__s1_len < 4) ? (__builtin_constant_p (name) && (
(size_t)(const void *)((name) + 1) - (size_t)(const void *)(name
) == 1) ? __builtin_strcmp ("KeyUsage", name) : (__extension__
({ const unsigned char *__s2 = (const unsigned char *) (const
char *) (name); int __result = (((const unsigned char *) (const
char *) ("KeyUsage"))[0] - __s2[0]); if (__s1_len > 0 &&
__result == 0) { __result = (((const unsigned char *) (const
char *) ("KeyUsage"))[1] - __s2[1]); if (__s1_len > 1 &&
__result == 0) { __result = (((const unsigned char *) (const
char *) ("KeyUsage"))[2] - __s2[2]); if (__s1_len > 2 &&
__result == 0) __result = (((const unsigned char *) (const char
*) ("KeyUsage"))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p
(name) && ((size_t)(const void *)((name) + 1) - (size_t
)(const void *)(name) == 1) && (__s2_len = __builtin_strlen
(name), __s2_len < 4) ? (__builtin_constant_p ("KeyUsage"
) && ((size_t)(const void *)(("KeyUsage") + 1) - (size_t
)(const void *)("KeyUsage") == 1) ? __builtin_strcmp ("KeyUsage"
, name) : (- (__extension__ ({ const unsigned char *__s2 = (const
unsigned char *) (const char *) ("KeyUsage"); int __result =
(((const unsigned char *) (const char *) (name))[0] - __s2[0
]); if (__s2_len > 0 && __result == 0) { __result =
(((const unsigned char *) (const char *) (name))[1] - __s2[1
]); if (__s2_len > 1 && __result == 0) { __result =
(((const unsigned char *) (const char *) (name))[2] - __s2[2
]); if (__s2_len > 2 && __result == 0) __result = (
((const unsigned char *) (const char *) (name))[3] - __s2[3])
; } } __result; })))) : __builtin_strcmp ("KeyUsage", name)))
); })
== 0)
464 {
465 kp->key_policy_keyusage_str = content;
466 kp->key_policy_keyusages |=
467 pskc_str2keyusage (kp->key_policy_keyusage_str);
468 }
469 else if (strcmp ("NumberOfTransactions", name)__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p
("NumberOfTransactions") && __builtin_constant_p (name
) && (__s1_len = __builtin_strlen ("NumberOfTransactions"
), __s2_len = __builtin_strlen (name), (!((size_t)(const void
*)(("NumberOfTransactions") + 1) - (size_t)(const void *)("NumberOfTransactions"
) == 1) || __s1_len >= 4) && (!((size_t)(const void
*)((name) + 1) - (size_t)(const void *)(name) == 1) || __s2_len
>= 4)) ? __builtin_strcmp ("NumberOfTransactions", name) :
(__builtin_constant_p ("NumberOfTransactions") && ((
size_t)(const void *)(("NumberOfTransactions") + 1) - (size_t
)(const void *)("NumberOfTransactions") == 1) && (__s1_len
= __builtin_strlen ("NumberOfTransactions"), __s1_len < 4
) ? (__builtin_constant_p (name) && ((size_t)(const void
*)((name) + 1) - (size_t)(const void *)(name) == 1) ? __builtin_strcmp
("NumberOfTransactions", name) : (__extension__ ({ const unsigned
char *__s2 = (const unsigned char *) (const char *) (name); int
__result = (((const unsigned char *) (const char *) ("NumberOfTransactions"
))[0] - __s2[0]); if (__s1_len > 0 && __result == 0
) { __result = (((const unsigned char *) (const char *) ("NumberOfTransactions"
))[1] - __s2[1]); if (__s1_len > 1 && __result == 0
) { __result = (((const unsigned char *) (const char *) ("NumberOfTransactions"
))[2] - __s2[2]); if (__s1_len > 2 && __result == 0
) __result = (((const unsigned char *) (const char *) ("NumberOfTransactions"
))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p (
name) && ((size_t)(const void *)((name) + 1) - (size_t
)(const void *)(name) == 1) && (__s2_len = __builtin_strlen
(name), __s2_len < 4) ? (__builtin_constant_p ("NumberOfTransactions"
) && ((size_t)(const void *)(("NumberOfTransactions")
+ 1) - (size_t)(const void *)("NumberOfTransactions") == 1) ?
__builtin_strcmp ("NumberOfTransactions", name) : (- (__extension__
({ const unsigned char *__s2 = (const unsigned char *) (const
char *) ("NumberOfTransactions"); int __result = (((const unsigned
char *) (const char *) (name))[0] - __s2[0]); if (__s2_len >
0 && __result == 0) { __result = (((const unsigned char
*) (const char *) (name))[1] - __s2[1]); if (__s2_len > 1
&& __result == 0) { __result = (((const unsigned char
*) (const char *) (name))[2] - __s2[2]); if (__s2_len > 2
&& __result == 0) __result = (((const unsigned char *
) (const char *) (name))[3] - __s2[3]); } } __result; })))) :
__builtin_strcmp ("NumberOfTransactions", name)))); })
== 0)
470 {
471 kp->key_policy_numberoftransactions_str = content;
472 if (kp->key_policy_numberoftransactions_str)
473 kp->key_policy_numberoftransactions =
474 strtoull (kp->key_policy_numberoftransactions_str, NULL((void*)0), 10);
475 }
476 else
477 {
478 _pskc_debug ("unknown <%s> element <%s>", x->parent->name, name);
479 *rc = PSKC_PARSE_ERROR;
480 }
481 }
482}
483
484static void
485parse_key (xmlNode * x, struct pskc_key *kp, int *rc)
486{
487 xmlNode *cur_node = NULL((void*)0);
488
489 for (cur_node = x; cur_node; cur_node = cur_node->next)
490 {
491 const char *name = (const char *) cur_node->name;
492 const char *content = (const char *)
493 (cur_node->children ? cur_node->children->content : NULL((void*)0));
494
495 if (cur_node->type != XML_ELEMENT_NODE)
496 continue;
497
498 if (strcmp ("Issuer", name)__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p
("Issuer") && __builtin_constant_p (name) &&
(__s1_len = __builtin_strlen ("Issuer"), __s2_len = __builtin_strlen
(name), (!((size_t)(const void *)(("Issuer") + 1) - (size_t)
(const void *)("Issuer") == 1) || __s1_len >= 4) &&
(!((size_t)(const void *)((name) + 1) - (size_t)(const void *
)(name) == 1) || __s2_len >= 4)) ? __builtin_strcmp ("Issuer"
, name) : (__builtin_constant_p ("Issuer") && ((size_t
)(const void *)(("Issuer") + 1) - (size_t)(const void *)("Issuer"
) == 1) && (__s1_len = __builtin_strlen ("Issuer"), __s1_len
< 4) ? (__builtin_constant_p (name) && ((size_t)(
const void *)((name) + 1) - (size_t)(const void *)(name) == 1
) ? __builtin_strcmp ("Issuer", name) : (__extension__ ({ const
unsigned char *__s2 = (const unsigned char *) (const char *)
(name); int __result = (((const unsigned char *) (const char
*) ("Issuer"))[0] - __s2[0]); if (__s1_len > 0 &&
__result == 0) { __result = (((const unsigned char *) (const
char *) ("Issuer"))[1] - __s2[1]); if (__s1_len > 1 &&
__result == 0) { __result = (((const unsigned char *) (const
char *) ("Issuer"))[2] - __s2[2]); if (__s1_len > 2 &&
__result == 0) __result = (((const unsigned char *) (const char
*) ("Issuer"))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p
(name) && ((size_t)(const void *)((name) + 1) - (size_t
)(const void *)(name) == 1) && (__s2_len = __builtin_strlen
(name), __s2_len < 4) ? (__builtin_constant_p ("Issuer") &&
((size_t)(const void *)(("Issuer") + 1) - (size_t)(const void
*)("Issuer") == 1) ? __builtin_strcmp ("Issuer", name) : (- (
__extension__ ({ const unsigned char *__s2 = (const unsigned char
*) (const char *) ("Issuer"); int __result = (((const unsigned
char *) (const char *) (name))[0] - __s2[0]); if (__s2_len >
0 && __result == 0) { __result = (((const unsigned char
*) (const char *) (name))[1] - __s2[1]); if (__s2_len > 1
&& __result == 0) { __result = (((const unsigned char
*) (const char *) (name))[2] - __s2[2]); if (__s2_len > 2
&& __result == 0) __result = (((const unsigned char *
) (const char *) (name))[3] - __s2[3]); } } __result; })))) :
__builtin_strcmp ("Issuer", name)))); })
== 0)
499 kp->key_issuer = content;
500 else if (strcmp ("AlgorithmParameters", name)__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p
("AlgorithmParameters") && __builtin_constant_p (name
) && (__s1_len = __builtin_strlen ("AlgorithmParameters"
), __s2_len = __builtin_strlen (name), (!((size_t)(const void
*)(("AlgorithmParameters") + 1) - (size_t)(const void *)("AlgorithmParameters"
) == 1) || __s1_len >= 4) && (!((size_t)(const void
*)((name) + 1) - (size_t)(const void *)(name) == 1) || __s2_len
>= 4)) ? __builtin_strcmp ("AlgorithmParameters", name) :
(__builtin_constant_p ("AlgorithmParameters") && ((size_t
)(const void *)(("AlgorithmParameters") + 1) - (size_t)(const
void *)("AlgorithmParameters") == 1) && (__s1_len = __builtin_strlen
("AlgorithmParameters"), __s1_len < 4) ? (__builtin_constant_p
(name) && ((size_t)(const void *)((name) + 1) - (size_t
)(const void *)(name) == 1) ? __builtin_strcmp ("AlgorithmParameters"
, name) : (__extension__ ({ const unsigned char *__s2 = (const
unsigned char *) (const char *) (name); int __result = (((const
unsigned char *) (const char *) ("AlgorithmParameters"))[0] -
__s2[0]); if (__s1_len > 0 && __result == 0) { __result
= (((const unsigned char *) (const char *) ("AlgorithmParameters"
))[1] - __s2[1]); if (__s1_len > 1 && __result == 0
) { __result = (((const unsigned char *) (const char *) ("AlgorithmParameters"
))[2] - __s2[2]); if (__s1_len > 2 && __result == 0
) __result = (((const unsigned char *) (const char *) ("AlgorithmParameters"
))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p (
name) && ((size_t)(const void *)((name) + 1) - (size_t
)(const void *)(name) == 1) && (__s2_len = __builtin_strlen
(name), __s2_len < 4) ? (__builtin_constant_p ("AlgorithmParameters"
) && ((size_t)(const void *)(("AlgorithmParameters") +
1) - (size_t)(const void *)("AlgorithmParameters") == 1) ? __builtin_strcmp
("AlgorithmParameters", name) : (- (__extension__ ({ const unsigned
char *__s2 = (const unsigned char *) (const char *) ("AlgorithmParameters"
); int __result = (((const unsigned char *) (const char *) (name
))[0] - __s2[0]); if (__s2_len > 0 && __result == 0
) { __result = (((const unsigned char *) (const char *) (name
))[1] - __s2[1]); if (__s2_len > 1 && __result == 0
) { __result = (((const unsigned char *) (const char *) (name
))[2] - __s2[2]); if (__s2_len > 2 && __result == 0
) __result = (((const unsigned char *) (const char *) (name))
[3] - __s2[3]); } } __result; })))) : __builtin_strcmp ("AlgorithmParameters"
, name)))); })
== 0)
501 parse_algorithmparameters (cur_node->children, kp, rc);
502 else if (strcmp ("KeyProfileId", name)__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p
("KeyProfileId") && __builtin_constant_p (name) &&
(__s1_len = __builtin_strlen ("KeyProfileId"), __s2_len = __builtin_strlen
(name), (!((size_t)(const void *)(("KeyProfileId") + 1) - (size_t
)(const void *)("KeyProfileId") == 1) || __s1_len >= 4) &&
(!((size_t)(const void *)((name) + 1) - (size_t)(const void *
)(name) == 1) || __s2_len >= 4)) ? __builtin_strcmp ("KeyProfileId"
, name) : (__builtin_constant_p ("KeyProfileId") && (
(size_t)(const void *)(("KeyProfileId") + 1) - (size_t)(const
void *)("KeyProfileId") == 1) && (__s1_len = __builtin_strlen
("KeyProfileId"), __s1_len < 4) ? (__builtin_constant_p (
name) && ((size_t)(const void *)((name) + 1) - (size_t
)(const void *)(name) == 1) ? __builtin_strcmp ("KeyProfileId"
, name) : (__extension__ ({ const unsigned char *__s2 = (const
unsigned char *) (const char *) (name); int __result = (((const
unsigned char *) (const char *) ("KeyProfileId"))[0] - __s2[
0]); if (__s1_len > 0 && __result == 0) { __result
= (((const unsigned char *) (const char *) ("KeyProfileId"))
[1] - __s2[1]); if (__s1_len > 1 && __result == 0)
{ __result = (((const unsigned char *) (const char *) ("KeyProfileId"
))[2] - __s2[2]); if (__s1_len > 2 && __result == 0
) __result = (((const unsigned char *) (const char *) ("KeyProfileId"
))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p (
name) && ((size_t)(const void *)((name) + 1) - (size_t
)(const void *)(name) == 1) && (__s2_len = __builtin_strlen
(name), __s2_len < 4) ? (__builtin_constant_p ("KeyProfileId"
) && ((size_t)(const void *)(("KeyProfileId") + 1) - (
size_t)(const void *)("KeyProfileId") == 1) ? __builtin_strcmp
("KeyProfileId", name) : (- (__extension__ ({ const unsigned
char *__s2 = (const unsigned char *) (const char *) ("KeyProfileId"
); int __result = (((const unsigned char *) (const char *) (name
))[0] - __s2[0]); if (__s2_len > 0 && __result == 0
) { __result = (((const unsigned char *) (const char *) (name
))[1] - __s2[1]); if (__s2_len > 1 && __result == 0
) { __result = (((const unsigned char *) (const char *) (name
))[2] - __s2[2]); if (__s2_len > 2 && __result == 0
) __result = (((const unsigned char *) (const char *) (name))
[3] - __s2[3]); } } __result; })))) : __builtin_strcmp ("KeyProfileId"
, name)))); })
== 0)
503 kp->key_profileid = content;
504 else if (strcmp ("KeyReference", name)__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p
("KeyReference") && __builtin_constant_p (name) &&
(__s1_len = __builtin_strlen ("KeyReference"), __s2_len = __builtin_strlen
(name), (!((size_t)(const void *)(("KeyReference") + 1) - (size_t
)(const void *)("KeyReference") == 1) || __s1_len >= 4) &&
(!((size_t)(const void *)((name) + 1) - (size_t)(const void *
)(name) == 1) || __s2_len >= 4)) ? __builtin_strcmp ("KeyReference"
, name) : (__builtin_constant_p ("KeyReference") && (
(size_t)(const void *)(("KeyReference") + 1) - (size_t)(const
void *)("KeyReference") == 1) && (__s1_len = __builtin_strlen
("KeyReference"), __s1_len < 4) ? (__builtin_constant_p (
name) && ((size_t)(const void *)((name) + 1) - (size_t
)(const void *)(name) == 1) ? __builtin_strcmp ("KeyReference"
, name) : (__extension__ ({ const unsigned char *__s2 = (const
unsigned char *) (const char *) (name); int __result = (((const
unsigned char *) (const char *) ("KeyReference"))[0] - __s2[
0]); if (__s1_len > 0 && __result == 0) { __result
= (((const unsigned char *) (const char *) ("KeyReference"))
[1] - __s2[1]); if (__s1_len > 1 && __result == 0)
{ __result = (((const unsigned char *) (const char *) ("KeyReference"
))[2] - __s2[2]); if (__s1_len > 2 && __result == 0
) __result = (((const unsigned char *) (const char *) ("KeyReference"
))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p (
name) && ((size_t)(const void *)((name) + 1) - (size_t
)(const void *)(name) == 1) && (__s2_len = __builtin_strlen
(name), __s2_len < 4) ? (__builtin_constant_p ("KeyReference"
) && ((size_t)(const void *)(("KeyReference") + 1) - (
size_t)(const void *)("KeyReference") == 1) ? __builtin_strcmp
("KeyReference", name) : (- (__extension__ ({ const unsigned
char *__s2 = (const unsigned char *) (const char *) ("KeyReference"
); int __result = (((const unsigned char *) (const char *) (name
))[0] - __s2[0]); if (__s2_len > 0 && __result == 0
) { __result = (((const unsigned char *) (const char *) (name
))[1] - __s2[1]); if (__s2_len > 1 && __result == 0
) { __result = (((const unsigned char *) (const char *) (name
))[2] - __s2[2]); if (__s2_len > 2 && __result == 0
) __result = (((const unsigned char *) (const char *) (name))
[3] - __s2[3]); } } __result; })))) : __builtin_strcmp ("KeyReference"
, name)))); })
== 0)
505 kp->key_reference = content;
506 else if (strcmp ("FriendlyName", name)__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p
("FriendlyName") && __builtin_constant_p (name) &&
(__s1_len = __builtin_strlen ("FriendlyName"), __s2_len = __builtin_strlen
(name), (!((size_t)(const void *)(("FriendlyName") + 1) - (size_t
)(const void *)("FriendlyName") == 1) || __s1_len >= 4) &&
(!((size_t)(const void *)((name) + 1) - (size_t)(const void *
)(name) == 1) || __s2_len >= 4)) ? __builtin_strcmp ("FriendlyName"
, name) : (__builtin_constant_p ("FriendlyName") && (
(size_t)(const void *)(("FriendlyName") + 1) - (size_t)(const
void *)("FriendlyName") == 1) && (__s1_len = __builtin_strlen
("FriendlyName"), __s1_len < 4) ? (__builtin_constant_p (
name) && ((size_t)(const void *)((name) + 1) - (size_t
)(const void *)(name) == 1) ? __builtin_strcmp ("FriendlyName"
, name) : (__extension__ ({ const unsigned char *__s2 = (const
unsigned char *) (const char *) (name); int __result = (((const
unsigned char *) (const char *) ("FriendlyName"))[0] - __s2[
0]); if (__s1_len > 0 && __result == 0) { __result
= (((const unsigned char *) (const char *) ("FriendlyName"))
[1] - __s2[1]); if (__s1_len > 1 && __result == 0)
{ __result = (((const unsigned char *) (const char *) ("FriendlyName"
))[2] - __s2[2]); if (__s1_len > 2 && __result == 0
) __result = (((const unsigned char *) (const char *) ("FriendlyName"
))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p (
name) && ((size_t)(const void *)((name) + 1) - (size_t
)(const void *)(name) == 1) && (__s2_len = __builtin_strlen
(name), __s2_len < 4) ? (__builtin_constant_p ("FriendlyName"
) && ((size_t)(const void *)(("FriendlyName") + 1) - (
size_t)(const void *)("FriendlyName") == 1) ? __builtin_strcmp
("FriendlyName", name) : (- (__extension__ ({ const unsigned
char *__s2 = (const unsigned char *) (const char *) ("FriendlyName"
); int __result = (((const unsigned char *) (const char *) (name
))[0] - __s2[0]); if (__s2_len > 0 && __result == 0
) { __result = (((const unsigned char *) (const char *) (name
))[1] - __s2[1]); if (__s2_len > 1 && __result == 0
) { __result = (((const unsigned char *) (const char *) (name
))[2] - __s2[2]); if (__s2_len > 2 && __result == 0
) __result = (((const unsigned char *) (const char *) (name))
[3] - __s2[3]); } } __result; })))) : __builtin_strcmp ("FriendlyName"
, name)))); })
== 0)
507 kp->key_friendlyname = content;
508 else if (strcmp ("Data", name)__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p
("Data") && __builtin_constant_p (name) && (
__s1_len = __builtin_strlen ("Data"), __s2_len = __builtin_strlen
(name), (!((size_t)(const void *)(("Data") + 1) - (size_t)(const
void *)("Data") == 1) || __s1_len >= 4) && (!((size_t
)(const void *)((name) + 1) - (size_t)(const void *)(name) ==
1) || __s2_len >= 4)) ? __builtin_strcmp ("Data", name) :
(__builtin_constant_p ("Data") && ((size_t)(const void
*)(("Data") + 1) - (size_t)(const void *)("Data") == 1) &&
(__s1_len = __builtin_strlen ("Data"), __s1_len < 4) ? (__builtin_constant_p
(name) && ((size_t)(const void *)((name) + 1) - (size_t
)(const void *)(name) == 1) ? __builtin_strcmp ("Data", name)
: (__extension__ ({ const unsigned char *__s2 = (const unsigned
char *) (const char *) (name); int __result = (((const unsigned
char *) (const char *) ("Data"))[0] - __s2[0]); if (__s1_len
> 0 && __result == 0) { __result = (((const unsigned
char *) (const char *) ("Data"))[1] - __s2[1]); if (__s1_len
> 1 && __result == 0) { __result = (((const unsigned
char *) (const char *) ("Data"))[2] - __s2[2]); if (__s1_len
> 2 && __result == 0) __result = (((const unsigned
char *) (const char *) ("Data"))[3] - __s2[3]); } } __result
; }))) : (__builtin_constant_p (name) && ((size_t)(const
void *)((name) + 1) - (size_t)(const void *)(name) == 1) &&
(__s2_len = __builtin_strlen (name), __s2_len < 4) ? (__builtin_constant_p
("Data") && ((size_t)(const void *)(("Data") + 1) - (
size_t)(const void *)("Data") == 1) ? __builtin_strcmp ("Data"
, name) : (- (__extension__ ({ const unsigned char *__s2 = (const
unsigned char *) (const char *) ("Data"); int __result = (((
const unsigned char *) (const char *) (name))[0] - __s2[0]); if
(__s2_len > 0 && __result == 0) { __result = (((const
unsigned char *) (const char *) (name))[1] - __s2[1]); if (__s2_len
> 1 && __result == 0) { __result = (((const unsigned
char *) (const char *) (name))[2] - __s2[2]); if (__s2_len >
2 && __result == 0) __result = (((const unsigned char
*) (const char *) (name))[3] - __s2[3]); } } __result; }))))
: __builtin_strcmp ("Data", name)))); })
== 0)
509 parse_data (cur_node->children, kp, rc);
510 else if (strcmp ("UserId", name)__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p
("UserId") && __builtin_constant_p (name) &&
(__s1_len = __builtin_strlen ("UserId"), __s2_len = __builtin_strlen
(name), (!((size_t)(const void *)(("UserId") + 1) - (size_t)
(const void *)("UserId") == 1) || __s1_len >= 4) &&
(!((size_t)(const void *)((name) + 1) - (size_t)(const void *
)(name) == 1) || __s2_len >= 4)) ? __builtin_strcmp ("UserId"
, name) : (__builtin_constant_p ("UserId") && ((size_t
)(const void *)(("UserId") + 1) - (size_t)(const void *)("UserId"
) == 1) && (__s1_len = __builtin_strlen ("UserId"), __s1_len
< 4) ? (__builtin_constant_p (name) && ((size_t)(
const void *)((name) + 1) - (size_t)(const void *)(name) == 1
) ? __builtin_strcmp ("UserId", name) : (__extension__ ({ const
unsigned char *__s2 = (const unsigned char *) (const char *)
(name); int __result = (((const unsigned char *) (const char
*) ("UserId"))[0] - __s2[0]); if (__s1_len > 0 &&
__result == 0) { __result = (((const unsigned char *) (const
char *) ("UserId"))[1] - __s2[1]); if (__s1_len > 1 &&
__result == 0) { __result = (((const unsigned char *) (const
char *) ("UserId"))[2] - __s2[2]); if (__s1_len > 2 &&
__result == 0) __result = (((const unsigned char *) (const char
*) ("UserId"))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p
(name) && ((size_t)(const void *)((name) + 1) - (size_t
)(const void *)(name) == 1) && (__s2_len = __builtin_strlen
(name), __s2_len < 4) ? (__builtin_constant_p ("UserId") &&
((size_t)(const void *)(("UserId") + 1) - (size_t)(const void
*)("UserId") == 1) ? __builtin_strcmp ("UserId", name) : (- (
__extension__ ({ const unsigned char *__s2 = (const unsigned char
*) (const char *) ("UserId"); int __result = (((const unsigned
char *) (const char *) (name))[0] - __s2[0]); if (__s2_len >
0 && __result == 0) { __result = (((const unsigned char
*) (const char *) (name))[1] - __s2[1]); if (__s2_len > 1
&& __result == 0) { __result = (((const unsigned char
*) (const char *) (name))[2] - __s2[2]); if (__s2_len > 2
&& __result == 0) __result = (((const unsigned char *
) (const char *) (name))[3] - __s2[3]); } } __result; })))) :
__builtin_strcmp ("UserId", name)))); })
== 0)
511 kp->key_userid = content;
512 else if (strcmp ("Policy", name)__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p
("Policy") && __builtin_constant_p (name) &&
(__s1_len = __builtin_strlen ("Policy"), __s2_len = __builtin_strlen
(name), (!((size_t)(const void *)(("Policy") + 1) - (size_t)
(const void *)("Policy") == 1) || __s1_len >= 4) &&
(!((size_t)(const void *)((name) + 1) - (size_t)(const void *
)(name) == 1) || __s2_len >= 4)) ? __builtin_strcmp ("Policy"
, name) : (__builtin_constant_p ("Policy") && ((size_t
)(const void *)(("Policy") + 1) - (size_t)(const void *)("Policy"
) == 1) && (__s1_len = __builtin_strlen ("Policy"), __s1_len
< 4) ? (__builtin_constant_p (name) && ((size_t)(
const void *)((name) + 1) - (size_t)(const void *)(name) == 1
) ? __builtin_strcmp ("Policy", name) : (__extension__ ({ const
unsigned char *__s2 = (const unsigned char *) (const char *)
(name); int __result = (((const unsigned char *) (const char
*) ("Policy"))[0] - __s2[0]); if (__s1_len > 0 &&
__result == 0) { __result = (((const unsigned char *) (const
char *) ("Policy"))[1] - __s2[1]); if (__s1_len > 1 &&
__result == 0) { __result = (((const unsigned char *) (const
char *) ("Policy"))[2] - __s2[2]); if (__s1_len > 2 &&
__result == 0) __result = (((const unsigned char *) (const char
*) ("Policy"))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p
(name) && ((size_t)(const void *)((name) + 1) - (size_t
)(const void *)(name) == 1) && (__s2_len = __builtin_strlen
(name), __s2_len < 4) ? (__builtin_constant_p ("Policy") &&
((size_t)(const void *)(("Policy") + 1) - (size_t)(const void
*)("Policy") == 1) ? __builtin_strcmp ("Policy", name) : (- (
__extension__ ({ const unsigned char *__s2 = (const unsigned char
*) (const char *) ("Policy"); int __result = (((const unsigned
char *) (const char *) (name))[0] - __s2[0]); if (__s2_len >
0 && __result == 0) { __result = (((const unsigned char
*) (const char *) (name))[1] - __s2[1]); if (__s2_len > 1
&& __result == 0) { __result = (((const unsigned char
*) (const char *) (name))[2] - __s2[2]); if (__s2_len > 2
&& __result == 0) __result = (((const unsigned char *
) (const char *) (name))[3] - __s2[3]); } } __result; })))) :
__builtin_strcmp ("Policy", name)))); })
== 0)
513 parse_policy (cur_node->children, kp, rc);
514 else
515 {
516 _pskc_debug ("unknown <%s> element <%s>", x->parent->name, name);
517 *rc = PSKC_PARSE_ERROR;
518 }
519 }
520}
521
522static void
523parse_keypackage (xmlNode * x, struct pskc_key *kp, int *rc)
524{
525 xmlNode *cur_node = NULL((void*)0);
526
527 for (cur_node = x; cur_node; cur_node = cur_node->next)
528 {
529 const char *name = (const char *) cur_node->name;
530
531 if (cur_node->type != XML_ELEMENT_NODE)
532 continue;
533
534 if (strcmp ("DeviceInfo", name)__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p
("DeviceInfo") && __builtin_constant_p (name) &&
(__s1_len = __builtin_strlen ("DeviceInfo"), __s2_len = __builtin_strlen
(name), (!((size_t)(const void *)(("DeviceInfo") + 1) - (size_t
)(const void *)("DeviceInfo") == 1) || __s1_len >= 4) &&
(!((size_t)(const void *)((name) + 1) - (size_t)(const void *
)(name) == 1) || __s2_len >= 4)) ? __builtin_strcmp ("DeviceInfo"
, name) : (__builtin_constant_p ("DeviceInfo") && ((size_t
)(const void *)(("DeviceInfo") + 1) - (size_t)(const void *)(
"DeviceInfo") == 1) && (__s1_len = __builtin_strlen (
"DeviceInfo"), __s1_len < 4) ? (__builtin_constant_p (name
) && ((size_t)(const void *)((name) + 1) - (size_t)(const
void *)(name) == 1) ? __builtin_strcmp ("DeviceInfo", name) :
(__extension__ ({ const unsigned char *__s2 = (const unsigned
char *) (const char *) (name); int __result = (((const unsigned
char *) (const char *) ("DeviceInfo"))[0] - __s2[0]); if (__s1_len
> 0 && __result == 0) { __result = (((const unsigned
char *) (const char *) ("DeviceInfo"))[1] - __s2[1]); if (__s1_len
> 1 && __result == 0) { __result = (((const unsigned
char *) (const char *) ("DeviceInfo"))[2] - __s2[2]); if (__s1_len
> 2 && __result == 0) __result = (((const unsigned
char *) (const char *) ("DeviceInfo"))[3] - __s2[3]); } } __result
; }))) : (__builtin_constant_p (name) && ((size_t)(const
void *)((name) + 1) - (size_t)(const void *)(name) == 1) &&
(__s2_len = __builtin_strlen (name), __s2_len < 4) ? (__builtin_constant_p
("DeviceInfo") && ((size_t)(const void *)(("DeviceInfo"
) + 1) - (size_t)(const void *)("DeviceInfo") == 1) ? __builtin_strcmp
("DeviceInfo", name) : (- (__extension__ ({ const unsigned char
*__s2 = (const unsigned char *) (const char *) ("DeviceInfo"
); int __result = (((const unsigned char *) (const char *) (name
))[0] - __s2[0]); if (__s2_len > 0 && __result == 0
) { __result = (((const unsigned char *) (const char *) (name
))[1] - __s2[1]); if (__s2_len > 1 && __result == 0
) { __result = (((const unsigned char *) (const char *) (name
))[2] - __s2[2]); if (__s2_len > 2 && __result == 0
) __result = (((const unsigned char *) (const char *) (name))
[3] - __s2[3]); } } __result; })))) : __builtin_strcmp ("DeviceInfo"
, name)))); })
== 0)
535 parse_deviceinfo (cur_node->children, kp, rc);
536 else if (strcmp ("CryptoModuleInfo", name)__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p
("CryptoModuleInfo") && __builtin_constant_p (name) &&
(__s1_len = __builtin_strlen ("CryptoModuleInfo"), __s2_len =
__builtin_strlen (name), (!((size_t)(const void *)(("CryptoModuleInfo"
) + 1) - (size_t)(const void *)("CryptoModuleInfo") == 1) || __s1_len
>= 4) && (!((size_t)(const void *)((name) + 1) - (
size_t)(const void *)(name) == 1) || __s2_len >= 4)) ? __builtin_strcmp
("CryptoModuleInfo", name) : (__builtin_constant_p ("CryptoModuleInfo"
) && ((size_t)(const void *)(("CryptoModuleInfo") + 1
) - (size_t)(const void *)("CryptoModuleInfo") == 1) &&
(__s1_len = __builtin_strlen ("CryptoModuleInfo"), __s1_len <
4) ? (__builtin_constant_p (name) && ((size_t)(const
void *)((name) + 1) - (size_t)(const void *)(name) == 1) ? __builtin_strcmp
("CryptoModuleInfo", name) : (__extension__ ({ const unsigned
char *__s2 = (const unsigned char *) (const char *) (name); int
__result = (((const unsigned char *) (const char *) ("CryptoModuleInfo"
))[0] - __s2[0]); if (__s1_len > 0 && __result == 0
) { __result = (((const unsigned char *) (const char *) ("CryptoModuleInfo"
))[1] - __s2[1]); if (__s1_len > 1 && __result == 0
) { __result = (((const unsigned char *) (const char *) ("CryptoModuleInfo"
))[2] - __s2[2]); if (__s1_len > 2 && __result == 0
) __result = (((const unsigned char *) (const char *) ("CryptoModuleInfo"
))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p (
name) && ((size_t)(const void *)((name) + 1) - (size_t
)(const void *)(name) == 1) && (__s2_len = __builtin_strlen
(name), __s2_len < 4) ? (__builtin_constant_p ("CryptoModuleInfo"
) && ((size_t)(const void *)(("CryptoModuleInfo") + 1
) - (size_t)(const void *)("CryptoModuleInfo") == 1) ? __builtin_strcmp
("CryptoModuleInfo", name) : (- (__extension__ ({ const unsigned
char *__s2 = (const unsigned char *) (const char *) ("CryptoModuleInfo"
); int __result = (((const unsigned char *) (const char *) (name
))[0] - __s2[0]); if (__s2_len > 0 && __result == 0
) { __result = (((const unsigned char *) (const char *) (name
))[1] - __s2[1]); if (__s2_len > 1 && __result == 0
) { __result = (((const unsigned char *) (const char *) (name
))[2] - __s2[2]); if (__s2_len > 2 && __result == 0
) __result = (((const unsigned char *) (const char *) (name))
[3] - __s2[3]); } } __result; })))) : __builtin_strcmp ("CryptoModuleInfo"
, name)))); })
== 0)
537 parse_cryptomoduleinfo (cur_node->children, kp, rc);
538 else if (strcmp ("Key", name)__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p
("Key") && __builtin_constant_p (name) && (__s1_len
= __builtin_strlen ("Key"), __s2_len = __builtin_strlen (name
), (!((size_t)(const void *)(("Key") + 1) - (size_t)(const void
*)("Key") == 1) || __s1_len >= 4) && (!((size_t)(
const void *)((name) + 1) - (size_t)(const void *)(name) == 1
) || __s2_len >= 4)) ? __builtin_strcmp ("Key", name) : (__builtin_constant_p
("Key") && ((size_t)(const void *)(("Key") + 1) - (size_t
)(const void *)("Key") == 1) && (__s1_len = __builtin_strlen
("Key"), __s1_len < 4) ? (__builtin_constant_p (name) &&
((size_t)(const void *)((name) + 1) - (size_t)(const void *)
(name) == 1) ? __builtin_strcmp ("Key", name) : (__extension__
({ const unsigned char *__s2 = (const unsigned char *) (const
char *) (name); int __result = (((const unsigned char *) (const
char *) ("Key"))[0] - __s2[0]); if (__s1_len > 0 &&
__result == 0) { __result = (((const unsigned char *) (const
char *) ("Key"))[1] - __s2[1]); if (__s1_len > 1 &&
__result == 0) { __result = (((const unsigned char *) (const
char *) ("Key"))[2] - __s2[2]); if (__s1_len > 2 &&
__result == 0) __result = (((const unsigned char *) (const char
*) ("Key"))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p
(name) && ((size_t)(const void *)((name) + 1) - (size_t
)(const void *)(name) == 1) && (__s2_len = __builtin_strlen
(name), __s2_len < 4) ? (__builtin_constant_p ("Key") &&
((size_t)(const void *)(("Key") + 1) - (size_t)(const void *
)("Key") == 1) ? __builtin_strcmp ("Key", name) : (- (__extension__
({ const unsigned char *__s2 = (const unsigned char *) (const
char *) ("Key"); int __result = (((const unsigned char *) (const
char *) (name))[0] - __s2[0]); if (__s2_len > 0 &&
__result == 0) { __result = (((const unsigned char *) (const
char *) (name))[1] - __s2[1]); if (__s2_len > 1 &&
__result == 0) { __result = (((const unsigned char *) (const
char *) (name))[2] - __s2[2]); if (__s2_len > 2 &&
__result == 0) __result = (((const unsigned char *) (const char
*) (name))[3] - __s2[3]); } } __result; })))) : __builtin_strcmp
("Key", name)))); })
== 0)
539 {
540 xmlAttr *cur_attr = NULL((void*)0);
541
542 for (cur_attr = cur_node->properties; cur_attr;
543 cur_attr = cur_attr->next)
544 {
545 const char *attr_name = (const char *) cur_attr->name;
546 const char *attr_content =
547 (const char *) cur_attr->children->content;
548
549 if (strcmp ("Id", attr_name)__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p
("Id") && __builtin_constant_p (attr_name) &&
(__s1_len = __builtin_strlen ("Id"), __s2_len = __builtin_strlen
(attr_name), (!((size_t)(const void *)(("Id") + 1) - (size_t
)(const void *)("Id") == 1) || __s1_len >= 4) && (
!((size_t)(const void *)((attr_name) + 1) - (size_t)(const void
*)(attr_name) == 1) || __s2_len >= 4)) ? __builtin_strcmp
("Id", attr_name) : (__builtin_constant_p ("Id") && (
(size_t)(const void *)(("Id") + 1) - (size_t)(const void *)("Id"
) == 1) && (__s1_len = __builtin_strlen ("Id"), __s1_len
< 4) ? (__builtin_constant_p (attr_name) && ((size_t
)(const void *)((attr_name) + 1) - (size_t)(const void *)(attr_name
) == 1) ? __builtin_strcmp ("Id", attr_name) : (__extension__
({ const unsigned char *__s2 = (const unsigned char *) (const
char *) (attr_name); int __result = (((const unsigned char *
) (const char *) ("Id"))[0] - __s2[0]); if (__s1_len > 0 &&
__result == 0) { __result = (((const unsigned char *) (const
char *) ("Id"))[1] - __s2[1]); if (__s1_len > 1 &&
__result == 0) { __result = (((const unsigned char *) (const
char *) ("Id"))[2] - __s2[2]); if (__s1_len > 2 &&
__result == 0) __result = (((const unsigned char *) (const char
*) ("Id"))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p
(attr_name) && ((size_t)(const void *)((attr_name) +
1) - (size_t)(const void *)(attr_name) == 1) && (__s2_len
= __builtin_strlen (attr_name), __s2_len < 4) ? (__builtin_constant_p
("Id") && ((size_t)(const void *)(("Id") + 1) - (size_t
)(const void *)("Id") == 1) ? __builtin_strcmp ("Id", attr_name
) : (- (__extension__ ({ const unsigned char *__s2 = (const unsigned
char *) (const char *) ("Id"); int __result = (((const unsigned
char *) (const char *) (attr_name))[0] - __s2[0]); if (__s2_len
> 0 && __result == 0) { __result = (((const unsigned
char *) (const char *) (attr_name))[1] - __s2[1]); if (__s2_len
> 1 && __result == 0) { __result = (((const unsigned
char *) (const char *) (attr_name))[2] - __s2[2]); if (__s2_len
> 2 && __result == 0) __result = (((const unsigned
char *) (const char *) (attr_name))[3] - __s2[3]); } } __result
; })))) : __builtin_strcmp ("Id", attr_name)))); })
== 0)
550 kp->key_id = attr_content;
551 else if (strcmp ("Algorithm", attr_name)__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p
("Algorithm") && __builtin_constant_p (attr_name) &&
(__s1_len = __builtin_strlen ("Algorithm"), __s2_len = __builtin_strlen
(attr_name), (!((size_t)(const void *)(("Algorithm") + 1) - (
size_t)(const void *)("Algorithm") == 1) || __s1_len >= 4)
&& (!((size_t)(const void *)((attr_name) + 1) - (size_t
)(const void *)(attr_name) == 1) || __s2_len >= 4)) ? __builtin_strcmp
("Algorithm", attr_name) : (__builtin_constant_p ("Algorithm"
) && ((size_t)(const void *)(("Algorithm") + 1) - (size_t
)(const void *)("Algorithm") == 1) && (__s1_len = __builtin_strlen
("Algorithm"), __s1_len < 4) ? (__builtin_constant_p (attr_name
) && ((size_t)(const void *)((attr_name) + 1) - (size_t
)(const void *)(attr_name) == 1) ? __builtin_strcmp ("Algorithm"
, attr_name) : (__extension__ ({ const unsigned char *__s2 = (
const unsigned char *) (const char *) (attr_name); int __result
= (((const unsigned char *) (const char *) ("Algorithm"))[0]
- __s2[0]); if (__s1_len > 0 && __result == 0) { __result
= (((const unsigned char *) (const char *) ("Algorithm"))[1]
- __s2[1]); if (__s1_len > 1 && __result == 0) { __result
= (((const unsigned char *) (const char *) ("Algorithm"))[2]
- __s2[2]); if (__s1_len > 2 && __result == 0) __result
= (((const unsigned char *) (const char *) ("Algorithm"))[3]
- __s2[3]); } } __result; }))) : (__builtin_constant_p (attr_name
) && ((size_t)(const void *)((attr_name) + 1) - (size_t
)(const void *)(attr_name) == 1) && (__s2_len = __builtin_strlen
(attr_name), __s2_len < 4) ? (__builtin_constant_p ("Algorithm"
) && ((size_t)(const void *)(("Algorithm") + 1) - (size_t
)(const void *)("Algorithm") == 1) ? __builtin_strcmp ("Algorithm"
, attr_name) : (- (__extension__ ({ const unsigned char *__s2
= (const unsigned char *) (const char *) ("Algorithm"); int __result
= (((const unsigned char *) (const char *) (attr_name))[0] -
__s2[0]); if (__s2_len > 0 && __result == 0) { __result
= (((const unsigned char *) (const char *) (attr_name))[1] -
__s2[1]); if (__s2_len > 1 && __result == 0) { __result
= (((const unsigned char *) (const char *) (attr_name))[2] -
__s2[2]); if (__s2_len > 2 && __result == 0) __result
= (((const unsigned char *) (const char *) (attr_name))[3] -
__s2[3]); } } __result; })))) : __builtin_strcmp ("Algorithm"
, attr_name)))); })
== 0)
552 kp->key_algorithm = attr_content;
553 else
554 {
555 _pskc_debug ("unknown <%s> attribute <%s>", name,
556 attr_name);
557 *rc = PSKC_PARSE_ERROR;
558 }
559 }
560
561 parse_key (cur_node->children, kp, rc);
562 }
563 else
564 {
565 _pskc_debug ("unknown <%s> element <%s>", x->parent->name, name);
566 *rc = PSKC_PARSE_ERROR;
567 }
568 }
569}
570
571static void
572parse_keypackages (pskc_t * pd, xmlNode * x, int *rc)
573{
574 xmlNode *cur_node = NULL((void*)0);
575
576 for (cur_node = x; cur_node; cur_node = cur_node->next)
577 {
578 const char *name = (const char *) cur_node->name;
579
580 if (cur_node->type != XML_ELEMENT_NODE)
581 continue;
582
583 if (strcmp ("KeyPackage", name)__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p
("KeyPackage") && __builtin_constant_p (name) &&
(__s1_len = __builtin_strlen ("KeyPackage"), __s2_len = __builtin_strlen
(name), (!((size_t)(const void *)(("KeyPackage") + 1) - (size_t
)(const void *)("KeyPackage") == 1) || __s1_len >= 4) &&
(!((size_t)(const void *)((name) + 1) - (size_t)(const void *
)(name) == 1) || __s2_len >= 4)) ? __builtin_strcmp ("KeyPackage"
, name) : (__builtin_constant_p ("KeyPackage") && ((size_t
)(const void *)(("KeyPackage") + 1) - (size_t)(const void *)(
"KeyPackage") == 1) && (__s1_len = __builtin_strlen (
"KeyPackage"), __s1_len < 4) ? (__builtin_constant_p (name
) && ((size_t)(const void *)((name) + 1) - (size_t)(const
void *)(name) == 1) ? __builtin_strcmp ("KeyPackage", name) :
(__extension__ ({ const unsigned char *__s2 = (const unsigned
char *) (const char *) (name); int __result = (((const unsigned
char *) (const char *) ("KeyPackage"))[0] - __s2[0]); if (__s1_len
> 0 && __result == 0) { __result = (((const unsigned
char *) (const char *) ("KeyPackage"))[1] - __s2[1]); if (__s1_len
> 1 && __result == 0) { __result = (((const unsigned
char *) (const char *) ("KeyPackage"))[2] - __s2[2]); if (__s1_len
> 2 && __result == 0) __result = (((const unsigned
char *) (const char *) ("KeyPackage"))[3] - __s2[3]); } } __result
; }))) : (__builtin_constant_p (name) && ((size_t)(const
void *)((name) + 1) - (size_t)(const void *)(name) == 1) &&
(__s2_len = __builtin_strlen (name), __s2_len < 4) ? (__builtin_constant_p
("KeyPackage") && ((size_t)(const void *)(("KeyPackage"
) + 1) - (size_t)(const void *)("KeyPackage") == 1) ? __builtin_strcmp
("KeyPackage", name) : (- (__extension__ ({ const unsigned char
*__s2 = (const unsigned char *) (const char *) ("KeyPackage"
); int __result = (((const unsigned char *) (const char *) (name
))[0] - __s2[0]); if (__s2_len > 0 && __result == 0
) { __result = (((const unsigned char *) (const char *) (name
))[1] - __s2[1]); if (__s2_len > 1 && __result == 0
) { __result = (((const unsigned char *) (const char *) (name
))[2] - __s2[2]); if (__s2_len > 2 && __result == 0
) __result = (((const unsigned char *) (const char *) (name))
[3] - __s2[3]); } } __result; })))) : __builtin_strcmp ("KeyPackage"
, name)))); })
== 0)
584 {
585 struct pskc_key *tmp;
586
587 tmp = realloc (pd->keypackages,
588 sizeof (*pd->keypackages) * (pd->nkeypackages + 1));
589 if (tmp == NULL((void*)0))
590 {
591 *rc = PSKC_MALLOC_ERROR;
592 return;
593 }
594
595 pd->keypackages = tmp;
596 pd->nkeypackages++;
597
598 memset (&pd->keypackages[pd->nkeypackages - 1], 0,
599 sizeof (*pd->keypackages));
600
601 parse_keypackage (cur_node->children,
602 &pd->keypackages[pd->nkeypackages - 1], rc);
603 }
604 else if (strcmp ("Signature", name)__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p
("Signature") && __builtin_constant_p (name) &&
(__s1_len = __builtin_strlen ("Signature"), __s2_len = __builtin_strlen
(name), (!((size_t)(const void *)(("Signature") + 1) - (size_t
)(const void *)("Signature") == 1) || __s1_len >= 4) &&
(!((size_t)(const void *)((name) + 1) - (size_t)(const void *
)(name) == 1) || __s2_len >= 4)) ? __builtin_strcmp ("Signature"
, name) : (__builtin_constant_p ("Signature") && ((size_t
)(const void *)(("Signature") + 1) - (size_t)(const void *)("Signature"
) == 1) && (__s1_len = __builtin_strlen ("Signature")
, __s1_len < 4) ? (__builtin_constant_p (name) && (
(size_t)(const void *)((name) + 1) - (size_t)(const void *)(name
) == 1) ? __builtin_strcmp ("Signature", name) : (__extension__
({ const unsigned char *__s2 = (const unsigned char *) (const
char *) (name); int __result = (((const unsigned char *) (const
char *) ("Signature"))[0] - __s2[0]); if (__s1_len > 0 &&
__result == 0) { __result = (((const unsigned char *) (const
char *) ("Signature"))[1] - __s2[1]); if (__s1_len > 1 &&
__result == 0) { __result = (((const unsigned char *) (const
char *) ("Signature"))[2] - __s2[2]); if (__s1_len > 2 &&
__result == 0) __result = (((const unsigned char *) (const char
*) ("Signature"))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p
(name) && ((size_t)(const void *)((name) + 1) - (size_t
)(const void *)(name) == 1) && (__s2_len = __builtin_strlen
(name), __s2_len < 4) ? (__builtin_constant_p ("Signature"
) && ((size_t)(const void *)(("Signature") + 1) - (size_t
)(const void *)("Signature") == 1) ? __builtin_strcmp ("Signature"
, name) : (- (__extension__ ({ const unsigned char *__s2 = (const
unsigned char *) (const char *) ("Signature"); int __result =
(((const unsigned char *) (const char *) (name))[0] - __s2[0
]); if (__s2_len > 0 && __result == 0) { __result =
(((const unsigned char *) (const char *) (name))[1] - __s2[1
]); if (__s2_len > 1 && __result == 0) { __result =
(((const unsigned char *) (const char *) (name))[2] - __s2[2
]); if (__s2_len > 2 && __result == 0) __result = (
((const unsigned char *) (const char *) (name))[3] - __s2[3])
; } } __result; })))) : __builtin_strcmp ("Signature", name))
)); })
== 0)
605 pd->signed_p = 1;
606 else
607 {
608 _pskc_debug ("unknown <%s> element <%s>", x->parent->name, name);
609 *rc = PSKC_PARSE_ERROR;
610 }
611 }
612}
613
614static void
615parse_keycontainer (pskc_t * pd, xmlNode * x, int *rc)
616{
617 xmlAttr *cur_attr = NULL((void*)0);
618 const char *name = (const char *) x->name;
619
620 if (strcmp ("KeyContainer", name)__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p
("KeyContainer") && __builtin_constant_p (name) &&
(__s1_len = __builtin_strlen ("KeyContainer"), __s2_len = __builtin_strlen
(name), (!((size_t)(const void *)(("KeyContainer") + 1) - (size_t
)(const void *)("KeyContainer") == 1) || __s1_len >= 4) &&
(!((size_t)(const void *)((name) + 1) - (size_t)(const void *
)(name) == 1) || __s2_len >= 4)) ? __builtin_strcmp ("KeyContainer"
, name) : (__builtin_constant_p ("KeyContainer") && (
(size_t)(const void *)(("KeyContainer") + 1) - (size_t)(const
void *)("KeyContainer") == 1) && (__s1_len = __builtin_strlen
("KeyContainer"), __s1_len < 4) ? (__builtin_constant_p (
name) && ((size_t)(const void *)((name) + 1) - (size_t
)(const void *)(name) == 1) ? __builtin_strcmp ("KeyContainer"
, name) : (__extension__ ({ const unsigned char *__s2 = (const
unsigned char *) (const char *) (name); int __result = (((const
unsigned char *) (const char *) ("KeyContainer"))[0] - __s2[
0]); if (__s1_len > 0 && __result == 0) { __result
= (((const unsigned char *) (const char *) ("KeyContainer"))
[1] - __s2[1]); if (__s1_len > 1 && __result == 0)
{ __result = (((const unsigned char *) (const char *) ("KeyContainer"
))[2] - __s2[2]); if (__s1_len > 2 && __result == 0
) __result = (((const unsigned char *) (const char *) ("KeyContainer"
))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p (
name) && ((size_t)(const void *)((name) + 1) - (size_t
)(const void *)(name) == 1) && (__s2_len = __builtin_strlen
(name), __s2_len < 4) ? (__builtin_constant_p ("KeyContainer"
) && ((size_t)(const void *)(("KeyContainer") + 1) - (
size_t)(const void *)("KeyContainer") == 1) ? __builtin_strcmp
("KeyContainer", name) : (- (__extension__ ({ const unsigned
char *__s2 = (const unsigned char *) (const char *) ("KeyContainer"
); int __result = (((const unsigned char *) (const char *) (name
))[0] - __s2[0]); if (__s2_len > 0 && __result == 0
) { __result = (((const unsigned char *) (const char *) (name
))[1] - __s2[1]); if (__s2_len > 1 && __result == 0
) { __result = (((const unsigned char *) (const char *) (name
))[2] - __s2[2]); if (__s2_len > 2 && __result == 0
) __result = (((const unsigned char *) (const char *) (name))
[3] - __s2[3]); } } __result; })))) : __builtin_strcmp ("KeyContainer"
, name)))); })
!= 0)
621 {
622 _pskc_debug ("unknown top-level element <%s>", name);
623 *rc = PSKC_PARSE_ERROR;
624 }
625
626 for (cur_attr = x->properties; cur_attr; cur_attr = cur_attr->next)
627 {
628 const char *attr_name = (const char *) cur_attr->name;
629 const char *attr_content = (const char *) cur_attr->children->content;
630
631 if (strcmp ("Version", attr_name)__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p
("Version") && __builtin_constant_p (attr_name) &&
(__s1_len = __builtin_strlen ("Version"), __s2_len = __builtin_strlen
(attr_name), (!((size_t)(const void *)(("Version") + 1) - (size_t
)(const void *)("Version") == 1) || __s1_len >= 4) &&
(!((size_t)(const void *)((attr_name) + 1) - (size_t)(const void
*)(attr_name) == 1) || __s2_len >= 4)) ? __builtin_strcmp
("Version", attr_name) : (__builtin_constant_p ("Version") &&
((size_t)(const void *)(("Version") + 1) - (size_t)(const void
*)("Version") == 1) && (__s1_len = __builtin_strlen (
"Version"), __s1_len < 4) ? (__builtin_constant_p (attr_name
) && ((size_t)(const void *)((attr_name) + 1) - (size_t
)(const void *)(attr_name) == 1) ? __builtin_strcmp ("Version"
, attr_name) : (__extension__ ({ const unsigned char *__s2 = (
const unsigned char *) (const char *) (attr_name); int __result
= (((const unsigned char *) (const char *) ("Version"))[0] -
__s2[0]); if (__s1_len > 0 && __result == 0) { __result
= (((const unsigned char *) (const char *) ("Version"))[1] -
__s2[1]); if (__s1_len > 1 && __result == 0) { __result
= (((const unsigned char *) (const char *) ("Version"))[2] -
__s2[2]); if (__s1_len > 2 && __result == 0) __result
= (((const unsigned char *) (const char *) ("Version"))[3] -
__s2[3]); } } __result; }))) : (__builtin_constant_p (attr_name
) && ((size_t)(const void *)((attr_name) + 1) - (size_t
)(const void *)(attr_name) == 1) && (__s2_len = __builtin_strlen
(attr_name), __s2_len < 4) ? (__builtin_constant_p ("Version"
) && ((size_t)(const void *)(("Version") + 1) - (size_t
)(const void *)("Version") == 1) ? __builtin_strcmp ("Version"
, attr_name) : (- (__extension__ ({ const unsigned char *__s2
= (const unsigned char *) (const char *) ("Version"); int __result
= (((const unsigned char *) (const char *) (attr_name))[0] -
__s2[0]); if (__s2_len > 0 && __result == 0) { __result
= (((const unsigned char *) (const char *) (attr_name))[1] -
__s2[1]); if (__s2_len > 1 && __result == 0) { __result
= (((const unsigned char *) (const char *) (attr_name))[2] -
__s2[2]); if (__s2_len > 2 && __result == 0) __result
= (((const unsigned char *) (const char *) (attr_name))[3] -
__s2[3]); } } __result; })))) : __builtin_strcmp ("Version",
attr_name)))); })
== 0)
632 pd->version = attr_content;
633 else if (strcmp ("Id", attr_name)__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p
("Id") && __builtin_constant_p (attr_name) &&
(__s1_len = __builtin_strlen ("Id"), __s2_len = __builtin_strlen
(attr_name), (!((size_t)(const void *)(("Id") + 1) - (size_t
)(const void *)("Id") == 1) || __s1_len >= 4) && (
!((size_t)(const void *)((attr_name) + 1) - (size_t)(const void
*)(attr_name) == 1) || __s2_len >= 4)) ? __builtin_strcmp
("Id", attr_name) : (__builtin_constant_p ("Id") && (
(size_t)(const void *)(("Id") + 1) - (size_t)(const void *)("Id"
) == 1) && (__s1_len = __builtin_strlen ("Id"), __s1_len
< 4) ? (__builtin_constant_p (attr_name) && ((size_t
)(const void *)((attr_name) + 1) - (size_t)(const void *)(attr_name
) == 1) ? __builtin_strcmp ("Id", attr_name) : (__extension__
({ const unsigned char *__s2 = (const unsigned char *) (const
char *) (attr_name); int __result = (((const unsigned char *
) (const char *) ("Id"))[0] - __s2[0]); if (__s1_len > 0 &&
__result == 0) { __result = (((const unsigned char *) (const
char *) ("Id"))[1] - __s2[1]); if (__s1_len > 1 &&
__result == 0) { __result = (((const unsigned char *) (const
char *) ("Id"))[2] - __s2[2]); if (__s1_len > 2 &&
__result == 0) __result = (((const unsigned char *) (const char
*) ("Id"))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p
(attr_name) && ((size_t)(const void *)((attr_name) +
1) - (size_t)(const void *)(attr_name) == 1) && (__s2_len
= __builtin_strlen (attr_name), __s2_len < 4) ? (__builtin_constant_p
("Id") && ((size_t)(const void *)(("Id") + 1) - (size_t
)(const void *)("Id") == 1) ? __builtin_strcmp ("Id", attr_name
) : (- (__extension__ ({ const unsigned char *__s2 = (const unsigned
char *) (const char *) ("Id"); int __result = (((const unsigned
char *) (const char *) (attr_name))[0] - __s2[0]); if (__s2_len
> 0 && __result == 0) { __result = (((const unsigned
char *) (const char *) (attr_name))[1] - __s2[1]); if (__s2_len
> 1 && __result == 0) { __result = (((const unsigned
char *) (const char *) (attr_name))[2] - __s2[2]); if (__s2_len
> 2 && __result == 0) __result = (((const unsigned
char *) (const char *) (attr_name))[3] - __s2[3]); } } __result
; })))) : __builtin_strcmp ("Id", attr_name)))); })
== 0)
634 pd->id = attr_content;
635 else
636 {
637 _pskc_debug ("unknown <%s> attribute <%s>", name, attr_name);
638 *rc = PSKC_PARSE_ERROR;
639 }
640 }
641
642 parse_keypackages (pd, x->children, rc);
643}
644
645/**
646 * pskc_init:
647 * @container: pointer to a #pskc_t handle to initialize.
648 *
649 * This function initializes the PSKC @container handle. The memory
650 * allocate can be released by calling pskc_done().
651 *
652 * Returns: On success, %PSKC_OK (zero) is returned, on memory
653 * allocation errors %PSKC_MALLOC_ERROR is returned.
654 **/
655int
656pskc_init (pskc_t ** container)
657{
658 *container = calloc (1, sizeof (**container));
659 if (*container == NULL((void*)0))
660 return PSKC_MALLOC_ERROR;
661 return PSKC_OK;
662}
663
664/**
665 * pskc_done:
666 * @container: a #pskc_t handle, from pskc_init().
667 *
668 * This function releases the resources associated with the PSKC
669 * @container handle.
670 **/
671void
672pskc_done (pskc_t * container)
673{
674 size_t i;
675
676 if (container == NULL((void*)0))
677 return;
678
679 xmlFreeDoc (container->xmldoc);
680
681 for (i = 0; i < container->nkeypackages; i++)
682 {
683 pskc_key_t *kp = &container->keypackages[i];
684 free (kp->key_secret);
685 free (kp->key_b64secret);
686 }
687
688 free (container->keypackages);
689 free (container);
690}
691
692/**
693 * pskc_parse_from_memory:
694 * @container: a #pskc_t handle, from pskc_init().
695 * @len: length of @buffer.
696 * @buffer: XML data to parse.
697 *
698 * This function will parse the XML data in @buffer of @len size into
699 * @container. If %PSKC_PARSE_ERROR is returned, parsing of some
700 * elements have failed but the @container is still valid and contain
701 * partially parsed information. In this situation, you may continue
702 * but raise a warning.
703 *
704 * Returns: On success, %PSKC_OK (zero) is returned, on memory
705 * allocation errors %PSKC_MALLOC_ERROR is returned, on XML library
706 * errors %PSKC_XML_ERROR is returned, on PSKC parse errors
707 * %PSKC_PARSE_ERROR is returned.
708 **/
709int
710pskc_parse_from_memory (pskc_t * container, size_t len, const char *buffer)
711{
712 xmlDocPtr xmldoc;
713 xmlNode *root;
714 int rc = PSKC_OK;
715
716 xmldoc = xmlReadMemory (buffer, len, NULL((void*)0), NULL((void*)0), XML_PARSE_NONET);
717 if (xmldoc == NULL((void*)0))
718 return PSKC_XML_ERROR;
719
720 container->xmldoc = xmldoc;
721
722 root = xmlDocGetRootElement (xmldoc);
723 parse_keycontainer (container, root, &rc);
724
725 return rc;
726}