Coverage Report

Created: 2026-05-16 06:52

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/gnutls/lib/x509/supported_exts.h
Line
Count
Source
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
3.71k
#define MIN_WORD_LENGTH 9
39
7.46k
#define MAX_WORD_LENGTH 18
40
#define MIN_HASH_VALUE 13
41
3.59k
#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
3.59k
{
54
3.59k
  static const unsigned char asso_values[] =
55
3.59k
    {
56
3.59k
      35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
57
3.59k
      35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
58
3.59k
      35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
59
3.59k
      35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
60
3.59k
      35, 35, 35, 35, 35, 35,  0, 35,  3, 10,
61
3.59k
       4,  5,  4,  0, 35, 15, 13, 14, 35, 35,
62
3.59k
      35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
63
3.59k
      35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
64
3.59k
      35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
65
3.59k
      35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
66
3.59k
      35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
67
3.59k
      35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
68
3.59k
      35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
69
3.59k
      35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
70
3.59k
      35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
71
3.59k
      35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
72
3.59k
      35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
73
3.59k
      35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
74
3.59k
      35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
75
3.59k
      35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
76
3.59k
      35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
77
3.59k
      35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
78
3.59k
      35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
79
3.59k
      35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
80
3.59k
      35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
81
3.59k
      35, 35, 35, 35, 35, 35
82
3.59k
    };
83
3.59k
  register unsigned int hval = len;
84
85
3.59k
  switch (hval)
86
3.59k
    {
87
31
      default:
88
31
        hval += asso_values[(unsigned char)str[16]];
89
      /*FALLTHROUGH*/
90
36
      case 16:
91
36
      case 15:
92
38
      case 14:
93
42
      case 13:
94
43
      case 12:
95
44
      case 11:
96
555
      case 10:
97
3.59k
      case 9:
98
3.59k
        hval += asso_values[(unsigned char)str[8]];
99
      /*FALLTHROUGH*/
100
3.59k
      case 8:
101
3.59k
        hval += asso_values[(unsigned char)str[7]];
102
3.59k
        break;
103
3.59k
    }
104
3.59k
  return hval;
105
3.59k
}
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
3.73k
{
148
3.73k
  if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
149
3.59k
    {
150
3.59k
      register unsigned int key = x509_ext_hash (str, len);
151
152
3.59k
      if (key <= MAX_HASH_VALUE)
153
3.54k
        {
154
3.54k
          register const char *s = wordlist[key].name;
155
156
3.54k
          if (*str == *s && !strcmp (str + 1, s + 1))
157
2.63k
            return &wordlist[key];
158
3.54k
        }
159
3.59k
    }
160
1.09k
  return 0;
161
3.73k
}