diff options
author | Simon Josefsson <simon@josefsson.org> | 2008-10-08 15:23:13 +0200 |
---|---|---|
committer | Simon Josefsson <simon@josefsson.org> | 2008-10-08 15:23:13 +0200 |
commit | 2fdda6dc8ae0053f72f1e21dcab781d9da81d172 (patch) | |
tree | 0abc0dd9b0e4a9dc33435a90d6f8652f11b78686 /lib | |
parent | a59d06403ef4e5392b2ab0784da6a935219457d0 (diff) | |
download | libtasn1-2fdda6dc8ae0053f72f1e21dcab781d9da81d172.tar.gz libtasn1-2fdda6dc8ae0053f72f1e21dcab781d9da81d172.tar.bz2 libtasn1-2fdda6dc8ae0053f72f1e21dcab781d9da81d172.zip |
Update usages of MAX_* constants.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/ASN1.c | 14 | ||||
-rw-r--r-- | lib/ASN1.y | 14 | ||||
-rw-r--r-- | lib/coding.c | 2 | ||||
-rw-r--r-- | lib/decoding.c | 18 | ||||
-rw-r--r-- | lib/gstr.h | 4 | ||||
-rw-r--r-- | lib/parser_aux.c | 8 | ||||
-rw-r--r-- | lib/structure.c | 8 |
7 files changed, 34 insertions, 34 deletions
@@ -175,7 +175,7 @@ static node_asn *p_tree; /* pointer to the root of the static unsigned long lineNumber; /* line number describing the parser position inside the file */ -static char lastToken[MAX_NAME_SIZE+1]; /* last token find in the file +static char lastToken[ASN1_MAX_NAME_SIZE+1]; /* last token find in the file to parse before the 'parse error' */ extern char _asn1_identifierMissing[]; @@ -209,7 +209,7 @@ typedef union YYSTYPE #line 62 "ASN1.y" { unsigned int constant; - char str[MAX_NAME_SIZE+1]; + char str[ASN1_MAX_NAME_SIZE+1]; node_asn* node; } /* Line 187 of yacc.c. */ @@ -2381,7 +2381,7 @@ int _asn1_yylex() { int c,counter=0,k,lastc; - char string[MAX_NAME_SIZE+1]; /* will contain the next token */ + char string[ASN1_MAX_NAME_SIZE+1]; /* will contain the next token */ while(1) { @@ -2428,7 +2428,7 @@ _asn1_yylex() c=='(' || c==')' || c=='[' || c==']' || c=='{' || c=='}' || c==',' || c=='.')) { - if(counter>=MAX_NAME_SIZE){ + if(counter>=ASN1_MAX_NAME_SIZE){ result_parse=ASN1_NAME_TOO_LONG; return 0; } @@ -2490,7 +2490,7 @@ _asn1_create_errorDescription(int error,char *errorDescription) strcat(errorDescription,":"); _asn1_ltostr(lineNumber,errorDescription+strlen(fileName)+1); strcat(errorDescription,": name too long (more than "); - _asn1_ltostr(MAX_NAME_SIZE,errorDescription+strlen(errorDescription)); + _asn1_ltostr(ASN1_MAX_NAME_SIZE,errorDescription+strlen(errorDescription)); strcat(errorDescription," characters)"); } break; @@ -2538,7 +2538,7 @@ _asn1_create_errorDescription(int error,char *errorDescription) * is not defined. * * ASN1_NAME_TOO_LONG: In the file there is an identifier whith more - * than MAX_NAME_SIZE characters. + * than ASN1_MAX_NAME_SIZE characters. **/ asn1_retCode asn1_parser2tree(const char *file_name, ASN1_TYPE *definitions, @@ -2629,7 +2629,7 @@ asn1_parser2tree(const char *file_name, ASN1_TYPE *definitions, * is not defined. * * ASN1_NAME_TOO_LONG: In the file there is an identifier whith more - * than MAX_NAME_SIZE characters. + * than ASN1_MAX_NAME_SIZE characters. **/ int asn1_parser2array(const char *inputFileName,const char *outputFileName, const char *vectorName,char *errorDescription){ @@ -45,7 +45,7 @@ static node_asn *p_tree; /* pointer to the root of the static unsigned long lineNumber; /* line number describing the parser position inside the file */ -static char lastToken[MAX_NAME_SIZE+1]; /* last token find in the file +static char lastToken[ASN1_MAX_NAME_SIZE+1]; /* last token find in the file to parse before the 'parse error' */ extern char _asn1_identifierMissing[]; @@ -61,7 +61,7 @@ int _asn1_yylex(void); %union { unsigned int constant; - char str[MAX_NAME_SIZE+1]; + char str[ASN1_MAX_NAME_SIZE+1]; node_asn* node; } @@ -429,7 +429,7 @@ int _asn1_yylex() { int c,counter=0,k,lastc; - char string[MAX_NAME_SIZE+1]; /* will contain the next token */ + char string[ASN1_MAX_NAME_SIZE+1]; /* will contain the next token */ while(1) { @@ -476,7 +476,7 @@ _asn1_yylex() c=='(' || c==')' || c=='[' || c==']' || c=='{' || c=='}' || c==',' || c=='.')) { - if(counter>=MAX_NAME_SIZE){ + if(counter>=ASN1_MAX_NAME_SIZE){ result_parse=ASN1_NAME_TOO_LONG; return 0; } @@ -538,7 +538,7 @@ _asn1_create_errorDescription(int error,char *errorDescription) strcat(errorDescription,":"); _asn1_ltostr(lineNumber,errorDescription+strlen(fileName)+1); strcat(errorDescription,": name too long (more than "); - _asn1_ltostr(MAX_NAME_SIZE,errorDescription+strlen(errorDescription)); + _asn1_ltostr(ASN1_MAX_NAME_SIZE,errorDescription+strlen(errorDescription)); strcat(errorDescription," characters)"); } break; @@ -586,7 +586,7 @@ _asn1_create_errorDescription(int error,char *errorDescription) * is not defined. * * ASN1_NAME_TOO_LONG: In the file there is an identifier whith more - * than MAX_NAME_SIZE characters. + * than ASN1_MAX_NAME_SIZE characters. **/ asn1_retCode asn1_parser2tree(const char *file_name, ASN1_TYPE *definitions, @@ -677,7 +677,7 @@ asn1_parser2tree(const char *file_name, ASN1_TYPE *definitions, * is not defined. * * ASN1_NAME_TOO_LONG: In the file there is an identifier whith more - * than MAX_NAME_SIZE characters. + * than ASN1_MAX_NAME_SIZE characters. **/ int asn1_parser2array(const char *inputFileName,const char *outputFileName, const char *vectorName,char *errorDescription){ diff --git a/lib/coding.c b/lib/coding.c index 74c8390..e9fb91a 100644 --- a/lib/coding.c +++ b/lib/coding.c @@ -55,7 +55,7 @@ _asn1_error_description_value_not_found (node_asn * node, Estrcpy (ErrorDescription, ":: value of element '"); _asn1_hierarchical_name (node, ErrorDescription + strlen (ErrorDescription), - MAX_ERROR_DESCRIPTION_SIZE - 40); + ASN1_MAX_ERROR_DESCRIPTION_SIZE - 40); Estrcat (ErrorDescription, "' not found"); } diff --git a/lib/decoding.c b/lib/decoding.c index c1de9e6..223fe1d 100644 --- a/lib/decoding.c +++ b/lib/decoding.c @@ -40,7 +40,7 @@ _asn1_error_description_tag_error (node_asn * node, char *ErrorDescription) Estrcpy (ErrorDescription, ":: tag error near element '"); _asn1_hierarchical_name (node, ErrorDescription + strlen (ErrorDescription), - MAX_ERROR_DESCRIPTION_SIZE - 40); + ASN1_MAX_ERROR_DESCRIPTION_SIZE - 40); Estrcat (ErrorDescription, "'"); } @@ -1327,8 +1327,8 @@ asn1_der_decoding_element (ASN1_TYPE * structure, const char *elementName, const void *ider, int len, char *errorDescription) { node_asn *node, *p, *p2, *p3, *nodeFound = ASN1_TYPE_EMPTY; - char temp[128], currentName[MAX_NAME_SIZE * 10], *dot_p, *char_p; - int nameLen = MAX_NAME_SIZE * 10 - 1, state; + char temp[128], currentName[ASN1_MAX_NAME_SIZE * 10], *dot_p, *char_p; + int nameLen = ASN1_MAX_NAME_SIZE * 10 - 1, state; int counter, len2, len3, len4, move, ris, tlen; unsigned char class, *temp2; unsigned long tag; @@ -2461,12 +2461,12 @@ asn1_der_decoding_startEnd (ASN1_TYPE element, const void *ider, int len, asn1_retCode asn1_expand_any_defined_by (ASN1_TYPE definitions, ASN1_TYPE * element) { - char definitionsName[MAX_NAME_SIZE], name[2 * MAX_NAME_SIZE + 1], - value[MAX_NAME_SIZE]; + char definitionsName[ASN1_MAX_NAME_SIZE], name[2 * ASN1_MAX_NAME_SIZE + 1], + value[ASN1_MAX_NAME_SIZE]; asn1_retCode retCode = ASN1_SUCCESS, result; int len, len2, len3; ASN1_TYPE p, p2, p3, aux = ASN1_TYPE_EMPTY; - char errorDescription[MAX_ERROR_DESCRIPTION_SIZE]; + char errorDescription[ASN1_MAX_ERROR_DESCRIPTION_SIZE]; if ((definitions == ASN1_TYPE_EMPTY) || (*element == ASN1_TYPE_EMPTY)) return ASN1_ELEMENT_NOT_FOUND; @@ -2550,7 +2550,7 @@ asn1_expand_any_defined_by (ASN1_TYPE definitions, ASN1_TYPE * element) strcpy (name, definitionsName); strcat (name, p2->name); - len = MAX_NAME_SIZE; + len = ASN1_MAX_NAME_SIZE; result = asn1_read_value (definitions, name, value, &len); @@ -2700,12 +2700,12 @@ asn1_retCode asn1_expand_octet_string (ASN1_TYPE definitions, ASN1_TYPE * element, const char *octetName, const char *objectName) { - char name[2 * MAX_NAME_SIZE + 1], value[MAX_NAME_SIZE]; + char name[2 * ASN1_MAX_NAME_SIZE + 1], value[ASN1_MAX_NAME_SIZE]; asn1_retCode retCode = ASN1_SUCCESS, result; int len, len2, len3; ASN1_TYPE p2, aux = ASN1_TYPE_EMPTY; ASN1_TYPE octetNode = ASN1_TYPE_EMPTY, objectNode = ASN1_TYPE_EMPTY; - char errorDescription[MAX_ERROR_DESCRIPTION_SIZE]; + char errorDescription[ASN1_MAX_ERROR_DESCRIPTION_SIZE]; if ((definitions == ASN1_TYPE_EMPTY) || (*element == ASN1_TYPE_EMPTY)) return ASN1_ELEMENT_NOT_FOUND; @@ -1,5 +1,5 @@ void _asn1_str_cpy( char* dest, size_t dest_tot_size, const char* src); void _asn1_str_cat( char* dest, size_t dest_tot_size, const char* src); -#define Estrcpy(x,y) _asn1_str_cpy(x,MAX_ERROR_DESCRIPTION_SIZE,y) -#define Estrcat(x,y) _asn1_str_cat(x,MAX_ERROR_DESCRIPTION_SIZE,y) +#define Estrcpy(x,y) _asn1_str_cpy(x,ASN1_MAX_ERROR_DESCRIPTION_SIZE,y) +#define Estrcat(x,y) _asn1_str_cat(x,ASN1_MAX_ERROR_DESCRIPTION_SIZE,y) diff --git a/lib/parser_aux.c b/lib/parser_aux.c index 51169b1..e4665a3 100644 --- a/lib/parser_aux.c +++ b/lib/parser_aux.c @@ -27,7 +27,7 @@ #include "structure.h" #include "element.h" -char _asn1_identifierMissing[MAX_NAME_SIZE + 1]; /* identifier name not found */ +char _asn1_identifierMissing[ASN1_MAX_NAME_SIZE + 1]; /* identifier name not found */ /***********************************************/ /* Type: list_type */ @@ -95,7 +95,7 @@ ASN1_TYPE asn1_find_node (ASN1_TYPE pointer, const char *name) { node_asn *p; - char *n_end, n[MAX_NAME_SIZE + 1]; + char *n_end, n[ASN1_MAX_NAME_SIZE + 1]; const char *n_start; if (pointer == NULL) @@ -582,7 +582,7 @@ asn1_retCode _asn1_expand_object_id (ASN1_TYPE node) { node_asn *p, *p2, *p3, *p4, *p5; - char name_root[MAX_NAME_SIZE], name2[2 * MAX_NAME_SIZE + 1]; + char name_root[ASN1_MAX_NAME_SIZE], name2[2 * ASN1_MAX_NAME_SIZE + 1]; int move, tlen; if (node == NULL) @@ -836,7 +836,7 @@ asn1_retCode _asn1_check_identifier (ASN1_TYPE node) { node_asn *p, *p2; - char name2[MAX_NAME_SIZE * 2 + 2]; + char name2[ASN1_MAX_NAME_SIZE * 2 + 2]; if (node == NULL) return ASN1_ELEMENT_NOT_FOUND; diff --git a/lib/structure.c b/lib/structure.c index 743e9ba..8876e72 100644 --- a/lib/structure.c +++ b/lib/structure.c @@ -556,7 +556,7 @@ asn1_retCode _asn1_expand_identifier (node_asn ** node, node_asn * root) { node_asn *p, *p2, *p3; - char name2[MAX_NAME_SIZE + 2]; + char name2[ASN1_MAX_NAME_SIZE + 2]; int move; if (node == NULL) @@ -1127,8 +1127,8 @@ asn1_number_of_elements (ASN1_TYPE element, const char *name, int *num) const char * asn1_find_structure_from_oid (ASN1_TYPE definitions, const char *oidValue) { - char definitionsName[MAX_NAME_SIZE], name[2 * MAX_NAME_SIZE + 1]; - char value[MAX_NAME_SIZE]; + char definitionsName[ASN1_MAX_NAME_SIZE], name[2 * ASN1_MAX_NAME_SIZE + 1]; + char value[ASN1_MAX_NAME_SIZE]; ASN1_TYPE p; int len; asn1_retCode result; @@ -1150,7 +1150,7 @@ asn1_find_structure_from_oid (ASN1_TYPE definitions, const char *oidValue) strcpy (name, definitionsName); strcat (name, p->name); - len = MAX_NAME_SIZE; + len = ASN1_MAX_NAME_SIZE; result = asn1_read_value (definitions, name, value, &len); if ((result == ASN1_SUCCESS) && (!strcmp (oidValue, value))) |