Blame lib/x509/supported_exts.h

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