libksba  1.6.0
About: KSBA is a library to make the tasks of working with X.509 certificates, CMS data and related objects more easy.
  Fossies Dox: libksba-1.6.0.tar.bz2  ("unofficial" and yet experimental doxygen-generated source code documentation)  

asn1-parse.c File Reference
#include <config.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <assert.h>
#include <ctype.h>
#include <errno.h>
#include "util.h"
#include "ksba.h"
#include "asn1-func.h"
#include <stddef.h>
Include dependency graph for asn1-parse.c:

Go to the source code of this file.

Data Structures

struct  parser_control_s
 
union  YYSTYPE
 
union  yyalloc
 

Macros

#define YYBISON   1
 
#define YYBISON_VERSION   "3.3.2"
 
#define YYSKELETON_NAME   "yacc.c"
 
#define YYPURE   2
 
#define YYPUSH   0
 
#define YYPULL   1
 
#define yyparse   _ksba_asn1_yyparse
 
#define MAX_STRING_LENGTH   129
 
#define YYPRINT(F, N, L)   do { } while (0);
 
#define PARSECTL   ((struct parser_control_s *)parm)
 
#define YY_NULLPTR   ((void*)0)
 
#define YYERROR_VERBOSE   1
 
#define YYDEBUG   0
 
#define YYTOKENTYPE
 
#define YYSTYPE_IS_TRIVIAL   1
 
#define YYSTYPE_IS_DECLARED   1
 
#define NEW_NODE(a)   (new_node (PARSECTL, (a)))
 
#define YYSIZE_T   size_t
 
#define YYSIZE_MAXIMUM   ((YYSIZE_T) -1)
 
#define YY_(Msgid)   Msgid
 
#define YY_ATTRIBUTE(Spec)   /* empty */
 
#define YY_ATTRIBUTE_PURE   YY_ATTRIBUTE ((__pure__))
 
#define YY_ATTRIBUTE_UNUSED   YY_ATTRIBUTE ((__unused__))
 
#define YYUSE(E)   ((void) (E))
 
#define YY_INITIAL_VALUE(Value)   Value
 
#define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
 
#define YY_IGNORE_MAYBE_UNINITIALIZED_END
 
#define YYSTACK_ALLOC   YYMALLOC
 
#define YYSTACK_FREE   YYFREE
 
#define YYSTACK_ALLOC_MAXIMUM   YYSIZE_MAXIMUM
 
#define YYMALLOC   malloc
 
#define YYFREE   free
 
#define YYSTACK_GAP_MAXIMUM   (sizeof (union yyalloc) - 1)
 
#define YYSTACK_BYTES(N)
 
#define YYCOPY_NEEDED   1
 
#define YYSTACK_RELOCATE(Stack_alloc, Stack)
 
#define YYCOPY(Dst, Src, Count)
 
#define YYFINAL   2
 
#define YYLAST   195
 
#define YYNTOKENS   57
 
#define YYNNTS   51
 
#define YYNRULES   116
 
#define YYNSTATES   203
 
#define YYUNDEFTOK   2
 
#define YYMAXUTOK   301
 
#define YYTRANSLATE(YYX)    ((unsigned) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
 
#define YYPACT_NINF   -137
 
#define yypact_value_is_default(Yystate)    (!!((Yystate) == (-137)))
 
#define YYTABLE_NINF   -1
 
#define yytable_value_is_error(Yytable_value)    0
 
#define yyerrok   (yyerrstatus = 0)
 
#define yyclearin   (yychar = YYEMPTY)
 
#define YYEMPTY   (-2)
 
#define YYEOF   0
 
#define YYACCEPT   goto yyacceptlab
 
#define YYABORT   goto yyabortlab
 
#define YYERROR   goto yyerrorlab
 
#define YYRECOVERING()   (!!yyerrstatus)
 
#define YYBACKUP(Token, Value)
 
#define YYTERROR   1
 
#define YYERRCODE   256
 
#define YYDPRINTF(Args)
 
#define YY_SYMBOL_PRINT(Title, Type, Value, Location)
 
#define YY_STACK_PRINT(Bottom, Top)
 
#define YY_REDUCE_PRINT(Rule)
 
#define YYINITDEPTH   200
 
#define YYMAXDEPTH   10000
 
#define YYCASE_(N, S)
 
#define YYPOPSTACK(N)   (yyvsp -= (N), yyssp -= (N))
 
#define YYSYNTAX_ERROR
 

Typedefs

typedef union YYSTYPE YYSTYPE
 
typedef unsigned char yytype_uint8
 
typedef signed char yytype_int8
 
typedef unsigned short yytype_uint16
 
typedef short yytype_int16
 

Enumerations

enum  { CONST_EXPLICIT = 1 , CONST_IMPLICIT }
 
