Commit 2c36d750 authored by gates's avatar gates
Browse files

Rename struct for title entries to appropriate name.

parent 15000a41
......@@ -23,7 +23,7 @@
#include <stdlib.h>
static int print_digit_key_pair_enties(digit_key_pair_list *list);
static int print_config_entries(config_entry_list *list);
static int print_title_entries(title_entry_list *list);
/* Function to print the entres in a digit key pair list */
static int print_digit_key_pair_enties(digit_key_pair_list *list)
......@@ -49,15 +49,15 @@ static int print_digit_key_pair_enties(digit_key_pair_list *list)
}
/* Function that prints all entries parsed from a config file */
static int print_config_entries(config_entry_list *list)
static int print_title_entries(title_entry_list *list)
{
if (!list)
{
printf("Error: No config list passed as parameter.\n");
printf("Error: No title list passed as parameter.\n");
return 0;
}
config_entry_list *cursor = list;
title_entry_list *cursor = list;
while (cursor)
{
if (!cursor->entry.discid)
......@@ -163,7 +163,7 @@ static int print_config_file(config_file *cfgfile)
printf("\n");
int status1 = print_cert_list(cfgfile->host_cert_list);
int status2 = print_config_entries(cfgfile->list);
int status2 = print_title_entries(cfgfile->list);
return status1 & status2;
}
......
......@@ -71,15 +71,15 @@ static cert_list *new_cert_list();
static cert_list *add_cert_list(cert_list *list, const char *host_priv_key,
const char *host_cert, const char *host_nonce,
const char *host_key_point);
static config_entry_list *new_config_entry_list();
static int add_entry(config_entry_list *list, int type, const char *entry);
static title_entry_list *new_title_entry_list();
static int add_entry(title_entry_list *list, int type, const char *entry);
static digit_key_pair_list *new_digit_key_pair_list();
static digit_key_pair_list *add_digit_key_pair_entry(digit_key_pair_list *list,
int type, unsigned int digit, const char *key);
static int add_date_entry(config_entry_list *list, unsigned int year,
static int add_date_entry(title_entry_list *list, unsigned int year,
unsigned int month, unsigned int day);
void yyerror (void *scanner, dk_list *dklist, pk_list *pklist, cert_list *clist,
config_entry_list *celist, digit_key_pair_list *dkplist,
title_entry_list *celist, digit_key_pair_list *dkplist,
const char *msg);
extern int yyget_lineno (void *scanner);
......@@ -88,7 +88,7 @@ extern int yyget_lineno (void *scanner);
%}
/* Options set to generate a reentrant parser that is POSIX yacc compatible
* The basic 'scanner' parameters are set. Also, another parameter is set
* to pass in a config entry list struct used to hold all config entries.
* to pass in a title entry list struct used to hold all title entries.
* Most of these options are bison specific, but some BSD's have bison
* compatibility support for these options in byacc.
*/
......@@ -99,7 +99,7 @@ extern int yyget_lineno (void *scanner);
%parse-param{dk_list *dklist}
%parse-param{pk_list *pklist}
%parse-param{cert_list *clist}
%parse-param{config_entry_list *celist}
%parse-param{title_entry_list *celist}
%parse-param{digit_key_pair_list *dkplist}
%union
......@@ -147,7 +147,7 @@ extern int yyget_lineno (void *scanner);
%type <string> device_key device_node
%%
config_file
: dk_list_block pk_block host_cert_list_block config_entries
: dk_list_block pk_block host_cert_list_block title_entries
;
dk_list_block
......@@ -302,28 +302,28 @@ host_key_point
{ $$ = $2; }
;
config_entries
: config_entry_list newline_list
| config_entry_list
| config_entry_list error
title_entries
: title_entry_list newline_list
| title_entry_list
| title_entry_list error
{
if (yychar == YYEOF)
fprintf(stderr, "warning: last entry ended without newline\n");
}
;
config_entry_list
: config_entry_list config_entry NEWLINE
title_entry_list
: title_entry_list title_entry NEWLINE
{
celist->next = new_config_entry_list();
celist->next = new_title_entry_list();
celist = celist->next;
}
| config_entry NEWLINE
| title_entry NEWLINE
{
celist->next = new_config_entry_list();
celist->next = new_title_entry_list();
celist = celist->next;
}
| config_entry_list error NEWLINE
| title_entry_list error NEWLINE
{
fprintf(stderr, "bad entry at line %d\n", yyget_lineno(scanner) - 1);
yyerrok;
......@@ -335,7 +335,7 @@ config_entry_list
}
;
config_entry
title_entry
: newline_list disc_info entry_list
| disc_info entry_list
;
......@@ -528,7 +528,7 @@ int keydbcfg_parse_config(config_file *cfgfile, const char *path)
dk_list *head_dklist = new_dk_list();
pk_list *head_pklist = new_pk_list();
cert_list *head_clist = new_cert_list();
config_entry_list *head_celist = new_config_entry_list();
title_entry_list *head_celist = new_title_entry_list();
digit_key_pair_list *dkplist = NULL;
void *scanner;
......@@ -585,7 +585,7 @@ int keydbcfg_config_file_close(config_file *cfgfile)
/* free title entries */
while (cfgfile->list)
{
config_entry_list *next = cfgfile->list->next;
title_entry_list *next = cfgfile->list->next;
X_FREE(cfgfile->list->entry.discid);
X_FREE(cfgfile->list->entry.title);
X_FREE(cfgfile->list->entry.mek);
......@@ -703,13 +703,13 @@ static cert_list *add_cert_list(cert_list *list, const char *host_priv_key,
return list->next;
}
/* Function that returns pointer to new config entry list */
config_entry_list *new_config_entry_list()
/* Function that returns pointer to new title entry list */
title_entry_list *new_title_entry_list()
{
config_entry_list *list = (config_entry_list *)malloc(sizeof(*list));
title_entry_list *list = (title_entry_list *)malloc(sizeof(*list));
if (!list)
{
printf("Error allocating memory for new config entry list!\n");
printf("Error allocating memory for new title entry list!\n");
return NULL;
}
......@@ -731,11 +731,11 @@ config_entry_list *new_config_entry_list()
}
/* Function to add standard string entries to a config entry */
static int add_entry(config_entry_list *list, int type, const char *entry)
static int add_entry(title_entry_list *list, int type, const char *entry)
{
if (!list)
{
printf("Error: No config list passed as parameter.\n");
printf("Error: No title list passed as parameter.\n");
return 0;
}
......@@ -811,12 +811,12 @@ static digit_key_pair_list *add_digit_key_pair_entry(digit_key_pair_list *list,
}
/* Function to add a date entry */
static int add_date_entry(config_entry_list *list, unsigned int year,
static int add_date_entry(title_entry_list *list, unsigned int year,
unsigned int month, unsigned int day)
{
if (!list)
{
printf("Error: No config list passed as parameter.\n");
printf("Error: No title list passed as parameter.\n");
return 0;
}
......@@ -829,7 +829,7 @@ static int add_date_entry(config_entry_list *list, unsigned int year,
/* Our definition of yyerror */
void yyerror (void *scanner, dk_list *dklist, pk_list *pklist, cert_list *clist,
config_entry_list *celist, digit_key_pair_list *dkplist,
title_entry_list *celist, digit_key_pair_list *dkplist,
const char *msg)
{
fprintf(stderr, "%s: line %d\n", msg, yyget_lineno(scanner));
......
......@@ -30,7 +30,7 @@ struct digit_key_pair_t
char *key;
};
/* list of digit_key_pair struct used in config entry */
/* list of digit_key_pair struct used in title entry */
typedef struct digit_key_pair_list_t digit_key_pair_list;
struct digit_key_pair_list_t
{
......@@ -75,9 +75,9 @@ struct cert_entry
cert_list *next;
};
/* main config entry struct */
typedef struct config_entry_t config_entry;
struct config_entry_t
/* title entry struct */
typedef struct title_entry_t title_entry;
struct title_entry_t
{
char *discid;
char *title;
......@@ -91,12 +91,12 @@ struct config_entry_t
digit_key_pair_list *uk;
};
/* main struct for config entries, held in a list structure */
typedef struct config_entry_list_t config_entry_list;
struct config_entry_list_t
/* main struct for title entries, held in a list structure */
typedef struct title_entry_list_t title_entry_list;
struct title_entry_list_t
{
config_entry entry;
config_entry_list *next;
title_entry entry;
title_entry_list *next;
};
/* struct representing the contents of a config file */
......@@ -106,7 +106,7 @@ struct config_file_t
dk_list *dkl;
pk_list *pkl;
cert_list *host_cert_list;
config_entry_list *list;
title_entry_list *list;
};
/* Functions used throughout the parser */
......
......@@ -142,15 +142,15 @@ static cert_list *new_cert_list();
static cert_list *add_cert_list(cert_list *list, const char *host_priv_key,
const char *host_cert, const char *host_nonce,
const char *host_key_point);
static config_entry_list *new_config_entry_list();
static int add_entry(config_entry_list *list, int type, const char *entry);
static title_entry_list *new_title_entry_list();
static int add_entry(title_entry_list *list, int type, const char *entry);
static digit_key_pair_list *new_digit_key_pair_list();
static digit_key_pair_list *add_digit_key_pair_entry(digit_key_pair_list *list,
int type, unsigned int digit, const char *key);
static int add_date_entry(config_entry_list *list, unsigned int year,
static int add_date_entry(title_entry_list *list, unsigned int year,
unsigned int month, unsigned int day);
void yyerror (void *scanner, dk_list *dklist, pk_list *pklist, cert_list *clist,
config_entry_list *celist, digit_key_pair_list *dkplist,
title_entry_list *celist, digit_key_pair_list *dkplist,
const char *msg);
extern int yyget_lineno (void *scanner);
......@@ -636,7 +636,7 @@ static const char *const yytname[] =
"host_cert_list_end", "host_cert_entries", "host_cert_entry_block",
"host_cert_entry_start", "host_cert_entry_end", "host_cert_entry",
"host_priv_key", "host_cert", "host_nonce", "host_key_point",
"config_entries", "config_entry_list", "config_entry", "newline_list",
"title_entries", "title_entry_list", "title_entry", "newline_list",
"disc_info", "discid", "disc_title", "entry_list", "entry", "date_entry",
"mek_entry", "vid_entry", "bn_entry", "bn_data_list", "bn_data",
"vuk_entry", "pak_entry", "pak_data_list", "pak_data", "tk_entry",
......@@ -983,7 +983,7 @@ do { \
#if (defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER)
static void
yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, void *scanner, dk_list *dklist, pk_list *pklist, cert_list *clist, config_entry_list *celist, digit_key_pair_list *dkplist)
yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, void *scanner, dk_list *dklist, pk_list *pklist, cert_list *clist, title_entry_list *celist, digit_key_pair_list *dkplist)
#else
static void
yy_symbol_value_print (yyoutput, yytype, yyvaluep, scanner, dklist, pklist, clist, celist, dkplist)
......@@ -994,7 +994,7 @@ yy_symbol_value_print (yyoutput, yytype, yyvaluep, scanner, dklist, pklist, clis
dk_list *dklist;
pk_list *pklist;
cert_list *clist;
config_entry_list *celist;
title_entry_list *celist;
digit_key_pair_list *dkplist;
#endif
{
......@@ -1027,7 +1027,7 @@ yy_symbol_value_print (yyoutput, yytype, yyvaluep, scanner, dklist, pklist, clis
#if (defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER)
static void
yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, void *scanner, dk_list *dklist, pk_list *pklist, cert_list *clist, config_entry_list *celist, digit_key_pair_list *dkplist)
yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, void *scanner, dk_list *dklist, pk_list *pklist, cert_list *clist, title_entry_list *celist, digit_key_pair_list *dkplist)
#else
static void
yy_symbol_print (yyoutput, yytype, yyvaluep, scanner, dklist, pklist, clist, celist, dkplist)
......@@ -1038,7 +1038,7 @@ yy_symbol_print (yyoutput, yytype, yyvaluep, scanner, dklist, pklist, clist, cel
dk_list *dklist;
pk_list *pklist;
cert_list *clist;
config_entry_list *celist;
title_entry_list *celist;
digit_key_pair_list *dkplist;
#endif
{
......@@ -1090,7 +1090,7 @@ do { \
#if (defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER)
static void
yy_reduce_print (YYSTYPE *yyvsp, int yyrule, void *scanner, dk_list *dklist, pk_list *pklist, cert_list *clist, config_entry_list *celist, digit_key_pair_list *dkplist)
yy_reduce_print (YYSTYPE *yyvsp, int yyrule, void *scanner, dk_list *dklist, pk_list *pklist, cert_list *clist, title_entry_list *celist, digit_key_pair_list *dkplist)
#else
static void
yy_reduce_print (yyvsp, yyrule, scanner, dklist, pklist, clist, celist, dkplist)
......@@ -1100,7 +1100,7 @@ yy_reduce_print (yyvsp, yyrule, scanner, dklist, pklist, clist, celist, dkplist)
dk_list *dklist;
pk_list *pklist;
cert_list *clist;
config_entry_list *celist;
title_entry_list *celist;
digit_key_pair_list *dkplist;
#endif
{
......@@ -1374,7 +1374,7 @@ yysyntax_error (char *yyresult, int yystate, int yychar)
#if (defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER)
static void
yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, void *scanner, dk_list *dklist, pk_list *pklist, cert_list *clist, config_entry_list *celist, digit_key_pair_list *dkplist)
yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, void *scanner, dk_list *dklist, pk_list *pklist, cert_list *clist, title_entry_list *celist, digit_key_pair_list *dkplist)
#else
static void
yydestruct (yymsg, yytype, yyvaluep, scanner, dklist, pklist, clist, celist, dkplist)
......@@ -1385,7 +1385,7 @@ yydestruct (yymsg, yytype, yyvaluep, scanner, dklist, pklist, clist, celist, dkp
dk_list *dklist;
pk_list *pklist;
cert_list *clist;
config_entry_list *celist;
title_entry_list *celist;
digit_key_pair_list *dkplist;
#endif
{
......@@ -1418,7 +1418,7 @@ int yyparse ();
#endif
#else /* ! YYPARSE_PARAM */
#if defined __STDC__ || defined __cplusplus
int yyparse (void *scanner, dk_list *dklist, pk_list *pklist, cert_list *clist, config_entry_list *celist, digit_key_pair_list *dkplist);
int yyparse (void *scanner, dk_list *dklist, pk_list *pklist, cert_list *clist, title_entry_list *celist, digit_key_pair_list *dkplist);
#else
int yyparse ();
#endif
......@@ -1446,7 +1446,7 @@ yyparse (YYPARSE_PARAM)
#if (defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER)
int
yyparse (void *scanner, dk_list *dklist, pk_list *pklist, cert_list *clist, config_entry_list *celist, digit_key_pair_list *dkplist)
yyparse (void *scanner, dk_list *dklist, pk_list *pklist, cert_list *clist, title_entry_list *celist, digit_key_pair_list *dkplist)
#else
int
yyparse (scanner, dklist, pklist, clist, celist, dkplist)
......@@ -1454,7 +1454,7 @@ yyparse (scanner, dklist, pklist, clist, celist, dkplist)
dk_list *dklist;
pk_list *pklist;
cert_list *clist;
config_entry_list *celist;
title_entry_list *celist;
digit_key_pair_list *dkplist;
#endif
#endif
......@@ -1842,7 +1842,7 @@ yyreduce:
/* Line 1455 of yacc.c */
#line 317 "keydbcfg-parser.y"
{
celist->next = new_config_entry_list();
celist->next = new_title_entry_list();
celist = celist->next;
}
break;
......@@ -1852,7 +1852,7 @@ yyreduce:
/* Line 1455 of yacc.c */
#line 322 "keydbcfg-parser.y"
{
celist->next = new_config_entry_list();
celist->next = new_title_entry_list();
celist = celist->next;
}
break;
......@@ -2266,7 +2266,7 @@ int keydbcfg_parse_config(config_file *cfgfile, const char *path)
dk_list *head_dklist = new_dk_list();
pk_list *head_pklist = new_pk_list();
cert_list *head_clist = new_cert_list();
config_entry_list *head_celist = new_config_entry_list();
title_entry_list *head_celist = new_title_entry_list();
digit_key_pair_list *dkplist = NULL;
void *scanner;
......@@ -2323,7 +2323,7 @@ int keydbcfg_config_file_close(config_file *cfgfile)
/* free title entries */
while (cfgfile->list)
{
config_entry_list *next = cfgfile->list->next;
title_entry_list *next = cfgfile->list->next;
X_FREE(cfgfile->list->entry.discid);
X_FREE(cfgfile->list->entry.title);
X_FREE(cfgfile->list->entry.mek);
......@@ -2441,13 +2441,13 @@ static cert_list *add_cert_list(cert_list *list, const char *host_priv_key,
return list->next;
}
/* Function that returns pointer to new config entry list */
config_entry_list *new_config_entry_list()
/* Function that returns pointer to new title entry list */
title_entry_list *new_title_entry_list()
{
config_entry_list *list = (config_entry_list *)malloc(sizeof(*list));
title_entry_list *list = (title_entry_list *)malloc(sizeof(*list));
if (!list)
{
printf("Error allocating memory for new config entry list!\n");
printf("Error allocating memory for new title entry list!\n");
return NULL;
}
......@@ -2469,11 +2469,11 @@ config_entry_list *new_config_entry_list()
}
/* Function to add standard string entries to a config entry */
static int add_entry(config_entry_list *list, int type, const char *entry)
static int add_entry(title_entry_list *list, int type, const char *entry)
{
if (!list)
{
printf("Error: No config list passed as parameter.\n");
printf("Error: No title list passed as parameter.\n");
return 0;
}
......@@ -2549,12 +2549,12 @@ static digit_key_pair_list *add_digit_key_pair_entry(digit_key_pair_list *list,
}
/* Function to add a date entry */
static int add_date_entry(config_entry_list *list, unsigned int year,
static int add_date_entry(title_entry_list *list, unsigned int year,
unsigned int month, unsigned int day)
{
if (!list)
{
printf("Error: No config list passed as parameter.\n");
printf("Error: No title list passed as parameter.\n");
return 0;
}
......@@ -2567,7 +2567,7 @@ static int add_date_entry(config_entry_list *list, unsigned int year,
/* Our definition of yyerror */
void yyerror (void *scanner, dk_list *dklist, pk_list *pklist, cert_list *clist,
config_entry_list *celist, digit_key_pair_list *dkplist,
title_entry_list *celist, digit_key_pair_list *dkplist,
const char *msg)
{
fprintf(stderr, "%s: line %d\n", msg, yyget_lineno(scanner));
......
......@@ -38,7 +38,7 @@ struct aacs {
uint8_t pk[16], mk[16], vuk[16], vid[16], *uks;
uint32_t num_uks;
struct config_file_t *cf;
struct config_entry_list_t *ce;
struct title_entry_list_t *ce;
};
static const uint8_t empty_key[] = "\x00\x00\x00\x00\x00\x00\x00\x00"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment