Coverage Report

Created: 2023-03-26 08:33

/src/gnutls/lib/x509/supported_exts.h
Line
Count
Source (jump to first uncovered line)
1
/* ANSI-C code produced by gperf version 3.1 */
2
/* Command-line: gperf --global-table -t supported_exts.gperf  */
3
/* Computed positions: -k'8-9,17' */
4
5
#if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \
6
      && ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \
7
      && (')' == 41) && ('*' == 42) && ('+' == 43) && (',' == 44) \
8
      && ('-' == 45) && ('.' == 46) && ('/' == 47) && ('0' == 48) \
9
      && ('1' == 49) && ('2' == 50) && ('3' == 51) && ('4' == 52) \
10
      && ('5' == 53) && ('6' == 54) && ('7' == 55) && ('8' == 56) \
11
      && ('9' == 57) && (':' == 58) && (';' == 59) && ('<' == 60) \
12
      && ('=' == 61) && ('>' == 62) && ('?' == 63) && ('A' == 65) \
13
      && ('B' == 66) && ('C' == 67) && ('D' == 68) && ('E' == 69) \
14
      && ('F' == 70) && ('G' == 71) && ('H' == 72) && ('I' == 73) \
15
      && ('J' == 74) && ('K' == 75) && ('L' == 76) && ('M' == 77) \
16
      && ('N' == 78) && ('O' == 79) && ('P' == 80) && ('Q' == 81) \
17
      && ('R' == 82) && ('S' == 83) && ('T' == 84) && ('U' == 85) \
18
      && ('V' == 86) && ('W' == 87) && ('X' == 88) && ('Y' == 89) \
19
      && ('Z' == 90) && ('[' == 91) && ('\\' == 92) && (']' == 93) \
20
      && ('^' == 94) && ('_' == 95) && ('a' == 97) && ('b' == 98) \
21
      && ('c' == 99) && ('d' == 100) && ('e' == 101) && ('f' == 102) \
22
      && ('g' == 103) && ('h' == 104) && ('i' == 105) && ('j' == 106) \
23
      && ('k' == 107) && ('l' == 108) && ('m' == 109) && ('n' == 110) \
24
      && ('o' == 111) && ('p' == 112) && ('q' == 113) && ('r' == 114) \
25
      && ('s' == 115) && ('t' == 116) && ('u' == 117) && ('v' == 118) \
26
      && ('w' == 119) && ('x' == 120) && ('y' == 121) && ('z' == 122) \
27
      && ('{' == 123) && ('|' == 124) && ('}' == 125) && ('~' == 126))
28
/* The character set is not based on ISO-646.  */
29
#error "gperf generated tables don't work with this execution character set. Please report a bug to <bug-gperf@gnu.org>."
30
#endif
31
32
#line 1 "supported_exts.gperf"
33
34
#line 8 "supported_exts.gperf"
35
struct supported_exts_st { const char *name; };
36
37
#define TOTAL_KEYWORDS 14
38
0
#define MIN_WORD_LENGTH 9
39
0
#define MAX_WORD_LENGTH 18
40
#define MIN_HASH_VALUE 13
41
0
#define MAX_HASH_VALUE 34
42
/* maximum key range = 22, duplicates = 0 */
43
44
#ifdef __GNUC__
45
__inline
46
#else
47
#ifdef __cplusplus
48
inline
49
#endif
50
#endif
51
static unsigned int
52
x509_ext_hash (register const char *str, register size_t len)
53
0
{
54
0
  static const unsigned char asso_values[] =
55
0
    {
56
0
      35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
57
0
      35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
58
0
      35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
59
0
      35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
60
0
      35, 35, 35, 35, 35, 35,  0, 35,  3, 10,
61
0
       4,  5,  4,  0, 35, 15, 13, 14, 35, 35,
62
0
      35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
63
0
      35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
64
0
      35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
65
0
      35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
66
0
      35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
67
0
      35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
68
0
      35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
69
0
      35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
70
0
      35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
71
0
      35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
72
0
      35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
73
0
      35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
74
0
      35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
75
0
      35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
76
0
      35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
77
0
      35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
78
0
      35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
79
0
      35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
80
0
      35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
81
0
      35, 35, 35, 35, 35, 35
82
0
    };
83
0
  register unsigned int hval = len;
84
85
0
  switch (hval)
86
0
    {
87
0
      default:
88
0
        hval += asso_values[(unsigned char)str[16]];
89
      /*FALLTHROUGH*/
90
0
      case 16:
91
0
      case 15:
92
0
      case 14:
93
0
      case 13:
94
0
      case 12:
95
0
      case 11:
96
0
      case 10:
97
0
      case 9:
98
0
        hval += asso_values[(unsigned char)str[8]];
99
      /*FALLTHROUGH*/
100
0
      case 8:
101
0
        hval += asso_values[(unsigned char)str[7]];
102
0
        break;
103
0
    }
104
0
  return hval;
105
0
}
106
107
static const struct supported_exts_st wordlist[] =
108
  {
109
    {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
110
    {""}, {""}, {""}, {""},
111
#line 40 "supported_exts.gperf"
112
    {"2.5.29.54"},
113
#line 26 "supported_exts.gperf"
114
    {"2.5.29.35"},
115
    {""}, {""},
116
#line 22 "supported_exts.gperf"
117
    {"2.5.29.30"},
118
#line 38 "supported_exts.gperf"
119
    {"2.5.29.32"},
120
#line 13 "supported_exts.gperf"
121
    {"2.5.29.15"},
122
    {""}, {""},
123
#line 34 "supported_exts.gperf"
124
    {"1.3.6.1.5.5.7.1.24"},
125
#line 11 "supported_exts.gperf"
126
    {"2.5.29.14"},
127
#line 24 "supported_exts.gperf"
128
    {"2.5.29.31"},
129
    {""}, {""},
130
#line 30 "supported_exts.gperf"
131
    {"1.3.6.1.5.5.7.1.1"},
132
#line 32 "supported_exts.gperf"
133
    {"1.3.6.1.5.5.7.1.14"},
134
#line 28 "supported_exts.gperf"
135
    {"2.5.29.37"},
136
    {""}, {""},
137
#line 18 "supported_exts.gperf"
138
    {"2.5.29.18"},
139
#line 20 "supported_exts.gperf"
140
    {"2.5.29.19"},
141
#line 16 "supported_exts.gperf"
142
    {"2.5.29.17"}
143
  };
144
145
static const struct supported_exts_st *
146
is_ext_oid_supported (register const char *str, register size_t len)
147
0
{
148
0
  if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
149
0
    {
150
0
      register unsigned int key = x509_ext_hash (str, len);
151
152
0
      if (key <= MAX_HASH_VALUE)
153
0
        {
154
0
          register const char *s = wordlist[key].name;
155
156
0
          if (*str == *s && !strcmp (str + 1, s + 1))
157
0
            return &wordlist[key];
158
0
        }
159
0
    }
160
0
  return 0;
161
0
}