enum  yytokentype {
  ASSIG = 258 , NUM = 259 , IDENTIFIER = 260 , OPTIONAL = 261 ,
  INTEGER = 262 , SIZE = 263 , OCTET = 264 , STRING = 265 ,
  SEQUENCE = 266 , BIT = 267 , UNIVERSAL = 268 , PRIVATE = 269 ,
  DEFAULT = 270 , CHOICE = 271 , OF = 272 , OBJECT = 273 ,
  STR_IDENTIFIER = 274 , ksba_BOOLEAN = 275 , ksba_TRUE = 276 , ksba_FALSE = 277 ,
  APPLICATION = 278 , ANY = 279 , DEFINED = 280 , SET = 281 ,
  BY = 282 , EXPLICIT = 283 , IMPLICIT = 284 , DEFINITIONS = 285 ,
  TAGS = 286 , ksba_BEGIN = 287 , ksba_END = 288 , UTCTime = 289 ,
  GeneralizedTime = 290 , FROM = 291 , IMPORTS = 292 , TOKEN_NULL = 293 ,
  ENUMERATED = 294 , UTF8STRING = 295 , NUMERICSTRING = 296 , PRINTABLESTRING = 297 ,
  TELETEXSTRING = 298 , IA5STRING = 299 , UNIVERSALSTRING = 300 , BMPSTRING = 301
}
 

Functions

int _ksba_asn1_yyparse (void *parm)
 
static AsnNode new_node (struct parser_control_s *parsectl, node_type_t type)
 
static void set_name (AsnNode node, const char *name)
 
static void set_str_value (AsnNode node, const char *text)
 
static void set_ulong_value (AsnNode node, const char *text)
 
static void set_right (AsnNode node, AsnNode right)
 
static void append_right (AsnNode node, AsnNode right)
 
static void set_down (AsnNode node, AsnNode down)
 
static int yylex (YYSTYPE *lvalp, void *parm)
 
static void yyerror (void *parm, const char *s)
 
void * malloc (size_t)
 
void free (void *)
 
static size_t yystrlen (const char *yystr)
 
static char * yystpcpy (char *yydest, const char *yysrc)
 
static size_t yytnamerr (char *yyres, const char *yystr)
 
static int yysyntax_error (size_t *yymsg_alloc, char **yymsg, yytype_int16 *yyssp, int yytoken)
 
static void yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, void *parm)
 
static void release_all_nodes (AsnNode node)
 
int _ksba_asn_parse_file (const char *file_name, ksba_asn_tree_t *result, int debug)
 
void _ksba_asn_tree_release (ksba_asn_tree_t tree)
 
void _ksba_asn_release_nodes (AsnNode node)
 

Variables

static const yytype_uint8 yytranslate []
 
static const char *const yytname []
 
static const yytype_uint16 yytoknum []
 
static const yytype_int16 yypact []
 
static const yytype_uint8 yydefact []
 
static const yytype_int16 yypgoto []
 
static const yytype_int16 yydefgoto []
 
static const yytype_uint8 yytable []
 
static const yytype_int16 yycheck []
 
static const yytype_uint8 yystos []
 
static const yytype_uint8 yyr1 []
 
static const yytype_uint8 yyr2 []
 

Macro Definition Documentation

◆ MAX_STRING_LENGTH

#define MAX_STRING_LENGTH   129

Definition at line 95 of file asn1-parse.c.

◆ NEW_NODE

#define NEW_NODE (   a)    (new_node (PARSECTL, (a)))

Definition at line 229 of file asn1-parse.c.

◆ PARSECTL

#define PARSECTL   ((struct parser_control_s *)parm)

Definition at line 115 of file asn1-parse.c.

◆ YY_

#define YY_ (   Msgid)    Msgid

Definition at line 294 of file asn1-parse.c.

◆ YY_ATTRIBUTE

#define YY_ATTRIBUTE (   Spec)    /* empty */

Definition at line 304 of file asn1-parse.c.

◆ YY_ATTRIBUTE_PURE

#define YY_ATTRIBUTE_PURE   YY_ATTRIBUTE ((__pure__))

Definition at line 309 of file asn1-parse.c.

◆ YY_ATTRIBUTE_UNUSED

#define YY_ATTRIBUTE_UNUSED   YY_ATTRIBUTE ((__unused__))

Definition at line 313 of file asn1-parse.c.

◆ YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN

#define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN

Definition at line 335 of file asn1-parse.c.

◆ YY_IGNORE_MAYBE_UNINITIALIZED_END

#define YY_IGNORE_MAYBE_UNINITIALIZED_END

Definition at line 336 of file asn1-parse.c.

◆ YY_INITIAL_VALUE

#define YY_INITIAL_VALUE (   Value)    Value

Definition at line 332 of file asn1-parse.c.

◆ YY_NULLPTR

#define YY_NULLPTR   ((void*)0)

Definition at line 127 of file asn1-parse.c.

◆ YY_REDUCE_PRINT

#define YY_REDUCE_PRINT (   Rule)

Definition at line 957 of file asn1-parse.c.

◆ YY_STACK_PRINT

#define YY_STACK_PRINT (   Bottom,
  Top 
)

Definition at line 956 of file asn1-parse.c.

◆ YY_SYMBOL_PRINT

#define YY_SYMBOL_PRINT (   Title,
  Type,
  Value,
  Location 
)

Definition at line 955 of file asn1-parse.c.

◆ YYABORT

#define YYABORT   goto yyabortlab

Definition at line 801 of file asn1-parse.c.

◆ YYACCEPT

#define YYACCEPT   goto yyacceptlab

Definition at line 800 of file asn1-parse.c.

◆ YYBACKUP

