File: internal.h

package info (click to toggle)
oath-toolkit 2.6.1-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 20,824 kB
  • ctags: 9,237
  • sloc: ansic: 54,713; sh: 13,738; yacc: 1,254; xml: 756; makefile: 353
file content (126 lines) | stat: -rw-r--r-- 3,882 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
/*
 * internal.h - Internal prototypes.
 * Copyright (C) 2012-2015 Simon Josefsson
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public License
 * as published by the Free Software Foundation; either version 2.1 of
 * the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
 * 02110-1301 USA
 *
 */

#ifdef INTERNAL_NEED_PSKC_KEY_STRUCT
struct pskc_key
{
  /* Allocated by us */
  char *key_b64secret;
  char *key_secret;
  size_t key_secret_len;

  /* The rest are pointers into libxml structures. */

  /* DeviceInfo */
  const char *device_manufacturer;
  const char *device_serialno;
  const char *device_model;
  const char *device_issueno;
  const char *device_devicebinding;
  const char *device_startdate_str;
  struct tm device_startdate;
  const char *device_expirydate_str;
  struct tm device_expirydate;
  const char *device_userid;

  /* CryptoModuleInfo */
  const char *cryptomodule_id;

  /* Key */
  const char *key_id;
  const char *key_algorithm;
  const char *key_userid;
  const char *key_issuer;
  const char *key_secret_str;
  const char *key_counter_str;
  uint64_t key_counter;
  const char *key_time_str;
  uint32_t key_time;
  const char *key_timeinterval_str;
  uint32_t key_timeinterval;
  const char *key_timedrift_str;
  uint32_t key_timedrift;
  const char *key_friendlyname;
  const char *key_profileid;
  const char *key_reference;
  const char *key_policy_keyusage_str;
  int key_policy_keyusages;
  const char *key_policy_numberoftransactions_str;
  uint64_t key_policy_numberoftransactions;
  const char *key_algparm_suite;
  const char *key_algparm_chall_encoding_str;
  pskc_valueformat key_algparm_chall_encoding;
  const char *key_algparm_chall_min_str;
  uint32_t key_algparm_chall_min;
  const char *key_algparm_chall_max_str;
  uint32_t key_algparm_chall_max;
  const char *key_algparm_chall_checkdigits_str;
  int key_algparm_chall_checkdigits;
  const char *key_algparm_resp_encoding_str;
  pskc_valueformat key_algparm_resp_encoding;
  const char *key_algparm_resp_length_str;
  uint32_t key_algparm_resp_length;
  const char *key_algparm_resp_checkdigits_str;
  int key_algparm_resp_checkdigits;
  const char *key_policy_startdate_str;
  struct tm key_policy_startdate;
  const char *key_policy_expirydate_str;
  struct tm key_policy_expirydate;
  const char *key_policy_pinmaxfailedattempts_str;
  uint32_t key_policy_pinmaxfailedattempts;
  const char *key_policy_pinminlength_str;
  uint32_t key_policy_pinminlength;
  const char *key_policy_pinmaxlength_str;
  uint32_t key_policy_pinmaxlength;
  const char *key_policy_pinkeyid;
  const char *key_policy_pinusagemode_str;
  pskc_pinusagemode key_policy_pinusagemode;
  const char *key_policy_pinencoding_str;
  pskc_valueformat key_policy_pinencoding;
};
#endif

#ifdef INTERNAL_NEED_PSKC_STRUCT
#include <libxml/parser.h>
struct pskc
{
  /* raw XML */
  xmlDocPtr xmldoc;
  /* Is there a Signature element in xmldoc? */
  int signed_p;

  /* parsed data */
  const char *version;
  const char *id;
  size_t nkeypackages;
  struct pskc_key *keypackages;
};
#endif

#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)
#define _GL_ATTRIBUTE_FORMAT(spec) __attribute__ ((__format__ spec))
#else
#define _GL_ATTRIBUTE_FORMAT(spec)	/* empty */
#endif

extern void
_pskc_debug (const char *format, ...)
_GL_ATTRIBUTE_FORMAT ((printf, 1, 2));