#define YYBACKUP (   Token,
  Value 
)
Value:
do \
if (yychar == YYEMPTY) \
{ \
yychar = (Token); \
yylval = (Value); \
YYPOPSTACK (yylen); \
yystate = *yyssp; \
goto yybackup; \
} \
else \
{ \
yyerror (parm, YY_("syntax error: cannot back up")); \
YYERROR; \
} \
while (0)
#define YY_(Msgid)
Definition: asn1-parse.c:294
#define YYEMPTY
Definition: asn1-parse.c:797

Definition at line 807 of file asn1-parse.c.

◆ YYBISON

#define YYBISON   1

Definition at line 48 of file asn1-parse.c.

◆ YYBISON_VERSION

#define YYBISON_VERSION   "3.3.2"

Definition at line 51 of file asn1-parse.c.

◆ YYCASE_

#define YYCASE_ (   N,
 
)
Value:
case N: \
yyformat = S; \
break
#define N
Definition: dn.c:85

◆ yyclearin

#define yyclearin   (yychar = YYEMPTY)

Definition at line 796 of file asn1-parse.c.

◆ YYCOPY

#define YYCOPY (   Dst,
  Src,
  Count 
)
Value:
do \
{ \
YYSIZE_T yyi; \
for (yyi = 0; yyi < (Count); yyi++) \
(Dst)[yyi] = (Src)[yyi]; \
} \
while (0)

Definition at line 459 of file asn1-parse.c.

◆ YYCOPY_NEEDED

#define YYCOPY_NEEDED   1

Definition at line 431 of file asn1-parse.c.

◆ YYDEBUG

#define YYDEBUG   0

Definition at line 142 of file asn1-parse.c.

◆ YYDPRINTF

#define YYDPRINTF (   Args)

Definition at line 954 of file asn1-parse.c.

◆ YYEMPTY

#define YYEMPTY   (-2)

Definition at line 797 of file asn1-parse.c.

◆ YYEOF

#define YYEOF   0

Definition at line 798 of file asn1-parse.c.

◆ YYERRCODE

#define YYERRCODE   256

Definition at line 826 of file asn1-parse.c.

◆ yyerrok

#define yyerrok   (yyerrstatus = 0)

Definition at line 795 of file asn1-parse.c.

◆ YYERROR

#define YYERROR   goto yyerrorlab

Definition at line 802 of file asn1-parse.c.

◆ YYERROR_VERBOSE

#define YYERROR_VERBOSE   1

Definition at line 136 of file asn1-parse.c.

◆ YYFINAL

#define YYFINAL   2

Definition at line 472 of file asn1-parse.c.

◆ YYFREE

#define YYFREE   free

Definition at line 402 of file asn1-parse.c.

◆ YYINITDEPTH

#define YYINITDEPTH   200

Definition at line 963 of file asn1-parse.c.

◆ YYLAST

#define YYLAST   195

Definition at line 474 of file asn1-parse.c.

◆ YYMALLOC

#define YYMALLOC   malloc

Definition at line 396 of file asn1-parse.c.

◆ YYMAXDEPTH

#define YYMAXDEPTH   10000

Definition at line 974 of file asn1-parse.c.

◆ YYMAXUTOK

#define YYMAXUTOK   301

Definition at line 486 of file asn1-parse.c.

◆ YYNNTS

#define YYNNTS   51

Definition at line 479 of file asn1-parse.c.

◆ YYNRULES

#define YYNRULES   116

Definition at line 481 of file asn1-parse.c.

◆ YYNSTATES

#define YYNSTATES   203

Definition at line 483 of file asn1-parse.c.

◆ YYNTOKENS

#define YYNTOKENS   57

Definition at line 477 of file asn1-parse.c.

◆ YYPACT_NINF

#define YYPACT_NINF   -137

Definition at line 595 of file asn1-parse.c.

◆ yypact_value_is_default

#define yypact_value_is_default (   Yystate)     (!!((Yystate) == (-137)))

Definition at line 597 of file asn1-parse.c.

◆ yyparse

#define yyparse   _ksba_asn1_yyparse

Definition at line 92 of file asn1-parse.c.

◆ YYPOPSTACK

#define YYPOPSTACK (   N)    (yyvsp -= (N), yyssp -= (N))

◆ YYPRINT

#define YYPRINT (   F,
  N,
 
)    do { } while (0);

Definition at line 98 of file asn1-parse.c.

◆ YYPULL

#define YYPULL   1

Definition at line 63 of file asn1-parse.c.

◆ YYPURE

#define YYPURE   2

Definition at line 57 of file asn1-parse.c.

◆ YYPUSH

#define YYPUSH   0

Definition at line 60 of file asn1-parse.c.

◆ YYRECOVERING

#define YYRECOVERING ( )    (!!yyerrstatus)

Definition at line 805 of file asn1-parse.c.

◆ YYSIZE_MAXIMUM

#define YYSIZE_MAXIMUM   ((YYSIZE_T) -1)

Definition at line 284 of file asn1-parse.c.

◆ YYSIZE_T

#define YYSIZE_T   size_t

Definition at line 278 of file asn1-parse.c.

◆ YYSKELETON_NAME

#define YYSKELETON_NAME   "yacc.c"

Definition at line 54 of file asn1-parse.c.

◆ YYSTACK_ALLOC

#define YYSTACK_ALLOC   YYMALLOC

Definition at line 382 of file asn1-parse.c.

◆ YYSTACK_ALLOC_MAXIMUM

#define YYSTACK_ALLOC_MAXIMUM   YYSIZE_MAXIMUM

Definition at line 385 of file asn1-parse.c.

◆ YYSTACK_BYTES

#define YYSTACK_BYTES (   N)
Value:
((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
short yytype_int16
Definition: asn1-parse.c:268
union YYSTYPE YYSTYPE
Definition: asn1-parse.c:214
#define YYSTACK_GAP_MAXIMUM
Definition: asn1-parse.c:423

Definition at line 427 of file asn1-parse.c.

◆ YYSTACK_FREE

#define YYSTACK_FREE   YYFREE

Definition at line 383 of file asn1-parse.c.

◆ YYSTACK_GAP_MAXIMUM

#define YYSTACK_GAP_MAXIMUM   (sizeof (union yyalloc) - 1)

Definition at line 423 of file asn1-parse.c.

◆ YYSTACK_RELOCATE

#define YYSTACK_RELOCATE (   Stack_alloc,
  Stack 
)
Value:
do \
{ \
YYSIZE_T yynewbytes; \
YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
Stack = &yyptr->Stack_alloc; \
yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
yyptr += yynewbytes / sizeof (*yyptr); \
} \
while (0)

Definition at line 438 of file asn1-parse.c.

◆ YYSTYPE_IS_DECLARED

#define YYSTYPE_IS_DECLARED   1

Definition at line 216 of file asn1-parse.c.

◆ YYSTYPE_IS_TRIVIAL

#define YYSTYPE_IS_TRIVIAL   1

Definition at line 215 of file asn1-parse.c.

◆ YYSYNTAX_ERROR

#define YYSYNTAX_ERROR
Value:
yysyntax_error (&yymsg_alloc, &yymsg, \
yyssp, yytoken)
static int yysyntax_error(size_t *yymsg_alloc, char **yymsg, yytype_int16 *yyssp, int yytoken)
Definition: asn1-parse.c:1076

◆ YYTABLE_NINF

#define YYTABLE_NINF   -1

Definition at line 600 of file asn1-parse.c.

◆ yytable_value_is_error

#define yytable_value_is_error (   Yytable_value)     0

Definition at line 602 of file asn1-parse.c.

◆ YYTERROR

#define YYTERROR   1

Definition at line 825 of file asn1-parse.c.

◆ YYTOKENTYPE

#define YYTOKENTYPE

Definition at line 150 of file asn1-parse.c.

◆ YYTRANSLATE

#define YYTRANSLATE (   YYX)     ((unsigned) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)

Definition at line 490 of file asn1-parse.c.

◆ YYUNDEFTOK

#define YYUNDEFTOK   2

Definition at line 485 of file asn1-parse.c.

◆ YYUSE

#define YYUSE (   E)    ((void) (E))

Definition at line 318 of file asn1-parse.c.

Typedef Documentation

◆ YYSTYPE

typedef union YYSTYPE YYSTYPE

Definition at line 1 of file asn1-parse.c.

◆ yytype_int16

typedef short yytype_int16

Definition at line 268 of file asn1-parse.c.

◆ yytype_int8

typedef signed char yytype_int8

Definition at line 256 of file asn1-parse.c.

◆ yytype_uint16

typedef unsigned short yytype_uint16

Definition at line 262 of file asn1-parse.c.

◆ yytype_uint8

typedef unsigned char yytype_uint8

Definition at line 250 of file asn1-parse.c.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
CONST_EXPLICIT 
CONST_IMPLICIT 

Definition at line 102 of file asn1-parse.c.

◆ yytokentype

Enumerator
ASSIG 
NUM 
IDENTIFIER 
OPTIONAL 
INTEGER 
SIZE 
OCTET 
STRING 
SEQUENCE 
BIT 
UNIVERSAL 
PRIVATE 
DEFAULT 
CHOICE 
OF 
OBJECT 
STR_IDENTIFIER 
ksba_BOOLEAN 
ksba_TRUE 
ksba_FALSE 
APPLICATION 
ANY 
DEFINED 
SET 
BY 
EXPLICIT 
IMPLICIT 
DEFINITIONS 
TAGS 
ksba_BEGIN 
ksba_END 
UTCTime 
GeneralizedTime 
FROM 
IMPORTS 
TOKEN_NULL 
ENUMERATED 
UTF8STRING 
NUMERICSTRING 
PRINTABLESTRING 
TELETEXSTRING 
IA5STRING 
UNIVERSALSTRING 
BMPSTRING 

Definition at line 151 of file asn1-parse.c.

Function Documentation

◆ _ksba_asn1_yyparse()

int _ksba_asn1_yyparse ( void *  parm)

Definition at line 1231 of file asn1-parse.c.

References _ksba_asn_check_identifier(), _ksba_asn_set_default_tag(), _ksba_asn_type_set_config(), append_right(), CLASS_APPLICATION, CLASS_CONTEXT, CLASS_PRIVATE, CLASS_UNIVERSAL, CONST_EXPLICIT, CONST_IMPLICIT, YYSTYPE::constant, node_flag_s::explicit, asn_node_struct::flags, node_flag_s::has_imports, node_flag_s::implicit, name, NEW_NODE, YYSTYPE::node, PARSECTL, set_down(), set_name(), set_right(), set_str_value(), set_ulong_value(), YYSTYPE::str, TYPE_ANY, TYPE_BIT_STRING, TYPE_BMP_STRING, TYPE_BOOLEAN, TYPE_CHOICE, TYPE_CONSTANT, TYPE_DEFAULT, TYPE_DEFINITIONS, TYPE_ENUMERATED, TYPE_GENERALIZED_TIME, TYPE_IA5_STRING, TYPE_IDENTIFIER, TYPE_INTEGER, TYPE_NULL, TYPE_NUMERIC_STRING, TYPE_OBJECT_ID, TYPE_OCTET_STRING, TYPE_PRINTABLE_STRING, TYPE_SEQUENCE, TYPE_SEQUENCE_OF, TYPE_SET, TYPE_SET_OF, TYPE_SIZE, TYPE_TAG, TYPE_TELETEX_STRING, TYPE_UNIVERSAL_STRING, TYPE_UTC_TIME, TYPE_UTF8_STRING, YY_, YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN, YY_IGNORE_MAYBE_UNINITIALIZED_END, YY_INITIAL_VALUE, YY_REDUCE_PRINT, YY_STACK_PRINT, YY_SYMBOL_PRINT, YYABORT, YYACCEPT, yycheck, yydefact, yydefgoto, yydestruct(), YYDPRINTF, YYEMPTY, YYEOF, YYERROR, yyerror(), YYFINAL, YYINITDEPTH, YYLAST, yylex(), YYMAXDEPTH, YYNTOKENS, yypact, yypact_value_is_default, yypgoto, YYPOPSTACK, yyr1, yyr2, YYSIZE_T, yyalloc::yyss_alloc, YYSTACK_ALLOC, YYSTACK_BYTES, YYSTACK_FREE, YYSTACK_RELOCATE, yystos, YYSYNTAX_ERROR, yytable, yytable_value_is_error, YYTERROR, YYTRANSLATE, and yyalloc::yyvs_alloc.

◆ _ksba_asn_parse_file()

int _ksba_asn_parse_file ( const char *  file_name,
ksba_asn_tree_t result,
int  debug 
)

ksba_asn_parse_file: @file_name: Filename with the ASN module @pointer: Returns the syntax tree @debug: Enable debug output

Parse an ASN.1 file and return an syntax tree.

Return value: 0 for okay or an ASN_xx error code

Definition at line 2833 of file asn1-parse.c.

References _ksba_asn_change_integer_value(), _ksba_asn_expand_object_id(), parser_control_s::all_nodes, parser_control_s::debug, ksba_asn_tree_s::filename, parser_control_s::fp, GPG_ERR_SYNTAX, gpg_error, gpg_error_from_syserror, parser_control_s::lineno, ksba_asn_tree_s::node_list, ksba_asn_tree_s::parse_tree, parser_control_s::parse_tree, release_all_nodes(), parser_control_s::result_parse, xmalloc, and yyparse.

◆ _ksba_asn_release_nodes()

◆ _ksba_asn_tree_release()

void _ksba_asn_tree_release ( ksba_asn_tree_t  tree)

Definition at line 2875 of file asn1-parse.c.

References ksba_asn_tree_s::node_list, release_all_nodes(), and xfree.

◆ append_right()

static void append_right ( AsnNode  node,
AsnNode  right 
)
static

Definition at line 2798 of file asn1-parse.c.

References asn_node_struct::left, return_if_fail, and asn_node_struct::right.

Referenced by _ksba_asn1_yyparse().

◆ free()

void free ( void *  )

◆ malloc()

void* malloc ( size_t  )

Referenced by alloca(), and xmalloc().

◆ new_node()

static AsnNode new_node ( struct parser_control_s parsectl,
node_type_t  type 
)
static

◆ release_all_nodes()

◆ set_down()

static void set_down ( AsnNode  node,
AsnNode  down 
)
static

Definition at line 2812 of file asn1-parse.c.

References asn_node_struct::down, asn_node_struct::left, and return_if_fail.

Referenced by _ksba_asn1_yyparse().

◆ set_name()

static void set_name ( AsnNode  node,
const char *  name 
)
static

Definition at line 2761 of file asn1-parse.c.

References _ksba_asn_set_name(), and name.

Referenced by _ksba_asn1_yyparse().

◆ set_right()

static void set_right ( AsnNode  node,
AsnNode  right 
)
static

Definition at line 2788 of file asn1-parse.c.

References asn_node_struct::left, return_if_fail, and asn_node_struct::right.

Referenced by _ksba_asn1_yyparse().

◆ set_str_value()

static void set_str_value ( AsnNode  node,
const char *  text 
)
static

Definition at line 2767 of file asn1-parse.c.

References _ksba_asn_set_value(), VALTYPE_CSTR, and VALTYPE_NULL.

Referenced by _ksba_asn1_yyparse().

◆ set_ulong_value()

static void set_ulong_value ( AsnNode  node,
const char *  text 
)
static

Definition at line 2776 of file asn1-parse.c.

References _ksba_asn_set_value(), and VALTYPE_ULONG.

Referenced by _ksba_asn1_yyparse().

◆ yydestruct()

static void yydestruct ( const char *  yymsg,
int  yytype,
YYSTYPE yyvaluep,
void *  parm 
)
static

◆ yyerror()

static void yyerror ( void *  parm,
const char *  s 
)
static

Definition at line 2715 of file asn1-parse.c.

Referenced by _ksba_asn1_yyparse().

◆ yylex()

static int yylex ( YYSTYPE lvalp,
void *  parm 
)
static

Definition at line 2615 of file asn1-parse.c.

References DIM, IDENTIFIER, MAX_STRING_LENGTH, NUM, PARSECTL, YYSTYPE::str, YYNTOKENS, yytname, and yytoknum.

Referenced by _ksba_asn1_yyparse().

◆ yystpcpy()

static char* yystpcpy ( char *  yydest,
const char *  yysrc 
)
static

Definition at line 1003 of file asn1-parse.c.

Referenced by yytnamerr().

◆ yystrlen()

static size_t yystrlen ( const char *  yystr)
static

Definition at line 986 of file asn1-parse.c.

References YYSIZE_T.

Referenced by yysyntax_error(), and yytnamerr().

◆ yysyntax_error()

static int yysyntax_error ( size_t *  yymsg_alloc,
char **  yymsg,
yytype_int16 yyssp,
int  yytoken 
)
static

◆ yytnamerr()

static size_t yytnamerr ( char *  yyres,
const char *  yystr 
)
static

Definition at line 1025 of file asn1-parse.c.

References YYSIZE_T, yystpcpy(), and yystrlen().

Referenced by yysyntax_error().

Variable Documentation

◆ yycheck

const yytype_int16 yycheck[]
static
Initial value:
=
{
12, 59, 116, 4, 5, 39, 120, 4, 5, 4,
5, 45, 5, 149, 117, 54, 50, 51, 52, 53,
54, 55, 56, 5, 8, 8, 4, 3, 8, 5,
30, 7, 90, 0, 17, 13, 14, 17, 5, 97,
6, 4, 18, 146, 50, 23, 31, 183, 51, 15,
56, 33, 55, 49, 55, 89, 49, 5, 55, 7,
55, 9, 3, 11, 12, 49, 49, 4, 16, 49,
18, 54, 20, 131, 54, 189, 24, 191, 26, 137,
4, 5, 4, 5, 47, 48, 34, 35, 4, 5,
38, 39, 40, 41, 42, 43, 44, 45, 46, 21,
22, 5, 51, 7, 52, 9, 55, 11, 12, 51,
5, 51, 16, 55, 18, 55, 20, 51, 32, 51,
24, 55, 26, 55, 94, 47, 48, 50, 98, 3,
34, 35, 3, 145, 38, 39, 40, 41, 42, 43,
44, 45, 46, 28, 29, 28, 29, 19, 54, 10,
10, 54, 19, 54, 54, 25, 49, 4, 3, 49,
8, 5, 174, 17, 27, 54, 17, 5, 4, 53,
50, 49, 54, 5, 49, 56, 53, 4, 4, 4,
56, 50, 50, 56, 50, 50, 50, 156, 85, 132,
169, -1, 128, -1, 29, 160
}

Definition at line 709 of file asn1-parse.c.

Referenced by _ksba_asn1_yyparse(), and yysyntax_error().

◆ yydefact

const yytype_uint8 yydefact[]
static
Initial value:
=
{
2, 0, 1, 0, 0, 3, 0, 0, 9, 10,
17, 19, 0, 114, 115, 0, 0, 112, 20, 0,
0, 0, 18, 113, 0, 0, 108, 109, 110, 0,
0, 0, 0, 0, 116, 111, 72, 32, 0, 0,
0, 0, 0, 35, 102, 0, 36, 37, 86, 0,
44, 46, 48, 50, 52, 54, 56, 0, 26, 0,
74, 76, 78, 79, 58, 59, 60, 61, 62, 63,
64, 77, 80, 75, 82, 87, 104, 81, 85, 83,
84, 0, 0, 0, 0, 0, 40, 73, 0, 42,
0, 0, 0, 68, 0, 71, 0, 0, 0, 0,
0, 45, 47, 49, 51, 53, 55, 57, 0, 21,
22, 23, 0, 27, 28, 88, 0, 0, 107, 0,
0, 0, 0, 0, 15, 0, 43, 96, 0, 93,
0, 0, 0, 0, 0, 99, 0, 0, 0, 66,
0, 24, 0, 10, 0, 0, 0, 0, 41, 0,
4, 0, 0, 7, 8, 0, 0, 33, 89, 92,
0, 95, 97, 0, 101, 103, 98, 100, 0, 0,
70, 25, 0, 106, 0, 38, 0, 0, 5, 6,
13, 16, 91, 0, 90, 94, 69, 0, 67, 0,
105, 0, 14, 12, 30, 31, 11, 29, 65, 0,
0, 34, 39
}

Definition at line 635 of file asn1-parse.c.

Referenced by _ksba_asn1_yyparse().

◆ yydefgoto

const yytype_int16 yydefgoto[]
static
Initial value:
=
{
-1, 1, 153, 154, 155, 10, 197, 124, 125, 11,
12, 112, 58, 59, 184, 60, 61, 62, 86, 87,
63, 64, 65, 66, 67, 68, 69, 70, 71, 139,
140, 72, 73, 74, 75, 76, 159, 129, 130, 77,
78, 79, 80, 26, 27, 28, 29, 4, 24, 15,
5
}

Definition at line 672 of file asn1-parse.c.

Referenced by _ksba_asn1_yyparse().

◆ yypact

const yytype_int16 yypact[]
static
Initial value:
=
{
-137, 33, -137, -39, 0, -137, 76, 115, -137, 4,
-137, -137, -1, -137, -137, 15, 63, -137, -137, 59,
77, 86, -137, -137, 105, 24, -137, -137, -137, 18,
52, 126, 129, 128, -137, -137, 16, 94, 139, 17,
140, 97, 133, -137, 130, 20, -137, -137, -137, 99,
16, 16, 16, 16, 16, 16, 16, 22, 117, 96,
107, -137, -137, -137, -137, -137, -137, -137, -137, -137,
-137, -137, -137, -137, -137, -137, -137, -137, -137, -137,
-137, 100, 153, 155, 110, 152, -137, -137, 7, 16,
96, 156, 146, 111, 156, -137, 137, 96, 156, 149,
162, -137, -137, -137, -137, -137, -137, -137, 116, -137,
-137, -137, 164, -137, -137, -137, 84, 76, -137, 118,
84, 120, 122, 37, -137, -3, -137, -137, 52, -137,
51, 96, 162, 58, 168, -137, 60, 96, 125, -137,
66, -137, 123, -137, 119, 3, 76, -6, -137, 37,
-137, 173, 174, -137, -137, 131, 7, -137, 34, -137,
156, -137, -137, 68, -137, -137, -137, -137, 175, 162,
-137, -137, 124, -137, 5, -137, 127, 132, -137, -137,
-137, -137, -137, 78, -137, -137, -137, 134, -137, 84,
-137, 84, -137, -137, -137, -137, -137, -137, -137, 135,
136, -137, -137
}

Definition at line 607 of file asn1-parse.c.

Referenced by _ksba_asn1_yyparse(), and yysyntax_error().

◆ yypgoto

const yytype_int16 yypgoto[]
static
Initial value:
=
{
-137, -137, -137, -137, -136, -114, -137, 31, -137, -12,
-103, -137, -137, -137, -137, -137, -137, -137, 103, -34,
-137, -137, -137, -137, -137, -137, -137, -137, -137, 21,
57, -137, -137, -137, -58, 64, -137, 35, 30, -137,
-137, -137, -137, -137, -137, 165, -137, -137, -137, -137,
-137
}

Definition at line 661 of file asn1-parse.c.

Referenced by _ksba_asn1_yyparse().

◆ yyr1

const yytype_uint8 yyr1[]
static
Initial value:
=
{
0, 57, 58, 58, 59, 59, 60, 61, 61, 62,
62, 63, 63, 64, 64, 65, 65, 66, 66, 67,
67, 68, 68, 68, 69, 69, 70, 70, 70, 71,
71, 71, 72, 72, 72, 73, 74, 74, 75, 75,
76, 76, 77, 77, 78, 78, 79, 79, 80, 80,
81, 81, 82, 82, 83, 83, 84, 84, 85, 85,
85, 85, 85, 85, 85, 86, 87, 87, 88, 88,
89, 90, 91, 91, 91, 91, 91, 91, 91, 91,
91, 91, 91, 91, 91, 91, 91, 92, 92, 93,
93, 93, 94, 95, 95, 96, 96, 96, 97, 97,
97, 98, 99, 99, 100, 101, 101, 101, 102, 102,
103, 103, 104, 105, 106, 106, 107
}

Definition at line 761 of file asn1-parse.c.

Referenced by _ksba_asn1_yyparse().

◆ yyr2

const yytype_uint8 yyr2[]
static
Initial value:
=
{
0, 2, 0, 2, 1, 2, 2, 1, 1, 1,
1, 1, 1, 3, 4, 1, 3, 1, 4, 1,
2, 1, 1, 1, 3, 4, 1, 2, 2, 2,
2, 2, 1, 4, 7, 1, 1, 1, 4, 7,
1, 3, 2, 3, 1, 2, 1, 2, 1, 2,
1, 2, 1, 2, 1, 2, 1, 2, 1, 1,
1, 1, 1, 1, 1, 4, 1, 3, 2, 5,
4, 2, 1, 2, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 2, 1,
2, 2, 2, 1, 3, 4, 3, 4, 4, 3,
4, 4, 1, 4, 3, 7, 6, 4, 1, 1,
1, 2, 4, 0, 1, 1, 9
}

Definition at line 778 of file asn1-parse.c.

Referenced by _ksba_asn1_yyparse().

◆ yystos

const yytype_uint8 yystos[]
static
Initial value:
=
{
0, 58, 0, 5, 104, 107, 54, 30, 4, 5,
62, 66, 67, 28, 29, 106, 49, 55, 66, 31,
4, 3, 50, 32, 105, 5, 100, 101, 102, 103,
3, 5, 7, 18, 33, 102, 5, 7, 9, 11,
12, 16, 18, 20, 24, 26, 34, 35, 38, 39,
40, 41, 42, 43, 44, 45, 46, 52, 69, 70,
72, 73, 74, 77, 78, 79, 80, 81, 82, 83,
84, 85, 88, 89, 90, 91, 92, 96, 97, 98,
99, 3, 3, 19, 8, 49, 75, 76, 54, 10,
17, 54, 76, 10, 54, 19, 25, 17, 54, 76,
54, 76, 76, 76, 76, 76, 76, 76, 4, 13,
14, 23, 68, 28, 29, 91, 49, 54, 4, 3,
49, 75, 5, 49, 64, 65, 76, 91, 5, 94,
95, 17, 54, 95, 27, 91, 95, 17, 5, 86,
87, 53, 4, 5, 62, 67, 54, 62, 50, 49,
4, 47, 48, 59, 60, 61, 51, 55, 92, 93,
51, 55, 91, 87, 55, 5, 55, 91, 49, 51,
55, 53, 56, 55, 67, 50, 56, 61, 4, 4,
50, 64, 6, 15, 71, 94, 55, 4, 86, 56,
55, 56, 50, 5, 21, 22, 61, 63, 50, 62,
62, 50, 50
}

Definition at line 735 of file asn1-parse.c.

Referenced by _ksba_asn1_yyparse().

◆ yytable

const yytype_uint8 yytable[]
static
Initial value:
=
{
18, 115, 144, 8, 9, 92, 147, 8, 9, 8,
9, 99, 122, 177, 145, 6, 101, 102, 103, 104,
105, 106, 107, 25, 84, 84, 108, 30, 84, 31,
7, 32, 127, 2, 90, 109, 110, 97, 3, 135,
182, 150, 33, 174, 175, 111, 19, 196, 156, 183,
176, 34, 157, 16, 17, 126, 123, 36, 173, 37,
190, 38, 21, 39, 40, 85, 85, 20, 41, 85,
42, 91, 43, 162, 98, 199, 44, 200, 45, 167,
8, 9, 150, 193, 151, 152, 46, 47, 8, 143,
48, 49, 50, 51, 52, 53, 54, 55, 56, 194,
195, 36, 160, 37, 57, 38, 161, 39, 40, 160,
25, 160, 41, 164, 42, 166, 43, 169, 23, 169,
44, 170, 45, 186, 133, 151, 152, 22, 136, 81,
46, 47, 82, 18, 48, 49, 50, 51, 52, 53,
54, 55, 56, 13, 14, 113, 114, 83, 88, 89,
93, 94, 95, 100, 117, 96, 116, 118, 119, 120,
84, 128, 18, 131, 134, 132, 137, 138, 142, 141,
148, 149, 146, 165, 168, 172, 171, 178, 179, 187,
189, 180, 192, 191, 198, 201, 202, 181, 121, 163,
188, 0, 158, 0, 35, 185
}

Definition at line 685 of file asn1-parse.c.

Referenced by _ksba_asn1_yyparse(), and yysyntax_error().

◆ yytname

const char* const yytname[]
static
Initial value:
=
{
"$end", "error", "$undefined", "\"::=\"", "NUM", "IDENTIFIER",
"\"OPTIONAL\"", "\"INTEGER\"", "\"SIZE\"", "\"OCTET\"", "\"STRING\"",
"\"SEQUENCE\"", "\"BIT\"", "\"UNIVERSAL\"", "\"PRIVATE\"", "\"DEFAULT\"",
"\"CHOICE\"", "\"OF\"", "\"OBJECT\"", "\"IDENTIFIER\"", "\"BOOLEAN\"",
"\"TRUE\"", "\"FALSE\"", "\"APPLICATION\"", "\"ANY\"", "\"DEFINED\"",
"\"SET\"", "\"BY\"", "\"EXPLICIT\"", "\"IMPLICIT\"", "\"DEFINITIONS\"",
"\"TAGS\"", "\"BEGIN\"", "\"END\"", "\"UTCTime\"", "\"GeneralizedTime\"",
"\"FROM\"", "\"IMPORTS\"", "\"NULL\"", "\"ENUMERATED\"",
"\"UTF8String\"", "\"NumericString\"", "\"PrintableString\"",
"\"TeletexString\"", "\"IA5String\"", "\"UniversalString\"",
"\"BMPString\"", "'+'", "'-'", "'('", "')'", "','", "'['", "']'", "'{'",
"'}'", "'.'", "$accept", "input", "pos_num", "neg_num", "pos_neg_num",
"num_identifier", "pos_neg_identifier", "constant", "constant_list",
"obj_constant", "obj_constant_list", "class", "tag_type", "tag",
"default", "integer_def", "boolean_def", "Time", "size_def2", "size_def",
"octet_string_def", "utf8_string_def", "numeric_string_def",
"printable_string_def", "teletex_string_def", "ia5_string_def",
"universal_string_def", "bmp_string_def", "string_def", "bit_element",
"bit_element_list", "bit_string_def", "enumerated_def", "object_def",
"type_assig_right", "type_assig_right_tag",
"type_assig_right_tag_default", "type_assig", "type_assig_list",
"sequence_def", "set_def", "choise_def", "any_def", "type_def",
"constant_def", "type_constant", "type_constant_list", "definitions_id",
"imports_def", "explicit_implicit", "definitions", ((void*)0)
}

Definition at line 552 of file asn1-parse.c.

Referenced by yylex(), and yysyntax_error().

◆ yytoknum

const yytype_uint16 yytoknum[]
static
Initial value:
=
{
0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
295, 296, 297, 298, 299, 300, 301, 43, 45, 40,
41, 44, 91, 93, 123, 125, 46
}

Definition at line 584 of file asn1-parse.c.

Referenced by yylex().

◆ yytranslate

const yytype_uint8 yytranslate[]
static

Definition at line 495 of file asn1-parse.c.